mirror of
https://github.com/EpochModTeam/DayZ-Epoch.git
synced 2026-02-04 15:22:53 +03:00
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:
@@ -1,12 +1,18 @@
|
||||
private ["_activatingPlayer","_isOK","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey","_object","_result","_outcome","_oid","_object_para"];
|
||||
//PVDZE_veh_Publish2 = [[_dir,_location],_part_out,false,_keySelected,_activatingPlayer];
|
||||
private ["_activatingPlayer","_isOK","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey","_object","_result","_outcome","_oid","_object_para","_clientKey","_exitReason","_playerUID"];
|
||||
#include "\z\addons\dayz_server\compile\server_toggle_debug.hpp"
|
||||
|
||||
if (count _this < 6) exitWith {diag_log "Server_PublishVehicle2 error: Wrong parameter format";};
|
||||
|
||||
_worldspace = _this select 0;
|
||||
_class = _this select 1;
|
||||
_donotusekey = _this select 2;
|
||||
_keySelected = _this select 3;
|
||||
_activatingPlayer = _this select 4;
|
||||
_clientKey = _this select 5;
|
||||
_playerUID = getPlayerUID _activatingPlayer;
|
||||
|
||||
_exitReason = [_this,"PublishVehicle2",(_worldspace select 1),_clientKey,_playerUID,_activatingPlayer] call server_verifySender;
|
||||
if (_exitReason != "") exitWith {diag_log _exitReason};
|
||||
|
||||
if(_donotusekey) then {
|
||||
_isOK = true;
|
||||
@@ -89,5 +95,5 @@ if (_outcome != "PASS") then {
|
||||
PVDZE_veh_Init = _object;
|
||||
publicVariable "PVDZE_veh_Init";
|
||||
|
||||
diag_log format["PUBLISH: %1(%2) bought %3 with ObjectUID %4",if (alive _activatingPlayer) then {name _activatingPlayer} else {"DeadPlayer"},getPlayerUID _activatingPlayer,_class,_uid];
|
||||
diag_log format["PUBLISH: %1(%2) bought %3 with UID %4 @%5",_activatingPlayer,_playerUID,_class,_uid,(_location call fa_coor2str)];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user