Add sender verification to publish and swap object

Continuation of 8035df0

This is important to have on publish to identify cheaters who spam
create objects in the database or create objects with bad inventory.

- Renamed variables to backport to vanilla
- Removed % and & due to code filtering in publicvariableval.txt

Changes in modular_build.sqf were the same as player_build.sqf.

Tested with building, upgrading buildable/vehicle/tent, downgrading,
buying a vehicle, destroying tent and removing an object.
This commit is contained in:
ebayShopper
2017-11-03 16:09:14 -04:00
parent 6e48434001
commit 42e00475d6
41 changed files with 154 additions and 109 deletions

View File

@@ -58,7 +58,7 @@ if ((count _VehKey2) > 0) then {
if (isNil "_localResult2") then {
_localResult2 = 0;
} else {
PVDZ_obj_Destroy = [(_VehKey2 select 2),(_VehKey2 select 3),player,(_VehKey2 select 1),DZE_AuthKey];
PVDZ_obj_Destroy = [(_VehKey2 select 2),(_VehKey2 select 3),player,(_VehKey2 select 1),dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
//deleteVehicle (_VehKey2 select 1);
};

View File

@@ -152,11 +152,11 @@ if (_enoughMoney) then {
};
if (_buyingType in DZE_tradeVehicleKeyless) then {
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,"0",_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,"0",_activatingPlayer,dayz_authKey];
} else {
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_keySelected,_activatingPlayer,dayz_authKey];
};
publicVariableServer "PVDZE_veh_Publish2";
publicVariableServer "PVDZE_veh_Publish2";
_keySelected;
};

View File

@@ -540,14 +540,14 @@ if (_canBuild select 0) then {
//call publish precompiled function with given args and send public variable to server to save item to database
if (DZE_permanentPlot) then {
_tmpbuilt setVariable ["ownerPUID",dayz_playerUID,true];
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,dayz_playerUID,_vector],[]];
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,dayz_playerUID,_vector],[],player,dayz_authKey];
if (_lockable == 3) then {
_friendsArr = [[dayz_playerUID,toArray (name player)]];
_tmpbuilt setVariable ["doorfriends", _friendsArr, true];
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,dayz_playerUID,_vector],_friendsArr];
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,dayz_playerUID,_vector],_friendsArr,player,dayz_authKey];
};
} else {
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location, _vector],[]];
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location, _vector],[],player,dayz_authKey];
};
publicVariableServer "PVDZ_obj_Publish";
@@ -566,12 +566,12 @@ if (_canBuild select 0) then {
if (_canBuild select 1) then {
_friendsArr = [[dayz_playerUID,toArray (name player)]];
_tmpbuilt setVariable ["plotfriends", _friendsArr, true];
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,dayz_playerUID,_vector],_friendsArr];
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,dayz_playerUID,_vector],_friendsArr,player,dayz_authKey];
} else {
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,dayz_playerUID,_vector],[]];
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,dayz_playerUID,_vector],[],player,dayz_authKey];
};
} else {
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location, _vector],[]];
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location, _vector],[],player,dayz_authKey];
};
publicVariableServer "PVDZ_obj_Publish";
};

View File

@@ -90,7 +90,7 @@ if (_build) then {
*/
_object setVariable ["characterID",dayz_characterID,true];
PVDZ_obj_Publish = [dayz_characterID,_object,[round _direction, _location], _variables];
PVDZ_obj_Publish = [dayz_characterID,_object,[round _direction,_location],_variables,player,dayz_authKey];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];

View File

