diff --git a/SQF/dayz_code/actions/tow_AttachStraps.sqf b/SQF/dayz_code/actions/tow_AttachStraps.sqf
index 59021e4b3..f14a1510d 100644
--- a/SQF/dayz_code/actions/tow_AttachStraps.sqf
+++ b/SQF/dayz_code/actions/tow_AttachStraps.sqf
@@ -1,16 +1,17 @@
-private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_abort","_canSize","_configVeh","_capacity","_nameText","_isOk","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle"];
+private ["_vehicle","_started","_finished","_animState","_isMedic","_abort","_configVeh","_nameText","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle","_towTruck"];
if(TradeInprogress) exitWith { cutText ["Already in progress." , "PLAIN DOWN"] };
TradeInprogress = true;
// Tow Truck
-_towTruck = _this;
+_towTruck = _this select 3;
// Get all nearby vehicles within 10m
_findNearestVehicles = nearestObjects [_towTruck, ["Car"], 10];
_findNearestVehicle = [];
{
- if (alive _x and _towTruck != _x) then {
+ //diag_log ("SizeOF: " + str(sizeOf _x));
+ if (alive _x and _towTruck != _x and (sizeOf _x) < 10) then {
// within brounding box
if([_x,_towTruck] call fnc_isInsideBuilding2) then {
_findNearestVehicle set [(count _findNearestVehicle),_x];
@@ -71,12 +72,17 @@ if(_IsNearVehicle >= 1) then {
if (_finished) then {
- if(typeOf _towTruck == "VIL_asistvan_DZE" ) then {
- _vehicle attachTo [_towTruck];
- _towTruck setVariable ["DZEinTow", true, true];
- _towTruck setVariable ["DZEvehicleInTow", _vehicle, true];
- cutText [format["%1 has been attached to Tow Truck.",_nameText], "PLAIN DOWN"];
+ if([_vehicle,_towTruck] call fnc_isInsideBuilding2) then {
+ if(typeOf _towTruck == "VIL_asistvan_DZE" ) then {
+ _vehicle attachTo [_towTruck];
+ _towTruck setVariable ["DZEinTow", true, true];
+ _towTruck setVariable ["DZEvehicleInTow", _vehicle, true];
+ cutText [format["%1 has been attached to Tow Truck.",_nameText], "PLAIN DOWN"];
+ };
+ } else {
+ cutText [format["Failed to attach %1 to Tow Truck.",_nameText], "PLAIN DOWN"];
};
+
};
diff --git a/SQF/dayz_code/actions/tow_DetachStraps.sqf b/SQF/dayz_code/actions/tow_DetachStraps.sqf
index 5a912da71..16b3b3dc2 100644
--- a/SQF/dayz_code/actions/tow_DetachStraps.sqf
+++ b/SQF/dayz_code/actions/tow_DetachStraps.sqf
@@ -1,15 +1,15 @@
-private ["_vehicle","_curFuel","_newFuel","_started","_finished","_animState","_isMedic","_abort","_canSize","_configVeh","_capacity","_nameText","_isOk","_findNearestVehicles","_findNearestVehicle","_IsNearVehicle"];
+private ["_vehicle","_started","_finished","_animState","_isMedic","_configVeh","_nameText","_towTruck","_inTow"];
if(TradeInprogress) exitWith { cutText ["Already in progress." , "PLAIN DOWN"] };
TradeInprogress = true;
// Tow Truck
-_towTruck = _this;
+_towTruck = _this select 3;
// exit if no vehicle is in tow.
-_inTow = _towTruck getVariable ["DZEinTow", false]
+_inTow = _towTruck getVariable ["DZEinTow", false];
-if(!_inTow) then {
+if(_inTow) then {
// select the nearest one
_vehicle = _towTruck getVariable ["DZEvehicleInTow", false];
@@ -55,7 +55,6 @@ if(!_inTow) then {
[objNull, player, rSwitchMove,""] call RE;
player playActionNow "stop";
};
- _abort = true;
};
if (_finished) then {
@@ -63,7 +62,7 @@ if(!_inTow) then {
detach _vehicle;
_towTruck setVariable ["DZEinTow", false, true];
_towTruck setVariable ["DZEvehicleInTow", objNull, true];
- cutText [format["%1 has been dettached from Tow Truck.",_nameText], "PLAIN DOWN"];
+ cutText [format["%1 has been detached from Tow Truck.",_nameText], "PLAIN DOWN"];
};
} else {
diff --git a/SQF/dayz_code/compile/fn_selfActions.sqf b/SQF/dayz_code/compile/fn_selfActions.sqf
index b287d34df..7a7864175 100644
--- a/SQF/dayz_code/compile/fn_selfActions.sqf
+++ b/SQF/dayz_code/compile/fn_selfActions.sqf
@@ -508,7 +508,7 @@ if (!isNull cursorTarget and !_inVehicle and !_isPZombie and (player distance cu
if(!(_cursorTarget getVariable ["DZEinTow", false])) then {
s_player_towing = player addAction ["Attach Straps", "\z\addons\dayz_code\actions\tow_AttachStraps.sqf",_cursorTarget, 0, false, true, "",""];
} else {
- s_player_towing = player addAction ["Dettach Straps", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];
+ s_player_towing = player addAction ["Detach Straps", "\z\addons\dayz_code\actions\tow_DetachStraps.sqf",_cursorTarget, 0, false, true, "",""];
};
};
} else {
diff --git a/SQF/dayz_code/compile/player_zombieCheck.sqf b/SQF/dayz_code/compile/player_zombieCheck.sqf
index abe700b75..e05037db2 100644
--- a/SQF/dayz_code/compile/player_zombieCheck.sqf
+++ b/SQF/dayz_code/compile/player_zombieCheck.sqf
@@ -1,306 +1,93 @@
-private ["_listTalk","_group","_eyeDir","_attacked","_continue","_type","_chance","_last","_refObj","_inAngle","_tPos","_zPos","_cantSee","_entHeight","_delta","_targets","_lowBlood","_pHeight"];
+private ["_listTalk","_eyeDir","_attacked","_continue","_type","_chance","_last","_refObj","_inAngle","_tPos","_zPos","_cantSee","_entHeight","_delta","_targets","_pHeight","_lowBlood","_dist"];
_refObj = vehicle player;
_listTalk = (getPos _refObj) nearEntities ["zZombie_Base",80];
_pHeight = (getPosATL _refObj) select 2;
_attacked = false;
-//_multiplier = 1;
-
-//Old System
-
{
_continue = true;
_type = "zombie";
if (alive _x && _continue) then {
- private["_dist"];
- _dist = (_x distance _refObj);
- _group = _x;
-
- _targets = _group getVariable ["targets",[]];
-
- _chance = 1;
- if ((_x distance player < dayz_areaAffect) and !(animationState _x == "ZombieFeed")) then {
- if (_type == "zombie") then { [_x,"attack",(_chance),true] call dayz_zombieSpeak; };
- //perform an attack
- _last = _x getVariable["lastAttack",0];
- _entHeight = (getPosATL _x) select 2;
- _delta = _pHeight - _entHeight;
- if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then {
- zedattack = [_x, _type] spawn player_zombieAttack;
- _x setVariable["lastAttack",time];
- };
- _attacked = true;
- } else {
- if (_type == "zombie") then {
+
+ if (local _x) then {
+
+ _dist = (_x distance _refObj);
+
+ _chance = 1;
+ if ((_dist < dayz_areaAffect) and !(animationState _x == "ZombieFeed")) then {
+
+ [_x,"attack",(_chance),true] call dayz_zombieSpeak;
+ //perform an attack
+ _last = _x getVariable["lastAttack",0];
+ _entHeight = (getPosATL _x) select 2;
+ _delta = _pHeight - _entHeight;
+ if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then
+ {
+ [_x, _type] spawn player_zombieAttack;
+ _x setVariable["lastAttack",time];
+ };
+ _attacked = true;
+ } else {
if (speed _x < 4) then {
[_x,"idle",(_chance + 4),true] call dayz_zombieSpeak;
} else {
[_x,"chase",(_chance + 3),true] call dayz_zombieSpeak;
};
};
- };
+ //Noise Activation
+ _targets = _x getVariable ["targets",[]];
+ if (!(_refObj in _targets)) then {
+ if (_dist < DAYZ_disAudial) then {
+ if (DAYZ_disAudial > 80) then {
+
+ _targets set [count _targets, (driver _refObj)];
+ _x setVariable ["targets",_targets,true];
+
+ } else {
- //Noise Activation
- if (!(_refObj in _targets)) then {
- if (_dist < DAYZ_disAudial) then {
- if (DAYZ_disAudial > 80) then {
- if (!(_refObj in _targets)) then {
- _targets set [count _targets, driver _refObj];
- _group setVariable ["targets",_targets,true];
- };
- } else {
- if (_dist < (DAYZ_disAudial / 2)) then {
- if (!(_refObj in _targets)) then {
- _targets set [count _targets, driver _refObj];
- _group setVariable ["targets",_targets,true];
+ _cantSee = [_x,_refObj] call dayz_losCheck;
+ if (!_cantSee) then
+ {
+ _targets set [count _targets,(driver _refObj)];
+ _x setVariable ["targets",_targets,true];
+ }
+ else
+ {
+ if (_dist < (DAYZ_disAudial / 2)) then
+ {
+ _targets set [count _targets,(driver _refObj)];
+ _x setVariable ["targets",_targets,true];
+ };
};
};
};
};
- };
- //Sight Activation
- if (!(_refObj in _targets)) then {
- if (_dist < DAYZ_disVisual) then {
- //_chance = [_x,_dist,DAYZ_disVisual] call dayz_losChance;
- //diag_log ("Visual Detection: m" + str([_x,_dist]) + " " + str(_chance));
- //if ((random 1) < _chance) then {
- //diag_log ("Chance Detection");
+ //Sight Activation
+ _targets = _x getVariable ["targets",[]];
+ if (!(_refObj in _targets)) then {
+ if (_dist < DAYZ_disVisual) then {
+
_tPos = (getPosASL _refObj);
_zPos = (getPosASL _x);
//_eyeDir = _x call dayz_eyeDir;
_eyeDir = direction _x;
_inAngle = [_zPos,_eyeDir,30,_tPos] call fnc_inAngleSector;
if (_inAngle) then {
+
//LOS check
_cantSee = [_x,_refObj] call dayz_losCheck;
//diag_log ("LOS Check: " + str(_cantSee));
if (!_cantSee) then {
//diag_log ("Within LOS! Target");
- if (!(_refObj in _targets)) then {
- _targets set [count _targets, driver _refObj];
- _group setVariable ["targets",_targets,true];
- };
+ _targets set [count _targets,(driver _refObj)];
+ _x setVariable ["targets",_targets,true];
};
};
- //};
- };
- };
- };
- //diag_log ("Targets Array: " +str(_targets));
-} forEach _listTalk;
-
-
-// New Systems
-/*
-{
- _continue = true;
- _type = "zombie";
- _targets = _group getVariable ["targets",[]];
-
-if (alive _x and _continue) then
- {
- if (local _x) then
- {
- private["_dist"];
- _dist = (_x distance _refObj);
-
- _chance = 1;
- if ((_dist < dayz_areaAffect) and !(animationState _x == "ZombieFeed")) then
- {
- if (_type == "zombie") then { [_x,"attack",(_chance),true] call dayz_zombieSpeak; };
- //perform an attack
- _last = _x getVariable["lastAttack",0];
- _entHeight = (getPosATL _x) select 2;
- _delta = _pHeight - _entHeight;
- if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then
- {
- [_x, _type] spawn player_zombieAttack;
- _x setVariable["lastAttack",time];
- };
- _attacked = true;
- }
- else
- {
- if (_type == "zombie") then
- {
- if (speed _x < 4) then
- {
- [_x,"idle",(_chance + 4),true] call dayz_zombieSpeak;
- }
- else
- {
- [_x,"chase",(_chance + 3),true] call dayz_zombieSpeak;
- };
- };
- };
- //Noise Activation
- _target = _x getVariable ["target",[]];
- if (!(_refObj in _target)) then
- {
- if (_dist < DAYZ_disAudial) then
- {
- if (DAYZ_disAudial > 80) then
- {
- _target set [count _target,(driver _refObj)];
- _x setVariable ["target",_target];
- }
- else
- {
- // _chance = [_x,_dist,DAYZ_disAudial] call dayz_losChance;
- //diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
- // if ((random 1) < _chance) then {
- _cantSee = [_x,_refObj] call dayz_losCheck;
- if (!_cantSee) then
- {
- _target set [count _target,(driver _refObj)];
- _x setVariable ["target",_target];
- }
- else
- {
- if (_dist < (DAYZ_disAudial / 2)) then
- {
- _target set [count _target,(driver _refObj)];
- _x setVariable ["target",_target];
- };
- };
- //};
- };
- };
- };
- //Sight Activation
- _target = _x getVariable ["target",[]];
- if (!(_refObj in _target)) then
- {
- if (_dist < DAYZ_disVisual) then
- {
- _chance = [_x,_dist,DAYZ_disVisual] call dayz_losChance;
- //diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
- //if ((random 1) < _chance) then {
- //diag_log ("Chance Detection");
- _tPos = (getPosASL _refObj);
- _zPos = (getPosASL _x);
- //_eyeDir = _x call dayz_eyeDir;
- _eyeDir = direction _x;
- _inAngle = [_zPos,_eyeDir,30,_tPos] call fnc_inAngleSector;
- if (_inAngle) then
- {
- //diag_log ("In Angle");
- //LOS check
- _cantSee = [_x,_refObj] call dayz_losCheck;
- //diag_log ("LOS Check: " + str(_cantSee));
- if (!_cantSee) then
- {
- _target set [count _target,(driver _refObj)];
- _x setVariable ["target",_target];
- };
- };
- //};
- };
- };
- }
- else
- {
- private["_dist"];
- _dist = (_x distance _refObj);
-
- _chance = 1;
- if ((_x distance player < dayz_areaAffect) and !(animationState _x == "ZombieFeed")) then
- {
- if (_type == "zombie") then { [_x,"attack",(_chance),true] call dayz_zombieSpeak; };
- //perform an attack
- _last = _x getVariable["lastAttack",0];
- _entHeight = (getPosATL _x) select 2;
- _delta = _pHeight - _entHeight;
- if ( ((time - _last) > 1) and ((_delta < 1.5) and (_delta > -1.5)) ) then
- {
- [_x, _type] spawn player_zombieAttack;
- _x setVariable["lastAttack",time];
- };
- _attacked = true;
- }
- else
- {
- if (_type == "zombie") then
- {
- if (speed _x < 4) then
- {
- [_x,"idle",(_chance + 4),true] call dayz_zombieSpeak;
- }
- else
- {
- [_x,"chase",(_chance + 3),true] call dayz_zombieSpeak;
- };
- };
- };
- //Noise Activation
- _targets = _x getVariable ["targets",[]];
- if (!(_refObj in _targets)) then
- {
- if (_dist < DAYZ_disAudial) then
- {
- if (DAYZ_disAudial > 80) then
- {
- _targets set [count _targets,(driver _refObj)];
- _x setVariable ["targets",_targets,true];
- }
- else
- {
- //_chance = [_x,_dist,DAYZ_disAudial] call dayz_losChance;
- //diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
- //if ((random 1) < _chance) then {
- _cantSee = [_x,_refObj] call dayz_losCheck;
- if (!_cantSee) then
- {
- _targets set [count _targets,(driver _refObj)];
- _x setVariable ["targets",_targets,true];
- }
- else
- {
- if (_dist < (DAYZ_disAudial / 2)) then
- {
- _targets set [count _targets,(driver _refObj)];
- _x setVariable ["targets",_targets,true];
- };
- };
- //};
- };
- };
- };
- //Sight Activation
- _targets = _x getVariable ["targets",[]];
- if (!(_refObj in _targets)) then
- {
- if (_dist < DAYZ_disVisual) then
- {
- //_chance = [_x,_dist,DAYZ_disVisual] call dayz_losChance;
- //diag_log ("Visual Detection: " + str([_x,_dist]) + " " + str(_chance));
- //if ((random 1) < _chance) then {
- //diag_log ("Chance Detection");
- _tPos = (getPosASL _refObj);
- _zPos = (getPosASL _x);
- //_eyeDir = _x call dayz_eyeDir;
- _eyeDir = direction _x;
- _inAngle = [_zPos,_eyeDir,30,_tPos] call fnc_inAngleSector;
- if (_inAngle) then
- {
- //diag_log ("In Angle");
- //LOS check
- _cantSee = [_x,_refObj] call dayz_losCheck;
- //diag_log ("LOS Check: " + str(_cantSee));
- if (!_cantSee) then
- {
- //diag_log ("Within LOS! Target");
- _targets set [count _targets,(driver _refObj)];
- _x setVariable ["targets",_targets,true];
- };
- };
- //};
};
};
};
};
} forEach _listTalk;
-*/
if (_attacked) then {
if (r_player_unconscious) then {
diff --git a/SQF/dayz_code/init/compiles.sqf b/SQF/dayz_code/init/compiles.sqf
index 955ed7085..6af244b7c 100644
--- a/SQF/dayz_code/init/compiles.sqf
+++ b/SQF/dayz_code/init/compiles.sqf
@@ -431,10 +431,11 @@ if (!isDedicated) then {
object_delLocal = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_delLocal.sqf";
// object_cargoCheck = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_cargoCheck.sqf"; //Run by the player or server to monitor changes in cargo contents
fnc_usec_damageHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_damageHandler.sqf"; //Event handler run on damage
+ fnc_veh_ResetEH = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\veh_ResetEH.sqf"; //Initialize vehicle
// Vehicle damage fix
vehicle_handleDamage = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleDamage.sqf";
vehicle_handleKilled = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\vehicle_handleKilled.sqf";
- fnc_vehicleEventHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\vehicle_init.sqf"; //Initialize vehicle
+ //fnc_vehicleEventHandler = compile preprocessFileLineNumbers "\z\addons\dayz_code\init\vehicle_init.sqf"; //Initialize vehicle
fnc_inString = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_inString.sqf";
fnc_isInsideBuilding = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
fnc_isInsideBuilding2 = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_isInsideBuilding2.sqf"; //_isInside = [_unit,_building] call fnc_isInsideBuilding;
diff --git a/SQF/dayz_code/init/publicEH.sqf b/SQF/dayz_code/init/publicEH.sqf
index 9994aebc8..c78c41ffa 100644
--- a/SQF/dayz_code/init/publicEH.sqf
+++ b/SQF/dayz_code/init/publicEH.sqf
@@ -17,7 +17,7 @@
"dayzGutBody" addPublicVariableEventHandler {(_this select 1) spawn local_gutObject};
"dayzGutBodyZ" addPublicVariableEventHandler {(_this select 1) spawn local_gutObjectZ};
"dayzDelLocal" addPublicVariableEventHandler {(_this select 1) call object_delLocal};
-"dayzVehicleInit" addPublicVariableEventHandler {(_this select 1) call fnc_vehicleEventHandler};
+"dayzVehicleInit" addPublicVariableEventHandler {(_this select 1) call fnc_veh_ResetEH};
"dayzHumanity" addPublicVariableEventHandler {(_this select 1) spawn player_humanityChange};
"dayz_serverObjectMonitor" addPublicVariableEventHandler {dayz_serverObjectMonitor = dayz_safety};
"usecBreakLegs" addPublicVariableEventHandler {(_this select 1) call player_breaklegs};
diff --git a/SQF/dayz_code/init/veh_resetEH.sqf b/SQF/dayz_code/init/veh_resetEH.sqf
new file mode 100644
index 000000000..0cb07f59a
--- /dev/null
+++ b/SQF/dayz_code/init/veh_resetEH.sqf
@@ -0,0 +1,19 @@
+/***********************************************************
+ASSIGN DAMAGE HANDLER TO A UNIT
+- Function fnc_veh_ResetEH
+- unit call fnc_veh_ResetEH
+************************************************************/
+
+_this removeAllEventHandlers "HandleDamage";
+_this removeAllEventHandlers "Killed";
+_this addeventhandler ["HandleDamage",{ _this call fnc_veh_handleDam } ];
+_this addeventhandler ["Killed",{ _this call fnc_veh_handleKilled } ];
+
+if (isServer) then {
+ _this removeAllEventHandlers "GetOut";
+ _this removeAllEventHandlers "GetIn";
+ _this addEventHandler ["GetOut", {[(_this select 0),"all",true] call server_updateObject;}];
+ _this addEventHandler ["GetIn", {[(_this select 0),"all",true] call server_updateObject;}];
+};
+
+//diag_log(format["%1: all EH reset for %2", __FILE__, _this]);
\ No newline at end of file
diff --git a/SQF/dayz_code/system/player_monitor.fsm b/SQF/dayz_code/system/player_monitor.fsm
index e7150cf4e..780ccc569 100644
--- a/SQF/dayz_code/system/player_monitor.fsm
+++ b/SQF/dayz_code/system/player_monitor.fsm
@@ -16,46 +16,61 @@ item11[] = {"Make_PlayerID",2,250,-200.000000,175.000000,-100.000000,225.000000,
item12[] = {"Has_PlayerID",4,218,-75.000000,175.000000,25.000000,225.000000,1.000000,"Has PlayerID"};
item13[] = {"no_PlayerID",4,218,50.000000,150.000000,150.000000,200.000000,2.000000,"no PlayerID"};
item14[] = {"ERROR__No_Player",2,250,175.000000,150.000000,275.000000,200.000000,0.000000,"ERROR:" \n "No PlayerID"};
-item15[] = {"Request",2,250,-75.000000,250.000000,25.000000,300.000000,0.000000,"Request"};
-item16[] = {"Response",4,218,-175.000000,300.000000,-75.000000,350.000000,0.000000,"Response"};
-item17[] = {"Parse_Login",2,250,-75.000000,350.000000,25.000000,400.000000,0.000000,"Parse Login"};
-item18[] = {"Hive_Bad",4,218,50.000000,350.000000,150.000000,400.000000,10.000000,"Hive" \n "Bad"};
-item19[] = {"ERROR__Wrong_HIVE",2,250,175.000000,350.000000,275.000000,400.000000,0.000000,"ERROR:" \n "Wrong HIVE" \n "Version"};
-item20[] = {"Hive_Ok",4,218,-175.000000,400.000000,-75.000000,450.000000,0.000000,"Hive" \n "Ok"};
-item21[] = {"Phase_One",2,250,-75.000000,450.000000,25.000000,500.000000,0.000000,"Phase One"};
-item22[] = {"Response",4,218,-175.000000,500.000000,-75.000000,550.000000,0.000000,"Response"};
-item23[] = {"Phase_Two",2,4346,-75.000000,550.000000,25.000000,600.000000,0.000000,"Phase Two"};
-item24[] = {"Dead_Player",4,218,50.000000,550.000000,150.000000,600.000000,0.000000,"Dead" \n "Player"};
-item25[] = {"ERROR__Player_Already",2,250,175.000000,550.000000,275.000000,600.000000,0.000000,"ERROR:" \n "Player Already" \n "Dead"};
-item26[] = {"Alive",4,218,-175.000000,600.000000,-75.000000,650.000000,0.000000,"Alive"};
-item27[] = {"Position",2,250,-75.000000,650.000000,25.000000,700.000000,0.000000,"Position"};
-item28[] = {"Version_Ok",4,218,-175.000000,700.000000,-75.000000,750.000000,0.000000,"Version" \n "Ok"};
-item29[] = {"Load_In",2,250,-75.000000,850.000000,25.000000,900.000000,0.000000,"Load In"};
-item30[] = {"Bad_Version",4,218,50.000000,650.000000,150.000000,700.000000,0.000000,"Bad" \n "Version"};
-item31[] = {"ERROR__Bad_Versi",2,250,175.000000,650.000000,275.000000,700.000000,0.000000,"ERROR:" \n "Bad Version"};
-item32[] = {"Display_Ready",4,218,-175.000000,900.000000,-75.000000,950.000000,0.000000,"Display" \n "Ready"};
-item33[] = {"Preload_Display",2,250,-75.000000,950.000000,25.000000,1000.000000,0.000000,"Preload" \n "Display"};
-item34[] = {"Preload_Done",4,218,-175.000000,1000.000000,-75.000000,1050.000000,0.000000,"Preload" \n "Done"};
-item35[] = {"Initialize",2,250,-75.000000,1050.000000,25.000000,1100.000000,0.000000,"Initialize"};
-item36[] = {"Finish",1,250,-75.000000,1150.000000,25.000000,1200.000000,0.000000,"Finish"};
-item37[] = {"True",8,218,25.000000,1100.000000,125.000000,1150.000000,0.000000,"True"};
+item15[] = {"Request",2,250,-75.000000,400.000000,25.000000,450.000000,0.000000,"Request"};
+item16[] = {"Response",4,218,-175.000000,450.000000,-75.000000,500.000000,0.000000,"Response"};
+item17[] = {"Parse_Login",2,4346,-75.000000,500.000000,25.000000,550.000000,0.000000,"Parse Login"};
+item18[] = {"Hive_Bad",4,218,50.000000,500.000000,150.000000,550.000000,10.000000,"Hive" \n "Bad"};
+item19[] = {"ERROR__Wrong_HIVE",2,250,175.000000,500.000000,275.000000,550.000000,0.000000,"ERROR:" \n "Wrong HIVE" \n "Version"};
+item20[] = {"Hive_Ok",4,218,-175.000000,550.000000,-75.000000,600.000000,0.000000,"Hive" \n "Ok"};
+item21[] = {"Phase_One",2,250,-75.000000,600.000000,25.000000,650.000000,0.000000,"Phase One"};
+item22[] = {"Response",4,218,-175.000000,650.000000,-75.000000,700.000000,0.000000,"Response"};
+item23[] = {"Phase_Two",2,250,-75.000000,700.000000,25.000000,750.000000,0.000000,"Phase Two"};
+item24[] = {"Dead_Player",4,218,50.000000,700.000000,150.000000,750.000000,0.000000,"Dead" \n "Player"};
+item25[] = {"ERROR__Player_Already",2,250,175.000000,700.000000,275.000000,750.000000,0.000000,"ERROR:" \n "Player Already" \n "Dead"};
+item26[] = {"Alive",4,218,-175.000000,750.000000,-75.000000,800.000000,0.000000,"Alive"};
+item27[] = {"Position",2,250,-75.000000,800.000000,25.000000,850.000000,0.000000,"Position"};
+item28[] = {"Version_Ok",4,218,-175.000000,850.000000,-75.000000,900.000000,0.000000,"Version" \n "Ok"};
+item29[] = {"Load_In",2,250,-75.000000,1000.000000,25.000000,1050.000000,0.000000,"Load In"};
+item30[] = {"Bad_Version",4,218,50.000000,800.000000,150.000000,850.000000,0.000000,"Bad" \n "Version"};
+item31[] = {"ERROR__Bad_Versi",2,250,175.000000,800.000000,275.000000,850.000000,0.000000,"ERROR:" \n "Bad Version"};
+item32[] = {"Display_Ready",4,218,-175.000000,1050.000000,-75.000000,1100.000000,0.000000,"Display" \n "Ready"};
+item33[] = {"Preload_Display",2,250,-75.000000,1100.000000,25.000000,1150.000000,0.000000,"Preload" \n "Display"};
+item34[] = {"Preload_Done",4,218,-175.000000,1150.000000,-75.000000,1200.000000,0.000000,"Preload" \n "Done"};
+item35[] = {"Initialize",2,250,-75.000000,1200.000000,25.000000,1250.000000,0.000000,"Initialize"};
+item36[] = {"Finish",1,250,-75.000000,1300.000000,25.000000,1350.000000,0.000000,"Finish"};
+item37[] = {"True",8,218,25.000000,1250.000000,125.000000,1300.000000,0.000000,"True"};
item38[] = {"Too_Long",4,218,300.000000,150.000000,400.000000,200.000000,0.000000,"Too" \n "Long"};
-item39[] = {"Too_Long",4,218,300.000000,350.000000,400.000000,400.000000,0.000000,"Too" \n "Long"};
-item40[] = {"Too_Long",4,218,300.000000,550.000000,400.000000,600.000000,0.000000,"Too" \n "Long"};
-item41[] = {"Too_Long",4,218,300.000000,650.000000,400.000000,700.000000,0.000000,"Too" \n "Long"};
+item39[] = {"Too_Long",4,218,300.000000,500.000000,400.000000,550.000000,0.000000,"Too" \n "Long"};
+item40[] = {"Too_Long",4,218,300.000000,700.000000,400.000000,750.000000,0.000000,"Too" \n "Long"};
+item41[] = {"Too_Long",4,218,300.000000,800.000000,400.000000,850.000000,0.000000,"Too" \n "Long"};
item42[] = {"Enable_Sim",2,250,-75.000000,-100.000000,25.000000,-50.000000,0.000000,"Enable Sim"};
item43[] = {"Initialized",4,218,-175.000000,-150.000000,-75.000000,-100.000000,0.000000,"Initialized"};
-item44[] = {"New_Character",4,218,-425.000000,275.000000,-325.000000,325.000000,6.000000,"New" \n "Character"};
-item45[] = {"Gender_Selection",2,250,-500.000000,350.000000,-400.000000,400.000000,0.000000,"Gender Selection" \n "Dialog"};
-item46[] = {"Selected",4,218,-450.000000,450.000000,-350.000000,500.000000,0.000000,"Selected"};
-item47[] = {"Process",2,250,-300.000000,475.000000,-200.000000,525.000000,0.000000,"Process"};
+item44[] = {"New_Character",4,218,-500.000000,375.000000,-400.000000,425.000000,5.000000,"New" \n "Character"};
+item45[] = {"Gender_Selection",2,250,-500.000000,500.000000,-400.000000,550.000000,0.000000,"Gender Selection" \n "Dialog"};
+item46[] = {"Selected",4,218,-400.000000,600.000000,-300.000000,650.000000,0.000000,"Selected"};
+item47[] = {"Process",2,250,-275.000000,600.000000,-175.000000,650.000000,0.000000,"Process"};
item48[] = {"no_PlayerID",4,218,50.000000,-100.000000,150.000000,-50.000000,2.000000,"no PlayerID"};
item49[] = {"ERROR__No_Player_1",2,250,175.000000,-100.000000,275.000000,-50.000000,0.000000,"ERROR:" \n "No PlayerID"};
item50[] = {"Too_Long",4,218,300.000000,-100.000000,400.000000,-50.000000,0.000000,"Too" \n "Long"};
-item51[] = {"Stream",2,250,-75.000000,750.000000,25.000000,800.000000,0.000000,"Stream"};
-item52[] = {"Preloaded",4,218,-175.000000,800.000000,-75.000000,850.000000,0.000000,"Preloaded"};
-item53[] = {"New_Infected_Cha",4,218,-250.000000,350.000000,-150.000000,400.000000,5.000000,"New" \n "Infected" \n "Character"};
-item54[] = {"Player_Zombie__S",2,250,-375.000000,375.000000,-275.000000,425.000000,0.000000,"Player Zombie" \n " Selection"};
+item51[] = {"Stream",2,250,-75.000000,900.000000,25.000000,950.000000,0.000000,"Stream"};
+item52[] = {"Preloaded",4,218,-175.000000,950.000000,-75.000000,1000.000000,0.000000,"Preloaded"};
+item53[] = {"Retry",4,218,25.000000,375.000000,125.000000,425.000000,0.000000,"Retry"};
+item54[] = {"retry_",4,218,25.000000,425.000000,125.000000,475.000000,0.000000,"retry" \n ""};
+item55[] = {"Retry",2,250,125.000000,400.000000,225.000000,450.000000,0.000000,"Retry"};
+item56[] = {"auth_failed",4,218,250.000000,400.000000,350.000000,450.000000,0.000000,"auth failed"};
+item57[] = {"get_ready_to_clo",2,250,400.000000,400.000000,500.000000,450.000000,0.000000,"get ready to close"};
+item58[] = {"sleep_",4,218,550.000000,400.000000,650.000000,450.000000,0.000000,"sleep" \n ""};
+item59[] = {"Disconnect",2,250,675.000000,400.000000,775.000000,450.000000,0.000000,"Disconnect"};
+item60[] = {"No_time_date",4,218,25.000000,1150.000000,125.000000,1200.000000,0.000000,"No time/date"};
+item61[] = {"ERROR__No_Date_or",2,250,175.000000,1150.000000,275.000000,1200.000000,0.000000,"ERROR:" \n "No Date or Time"};
+item62[] = {"Too_Long",4,218,300.000000,1150.000000,400.000000,1200.000000,0.000000,"Too" \n "Long"};
+item63[] = {"get_ready_to_clo_1",2,250,450.000000,800.000000,550.000000,850.000000,0.000000,"get ready to close"};
+item64[] = {"sleep_",4,218,600.000000,800.000000,700.000000,850.000000,0.000000,"sleep" \n ""};
+item65[] = {"Server_Loading",2,250,-75.000000,250.000000,25.000000,300.000000,0.000000,"Server Loading"};
+item66[] = {"Too_Long",4,218,50.000000,250.000000,150.000000,300.000000,0.000000,"Too" \n "Long"};
+item67[] = {"Server_Ready",4,218,-75.000000,325.000000,25.000000,375.000000,0.000000,"Server Ready"};
+item68[] = {"New_Infected_Cha",4,218,-375.000000,450.000000,-275.000000,500.000000,5.000000,"New" \n "Infected" \n "Character"};
+item69[] = {"Player_Zombie__S",2,250,-300.000000,525.000000,-200.000000,575.000000,0.000000,"Player Zombie" \n " Selection"};
link0[] = {0,1};
link1[] = {0,5};
link2[] = {1,2};
@@ -71,56 +86,74 @@ link11[] = {9,12};
link12[] = {9,13};
link13[] = {10,11};
link14[] = {11,12};
-link15[] = {12,15};
+link15[] = {12,65};
link16[] = {13,14};
link17[] = {14,38};
link18[] = {15,16};
-link19[] = {16,17};
-link20[] = {17,18};
-link21[] = {17,20};
-link22[] = {17,44};
-link23[] = {17,53};
-link24[] = {18,19};
-link25[] = {19,39};
-link26[] = {20,21};
-link27[] = {21,22};
-link28[] = {22,23};
-link29[] = {23,24};
-link30[] = {23,26};
-link31[] = {24,25};
-link32[] = {25,40};
-link33[] = {26,27};
-link34[] = {27,28};
-link35[] = {27,30};
-link36[] = {28,51};
-link37[] = {29,32};
-link38[] = {30,31};
-link39[] = {31,41};
-link40[] = {32,33};
-link41[] = {33,34};
-link42[] = {34,35};
-link43[] = {35,37};
-link44[] = {37,36};
-link45[] = {38,14};
-link46[] = {39,19};
-link47[] = {40,25};
-link48[] = {41,31};
-link49[] = {42,6};
-link50[] = {42,48};
-link51[] = {43,42};
-link52[] = {44,45};
-link53[] = {45,46};
-link54[] = {46,47};
-link55[] = {47,20};
-link56[] = {48,49};
-link57[] = {49,50};
-link58[] = {50,49};
-link59[] = {51,52};
-link60[] = {52,29};
-link61[] = {53,54};
-link62[] = {54,20};
-globals[] = {25.000000,1,0,0,0,640,480,1,85,6316128,1,-452.194977,340.078094,1506.747437,277.117401,565,880,1};
-window[] = {2,-1,-1,-1,-1,806,2041,3012,46,3,583};
+link19[] = {15,54};
+link20[] = {16,17};
+link21[] = {17,18};
+link22[] = {17,20};
+link23[] = {17,44};
+link24[] = {17,68};
+link25[] = {18,19};
+link26[] = {19,39};
+link27[] = {20,21};
+link28[] = {21,22};
+link29[] = {22,23};
+link30[] = {23,24};
+link31[] = {23,26};
+link32[] = {24,25};
+link33[] = {25,40};
+link34[] = {26,27};
+link35[] = {27,28};
+link36[] = {27,30};
+link37[] = {28,51};
+link38[] = {29,32};
+link39[] = {30,31};
+link40[] = {31,41};
+link41[] = {32,33};
+link42[] = {33,34};
+link43[] = {34,35};
+link44[] = {35,37};
+link45[] = {35,60};
+link46[] = {37,36};
+link47[] = {38,59};
+link48[] = {39,59};
+link49[] = {40,59};
+link50[] = {41,63};
+link51[] = {42,6};
+link52[] = {42,48};
+link53[] = {43,42};
+link54[] = {44,45};
+link55[] = {45,46};
+link56[] = {46,47};
+link57[] = {47,20};
+link58[] = {48,49};
+link59[] = {49,50};
+link60[] = {50,59};
+link61[] = {51,52};
+link62[] = {52,29};
+link63[] = {53,15};
+link64[] = {54,55};
+link65[] = {55,53};
+link66[] = {55,56};
+link67[] = {56,57};
+link68[] = {57,58};
+link69[] = {58,59};
+link70[] = {60,61};
+link71[] = {61,62};
+link72[] = {62,59};
+link73[] = {63,64};
+link74[] = {64,59};
+link75[] = {65,66};
+link76[] = {65,67};
+link77[] = {66,59};
+link78[] = {67,15};
+link79[] = {68,69};
+link80[] = {69,20};
+globals[] = {25.000000,1,0,0,0,640,480,1,131,6316128,1,-251.037598,801.434570,1133.794189,96.643585,893,880,1};
+window[] = {2,-1,-1,-1,-1,936,156,1528,156,3,911};
*//*%FSM*/
class FSM
{
@@ -134,11 +167,19 @@ class FSM
init = /*%FSM*/"dayz_versionNo = getText(configFile >> ""CfgMods"" >> ""DayZ"" >> ""version"");" \n
"diag_log (""DAYZ: CLIENT IS RUNNING DAYZ_CODE "" + str(dayz_versionNo));" \n
"" \n
+ "_AuthAttempt = 0;" \n
+ "" \n
"0 fadeSound 0;" \n
"//player setPosATL [-2148,6655,0];" \n
+ "" \n
"progressLoadingScreen 0.1;" \n
- "_timeStart = time;" \n
- "player enableSimulation false;" \n
+ "0 cutText ["""",""BLACK""];" \n
+ "" \n
+ "_timeStart = diag_tickTime;" \n
+ "_readytoAuth = false;" \n
+ "_startCheck = 0;" \n
+ "//player enableSimulation false;" \n
+ "" \n
""/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
@@ -195,6 +236,7 @@ class FSM
"diag_log (""PLOGIN: Initating"");" \n
"" \n
"dayz_loadScreenMsg = (localize ""str_player_13""); " \n
+ "" \n
"progressLoadingScreen 0.2;" \n
""/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
@@ -208,8 +250,13 @@ class FSM
precondition = /*%FSM*/""/*%FSM*/;
condition=/*%FSM*/"!isnil ""bis_fnc_init"""/*%FSM*/;
action=/*%FSM*/"dayz_forceSave = {" \n
+ "_gearSave = false;" \n
"" \n
+ "if (!dialog) then {" \n
" createGearDialog [player, ""RscDisplayGear""];" \n
+ " _gearSave = true;" \n
+ "};" \n
+ "" \n
"_dialog = findDisplay 106;" \n
"_magazineArray = [];" \n
"" \n
@@ -244,7 +291,10 @@ class FSM
" };" \n
" };" \n
"};" \n
+ "" \n
+ "if (_gearSave) then {" \n
" closeDialog 0;" \n
+ "};" \n
"" \n
" _medical = player call player_sumMedical;" \n
" " \n
@@ -256,6 +306,7 @@ class FSM
" _config = configFile >> ""CfgMovesMaleSdr"" >> ""States"" >> _currentAnim;" \n
" _onLadder = (getNumber (_config >> ""onLadder"")) == 1;" \n
" _isTerminal = (getNumber (_config >> ""terminal"")) == 1;" \n
+ " _isInVehicle = vehicle player != player;" \n
" //_wpnDisabled = (getNumber (_config >> ""disableWeapons"")) == 1;" \n
" _currentModel = typeOf player;" \n
" _charPos = getPosATL player;" \n
@@ -266,7 +317,7 @@ class FSM
" //If position to be updated, make sure it is at ground level!" \n
" if ((count _playerPos > 0) and !_isTerminal) then {" \n
" _charPos set [2,0];" \n
- " _playerPos set[1,_charPos]; " \n
+ " _playerPos set[1,_charPos];" \n
" };" \n
" };" \n
" if (_isInVehicle) then {" \n
@@ -286,14 +337,14 @@ class FSM
" _currentState = [_currentWpn,_currentAnim,_temp];" \n
" " \n
" dayz_Magazines = _magazineArray;" \n
- " dayzPlayerSave = [player,dayz_Magazines,false,true];" \n
+ " dayzPlayerSave = [player,dayz_Magazines,false];" \n
" publicVariableServer ""dayzPlayerSave"";" \n
" " \n
" if (isServer) then {" \n
" dayzPlayerSave call server_playerSync;" \n
" };" \n
- "" \n
- " dayz_lastSave = time;" \n
+ " " \n
+ " dayz_lastSave = diag_tickTime;" \n
" dayz_Magazines = [];" \n
"};"/*%FSM*/;
};
@@ -329,6 +380,7 @@ class FSM
init = /*%FSM*/"diag_log (""PLOGIN: Player Ready"");" \n
"" \n
"dayz_loadScreenMsg = (localize ""str_player_13""); " \n
+ "" \n
"progressLoadingScreen 0.3;" \n
"" \n
"_playerUID = getPlayerUID player;"/*%FSM*/;
@@ -359,7 +411,7 @@ class FSM
class Has_PlayerID
{
priority = 1.000000;
- to="Request";
+ to="Server_Loading";
precondition = /*%FSM*/""/*%FSM*/;
condition=/*%FSM*/"!(isNil ""_playerUID"")"/*%FSM*/;
action=/*%FSM*/""/*%FSM*/;
@@ -383,7 +435,7 @@ class FSM
class Has_PlayerID
{
priority = 1.000000;
- to="Request";
+ to="Server_Loading";
precondition = /*%FSM*/""/*%FSM*/;
condition=/*%FSM*/"!(isNil ""_playerUID"")"/*%FSM*/;
action=/*%FSM*/""/*%FSM*/;
@@ -398,7 +450,7 @@ class FSM
name = "ERROR__No_Player";
init = /*%FSM*/"endLoadingScreen;" \n
"selectNoPlayer;" \n
- "_myTime = time;" \n
+ "_myTime = diag_tickTime;" \n
"1 cutText [localize ""str_player_14"", ""PLAIN"",15];"/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
@@ -407,9 +459,9 @@ class FSM
class Too_Long
{
priority = 0.000000;
- to="ERROR__No_Player";
+ to="Disconnect";
precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"(time - _myTime) > 10"/*%FSM*/;
+ condition=/*%FSM*/"(diag_tickTime - _myTime) > 10"/*%FSM*/;
action=/*%FSM*/""/*%FSM*/;
};
/*%FSM*/
@@ -424,20 +476,35 @@ class FSM
"" \n
"diag_log (""PLOGIN: Requesting Authentication... ("" + _playerUID + "")"");" \n
"dayz_loadScreenMsg = (localize ""str_player_15"");" \n
- "progressLoadingScreen 0.5;" \n
+ "" \n
+ "progressLoadingScreen 0.7;" \n
"" \n
"_msg = [];" \n
"" \n
- "//[""dayzLogin"",[_playerUID,player]] call callRpcProcedure;" \n
- "" \n
"dayzLogin = [_playerUID,player];" \n
"publicVariableServer ""dayzLogin"";" \n
"" \n
+ "if (isServer) then {" \n
+ " dayzLogin call server_playerLogin;" \n
+ "};" \n
+ "" \n
"dayzPlayerLogin = [];" \n
+ "" \n
+ "_myTime = diag_tickTime;" \n
""/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
{
+ /*%FSM*/
+ class retry_
+ {
+ priority = 0.000000;
+ to="Retry";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"(diag_tickTime - _myTime) > 10"/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
/*%FSM*/
class Response
{
@@ -469,16 +536,17 @@ class FSM
"" \n
"_isHiveOk = false;" \n
"_newPlayer = false;" \n
- "_isInfected = _msg select 9;" \n
+ "_isInfected = false;" \n
"" \n
"if (count _msg > 7) then {" \n
" _isHiveOk = _msg select 7;" \n
" _newPlayer = _msg select 8;" \n
+ " _isInfected = _msg select 9;" \n
" diag_log (""PLAYER RESULT: "" + str(_isHiveOk));" \n
"};" \n
"" \n
"dayz_loadScreenMsg = (localize ""str_player_17""); " \n
- "progressLoadingScreen 0.7;" \n
+ "progressLoadingScreen 0.8;" \n
"diag_log (""PLOGIN: authenticated with : "" + str(_msg));" \n
"" \n
"//Not Equal Failure" \n
@@ -517,7 +585,7 @@ class FSM
/*%FSM*/
class New_Character
{
- priority = 6.000000;
+ priority = 5.000000;
to="Gender_Selection";
precondition = /*%FSM*/""/*%FSM*/;
condition=/*%FSM*/"_isNew && _isInfected == 0"/*%FSM*/;
@@ -554,8 +622,8 @@ class FSM
init = /*%FSM*/"endLoadingScreen;" \n
"selectNoPlayer;" \n
"" \n
- "_myTime = time;" \n
- "1 cutText [""This server is running an incorrect version of the server side application. If this is the first time you have seen this error please reconnect. If you are the server admin please contact DayZepoch.com staff."", ""PLAIN"",5];"/*%FSM*/;
+ "_myTime = diag_tickTime;" \n
+ "1 cutText [""This server is running an incorrect version of the server side application. You cannot play on this server. If you are the server admin please contact DayZ Epoch staff."", ""PLAIN"",5];"/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
{
@@ -563,9 +631,9 @@ class FSM
class Too_Long
{
priority = 0.000000;
- to="ERROR__Wrong_HIVE";
+ to="Disconnect";
precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"(time - _myTime) > 10"/*%FSM*/;
+ condition=/*%FSM*/"(diag_tickTime - _myTime) > 10"/*%FSM*/;
action=/*%FSM*/""/*%FSM*/;
};
/*%FSM*/
@@ -593,6 +661,8 @@ class FSM
"dayzGearSave = false;" \n
"_inventory call player_gearSet;" \n
"" \n
+ "//player addMagazine ""7Rnd_45ACP_1911"";" \n
+ "" \n
"//Assess in backpack" \n
"if (count _backpack > 0) then {" \n
" //Populate" \n
@@ -662,7 +732,7 @@ class FSM
"publicVariableServer ""dayzLogin2"";" \n
"" \n
"dayz_loadScreenMsg = ""Requesting Character data from server"";" \n
- "progressLoadingScreen 0.8;" \n
+ "progressLoadingScreen 0.9;" \n
"diag_log ""Attempting Phase two..."";"/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
@@ -693,14 +763,16 @@ class FSM
"_setDir = _worldspace select 0;" \n
"_setPos = _worldspace select 1;" \n
"" \n
- "if(dayz_paraSpawn and !(player isKindOf ""PZombie_VB"")) then {" \n
- " _para = createVehicle [""ParachuteWest"", _setPos, [], 0, ""FLY""]; " \n
- " player moveInDriver _para;" \n
- "} else {" \n
- " player setPosATL _setPos;" \n
- " player setDir _setDir;" \n
- "};" \n
+ "player setPosATL _setPos;" \n
+ "player setDir _setDir;" \n
"" \n
+ "{" \n
+ " if (player getVariable[""hit_""+_x,false]) then { " \n
+ " [player,_x,_x] spawn fnc_usec_damageBleed; " \n
+ " usecBleed = [player,_x,_x];" \n
+ " publicVariable ""usecBleed""; // draw blood stream on character, on all gameclients" \n
+ " };" \n
+ "} forEach USEC_typeOfWounds;" \n
"//Legs and Arm fractures" \n
"_legs = player getVariable [""hit_legs"",0];" \n
"_arms = player getVariable [""hit_hands"",0];" \n
@@ -780,7 +852,7 @@ class FSM
"dayz_lastMeal = (_lastAte * 60);" \n
"dayz_lastDrink = (_lastDrank * 60);" \n
"dayz_zombiesLocal = 0; //Used to record how many local zombies being tracked" \n
- "dayz_skilllevel = _days; //total alive dayz" \n
+ "dayz_Survived = _days; //total alive dayz" \n
"" \n
"//load in medical details" \n
"r_player_dead = player getVariable[""USEC_isDead"",false];" \n
@@ -830,7 +902,7 @@ class FSM
name = "ERROR__Player_Already";
init = /*%FSM*/"endLoadingScreen;" \n
"selectNoPlayer;" \n
- "_myTime = time;" \n
+ "_myTime = diag_tickTime;" \n
""/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
@@ -839,9 +911,9 @@ class FSM
class Too_Long
{
priority = 0.000000;
- to="ERROR__Player_Already";
+ to="Disconnect";
precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"(time - _myTime) > 10"/*%FSM*/;
+ condition=/*%FSM*/"(diag_tickTime - _myTime) > 10"/*%FSM*/;
action=/*%FSM*/""/*%FSM*/;
};
/*%FSM*/
@@ -852,12 +924,13 @@ class FSM
class Position
{
name = "Position";
- init = /*%FSM*/"" \n
+ init = /*%FSM*/"endLoadingScreen;" \n
+ "startLoadingScreen ["""",""DayZ_loadingScreen""];" \n
+ "" \n
"//Location" \n
"_myLoc = getPosATL player;" \n
"" \n
"dayz_loadScreenMsg = ""Setup Completed, please wait..."";" \n
- "progressLoadingScreen 0.9;" \n
"" \n
"//GUI" \n
"3 cutRsc [""playerStatusGUI"", ""PLAIN"",0];" \n
@@ -913,7 +986,7 @@ class FSM
name = "Load_In";
init = /*%FSM*/"//Reveal action types" \n
"" \n
- "{player reveal _x} forEach (nearestObjects [getPosATL player, dayz_reveal, 50]);" \n
+ "{player reveal _x} forEach (nearestObjects [getPosATL player, [""AllVehicles"",""WeaponHolder"",""StashSmall"",""StashMedium"",""TentStorage"",""BuiltItems""], 50]);" \n
"" \n
"dayz_clientPreload = true;" \n
"3 fadeSound 1;" \n
@@ -945,8 +1018,13 @@ class FSM
name = "ERROR__Bad_Versi";
init = /*%FSM*/"endLoadingScreen;" \n
"selectNoPlayer;" \n
- "_myTime = time;" \n
- "1 cutText [format[localize ""str_player_18"",dayz_versionNo,_version], ""PLAIN""];"/*%FSM*/;
+ "_myTime = diag_tickTime;" \n
+ "" \n
+ "dayz_loadScreenMsg = ""You are running an incorrect version of DAYZ_CODE, please download this file from dayzepoch.com."";" \n
+ "" \n
+ "1 cutText [format[localize ""str_player_18"",dayz_versionNo,_version], ""PLAIN""];" \n
+ "" \n
+ "progressLoadingScreen 0.5;"/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
{
@@ -954,9 +1032,9 @@ class FSM
class Too_Long
{
priority = 0.000000;
- to="ERROR__Bad_Versi";
+ to="get_ready_to_clo_1";
precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"(time - _myTime) > 10"/*%FSM*/;
+ condition=/*%FSM*/"(diag_tickTime - _myTime) > 5"/*%FSM*/;
action=/*%FSM*/""/*%FSM*/;
};
/*%FSM*/
@@ -977,10 +1055,10 @@ class FSM
"" \n
"//Select Weapon" \n
"// Desc: select default weapon & handle multiple muzzles" \n
- "_playerObjName = format[""player%1"",_playerUID];" \n
- "call compile format[""player%1 = player;"",_playerUID];" \n
- "diag_log (format[""player%1 = player"",_playerUID]);" \n
- "publicVariable _playerObjName;" \n
+ "////_playerObjName = format[""player%1"",_playerUID];" \n
+ "////call compile format[""player%1 = player;"",_playerUID];" \n
+ "////diag_log (format[""player%1 = player"",_playerUID]);" \n
+ "////publicVariable _playerObjName;" \n
"" \n
"//_state = player getVariable[""state"",[]];" \n
"_currentWpn = """";" \n
@@ -993,6 +1071,9 @@ class FSM
" if (count _state > 2) then {" \n
" dayz_temperatur = _state select 2;" \n
" };" \n
+ "} else {" \n
+ " _currentWpn = ""Makarov"";" \n
+ " _currentAnim = ""aidlpercmstpsraswpstdnon_player_idlesteady02"";" \n
"};" \n
"" \n
"if (player hasWeapon ""MeleeCrowbar"") then {" \n
@@ -1010,7 +1091,7 @@ class FSM
"" \n
"reload player;" \n
"" \n
- "if (_currentAnim != """" and !dayz_paraSpawn) then {" \n
+ "if (_currentAnim != """") then {" \n
" [objNull, player, rSwitchMove,_currentAnim] call RE;" \n
"};" \n
"if (_currentWpn != """") then {" \n
@@ -1063,6 +1144,17 @@ class FSM
{
name = "Initialize";
init = /*%FSM*/"#define ods(arg1) ""armaperflib"" callextension arg1" \n
+ "" \n
+ "if (!isNil ""dayzSetDate"") then {" \n
+ " setDate dayzSetDate;" \n
+ "};" \n
+ "" \n
+ "if (!isNil ""dayzInfectedCamps"") then {" \n
+ " //diag_log (""Infected Camps: "" +str(dayzInfectedCamps));" \n
+ " dayzInfectedCamps spawn infectedcamps;" \n
+ "};" \n
+ "" \n
+ "diag_log (""Local Time: "" +str(dayzSetDate));" \n
"" \n
"//Medical" \n
"dayz_medicalH = [] execVM ""\z\addons\dayz_code\medical\init_medical.sqf""; //Medical Monitor Script (client only)" \n
@@ -1078,7 +1170,7 @@ class FSM
"//Add core tools" \n
"player addWeapon ""Loot"";" \n
"player addWeapon ""Flare"";" \n
- "" \n
+ "if ((currentWeapon player == """")) then { player action [""SWITCHWEAPON"", player,player,1]; };" \n
"//load in medical details" \n
"r_player_dead = player getVariable[""USEC_isDead"",false];" \n
"r_player_unconscious = player getVariable[""NORRN_unconscious"", false];" \n
@@ -1090,19 +1182,24 @@ class FSM
"r_player_blood = player getVariable[""USEC_BloodQty"",r_player_bloodTotal];" \n
"" \n
"""colorCorrections"" ppEffectEnable true;" \n
- """colorCorrections"" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, (r_player_blood/r_player_bloodTotal)], [1, 1, 1, 0.0]];" \n
+ """colorCorrections"" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1 min (4*r_player_blood/3/r_player_bloodTotal)], [1, 1, 1, 0.0]];" \n
"""colorCorrections"" ppEffectCommit 0;" \n
"" \n
"dayz_gui = [] spawn {" \n
" private[""_distance""];" \n
" dayz_musicH = [] spawn player_music;" \n
" while {true} do {" \n
- " _array = player call world_surfaceNoise;" \n
+ " _array = player call world_surfaceNoise;" \n
" dayz_surfaceNoise = _array select 1;" \n
" dayz_surfaceType = _array select 0;" \n
"" \n
" call player_checkStealth;" \n
" dayz_statusArray = [] call player_updateGui;" \n
+ " if (!isNull cursorTarget and !dayz_heartBeat) then {" \n
+ " if (alive cursorTarget) then {" \n
+ " _id = cursorTarget spawn dayz_lowHumanity;" \n
+ " };" \n
+ " };" \n
" sleep 0.2;" \n
" };" \n
"};" \n
@@ -1113,14 +1210,14 @@ class FSM
"" \n
"_world = toUpper(worldName); //toUpper(getText (configFile >> ""CfgWorlds"" >> (worldName) >> ""description""));" \n
"_nearestCity = nearestLocations [getPos player, [""NameCityCapital"",""NameCity"",""NameVillage"",""NameLocal""],1000];" \n
- "_town = ""Wilderness"";" \n
+ "Dayz_logonTown = ""Wilderness"";" \n
"" \n
- "if (count _nearestCity > 0) then {_town = text (_nearestCity select 0)};" \n
+ "if (count _nearestCity > 0) then {Dayz_logonTown = text (_nearestCity select 0)};" \n
"" \n
- "_strTime = call curTimeStr;" \n
- "_strDate = date;" \n
+ "_first = [_world,Dayz_logonTown,localize (""str_player_06"") + "" "" + str(_days)] spawn BIS_fnc_infoText;" \n
"" \n
- "_first = [_world,_town,localize (""str_player_06"") + "" "" + str(_days)] spawn BIS_fnc_infoText;" \n
+ "Dayz_logonTime = daytime;" \n
+ "Dayz_logonDate = dayz_Survived;" \n
"" \n
"dayz_animalCheck = [] spawn player_spawn_1;" \n
"" \n
@@ -1151,11 +1248,9 @@ class FSM
" sleep 1;" \n
" };" \n
"};" \n
- "//Removed for now" \n
- "//[] execVM ""\z\addons\dayz_code\system\antihack.sqf"";" \n
"" \n
"// TODO: questionably" \n
- "{ _x call fnc_vehicleEventHandler; } forEach vehicles;" \n
+ "{ _x call fnc_veh_ResetEH; } forEach vehicles;" \n
"" \n
"private[""_fadeFire""];" \n
"{" \n
@@ -1163,11 +1258,20 @@ class FSM
" if (!_fadeFire) then {" \n
" nul = [_x,2,0,false,false] spawn BIS_Effects_Burn;" \n
" };" \n
- "} forEach allMissionObjects ""SpawnableWreck"";" \n
- ""/*%FSM*/;
+ "} forEach allMissionObjects ""SpawnableWreck"";"/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
{
+ /*%FSM*/
+ class No_time_date
+ {
+ priority = 0.000000;
+ to="ERROR__No_Date_or";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"!isNil ""dayzSetDate"""/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
/*%FSM*/
class True
{
@@ -1192,6 +1296,8 @@ class FSM
"" \n
"dayzLoginRecord = [_playerUID,_charID,0];" \n
"publicVariableServer ""dayzLoginRecord"";" \n
+ "" \n
+ "endLoadingScreen;" \n
""/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
@@ -1203,8 +1309,11 @@ class FSM
class Enable_Sim
{
name = "Enable_Sim";
- init = /*%FSM*/"_myAnim = getNumber(configFile >> ""CfgPatches"" >> ""dayz_anim"" >> ""isUpdated"");" \n
- ""/*%FSM*/;
+ init = /*%FSM*/"diag_log (""PLOGIN: Enable Sim"");" \n
+ "" \n
+ "_myAnim = getNumber(configFile >> ""CfgPatches"" >> ""dayz_anim"" >> ""isUpdated"");" \n
+ "" \n
+ "player enableSimulation true;"/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
{
@@ -1282,7 +1391,7 @@ class FSM
name = "ERROR__No_Player_1";
init = /*%FSM*/"endLoadingScreen;" \n
"selectNoPlayer;" \n
- "_myTime = time;" \n
+ "_myTime = diag_tickTime;" \n
"1 cutText [""You have an outdated version of 'dayz_anim' please download the correct version"", ""PLAIN"",15];"/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
@@ -1291,9 +1400,9 @@ class FSM
class Too_Long
{
priority = 0.000000;
- to="ERROR__No_Player_1";
+ to="Disconnect";
precondition = /*%FSM*/""/*%FSM*/;
- condition=/*%FSM*/"(time - _myTime) > 10"/*%FSM*/;
+ condition=/*%FSM*/"(diag_tickTime - _myTime) > 10"/*%FSM*/;
action=/*%FSM*/""/*%FSM*/;
};
/*%FSM*/
@@ -1305,12 +1414,12 @@ class FSM
{
name = "Stream";
init = /*%FSM*/"//stream in location" \n
- "//call stream_locationCheck;" \n
+ "//[false] call stream_locationCheck;" \n
"" \n
"_zombies = (getPosATL player) nearEntities [""zZombie_Base"",30];" \n
"{deleteVehicle _x} forEach _zombies;" \n
"" \n
- "//endLoadingScreen;"/*%FSM*/;
+ "endLoadingScreen;"/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
{
@@ -1327,6 +1436,175 @@ class FSM
};
};
/*%FSM*/
+ /*%FSM*/
+ class Retry
+ {
+ name = "Retry";
+ init = /*%FSM*/"diag_log (""PLOGIN: Retrying Authentication... ("" + _playerUID + "")"");" \n
+ "dayz_loadScreenMsg = (localize ""str_player_14"");" \n
+ "" \n
+ "_AuthAttempt = _AuthAttempt +1;" \n
+ "" \n
+ "_myTime = diag_tickTime;"/*%FSM*/;
+ precondition = /*%FSM*/""/*%FSM*/;
+ class Links
+ {
+ /*%FSM*/
+ class auth_failed
+ {
+ priority = 0.000000;
+ to="get_ready_to_clo";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"_AuthAttempt > 5"/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class Retry
+ {
+ priority = 0.000000;
+ to="Request";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"(diag_tickTime - _myTime) > 5"/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
+ };
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class get_ready_to_clo
+ {
+ name = "get_ready_to_clo";
+ init = /*%FSM*/"diag_log (""PLOGIN: Authentication Failed ("" + _playerUID + "")"");" \n
+ "dayz_loadScreenMsg = (localize ""str_player_32"");" \n
+ "" \n
+ "progressLoadingScreen 1;" \n
+ "" \n
+ "_myTime = diag_tickTime;"/*%FSM*/;
+ precondition = /*%FSM*/""/*%FSM*/;
+ class Links
+ {
+ /*%FSM*/
+ class sleep_
+ {
+ priority = 0.000000;
+ to="Disconnect";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"(diag_tickTime - _myTime) > 2"/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
+ };
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class Disconnect
+ {
+ name = "Disconnect";
+ init = /*%FSM*/"endLoadingScreen;" \n
+ "" \n
+ "// disable player interaction and move him off site" \n
+ "// player setPos [10,10,100000];" \n
+ " player enableSimulation false;" \n
+ "" \n
+ "diag_log (""End Mission"");" \n
+ "" \n
+ "//if (!isServer) then {" \n
+ " failMission ""LOSER"";" \n
+ " endMission ""END1""" \n
+ "//};"/*%FSM*/;
+ precondition = /*%FSM*/""/*%FSM*/;
+ class Links
+ {
+ };
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class ERROR__No_Date_or
+ {
+ name = "ERROR__No_Date_or";
+ init = /*%FSM*/"endLoadingScreen;" \n
+ "selectNoPlayer;" \n
+ "_myTime = diag_tickTime;" \n
+ "1 cutText [""Could not retive date and time from server disconect and retry."", ""PLAIN"",5];"/*%FSM*/;
+ precondition = /*%FSM*/""/*%FSM*/;
+ class Links
+ {
+ /*%FSM*/
+ class Too_Long
+ {
+ priority = 0.000000;
+ to="Disconnect";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"(diag_tickTime - _myTime) > 10"/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
+ };
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class get_ready_to_clo_1
+ {
+ name = "get_ready_to_clo_1";
+ init = /*%FSM*/"//diag_log (""PLOGIN:Wrong DayZ Version ("" + dayz_versionNo + "")"");" \n
+ "diag_log format[localize ""str_player_18"",dayz_versionNo,_version];" \n
+ "" \n
+ "dayz_loadScreenMsg = ""You are running an incorrect version of DAYZ_CODE, please download this file from dayzepoch.com."";" \n
+ "" \n
+ "progressLoadingScreen 1;"/*%FSM*/;
+ precondition = /*%FSM*/""/*%FSM*/;
+ class Links
+ {
+ /*%FSM*/
+ class sleep_
+ {
+ priority = 0.000000;
+ to="Disconnect";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"(diag_tickTime - _myTime) > 5"/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
+ };
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class Server_Loading
+ {
+ name = "Server_Loading";
+ init = /*%FSM*/"_myTime = diag_tickTime;" \n
+ "dayz_loadScreenMsg = (""Waiting for server to start authentication"");" \n
+ "diag_log ""PLOGIN: Waiting for server to start authentication"";" \n
+ "" \n
+ "progressLoadingScreen 0.5;"/*%FSM*/;
+ precondition = /*%FSM*/""/*%FSM*/;
+ class Links
+ {
+ /*%FSM*/
+ class Server_Ready
+ {
+ priority = 0.000000;
+ to="Request";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"!isNil ""sm_done"""/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
+ /*%FSM*/
+ class Too_Long
+ {
+ priority = 0.000000;
+ to="Disconnect";
+ precondition = /*%FSM*/""/*%FSM*/;
+ condition=/*%FSM*/"(diag_tickTime - _myTime) > 120"/*%FSM*/;
+ action=/*%FSM*/""/*%FSM*/;
+ };
+ /*%FSM*/
+ };
+ };
+ /*%FSM*/
/*%FSM*/
class Player_Zombie__S
{
diff --git a/SQF/dayz_server/compile/server_publishVehicle.sqf b/SQF/dayz_server/compile/server_publishVehicle.sqf
index da5fc17b4..e4061aa9a 100644
--- a/SQF/dayz_server/compile/server_publishVehicle.sqf
+++ b/SQF/dayz_server/compile/server_publishVehicle.sqf
@@ -112,7 +112,7 @@ dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
_object setvelocity [0,0,1];
- _object call fnc_vehicleEventHandler;
+ _object call fnc_veh_ResetEH;
// testing - should make sure everyone has eventhandlers for vehicles was unused...
dayzVehicleInit = _object;
diff --git a/SQF/dayz_server/compile/server_publishVehicle2.sqf b/SQF/dayz_server/compile/server_publishVehicle2.sqf
index 09394e827..bb9cd71d3 100644
--- a/SQF/dayz_server/compile/server_publishVehicle2.sqf
+++ b/SQF/dayz_server/compile/server_publishVehicle2.sqf
@@ -98,7 +98,7 @@ _key call server_hiveWrite;
dayz_serverObjectMonitor set [count dayz_serverObjectMonitor,_object];
- _object call fnc_vehicleEventHandler;
+ _object call fnc_veh_ResetEH;
// for non JIP users this should make sure everyone has eventhandlers for vehicles.
dayzVehicleInit = _object;
diff --git a/SQF/dayz_server/system/server_cleanup.fsm b/SQF/dayz_server/system/server_cleanup.fsm
index ae856df99..f1e9424da 100644
--- a/SQF/dayz_server/system/server_cleanup.fsm
+++ b/SQF/dayz_server/system/server_cleanup.fsm
@@ -35,8 +35,8 @@ link14[] = {11,12};
link15[] = {12,1};
link16[] = {13,5};
link17[] = {14,13};
-globals[] = {25.000000,1,0,0,0,640,480,1,24,6316128,1,-419.782135,377.473389,490.440002,-241.733459,910,880,1};
-window[] = {2,-1,-1,-1,-1,784,1706,2984,26,3,928};
+globals[] = {25.000000,1,0,0,0,640,480,1,25,6316128,1,-419.782135,377.473389,303.547668,-419.297363,675,612,1};
+window[] = {0,-1,-1,-1,-1,900,1933,3211,142,1,693};
*//*%FSM*/
class FSM
{
@@ -69,7 +69,6 @@ class FSM
{
name = "waiting";
init = /*%FSM*/"//diag_log ""CLEANUP: Waiting for next task"";" \n
- "//_numDead = {local _x} count allDead;" \n
""/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
@@ -112,6 +111,7 @@ class FSM
{
name = "sync_the_time";
init = /*%FSM*/"//Send request" \n
+ "_lastUpdate = diag_tickTime;" \n
"_key = ""CHILD:307:"";" \n
"_result = _key call server_hiveReadWrite;" \n
"_outcome = _result select 0;" \n
@@ -156,25 +156,32 @@ class FSM
class general_cleanup
{
name = "general_cleanup";
- init = /*%FSM*/"//Clean groups" \n
- "{" \n
- " //diag_log (""CLEANUP: CHECKING GROUP WITH "" + str(count units _x) + "" UNITS"");" \n
- " if (count units _x==0) then {" \n
- " deleteGroup _x;" \n
- " //diag_log (""CLEANUP: DELETING A GROUP"");" \n
- " };" \n
- "} forEach allGroups;" \n
+ init = /*%FSM*/"if ((diag_tickTime - _lastCleanup) > 2) then {" \n
+ " " \n
+ " _safety = dayz_serverObjectMonitor;" \n
"" \n
- "//Check for hackers" \n
- " {" \n
- " if(vehicle _x != _x && !(vehicle _x in _safety) && (isPlayer _x) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n
- " diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
- " (vehicle _x) setDamage 1;" \n
- " _x setDamage 1;" \n
- " };" \n
- " } forEach allUnits;" \n
+ " //Clean groups" \n
+ " {" \n
+ " diag_log (""CLEANUP: CHECKING GROUP WITH "" + str(count units _x) + "" UNITS"");" \n
+ " if (count units _x==0) then {" \n
+ " deleteGroup _x;" \n
+ " diag_log (""CLEANUP: DELETING A GROUP"");" \n
+ " };" \n
+ " } forEach allGroups;" \n
"" \n
- "dayz_serverObjectMonitor = _safety;"/*%FSM*/;
+ " //Check for hackers" \n
+ " {" \n
+ " if(vehicle _x != _x && !(vehicle _x in _safety) && (isPlayer _x) && (typeOf vehicle _x) != ""ParachuteWest"") then {" \n
+ " diag_log (""CLEANUP: KILLING A HACKER "" + (name _x) + "" "" + str(_x) + "" IN "" + (typeOf vehicle _x));" \n
+ " (vehicle _x) setDamage 1;" \n
+ " _x setDamage 1;" \n
+ " };" \n
+ " } forEach allUnits;" \n
+ "" \n
+ " dayz_serverObjectMonitor = _safety;" \n
+ "" \n
+ " _lastCleanup = diag_tickTime;" \n
+ "};"/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
{
@@ -198,13 +205,11 @@ class FSM
init = /*%FSM*/"diag_log (""CLEANUP: INITIALIZING CLEANUP SCRIPT"");" \n
"" \n
"_safety = dayz_serverObjectMonitor;" \n
- "_dateNow = (DateToNumber date);" \n
+ "//_dateNow = (DateToNumber date);" \n
"" \n
"_lastUpdate = diag_tickTime;" \n
- "_timeNem =diag_tickTime;" \n
- "" \n
"_lastNeedUpdate = diag_tickTime;" \n
- "_maxBodies = 15;" \n
+ "_lastCleanup = diag_tickTime;" \n
""/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
@@ -226,14 +231,14 @@ class FSM
class update_objects
{
name = "update_objects";
- init = /*%FSM*/"diag_log format[""DEBUG: needUpdate_objects=%1"",needUpdate_objects];" \n
+ init = /*%FSM*/"//diag_log format[""DEBUG: needUpdate_objects=%1"",needUpdate_objects];" \n
"{" \n
"// _x setVariable [""needUpdate"",false,true];" \n
" needUpdate_objects = needUpdate_objects - [_x];" \n
" [_x,""all""] call server_updateObject;" \n
"" \n
"} forEach needUpdate_objects;" \n
- ""/*%FSM*/;
+ "_lastNeedUpdate = diag_tickTime;"/*%FSM*/;
precondition = /*%FSM*/""/*%FSM*/;
class Links
{
diff --git a/SQF/dayz_server/system/server_monitor.sqf b/SQF/dayz_server/system/server_monitor.sqf
index 4186f1dfd..ccd3f4716 100644
--- a/SQF/dayz_server/system/server_monitor.sqf
+++ b/SQF/dayz_server/system/server_monitor.sqf
@@ -231,7 +231,7 @@ if (isServer and isNil "sm_done") then {
if (!((typeOf _object) in dayz_allowedObjects)) then {
_object setvelocity [0,0,1];
- _object call fnc_vehicleEventHandler;
+ _object call fnc_veh_ResetEH;
if(_ownerID != "0") then {
_object setvehiclelock "locked";
@@ -274,6 +274,8 @@ if (isServer and isNil "sm_done") then {
OldHeliCrash = false;
};
+ allowConnection = true;
+
// [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire]
if(OldHeliCrash) then {
nul = [3, 4, (50 * 60), (15 * 60), 0.75, 'center', HeliCrashArea, true, false] spawn server_spawnCrashSite;
@@ -286,6 +288,7 @@ if (isServer and isNil "sm_done") then {
_id = [] execFSM "\z\addons\dayz_server\system\server_cleanup.fsm";
};
- allowConnection = true;
+
sm_done = true;
+ publicVariable "sm_done";
};