From 1611a16b573d6048c3174d2bde4717d22cecaada Mon Sep 17 00:00:00 2001 From: Cloudhax23 Date: Thu, 23 Feb 2017 17:12:11 -0600 Subject: [PATCH] Create ExileServer_object_container_database_update.sqf --- ...erver_object_container_database_update.sqf | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Overrides/ExileServer_object_container_database_update.sqf diff --git a/Overrides/ExileServer_object_container_database_update.sqf b/Overrides/ExileServer_object_container_database_update.sqf new file mode 100644 index 0000000..de93f48 --- /dev/null +++ b/Overrides/ExileServer_object_container_database_update.sqf @@ -0,0 +1,46 @@ +/** + * ExileServer_object_container_database_update + * + * Exile Mod + * www.exilemod.com + * © 2015 Exile Mod Team + * + * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. + * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/. + */ + +private["_containerObject","_containerID","_position","_vectorDirection","_vectorUp","_territoryFlag","_territoryID","_data","_extDB2Message"]; +_containerObject= _this; +_containerID = _containerObject getVariable ["ExileDatabaseID", -1]; +if (_containerID > -1) then +{ + _position = getPosATL _containerObject; + _vectorDirection = vectorDir _containerObject; + _vectorUp = vectorUp _containerObject; + _territoryFlag = _containerObject call ExileClient_util_world_getTerritoryAtPosition; + _territoryID = if (isNull _territoryFlag) then { 'NULL' } else { _territoryFlag getVariable ["ExileDatabaseID", 'NULL']}; + _containerObject setVariable ["ExileTerritoryID", _territoryID]; + _data = + [ + _containerObject getVariable ["ExileIsLocked",-1], + _position select 0, + _position select 1, + _position select 2, + _vectorDirection select 0, + _vectorDirection select 1, + _vectorDirection select 2, + _vectorUp select 0, + _vectorUp select 1, + _vectorUp select 2, + _containerObject call ExileServer_util_getItemCargo, + magazinesAmmoCargo _containerObject, + weaponsItemsCargo _containerObject, + _containerObject call ExileServer_util_getObjectContainerCargo, + _territoryID, + _containerObject getVariable ["ExileMoney", 0], + _containerID + ]; + _extDB2Message = ["updateContainer", _data] call ExileServer_util_extDB2_createMessage; + _extDB2Message call ExileServer_system_database_query_fireAndForget; +}; +true