@@ -69,7 +69,7 @@ for "_i" from 1 to 20 do {
if (_realObjectStillThere) then { // send to server the destroy request
_realObjectStillThere = false;
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
diag_log [diag_ticktime, __FILE__, "Networked object, request to destroy", PVDZ_obj_Destroy];
} else {
@@ -147,7 +147,7 @@ if (!_realObjectStillThere) then {
_object setVariable ["ownerArray",_ownerArray,true];
_variables = [[ "ownerArray", _ownerArray]];
_object setVariable ["characterID",_characterID,true];
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos],_variables];
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos],_variables,player,dayz_authKey];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];
/*

View File

@@ -127,16 +127,9 @@ if (_proceed) then {
format [localize "STR_BLD_DISMANTLED",typeOf _object] call dayz_rollingMessages;
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_object,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_object,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
if (isServer) then {
PVDZ_obj_Destroy call server_deleteObjDirect;
};
//Need to update for sanity no client should ever create or delete anything
//deleteVehicle _object;
[_dismantleToo,1,1] call fn_dropItem;
};

View File

@@ -79,7 +79,7 @@ if (_isOk) then {
["PartWoodPile",1,1] call fn_dropItem;
["equip_duct_tape",1,1] call fn_dropItem;
};
PVDZ_obj_Destroy = [(_holder getVariable["ObjectID","0"]),(_holder getVariable["ObjectUID","0"]),player,_holder,DZE_AuthKey];
PVDZ_obj_Destroy = [(_holder getVariable["ObjectID","0"]),(_holder getVariable["ObjectUID","0"]),player,_holder,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
} else {
deleteVehicle _holder;

View File

@@ -158,7 +158,7 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
[_object,true] call dayz_inflame;
_object spawn player_fireMonitor;
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos],[[[],[]],_magazines,[[],[]]]];
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir,_pos],[[[],[]],_magazines,[[],[]]],player,dayz_authKey];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];

View File

@@ -128,7 +128,7 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
_backpacks = getBackpackCargo _cursorTarget;
//remove old tent
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
//deleteVehicle _cursorTarget;
@@ -183,9 +183,9 @@ if ((_startUpgrade) AND (isClass(_upgradeConfig))) then {
//publish new tent
if (DZE_permanentPlot) then {
_object setVariable ["ownerPUID",dayz_playerUID,true];
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos, dayz_playerUID],[_weapons,_magazines,_backpacks]];
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir,_pos,dayz_playerUID],[_weapons,_magazines,_backpacks],player,dayz_authKey];
} else {
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos],[_weapons,_magazines,_backpacks]];
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir,_pos],[_weapons,_magazines,_backpacks],player,dayz_authKey];
};
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];

View File

@@ -127,7 +127,7 @@ _object setVariable ["characterID",_characterID,true];
//remove old object
//deleteVehicle _cursorTarget;
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_cursorTarget,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
// create a weaponholder with dismissed parts
@@ -140,7 +140,7 @@ _wh = "WeaponHolder" createVehicle (getPosATL player);
//publish new object
_variables = [["ownerArray", _ownerArray],["padlockCombination", _ownerPasscode]];
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir, _pos],_variables];
PVDZ_obj_Publish = [dayz_characterID,_object,[_dir,_pos],_variables,player,dayz_authKey];
publicVariableServer "PVDZ_obj_Publish";
diag_log [diag_ticktime, __FILE__, "New Networked object, request to save to hive. PVDZ_obj_Publish:", PVDZ_obj_Publish];
/*

View File

@@ -405,14 +405,14 @@ if (_canBuild select 0) then {
_tmpbuilt setVariable ["CharacterID",_combination,true];
if (DZE_permanentPlot) then {
_tmpbuilt setVariable ["ownerPUID",dayz_playerUID,true];
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,dayz_playerUID],[]];
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,dayz_playerUID],[],player,dayz_authKey];
if (_lockable == 3) then {
_friendsArr = [[dayz_playerUID,toArray (name player)]];
_tmpbuilt setVariable ["doorfriends", _friendsArr, true];
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,dayz_playerUID,_vector],_friendsArr];
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location,dayz_playerUID,_vector],_friendsArr,player,dayz_authKey];
};
} else {
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location],[]];
PVDZ_obj_Publish = [_combination,_tmpbuilt,[_dir,_location],[],player,dayz_authKey];
};
publicVariableServer "PVDZ_obj_Publish";
@@ -431,12 +431,12 @@ if (_canBuild select 0) then {
if (_canBuild select 1) then {
_friendsArr = [[dayz_playerUID,toArray (name player)]];
_tmpbuilt setVariable ["plotfriends", _friendsArr, true];
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,dayz_playerUID],_friendsArr];
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,dayz_playerUID],_friendsArr,player,dayz_authKey];
} else {
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,dayz_playerUID],[]];
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location,dayz_playerUID],[],player,dayz_authKey];
};
} else {
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location],[]];
PVDZ_obj_Publish = [dayz_characterID,_tmpbuilt,[_dir,_location],[],player,dayz_authKey];
};
publicVariableServer "PVDZ_obj_Publish";
};

View File

@@ -113,9 +113,9 @@ if ((count _upgrade) > 0) then {
if (DZE_permanentPlot) then {
_ownerID = _obj getVariable["ownerPUID","0"];
_object setVariable ["ownerPUID",_ownerID,true];
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location,dayz_playerUID,_vector],_classname,_obj,player];
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location,dayz_playerUID,_vector],_classname,_obj,player,[],dayz_authKey];
} else {
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location, _vector],_classname,_obj,player];
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location, _vector],_classname,_obj,player,[],dayz_authKey];
};
publicVariableServer "PVDZE_obj_Swap";

View File

@@ -65,16 +65,11 @@ 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,false];
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,dayz_authKey,false];
publicVariableServer "PVDZ_obj_Destroy";
//Send killed for object
if (isServer) then {
PVDZ_obj_Destroy call server_deleteObjDirect;
} else {
PVDZ_veh_Save = [_obj, "killed"];
publicVariableServer "PVDZ_veh_Save";
};
PVDZ_veh_Save = [_obj, "killed"];
publicVariableServer "PVDZ_veh_Save";
//Set fire to item
onFire = [_obj,_fireIntensity,time,false,true] spawn BIS_Effects_Burn;

View File

@@ -137,12 +137,12 @@ if ((count _upgrade) > 0) then {
if (_lockable == 3) then {
_friendsArr = [[dayz_playerUID,toArray (name player)]];
_object setVariable ["doorfriends", _friendsArr, true];
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location,_ownerID,_vector],_classname,_obj,player,_friendsArr];
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location,_ownerID,_vector],_classname,_obj,player,_friendsArr,dayz_authKey];
} else {
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location,_ownerID,_vector],_classname,_obj,player];
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location,_ownerID,_vector],_classname,_obj,player,[],dayz_authKey];
};
} else {
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location,_vector],_classname,_obj,player];
PVDZE_obj_Swap = [_objectCharacterID,_object,[_dir,_location,_vector],_classname,_obj,player,[],dayz_authKey];
};
publicVariableServer "PVDZE_obj_Swap";

View File

@@ -152,7 +152,7 @@ if (_proceed && _success) then {
_ipos = getPosATL _obj;
if(!_isWreck && !_isWreckBuilding) then {
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,player,_obj,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
};

View File

@@ -123,7 +123,7 @@ if (_finished) then {
_location = [_sign] call FNC_GetPos;
[_part_out,_sign] call fn_waitForObject;
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,dayz_characterID,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,dayz_characterID,_activatingPlayer,dayz_authKey];
publicVariableServer "PVDZE_veh_Publish2";
format[localize "STR_EPOCH_PLAYER_180",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
@@ -183,7 +183,7 @@ if (_finished) then {
//if(_objectID != "0" && _objectUID != "0") then {
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
//deleteVehicle _obj;

View File

@@ -108,7 +108,7 @@ if (_qty >= _qty_in) then {
_location = [_sign] call FNC_GetPos;
[_part_out,_sign] call fn_waitForObject;
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,dayz_characterID,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,dayz_characterID,_activatingPlayer,dayz_authKey];
publicVariableServer "PVDZE_veh_Publish2";
format[localize "str_epoch_player_180",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
@@ -156,7 +156,7 @@ if (_qty >= _qty_in) then {
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
//deleteVehicle _obj;

View File

@@ -128,7 +128,7 @@ if (_finished) then {
_location = [_sign] call FNC_GetPos;
[_part_out,_sign] call fn_waitForObject;
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer,dayz_authKey];
publicVariableServer "PVDZE_veh_Publish2";
format[localize "STR_EPOCH_ACTIONS_11",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
@@ -159,7 +159,7 @@ if (_finished) then {
if(local _obj && !isNull _obj && alive _obj && !_notSetup) then {
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
//deleteVehicle _obj;

View File

@@ -114,7 +114,7 @@ if (_qty >= _qty_in) then {
_location = [_sign] call FNC_GetPos;
[_part_out,_sign] call fn_waitForObject;
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer,dayz_authKey];
publicVariableServer "PVDZE_veh_Publish2";
format["Bought %3 for %1 %2, key added to toolbelt.",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
@@ -142,7 +142,7 @@ if (_qty >= _qty_in) then {
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
//deleteVehicle _obj;

View File

@@ -127,7 +127,7 @@ if (_finished) then {
_location = [_sign] call FNC_GetPos;
[_part_out,_sign] call fn_waitForObject;
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer,dayz_authKey];
publicVariableServer "PVDZE_veh_Publish2";
format[localize "STR_EPOCH_ACTIONS_11",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
@@ -189,7 +189,7 @@ if (_finished) then {
//if(_objectID != "0" && _objectUID != "0") then {
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
//deleteVehicle _obj;

View File

@@ -126,7 +126,7 @@ if (_finished) then {
_location = [_sign] call FNC_GetPos;
[_part_out,_sign] call fn_waitForObject;
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,0,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,true,0,_activatingPlayer,dayz_authKey];
publicVariableServer "PVDZE_veh_Publish2";
};
@@ -185,7 +185,7 @@ if (_finished) then {
//if(_objectID != "0" && _objectUID != "0") then {
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
//deleteVehicle _obj;

View File

@@ -112,7 +112,7 @@ if (_qty >= _qty_in) then {
_location = [_sign] call FNC_GetPos;
[_part_out,_sign] call fn_waitForObject;
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer];
PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_result select 1,_activatingPlayer,dayz_authKey];
publicVariableServer "PVDZE_veh_Publish2";
format["Bought %3 for %1 %2, key added to toolbelt.",_qty_in,_textPartIn,_textPartOut] call dayz_rollingMessages;
@@ -163,7 +163,7 @@ if (_qty >= _qty_in) then {
_objectID = _obj getVariable ["ObjectID","0"];
_objectUID = _obj getVariable ["ObjectUID","0"];
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,DZE_AuthKey];
PVDZ_obj_Destroy = [_objectID,_objectUID,_activatingPlayer,_obj,dayz_authKey];
publicVariableServer "PVDZ_obj_Destroy";
//deleteVehicle _obj;