mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2025-12-13 19:52:38 +03:00
move deleteVehicle to server
This commit is contained in:
@@ -60,7 +60,7 @@ if ((count _VehKey2) > 0) then {
|
||||
} else {
|
||||
PVDZ_obj_Destroy = [(_VehKey2 select 2),(_VehKey2 select 3),player,(_VehKey2 select 1),DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
deleteVehicle (_VehKey2 select 1);
|
||||
//deleteVehicle (_VehKey2 select 1);
|
||||
};
|
||||
} else {
|
||||
_localResult2 = 0;
|
||||
|
||||
@@ -72,9 +72,10 @@ for "_i" from 1 to 20 do {
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
diag_log [diag_ticktime, __FILE__, "Networked object, request to destroy", PVDZ_obj_Destroy];
|
||||
};
|
||||
} else {
|
||||
// remove object
|
||||
deleteVehicle _cursorTarget;
|
||||
};
|
||||
_cursorTarget = objNull;
|
||||
|
||||
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
|
||||
|
||||
@@ -135,7 +135,7 @@ if (_proceed) then {
|
||||
};
|
||||
|
||||
//Need to update for sanity no client should ever create or delete anything
|
||||
deleteVehicle _object;
|
||||
//deleteVehicle _object;
|
||||
|
||||
[_dismantleToo,1,1] call fn_dropItem;
|
||||
};
|
||||
|
||||
@@ -81,8 +81,9 @@ if (_isOk) then {
|
||||
};
|
||||
PVDZ_obj_Destroy = [(_holder getVariable["ObjectID","0"]),(_holder getVariable["ObjectUID","0"]),player,_holder,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
};
|
||||
} else {
|
||||
deleteVehicle _holder;
|
||||
};
|
||||
} else {
|
||||
if (!_isOk) exitWith {
|
||||
_holder setVariable["claimed",0,true];
|
||||
|
||||
@@ -130,7 +130,7 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
|
||||
//remove old tent
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
deleteVehicle _cursorTarget;
|
||||
//deleteVehicle _cursorTarget;
|
||||
|
||||
// remove parts from players inventory before creation of new tent.
|
||||
{
|
||||
|
||||
@@ -72,6 +72,9 @@ if (!_ok) exitWith {
|
||||
format [localize "str_upgradeMissingPart", _missing] call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
_PlayerNear = {isPlayer _x} count (([_cursorTarget] call FNC_GetPos) nearEntities ["CAManBase", 10]) > 1;
|
||||
if (_PlayerNear) exitWith {localize "str_pickup_limit_5" call dayz_rollingMessages;};
|
||||
|
||||
if (dayz_actionInProgress) exitWith {
|
||||
{ player addMagazine _x; } forEach _upgradeParts;
|
||||
localize "str_player_actionslimit" call dayz_rollingMessages;
|
||||
@@ -123,8 +126,8 @@ _object setVariable ["padlockCombination",_ownerPasscode,true];
|
||||
_object setVariable ["characterID",_characterID,true];
|
||||
|
||||
//remove old object
|
||||
deleteVehicle _cursorTarget;
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_object,DZE_AuthKey];
|
||||
//deleteVehicle _cursorTarget;
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
|
||||
// create a weaponholder with dismissed parts
|
||||
|
||||
@@ -65,7 +65,7 @@ player addMagazine _emptycan;
|
||||
// Added Nutrition-Factor for work
|
||||
["Working",0,[20,40,15,0]] call dayz_NutritionSystem;
|
||||
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,DZE_AuthKey];
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,DZE_AuthKey,false];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
|
||||
//Send killed for object
|
||||
|
||||
@@ -149,15 +149,15 @@ if (_proceed && _success) then {
|
||||
|
||||
// Double check that object is not null
|
||||
if(!isNull(_obj)) then {
|
||||
|
||||
_ipos = getPosATL _obj;
|
||||
deleteVehicle _obj;
|
||||
|
||||
if(!_isWreck && !_isWreckBuilding) then {
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
};
|
||||
|
||||
//deleteVehicle _obj;
|
||||
|
||||
if (_isWreckBuilding) then {
|
||||
PVDZ_send = [player,"RemoveObject",_ipos];
|
||||
publicVariableServer "PVDZ_send";
|
||||
|
||||
@@ -186,7 +186,7 @@ if (_finished) then {
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
|
||||
deleteVehicle _obj;
|
||||
//deleteVehicle _obj;
|
||||
|
||||
// payout
|
||||
_canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange;
|
||||
|
||||
@@ -159,7 +159,7 @@ if (_qty >= _qty_in) then {
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
|
||||
deleteVehicle _obj;
|
||||
//deleteVehicle _obj;
|
||||
|
||||
format[localize "str_epoch_player_181",_qty_in,_textPartIn,_qty_out,_textPartOut] call dayz_rollingMessages;
|
||||
};
|
||||
|
||||
@@ -162,7 +162,7 @@ if (_finished) then {
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
|
||||
deleteVehicle _obj;
|
||||
//deleteVehicle _obj;
|
||||
|
||||
// payout
|
||||
_canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange;
|
||||
|
||||
@@ -145,7 +145,7 @@ if (_qty >= _qty_in) then {
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
|
||||
deleteVehicle _obj;
|
||||
//deleteVehicle _obj;
|
||||
|
||||
format[localize "str_epoch_player_181",_qty_in,_textPartIn,_qty_out,_textPartOut] call dayz_rollingMessages;
|
||||
} else {
|
||||
|
||||
@@ -192,7 +192,7 @@ if (_finished) then {
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
|
||||
deleteVehicle _obj;
|
||||
//deleteVehicle _obj;
|
||||
|
||||
// remove Key
|
||||
_temp_keys = [];
|
||||
|
||||
@@ -188,7 +188,7 @@ if (_finished) then {
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
|
||||
deleteVehicle _obj;
|
||||
//deleteVehicle _obj;
|
||||
|
||||
// payout
|
||||
_canAfford = [[[_part_out,_qty_out]],1] call epoch_returnChange;
|
||||
|
||||
@@ -166,7 +166,7 @@ if (_qty >= _qty_in) then {
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
|
||||
deleteVehicle _obj;
|
||||
//deleteVehicle _obj;
|
||||
|
||||
format[localize "str_epoch_player_181",_qty_in,_textPartIn,_qty_out,_textPartOut] call dayz_rollingMessages;
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ if (_ownerID in [dayz_characterID,dayz_playerUID] or typeOf _obj in _campItems)
|
||||
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
deleteVehicle _obj;
|
||||
//deleteVehicle _obj;
|
||||
|
||||
//Add weapons
|
||||
_objWpnTypes = _weapons select 0;
|
||||
|
||||
@@ -12,6 +12,6 @@ if (isServer) then {
|
||||
//For normal remove let object_pickup.sqf perform deletion to ensure player has room in gear first, no others remove at same time and animation runs
|
||||
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,DZE_AuthKey];
|
||||
publicVariableServer "PVDZ_obj_Destroy";
|
||||
deleteVehicle _obj;
|
||||
//deleteVehicle _obj;
|
||||
};
|
||||
};
|
||||
@@ -2,7 +2,7 @@
|
||||
[_objectID,_objectUID,_activatingPlayer,_object,DZE_AuthKey] call server_deleteObj;
|
||||
For PV calls from the client use this function, otherwise if calling directly from the server use server_deleteObjDirect
|
||||
*/
|
||||
private["_id","_uid","_key","_activatingPlayer","_object","_clientKey","_PlayerUID","_PUIDIndex"];
|
||||
private["_id","_uid","_key","_activatingPlayer","_object","_clientKey","_PlayerUID","_PUIDIndex","_processDelete"];
|
||||
|
||||
if (count _this < 5) exitWith {diag_log "Server_DeleteObj error: Improper parameter format";};
|
||||
_id = _this select 0;
|
||||
@@ -10,24 +10,26 @@ _uid = _this select 1;
|
||||
_activatingPlayer = _this select 2;
|
||||
_object = _this select 3;
|
||||
_clientKey = _this select 4;
|
||||
_processDelete = if (count _this > 5) then {_this select 5} else {true};
|
||||
_PlayerUID = getPlayerUID _activatingPlayer;
|
||||
_PUIDIndex = DZE_ServerPUIDArray find _PlayerUID;
|
||||
|
||||
if (_object distance _activatingPlayer > (Z_VehicleDistance + 10)) exitWith {diag_log "Server_DeleteObj error: Delete verification failed, referenced player is too far away from object";};
|
||||
if (_PUIDIndex < 0) exitWith {diag_log "Server_DeleteObj error: PUID NOT FOUND ON SERVER";};
|
||||
if ((((DZE_ServerClientKeys select _PUIDIndex) select 0) != (owner _activatingPlayer)) || (((DZE_ServerClientKeys select _PUIDIndex) select 1) != _clientKey)) exitWith {diag_log "Server_DeleteObj error: CLIENT AUTH KEY INCORRECT OR UNRECOGNIZED";};
|
||||
if (_object distance _activatingPlayer > (Z_VehicleDistance + 10)) exitWith {diag_log format["Server_DeleteObj error: Delete verification failed, referenced player is too far away from object. PV ARRAY: %1", _this];};
|
||||
if (_PUIDIndex < 0) exitWith {diag_log format["Server_DeleteObj error: PUID NOT FOUND ON SERVER. PV ARRAY: %1", _this];};
|
||||
if ((((DZE_ServerClientKeys select _PUIDIndex) select 0) != (owner _activatingPlayer)) || (((DZE_ServerClientKeys select _PUIDIndex) select 1) != _clientKey)) exitWith {diag_log format["Server_DeleteObj error: CLIENT AUTH KEY INCORRECT OR UNRECOGNIZED. PV ARRAY: %1", _this];};
|
||||
|
||||
if (isServer) then {
|
||||
if (_processDelete) then {deleteVehicle _object};
|
||||
//remove from database
|
||||
if (parseNumber _id > 0) then {
|
||||
//Send request
|
||||
_key = format["CHILD:304:%1:",_id];
|
||||
_key call server_hiveWrite;
|
||||
diag_log format["DELETE: Player %1 ,with Player UID %2 deleted object with ID: %3",_activatingPlayer, _PlayerUID, _id];
|
||||
diag_log format["DELETE: Player %1 with Player UID %2 deleted object with ID: %3",_activatingPlayer, _PlayerUID, _id];
|
||||
} else {
|
||||
//Send request
|
||||
_key = format["CHILD:310:%1:",_uid];
|
||||
_key call server_hiveWrite;
|
||||
diag_log format["DELETE: Player %1 ,with Player UID %2 deleted object with UID: %3",_activatingPlayer, _PlayerUID, _uid];
|
||||
diag_log format["DELETE: Player %1 with Player UID %2 deleted object with UID: %3",_activatingPlayer, _PlayerUID, _uid];
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user