From d0203ab1576ac5c511f908cde285f5b86c9c2689 Mon Sep 17 00:00:00 2001 From: Skaronator Date: Sun, 2 Feb 2014 20:30:52 +0100 Subject: [PATCH] Cleanup dayz_server scripts --- .../compile/server_handleZedSpawn.sqf | 3 - SQF/dayz_server/compile/server_lockedObj.sqf | 114 ------------------ SQF/dayz_server/compile/server_playerStat.sqf | 4 - .../compile/server_updateNearbyObjects.sqf | 6 - .../compile/server_updatePlayer.sqf | 0 SQF/dayz_server/compile/zombie_findOwner.sqf | 8 -- SQF/dayz_server/init/server_functions.sqf | 26 +++- 7 files changed, 23 insertions(+), 138 deletions(-) delete mode 100644 SQF/dayz_server/compile/server_handleZedSpawn.sqf delete mode 100644 SQF/dayz_server/compile/server_lockedObj.sqf delete mode 100644 SQF/dayz_server/compile/server_playerStat.sqf delete mode 100644 SQF/dayz_server/compile/server_updateNearbyObjects.sqf delete mode 100644 SQF/dayz_server/compile/server_updatePlayer.sqf delete mode 100644 SQF/dayz_server/compile/zombie_findOwner.sqf diff --git a/SQF/dayz_server/compile/server_handleZedSpawn.sqf b/SQF/dayz_server/compile/server_handleZedSpawn.sqf deleted file mode 100644 index 2de9e6813..000000000 --- a/SQF/dayz_server/compile/server_handleZedSpawn.sqf +++ /dev/null @@ -1,3 +0,0 @@ -private["_zed"]; -_zed = _this select 0; -_zed enableSimulation false; \ No newline at end of file diff --git a/SQF/dayz_server/compile/server_lockedObj.sqf b/SQF/dayz_server/compile/server_lockedObj.sqf deleted file mode 100644 index 09db92236..000000000 --- a/SQF/dayz_server/compile/server_lockedObj.sqf +++ /dev/null @@ -1,114 +0,0 @@ -/* -lock or unlock a object via Server w/o using setVariable on the obj -1: PVDZE_locked = [player,_obj,_combination]; -*/ -_player = _this select 0; -_obj = _this select 1; -_combi = _this select 2; -_owner = owner _player; - -//_correctlyCombi = HIVECALL TO GET THE OBJECT COMBINATION; - -if (_combi != _correctlyCombi) exitWith { //force exit script if code if wrong - PVDZES_Combination = false; //PVDZES >> S is to kick player they are manipulating it to other player, PVDZE is allow via BE Filter but PVDZES not - _owner publicVariableClient "PVDZES_Combination"; -}; - -PVDZES_Combination = true; //if code is correct send it to the client -_owner publicVariableClient "PVDZES_Combination"; - -/* Client Code Example - -PVDZE_locked = [player,_vault,_combination]; -publicVariableServer = PVDZE_locked; - -waitUntil{!isNil "PVDZES_Combination"} - -if (PVDZES_Combination) then { - Say Combination correct!, Unlock/Lock in Progress -}else{ - Say Combination incorrect! -}; - -*/ - -_objType = typeOf _obj; -_locked = false; -if (_objType in DZE_LockedStorage) then { _locked = true; }; -_dir = direction _obj; -_pos = _obj getVariable["OEMPos",(getposATL _obj)]; - -if (_locked) then { //unlock - _unlockedClass = getText (configFile >> "CfgVehicles" >> _objType >> "unlockedClass"); - -/* _weapons = HIVECALL TO GET THE INVENTORY - _magazines = HIVECALL TO GET THE INVENTORY - _backpacks = HIVECALL TO GET THE INVENTORY */ - - _holder = createVehicle [_unlockedClass,_pos,[], 0, "CAN_COLLIDE"]; - if ((isNull _holder) or (isNil "_holder")) then { - _holder = createVehicle [_unlockedClass,_pos,[], 0, "CAN_COLLIDE"]; - }; - // Remove locked vault - deleteVehicle _obj; - _holder setdir _dir; - _holder setPosATL _pos; - -// _holder setVariable["CharacterID",_ownerID,true]; - _holder setVariable["ObjectID",_objectID,true]; - _holder setVariable["ObjectUID",_objectUID,true]; - _holder setVariable ["OEMPos", _pos, true]; - - if (count _weapons > 0) then { - //Add weapons - _objWpnTypes = _weapons select 0; - _objWpnQty = _weapons select 1; - _countr = 0; - { - _holder addweaponcargoGlobal [_x,(_objWpnQty select _countr)]; - _countr = _countr + 1; - } forEach _objWpnTypes; - }; - - if (count _magazines > 0) then { - //Add Magazines - _objWpnTypes = _magazines select 0; - _objWpnQty = _magazines select 1; - _countr = 0; - { - _holder addmagazinecargoGlobal [_x,(_objWpnQty select _countr)]; - _countr = _countr + 1; - } forEach _objWpnTypes; - }; - - if (count _backpacks > 0) then { - //Add Backpacks - _objWpnTypes = _backpacks select 0; - _objWpnQty = _backpacks select 1; - _countr = 0; - { - _holder addbackpackcargoGlobal [_x,(_objWpnQty select _countr)]; - _countr = _countr + 1; - } forEach _objWpnTypes; - }; -} else { //lock - _lockedClass = getText (configFile >> "CfgVehicles" >> _objType >> "lockedClass"); - - //PVDZE_veh_Update = [_obj,"gear"]; - //publicVariableServer "PVDZE_veh_Update"; - [_obj,"gear"] spawn server_updateObject; - - //place vault - _holder = createVehicle [_lockedClass,_pos,[], 0, "CAN_COLLIDE"]; - _holder setdir _dir; - _holder setPosATL _pos; - -// _holder setVariable["CharacterID",_ownerID,true]; - _holder setVariable["ObjectID",_objectID,true]; - _holder setVariable["ObjectUID",_objectUID,true]; - _holder setVariable ["OEMPos", _pos, true]; - - // remove vault - deleteVehicle _obj; - -}; \ No newline at end of file diff --git a/SQF/dayz_server/compile/server_playerStat.sqf b/SQF/dayz_server/compile/server_playerStat.sqf deleted file mode 100644 index 47aeab9d7..000000000 --- a/SQF/dayz_server/compile/server_playerStat.sqf +++ /dev/null @@ -1,4 +0,0 @@ -private ["_unit","_variable","_change"]; -_unit = _this select 0; -_variable = _this select 1; -_change = _this select 2; \ No newline at end of file diff --git a/SQF/dayz_server/compile/server_updateNearbyObjects.sqf b/SQF/dayz_server/compile/server_updateNearbyObjects.sqf deleted file mode 100644 index b86c7d7ed..000000000 --- a/SQF/dayz_server/compile/server_updateNearbyObjects.sqf +++ /dev/null @@ -1,6 +0,0 @@ -private["_pos"]; -_pos = _this select 0; - -{ - [_x, "gear"] call server_updateObject; -} forEach nearestObjects [_pos, dayz_updateObjects, 10]; diff --git a/SQF/dayz_server/compile/server_updatePlayer.sqf b/SQF/dayz_server/compile/server_updatePlayer.sqf deleted file mode 100644 index e69de29bb..000000000 diff --git a/SQF/dayz_server/compile/zombie_findOwner.sqf b/SQF/dayz_server/compile/zombie_findOwner.sqf deleted file mode 100644 index a396fe9c6..000000000 --- a/SQF/dayz_server/compile/zombie_findOwner.sqf +++ /dev/null @@ -1,8 +0,0 @@ -private["_unit"]; -_unit = _this select 0; - -#ifdef DZE_SERVER_DEBUG -diag_log ("CLEANUP: DELETE UNCONTROLLED ZOMBIE: " + (typeOf _unit) + " OF: " + str(_unit) ); -#endif - -deleteVehicle _unit; \ No newline at end of file diff --git a/SQF/dayz_server/init/server_functions.sqf b/SQF/dayz_server/init/server_functions.sqf index 4d58087e8..88393e5f3 100644 --- a/SQF/dayz_server/init/server_functions.sqf +++ b/SQF/dayz_server/init/server_functions.sqf @@ -29,10 +29,7 @@ server_publishVeh3 = compile preprocessFileLineNumbers "\z\addons\dayz_server server_tradeObj = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_tradeObject.sqf"; server_traders = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_traders.sqf"; server_playerSync = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_playerSync.sqf"; -zombie_findOwner = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\zombie_findOwner.sqf"; -server_updateNearbyObjects = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_updateNearbyObjects.sqf"; server_spawnCrashSite = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnCrashSite.sqf"; -server_handleZedSpawn = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_handleZedSpawn.sqf"; server_spawnEvents = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_spawnEvent.sqf"; //server_weather = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\server_weather.sqf"; fnc_plyrHit = compile preprocessFileLineNumbers "\z\addons\dayz_server\compile\fnc_plyrHit.sqf"; @@ -45,6 +42,29 @@ server_sendToClient = compile preprocessFileLineNumbers "\z\addons\dayz_server //onPlayerConnected {[_uid,_name] call server_onPlayerConnect;}; onPlayerDisconnected {[_uid,_name] call server_onPlayerDisconnect;}; +server_updateNearbyObjects = { + private["_pos"]; + _pos = _this select 0; + { + [_x, "gear"] call server_updateObject; + } forEach nearestObjects [_pos, dayz_updateObjects, 10]; +}; + +server_handleZedSpawn = { + private["_zed"]; + _zed = _this select 0; + _zed enableSimulation false; +}; + +zombie_findOwner = { + private["_unit"]; + _unit = _this select 0; + #ifdef DZE_SERVER_DEBUG + diag_log ("CLEANUP: DELETE UNCONTROLLED ZOMBIE: " + (typeOf _unit) + " OF: " + str(_unit) ); + #endif + deleteVehicle _unit; +}; + vehicle_handleInteract = { private["_object"]; _object = _this select 0;