Files
DayZ-Epoch/SQF/dayz_server/compile/server_maintainArea.sqf
icomrade 657fe60f26 Better maintain
Intensive commands are processed on the client only, as opposed to
twice. an array of objects, their corresponding UID and ID are sent to
the server. Sending the objects as an array, despite the size the array
can reach, should be better than the way this was set up before.

Needs testing on a full server however.
2016-08-03 19:54:06 -04:00

46 lines
1.3 KiB
Plaintext

/* Maintain Area - written by Skaronator */
/*
1: PVDZE_maintainArea = [player,1,[[Object, _objectID, _objectUID],[Object, _objectID, _objectUID]...etc]];
2: PVDZE_maintainArea = [player,2,[Object, _objectID, _objectUID]];
*/
private ["_player","_name","_ObjArray","_uniqueID","_key"];
_player = _this select 0;
_option = _this select 1;
_objectsInfo = _this select 2;
if (_option == 1) then {
{
_obj = _x select 0;
_ID = _x select 1;
_UID = _x select 2;
if (_ID == "0") then {
if (_UID != "0") then {
_obj setDamage 0;
_key = format["CHILD:397:%1:", _UID];
_key call server_hiveWrite;
};
} else {
_obj setDamage 0;
_key = format["CHILD:396:%1:", _ID];
_key call server_hiveWrite;
};
} count _objectsInfo;
_name = if (alive _player) then { name _player; } else { "Dead Player"; };
diag_log format ["MAINTAIN AREA BY %1 - %2 Objects at %3", _name, (count _objectsInfo), (getPosATL _player)];
} else {
_obj = _objectsInfo select 0;
_ID = _objectsInfo select 1;
_UID = _objectsInfo select 2;
if (_ID == "0") then {
if (_UID != "0") then {
_obj setDamage 0;
_key = format["CHILD:397:%1:", _UID];
_key call server_hiveWrite;
};
} else {
_obj setDamage 0;
_key = format["CHILD:396:%1:", _ID];
_key call server_hiveWrite;
};
};