From aa14a03c4ecc30fa21f56bfbdbe96ccfb9bbdbbb Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Sun, 27 Oct 2013 10:22:29 -0500 Subject: [PATCH] added server side logging of purchases of vehicles and removals --- SQF/dayz_code/actions/buy_db.sqf | 2 +- SQF/dayz_code/actions/list_playerDeaths.sqf | 2 +- SQF/dayz_code/actions/remove.sqf | 6 ++++-- SQF/dayz_code/actions/repair_vehicle.sqf | 2 +- SQF/dayz_code/actions/salvage_vehicle.sqf | 2 +- SQF/dayz_code/actions/sell_db.sqf | 2 +- SQF/dayz_code/actions/trade_any_bicycle.sqf | 7 +++---- SQF/dayz_code/actions/trade_any_boat.sqf | 7 +++---- SQF/dayz_code/actions/trade_any_vehicle.sqf | 7 +++---- SQF/dayz_code/actions/trade_backpacks.sqf | 2 +- SQF/dayz_code/actions/trade_items.sqf | 2 +- SQF/dayz_code/actions/trade_items_wo_db.sqf | 2 +- SQF/dayz_code/actions/trade_weapons.sqf | 2 +- SQF/dayz_code/compile/player_packTent.sqf | 6 ++++-- SQF/dayz_code/compile/player_packVault.sqf | 6 ++++-- SQF/dayz_server/compile/server_deleteObj.sqf | 5 +++-- SQF/dayz_server/compile/server_publishVehicle2.sqf | 5 +++-- 17 files changed, 36 insertions(+), 31 deletions(-) diff --git a/SQF/dayz_code/actions/buy_db.sqf b/SQF/dayz_code/actions/buy_db.sqf index 58c6536ee..a522157e8 100644 --- a/SQF/dayz_code/actions/buy_db.sqf +++ b/SQF/dayz_code/actions/buy_db.sqf @@ -5,7 +5,7 @@ if (TradeInprogress) exitWith {}; // Do not allow if any script is running. {player removeAction _x} forEach s_player_parts;s_player_parts = []; // [ _trader_id, _category, _action ]; -_activatingPlayer = _this select 1; +_activatingPlayer = player; _trader_id = (_this select 3) select 0; // _category = (_this select 3) select 1; diff --git a/SQF/dayz_code/actions/list_playerDeaths.sqf b/SQF/dayz_code/actions/list_playerDeaths.sqf index bbb76695b..467f778ca 100644 --- a/SQF/dayz_code/actions/list_playerDeaths.sqf +++ b/SQF/dayz_code/actions/list_playerDeaths.sqf @@ -1,7 +1,7 @@ private ["_activatingPlayer"]; // [ _trader_id, _category, _action ]; -_activatingPlayer = _this select 1; +_activatingPlayer = player; //diag_log format["DEBUG DEATH OBJ: %1", _this select 0]; diff --git a/SQF/dayz_code/actions/remove.sqf b/SQF/dayz_code/actions/remove.sqf index 0bab114a0..ede026a2d 100644 --- a/SQF/dayz_code/actions/remove.sqf +++ b/SQF/dayz_code/actions/remove.sqf @@ -2,7 +2,7 @@ delete object from db with extra waiting by [VB]AWOL parameters: _obj */ -private ["_obj","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_objType","_sfx","_dis","_itemOut","_countOut","_selectedRemoveOutput","_friendlies","_nearestPole","_ownerID","_refundpart","_isWreck","_findNearestPoles","_findNearestPole","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle"]; +private ["_activatingPlayer","_obj","_objectID","_objectUID","_started","_finished","_animState","_isMedic","_isOk","_proceed","_counter","_limit","_objType","_sfx","_dis","_itemOut","_countOut","_selectedRemoveOutput","_friendlies","_nearestPole","_ownerID","_refundpart","_isWreck","_findNearestPoles","_findNearestPole","_IsNearPlot","_brokenTool","_removeTool","_isDestructable","_isRemovable","_objOwnerID","_isOwnerOfObj","_preventRefund","_ipos","_item","_radius","_isWreckBuilding","_nameVehicle"]; if(TradeInprogress) exitWith { cutText ["Remove already in progress." , "PLAIN DOWN"]; }; TradeInprogress = true; @@ -12,6 +12,8 @@ s_player_deleteBuild = 1; _obj = _this select 3; +_activatingPlayer = player; + _objOwnerID = _obj getVariable["CharacterID","0"]; _isOwnerOfObj = (_objOwnerID == dayz_characterID); @@ -158,7 +160,7 @@ if (_proceed) then { deleteVehicle _obj; if(!_isWreck) then { - PVDZE_obj_Delete = [_objectID,_objectUID]; + PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer]; publicVariableServer "PVDZE_obj_Delete"; }; diff --git a/SQF/dayz_code/actions/repair_vehicle.sqf b/SQF/dayz_code/actions/repair_vehicle.sqf index 69afa5367..20a7d2549 100644 --- a/SQF/dayz_code/actions/repair_vehicle.sqf +++ b/SQF/dayz_code/actions/repair_vehicle.sqf @@ -1,7 +1,7 @@ private ["_part","_cancel","_color","_allFixed","_percent","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints"]; // [ _trader_id, _category, _action ]; -// _activatingPlayer = _this select 1; +// _activatingPlayer = player; _vehicle = _this select 3; diff --git a/SQF/dayz_code/actions/salvage_vehicle.sqf b/SQF/dayz_code/actions/salvage_vehicle.sqf index c1ba11b77..9af1d68f4 100644 --- a/SQF/dayz_code/actions/salvage_vehicle.sqf +++ b/SQF/dayz_code/actions/salvage_vehicle.sqf @@ -1,7 +1,7 @@ private ["_part","_cancel","_color","_percent","_string","_handle","_damage","_cmpt","_vehicle","_hitpoints"]; // [ _trader_id, _category, _action ]; -// _activatingPlayer = _this select 1; +// _activatingPlayer = player; _vehicle = _this select 3; diff --git a/SQF/dayz_code/actions/sell_db.sqf b/SQF/dayz_code/actions/sell_db.sqf index 2faa53271..4a5338301 100644 --- a/SQF/dayz_code/actions/sell_db.sqf +++ b/SQF/dayz_code/actions/sell_db.sqf @@ -6,7 +6,7 @@ TradeInprogress = true; {player removeAction _x} forEach s_player_parts;s_player_parts = []; // [ _trader_id, _category, _action ]; -_activatingPlayer = _this select 1; +_activatingPlayer = player; _trader_id = (_this select 3) select 0; //_category = (_this select 3) select 1; diff --git a/SQF/dayz_code/actions/trade_any_bicycle.sqf b/SQF/dayz_code/actions/trade_any_bicycle.sqf index bc89f97f5..ea0a03df8 100644 --- a/SQF/dayz_code/actions/trade_any_bicycle.sqf +++ b/SQF/dayz_code/actions/trade_any_bicycle.sqf @@ -9,7 +9,7 @@ if(_playerNear) exitWith { TradeInprogress = false; cutText ["Cannot trade while // [part_out,part_in, qty_out, qty_in, loc]; -_activatingPlayer = _this select 1; +_activatingPlayer = player; _part_out = (_this select 3) select 0; _part_in = (_this select 3) select 1; @@ -111,7 +111,7 @@ if (_qty >= _qty_in) then { _location = (getPosATL _veh); //["PVDZE_veh_Publish",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure; - PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,true,dayz_characterID]; + PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,true,dayz_characterID,_activatingPlayer]; publicVariableServer "PVDZE_veh_Publish2"; player reveal _veh; @@ -160,8 +160,7 @@ if (_qty >= _qty_in) then { _objectID = _obj getVariable ["ObjectID","0"]; _objectUID = _obj getVariable ["ObjectUID","0"]; - //["PVDZE_obj_Delete",[_objectID,_objectUID]] call callRpcProcedure; - PVDZE_obj_Delete = [_objectID,_objectUID]; + PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer]; publicVariableServer "PVDZE_obj_Delete"; deleteVehicle _obj; diff --git a/SQF/dayz_code/actions/trade_any_boat.sqf b/SQF/dayz_code/actions/trade_any_boat.sqf index 6c4bc3526..bbef14224 100644 --- a/SQF/dayz_code/actions/trade_any_boat.sqf +++ b/SQF/dayz_code/actions/trade_any_boat.sqf @@ -9,7 +9,7 @@ if(_playerNear) exitWith { TradeInprogress = false; cutText ["Cannot trade while // [part_out,part_in, qty_out, qty_in, loc]; -_activatingPlayer = _this select 1; +_activatingPlayer = player; _part_out = (_this select 3) select 0; _part_in = (_this select 3) select 1; @@ -128,7 +128,7 @@ if (_qty >= _qty_in) then { _location = (getPosATL _veh); //["PVDZE_veh_Publish",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure; - PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected]; + PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer]; publicVariableServer "PVDZE_veh_Publish2"; player reveal _veh; @@ -154,8 +154,7 @@ if (_qty >= _qty_in) then { _objectID = _obj getVariable ["ObjectID","0"]; _objectUID = _obj getVariable ["ObjectUID","0"]; - //["PVDZE_obj_Delete",[_objectID,_objectUID]] call callRpcProcedure; - PVDZE_obj_Delete = [_objectID,_objectUID]; + PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer]; publicVariableServer "PVDZE_obj_Delete"; deleteVehicle _obj; diff --git a/SQF/dayz_code/actions/trade_any_vehicle.sqf b/SQF/dayz_code/actions/trade_any_vehicle.sqf index d4018bc56..d3f8a298f 100644 --- a/SQF/dayz_code/actions/trade_any_vehicle.sqf +++ b/SQF/dayz_code/actions/trade_any_vehicle.sqf @@ -9,7 +9,7 @@ if(_playerNear) exitWith { TradeInprogress = false; cutText ["Cannot trade while // [part_out,part_in, qty_out, qty_in, loc]; -_activatingPlayer = _this select 1; +_activatingPlayer = player; _part_out = (_this select 3) select 0; _part_in = (_this select 3) select 1; @@ -127,7 +127,7 @@ if (_qty >= _qty_in) then { _location = (getPosATL _veh); //["PVDZE_veh_Publish",[_veh,[_dir,_location],_part_out,false,_keySelected]] call callRpcProcedure; - PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected]; + PVDZE_veh_Publish2 = [_veh,[_dir,_location],_part_out,false,_keySelected,_activatingPlayer]; publicVariableServer "PVDZE_veh_Publish2"; player reveal _veh; @@ -180,8 +180,7 @@ if (_qty >= _qty_in) then { _objectID = _obj getVariable ["ObjectID","0"]; _objectUID = _obj getVariable ["ObjectUID","0"]; - //["PVDZE_obj_Delete",[_objectID,_objectUID]] call callRpcProcedure; - PVDZE_obj_Delete = [_objectID,_objectUID]; + PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer]; publicVariableServer "PVDZE_obj_Delete"; deleteVehicle _obj; diff --git a/SQF/dayz_code/actions/trade_backpacks.sqf b/SQF/dayz_code/actions/trade_backpacks.sqf index 13ac1a5be..687c4fabe 100644 --- a/SQF/dayz_code/actions/trade_backpacks.sqf +++ b/SQF/dayz_code/actions/trade_backpacks.sqf @@ -4,7 +4,7 @@ private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_bos","_bag","_clas if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; }; TradeInprogress = true; -_activatingPlayer = _this select 1; +_activatingPlayer = player; _part_out = (_this select 3) select 0; _part_in = (_this select 3) select 1; diff --git a/SQF/dayz_code/actions/trade_items.sqf b/SQF/dayz_code/actions/trade_items.sqf index b1d208c70..6a0af6361 100644 --- a/SQF/dayz_code/actions/trade_items.sqf +++ b/SQF/dayz_code/actions/trade_items.sqf @@ -6,7 +6,7 @@ TradeInprogress = true; _total_parts_out = 0; -_activatingPlayer = _this select 1; +_activatingPlayer = player; _part_out = (_this select 3) select 0; _part_in = (_this select 3) select 1; diff --git a/SQF/dayz_code/actions/trade_items_wo_db.sqf b/SQF/dayz_code/actions/trade_items_wo_db.sqf index e5ed7f505..89656cf5a 100644 --- a/SQF/dayz_code/actions/trade_items_wo_db.sqf +++ b/SQF/dayz_code/actions/trade_items_wo_db.sqf @@ -4,7 +4,7 @@ private ["_part_out","_part_in","_qty_out","_qty_in","_textPartIn","_textPartOut if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; }; TradeInprogress = true; -//_activatingPlayer = _this select 1; +//_activatingPlayer = player; _part_out = (_this select 3) select 0; _part_in = (_this select 3) select 1; diff --git a/SQF/dayz_code/actions/trade_weapons.sqf b/SQF/dayz_code/actions/trade_weapons.sqf index 805cb1815..a4a048cb8 100644 --- a/SQF/dayz_code/actions/trade_weapons.sqf +++ b/SQF/dayz_code/actions/trade_weapons.sqf @@ -4,7 +4,7 @@ private ["_part_out","_part_in","_qty_out","_qty_in","_qty","_buy_o_sell","_trad if(TradeInprogress) exitWith { cutText ["Trade already in progress." , "PLAIN DOWN"]; }; TradeInprogress = true; -_activatingPlayer = _this select 1; +_activatingPlayer = player; _part_out = (_this select 3) select 0; _part_in = (_this select 3) select 1; diff --git a/SQF/dayz_code/compile/player_packTent.sqf b/SQF/dayz_code/compile/player_packTent.sqf index 34e55e839..90af47e9e 100644 --- a/SQF/dayz_code/compile/player_packTent.sqf +++ b/SQF/dayz_code/compile/player_packTent.sqf @@ -1,7 +1,7 @@ /* [_obj] spawn player_packTent; */ -private ["_objectID","_objectUID","_obj","_ownerID","_dir","_pos","_object","_holder","_weapons","_magazines","_backpacks","_objWpnTypes","_objWpnQty","_countr","_alreadyPacking","_dis","_sfx","_classname","_location"]; +private ["_activatingPlayer","_objectID","_objectUID","_obj","_ownerID","_dir","_pos","_object","_holder","_weapons","_magazines","_backpacks","_objWpnTypes","_objWpnQty","_countr","_alreadyPacking","_dis","_sfx","_classname","_location"]; if(TradeInprogress) exitWith { cutText ["Pack tent already in progress." , "PLAIN DOWN"]; }; TradeInprogress = true; @@ -9,6 +9,8 @@ TradeInprogress = true; player removeAction s_player_packtent; s_player_packtent = 1; +_activatingPlayer = player; + _obj = _this; _ownerID = _obj getVariable["CharacterID","0"]; _objectID = _obj getVariable["ObjectID","0"]; @@ -57,7 +59,7 @@ if(!isNull _obj and alive _obj) then { _backpacks = getBackpackCargo _obj; deleteVehicle _obj; - PVDZE_obj_Delete = [_objectID,_objectUID]; + PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer]; publicVariableServer "PVDZE_obj_Delete"; if (isServer) then { PVDZE_obj_Delete call server_deleteObj; diff --git a/SQF/dayz_code/compile/player_packVault.sqf b/SQF/dayz_code/compile/player_packVault.sqf index 8035f9c41..888083e40 100644 --- a/SQF/dayz_code/compile/player_packVault.sqf +++ b/SQF/dayz_code/compile/player_packVault.sqf @@ -1,11 +1,13 @@ /* [_obj] spawn player_packVault; */ -private ["_obj","_ownerID","_objectID","_objectUID","_alreadyPacking","_location1","_location2","_dir","_pos","_bag","_holder","_weapons","_magazines","_backpacks","_objWpnTypes","_objWpnQty","_countr","_packedClass","_text","_playerNear"]; +private ["_activatingPlayer","_obj","_ownerID","_objectID","_objectUID","_alreadyPacking","_location1","_location2","_dir","_pos","_bag","_holder","_weapons","_magazines","_backpacks","_objWpnTypes","_objWpnQty","_countr","_packedClass","_text","_playerNear"]; if(TradeInprogress) exitWith { cutText ["That is already being packed." , "PLAIN DOWN"]; }; TradeInprogress = true; +_activatingPlayer = player; + _obj = _this; _packedClass = getText (configFile >> "CfgVehicles" >> (typeOf _obj) >> "packedClass"); @@ -60,7 +62,7 @@ if(!isNull _obj and alive _obj) then { _backpacks = getBackpackCargo _obj; // Remove from database - PVDZE_obj_Delete = [_objectID,_objectUID]; + PVDZE_obj_Delete = [_objectID,_objectUID,_activatingPlayer]; publicVariableServer "PVDZE_obj_Delete"; // Set down vault "take" item diff --git a/SQF/dayz_server/compile/server_deleteObj.sqf b/SQF/dayz_server/compile/server_deleteObj.sqf index c2805c149..441fdc921 100644 --- a/SQF/dayz_server/compile/server_deleteObj.sqf +++ b/SQF/dayz_server/compile/server_deleteObj.sqf @@ -4,6 +4,7 @@ private["_id","_uid","_key"]; _id = _this select 0; _uid = _this select 1; +_activatingPlayer = _this select 2; if (isServer) then { //remove from database @@ -12,14 +13,14 @@ if (isServer) then { _key = format["CHILD:304:%1:",_id]; _key call server_hiveWrite; #ifdef DZE_SERVER_DEBUG_HIVE - diag_log format["DELETE: Deleted by ID: %1",_id]; + diag_log format["DELETE: %1 Deleted by ID: %2",_activatingPlayer,_id]; #endif } else { //Send request _key = format["CHILD:310:%1:",_uid]; _key call server_hiveWrite; #ifdef DZE_SERVER_DEBUG_HIVE - diag_log format["DELETE: Deleted by UID: %1",_uid]; + diag_log format["DELETE: %1 Deleted by UID: %2",_activatingPlayer,_uid]; #endif }; }; \ No newline at end of file diff --git a/SQF/dayz_server/compile/server_publishVehicle2.sqf b/SQF/dayz_server/compile/server_publishVehicle2.sqf index abc4595a9..96a390f3d 100644 --- a/SQF/dayz_server/compile/server_publishVehicle2.sqf +++ b/SQF/dayz_server/compile/server_publishVehicle2.sqf @@ -1,10 +1,11 @@ -private ["_isOK","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey"]; +private ["_activatingPlayer","_isOK","_object","_worldspace","_location","_dir","_class","_uid","_key","_keySelected","_characterID","_donotusekey"]; _object = _this select 0; _worldspace = _this select 1; _class = _this select 2; _donotusekey = _this select 3; _keySelected = _this select 4; +_activatingPlayer = _this select 5; if(_donotusekey) then { _isOK = true; @@ -115,5 +116,5 @@ _key call server_hiveWrite; PVDZE_veh_Init = _object; publicVariable "PVDZE_veh_Init"; - diag_log ("PUBLISH: Created " + (_class) + " with ID " + str(_uid)); + diag_log ("PUBLISH: " + str(_activatingPlayer) + " Bought " + (_class) + " with ID " + str(_uid)); }; \ No newline at end of file