mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
Update server_updateObject from private to local
This commit is contained in:
@@ -1,21 +1,20 @@
|
|||||||
// [_object,_type] spawn server_updateObject;
|
// [_object,_type] spawn server_updateObject;
|
||||||
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
||||||
if (isNil "sm_done") exitWith {};
|
//if (isNil "sm_done") exitWith {diag_log "sm_done is nil";};
|
||||||
private ["_class","_objectID","_objectUID","_isNotOk","_object","_type","_forced","_totalDmg"];
|
|
||||||
|
|
||||||
_object = _this select 0;
|
local _object = _this select 0;
|
||||||
if ((isNil "_object") || {isNull _object}) exitWith {diag_log "server_updateObject.sqf _object null or nil, could not update object"};
|
if ((isNil "_object") || isNull _object) exitWith {diag_log "server_updateObject.sqf _object null or nil, could not update object"};
|
||||||
|
|
||||||
_type = _this select 1;
|
local _type = _this select 1;
|
||||||
_forced = if (count _this > 2) then {_this select 2} else {false};
|
local _forced = if (count _this > 2) then {_this select 2} else {false};
|
||||||
_totalDmg = if (count _this > 3) then {_this select 3} else {false};
|
local _totalDmg = if (count _this > 3) then {_this select 3} else {false};
|
||||||
_isNotOk = false;
|
local _isNotOk = false;
|
||||||
_objectID = "0";
|
local _objectID = "0";
|
||||||
_objectUID = "0";
|
local _objectUID = "0";
|
||||||
|
|
||||||
_objectID = _object getVariable ["ObjectID","0"];
|
_objectID = _object getVariable ["ObjectID","0"];
|
||||||
_objectUID = _object getVariable ["ObjectUID","0"];
|
_objectUID = _object getVariable ["ObjectUID","0"];
|
||||||
_class = typeOf _object;
|
local _class = typeOf _object;
|
||||||
|
|
||||||
if (typeName _objectID != "STRING" || {typeName _objectUID != "STRING"}) then {
|
if (typeName _objectID != "STRING" || {typeName _objectUID != "STRING"}) then {
|
||||||
#ifdef OBJECT_DEBUG
|
#ifdef OBJECT_DEBUG
|
||||||
@@ -59,7 +58,7 @@ call {
|
|||||||
if (_type == "gear") exitwith {
|
if (_type == "gear") exitwith {
|
||||||
[_object,_objectID,_objectUID,_class] call server_obj_inv;
|
[_object,_objectID,_objectUID,_class] call server_obj_inv;
|
||||||
};
|
};
|
||||||
if (_type == "damage" || {_type == "repair"}) exitwith {
|
if (_type == "damage" || _type == "repair") exitwith {
|
||||||
[_object,_objectID,_objectUID,_forced,_totalDmg] call server_obj_dam;
|
[_object,_objectID,_objectUID,_forced,_totalDmg] call server_obj_dam;
|
||||||
};
|
};
|
||||||
if (_type == "killed") exitwith {
|
if (_type == "killed") exitwith {
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
||||||
|
|
||||||
server_obj_pos = {
|
server_obj_pos = {
|
||||||
private ["_object","_objectID","_class","_position","_worldspace","_fuel","_key"];
|
local _object = _this select 0;
|
||||||
|
local _objectID = _this select 1;
|
||||||
|
local _class = _this select 2;
|
||||||
|
|
||||||
_object = _this select 0;
|
local _position = getPosATL _object;
|
||||||
_objectID = _this select 1;
|
|
||||||
_class = _this select 2;
|
|
||||||
|
|
||||||
_position = getPosATL _object;
|
|
||||||
//_worldspace = [round (direction _object),_position];
|
//_worldspace = [round (direction _object),_position];
|
||||||
_worldspace = [getDir _object, _position] call AN_fnc_formatWorldspace; // Precise Base Building 1.0.5
|
local _worldspace = [getDir _object, _position] call AN_fnc_formatWorldspace; // Precise Base Building 1.0.5
|
||||||
_fuel = [0, fuel _object] select (_class isKindOf "AllVehicles");
|
local _fuel = [0, fuel _object] select (_class isKindOf "AllVehicles");
|
||||||
|
|
||||||
_key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
|
local _key = format["CHILD:305:%1:%2:%3:",_objectID,_worldspace,_fuel];
|
||||||
_key call server_hiveWrite;
|
_key call server_hiveWrite;
|
||||||
|
|
||||||
#ifdef OBJECT_DEBUG
|
#ifdef OBJECT_DEBUG
|
||||||
@@ -21,14 +19,12 @@ server_obj_pos = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
server_obj_inv = {
|
server_obj_inv = {
|
||||||
private ["_object","_objectID", "_objectUID", "_class","_inventory","_key","_coins","_previous"];
|
local _object = _this select 0;
|
||||||
|
local _objectID = _this select 1;
|
||||||
|
local _objectUID = _this select 2;
|
||||||
|
local _class = _this select 3;
|
||||||
|
|
||||||
_object = _this select 0;
|
local _inventory = call {
|
||||||
_objectID = _this select 1;
|
|
||||||
_objectUID = _this select 2;
|
|
||||||
_class = _this select 3;
|
|
||||||
|
|
||||||
_inventory = call {
|
|
||||||
if (DZE_permanentPlot && {_class == "Plastic_Pole_EP1_DZ"}) exitwith {
|
if (DZE_permanentPlot && {_class == "Plastic_Pole_EP1_DZ"}) exitwith {
|
||||||
_object getVariable ["plotfriends", []] //We're replacing the inventory with UIDs for this item
|
_object getVariable ["plotfriends", []] //We're replacing the inventory with UIDs for this item
|
||||||
};
|
};
|
||||||
@@ -42,8 +38,9 @@ server_obj_inv = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
_previous = str(_object getVariable["lastInventory",[]]);
|
local _previous = str(_object getVariable["lastInventory",[]]);
|
||||||
if (str _inventory != _previous) then {
|
if (str _inventory != _previous) then {
|
||||||
|
local _key = "";
|
||||||
_object setVariable ["lastInventory",_inventory];
|
_object setVariable ["lastInventory",_inventory];
|
||||||
if (_objectID == "0") then {
|
if (_objectID == "0") then {
|
||||||
_key = format["CHILD:309:%1:",_objectUID] + str _inventory + ":";
|
_key = format["CHILD:309:%1:",_objectUID] + str _inventory + ":";
|
||||||
@@ -52,7 +49,7 @@ server_obj_inv = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (Z_SingleCurrency) then {
|
if (Z_SingleCurrency) then {
|
||||||
_coins = _object getVariable ["cashMoney", -1]; //set to invalid value if getVariable fails to prevent overwriting of coins in DB
|
local _coins = _object getVariable ["cashMoney", -1]; //set to invalid value if getVariable fails to prevent overwriting of coins in DB
|
||||||
_key = _key + str _coins + ":";
|
_key = _key + str _coins + ":";
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -66,23 +63,22 @@ server_obj_inv = {
|
|||||||
|
|
||||||
server_obj_dam = {
|
server_obj_dam = {
|
||||||
//Allow dmg process
|
//Allow dmg process
|
||||||
private ["_object","_objectID", "_objectUID","_forced","_totalDmg","_recorddmg","_hitpoints","_array","_hit","_key","_damage","_allFixed","_lastUpdate"];
|
|
||||||
|
|
||||||
_object = _this select 0;
|
local _object = _this select 0;
|
||||||
_objectID = _this select 1;
|
local _objectID = _this select 1;
|
||||||
_objectUID = _this select 2;
|
local _objectUID = _this select 2;
|
||||||
_forced = _this select 3;
|
local _forced = _this select 3;
|
||||||
_totalDmg = _this select 4;
|
local _totalDmg = _this select 4;
|
||||||
|
|
||||||
_recorddmg = false;
|
local _recorddmg = false;
|
||||||
_hitpoints = _object call vehicle_getHitpoints;
|
local _hitpoints = _object call vehicle_getHitpoints;
|
||||||
_damage = damage _object;
|
local _damage = damage _object;
|
||||||
_array = [];
|
local _array = [];
|
||||||
_allFixed = true;
|
local _allFixed = true;
|
||||||
_lastUpdate = _object getVariable ["lastUpdate",diag_tickTime];
|
local _lastUpdate = _object getVariable ["lastUpdate",diag_tickTime];
|
||||||
|
|
||||||
{
|
{
|
||||||
_hit = [_object,_x] call object_getHit;
|
local _hit = [_object,_x] call object_getHit;
|
||||||
if ((_hit select 0) > 0) then {
|
if ((_hit select 0) > 0) then {
|
||||||
|
|
||||||
_allFixed = false;
|
_allFixed = false;
|
||||||
@@ -110,6 +106,7 @@ server_obj_dam = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (_recorddmg) then {
|
if (_recorddmg) then {
|
||||||
|
local _key = "";
|
||||||
if (_objectID == "0") then {
|
if (_objectID == "0") then {
|
||||||
_key = format["CHILD:306:%1:",_objectUID] + str _array + ":" + str _damage + ":";
|
_key = format["CHILD:306:%1:",_objectUID] + str _array + ":" + str _damage + ":";
|
||||||
} else {
|
} else {
|
||||||
@@ -124,18 +121,17 @@ server_obj_dam = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
server_obj_killed = {
|
server_obj_killed = {
|
||||||
private ["_object", "_objectID", "_objectUID", "_class","_clientKey","_exitReason","_index","_key","_playerUID"];
|
local _object = _this select 0;
|
||||||
|
local _objectID = _this select 1;
|
||||||
|
local _objectUID = _this select 2;
|
||||||
|
local _playerUID = _this select 3;
|
||||||
|
local _clientKey = _this select 4;
|
||||||
|
local _class = _this select 5;
|
||||||
|
local _key = "";
|
||||||
|
|
||||||
_object = _this select 0;
|
local _index = dayz_serverPUIDArray find _playerUID;
|
||||||
_objectID = _this select 1;
|
|
||||||
_objectUID = _this select 2;
|
|
||||||
_playerUID = _this select 3;
|
|
||||||
_clientKey = _this select 4;
|
|
||||||
_class = _this select 5;
|
|
||||||
|
|
||||||
_index = dayz_serverPUIDArray find _playerUID;
|
local _exitReason = call {
|
||||||
|
|
||||||
_exitReason = call {
|
|
||||||
//Can't use owner because player may already be dead, can't use distance because player may be far from vehicle wreck
|
//Can't use owner because player may already be dead, can't use distance because player may be far from vehicle wreck
|
||||||
if (_clientKey == dayz_serverKey) exitwith {""};
|
if (_clientKey == dayz_serverKey) exitwith {""};
|
||||||
if (_index < 0) exitwith {
|
if (_index < 0) exitwith {
|
||||||
|
|||||||
Reference in New Issue
Block a user