Merge remote-tracking branch 'upstream/master'

This commit is contained in:
facoptere
2013-11-18 18:33:19 +01:00
12 changed files with 128 additions and 80 deletions

View File

@@ -0,0 +1,16 @@
private ["_spawnveh","_position","_direction","_veh"];
{
_spawnveh = _x select 0;
_position = _x select 1;
_direction = _x select 2;
//diag_log("DEBUG: Spawning a crashed " + _spawnveh + " with " + _spawnloot + " at " + str(_position));
_veh = _spawnveh createVehicleLocal _position;
_veh enableSimulation false;
// Randomize placement a bit
_veh setDir _direction;
_veh setpos _position;
} forEach _this;

View File

@@ -64,6 +64,8 @@ if (!isDedicated) then {
object_roadFlare = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_roadFlare.sqf";
object_setpitchbank = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\fn_setpitchbank.sqf";
object_monitorGear = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\object_monitorGear.sqf";
local_roadDebris = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_roadDebris.sqf";
//Zombies
zombie_findTargetAgent = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\zombie_findTargetAgent.sqf";
@@ -123,6 +125,55 @@ if (!isDedicated) then {
onPreloadStarted "dayz_preloadFinished = false;";
onPreloadFinished "dayz_preloadFinished = true;";
//This is still needed but the fsm should terminate if any errors pop up.
[] spawn {
private["_timeOut","_display","_control1","_control2"];
disableSerialization;
_timeOut = 0;
dayz_loadScreenMsg = "";
diag_log "DEBUG: loadscreen guard started.";
_display = uiNameSpace getVariable "BIS_loadingScreen";
if (!isNil "_display") then {
_control1 = _display displayctrl 8400;
_control2 = _display displayctrl 102;
};
waitUntil {!dayz_DisplayGenderSelect};
// 120 sec timeout (12000 * 0.01)
while { _timeOut < 12000 } do {
if (dayz_clientPreload && dayz_authed) exitWith { diag_log "PLOGIN: Login loop completed!"; };
if (!isNil "_display") then {
if ( isNull _display ) then {
waitUntil { !dialog; };
startLoadingScreen ["","RscDisplayLoadCustom"];
_display = uiNameSpace getVariable "BIS_loadingScreen";
_control1 = _display displayctrl 8400;
_control2 = _display displayctrl 102;
};
if ( dayz_loadScreenMsg != "" ) then {
_control1 ctrlSetText dayz_loadScreenMsg;
dayz_loadScreenMsg = "";
};
_control2 ctrlSetText format["%1",round(_timeOut*0.01)];
};
_timeOut = _timeOut + 1;
if (_timeOut >= 12000) then {
1 cutText [localize "str_player_login_timeout", "PLAIN DOWN"];
sleep 10;
endLoadingScreen;
endMission "END1";
};
sleep 0.01;
};
};
// TODO: need move it in player_monitor.fsm
// allow player disconnect from server, if loading hang, kicked by BE etc.
[] spawn {

View File

@@ -66,6 +66,7 @@ if (!isDedicated) then {
"PVDZE_obj_Fire" addPublicVariableEventHandler {nul=(_this select 1) spawn BIS_Effects_Burn};
"PVDZE_plr_FriendRQ" addPublicVariableEventHandler {cutText[(_this select 1),"PLAIN DOWN"];};
"PVDZE_obj_Debris" addPublicVariableEventHandler {(_this select 1) call local_roadDebris};
"norrnRaDrag" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\publicEH\animDrag.sqf"};
"norrnRnoAnim" addPublicVariableEventHandler {(_this select 1) execVM "\z\addons\dayz_code\medical\publicEH\noAnim.sqf"};

View File

@@ -1,4 +1,4 @@
/*%FSM<COMPILE "C:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Player Monitor">*/
/*%FSM<COMPILE "F:\Program Files (x86)\Bohemia Interactive\Tools\FSM Editor Personal Edition\scriptedFSM.cfg, DayZ Player Monitor">*/
/*%FSM<HEAD>*/
/*
item0[] = {"init",0,250,-75.000000,-350.000000,25.000000,-300.000000,0.000000,"init"};
@@ -152,8 +152,8 @@ 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,-592.955444,422.624878,1469.107178,428.394379,888,911,1};
window[] = {2,-1,-1,-1,-1,980,200,1572,200,3,906};
globals[] = {25.000000,1,0,0,0,640,480,1,131,6316128,1,-592.955444,422.624878,1027.017090,306.503998,888,630,1};
window[] = {2,-1,-1,-1,-1,858,78,1370,78,3,906};
*//*%FSM</HEAD>*/
class FSM
{
@@ -472,9 +472,7 @@ class FSM
class Request
{
name = "Request";
init = /*%FSM<STATEINIT""">*/"//startLoadingScreen ["""",""DayZ_loadingScreen""];" \n
"" \n
"diag_log (""PLOGIN: Requesting Authentication... ("" + _playerUID + "")"");" \n
init = /*%FSM<STATEINIT""">*/"diag_log (""PLOGIN: Requesting Authentication... ("" + _playerUID + "")"");" \n
"dayz_loadScreenMsg = (localize ""str_player_15"");" \n
"" \n
"progressLoadingScreen 0.7;" \n
@@ -762,17 +760,15 @@ class FSM
"" \n
"_worldspace = dayzPlayerLogin2 select 0;" \n
"_state = dayzPlayerLogin2 select 1;" \n
"PVDZE_plr_SetWeather = dayzPlayerLogin2 select 2;" \n
"PVDZE_plr_SetDate = dayzPlayerLogin2 select 3;" \n
"DZE_FreshSpawn = dayzPlayerLogin2 select 4;" \n
"DZE_FreshSpawn = dayzPlayerLogin2 select 2;" \n
"" \n
"_setDir = _worldspace select 0;" \n
"_setPos = _worldspace select 1;" \n
"" \n
"if(dayz_paraSpawn and !(player isKindOf ""PZombie_VB"") and DZE_FreshSpawn) then {" \n
" player setPosATL [(_setPos select 0),(_setPos select 1),1000];" \n
" player setDir _setDir;" \n
" [player,1000] spawn BIS_fnc_halo;" \n
" player setPosATL [(_setPos select 0),(_setPos select 1),2000];" \n
" [player,2000] spawn BIS_fnc_halo;" \n
"} else {" \n
"" \n
" // make protective box" \n
@@ -942,10 +938,7 @@ class FSM
class Position
{
name = "Position";
init = /*%FSM<STATEINIT""">*/"endLoadingScreen;" \n
"startLoadingScreen ["""",""DayZ_loadingScreen""];" \n
"" \n
"//Location" \n
init = /*%FSM<STATEINIT""">*/"//Location" \n
"_myLoc = getPosATL player;" \n
"" \n
"dayz_loadScreenMsg = ""Setup Completed, please wait..."";" \n
@@ -1186,23 +1179,7 @@ class FSM
class Initialize
{
name = "Initialize";
init = /*%FSM<STATEINIT""">*/"#define ods(arg1) ""armaperflib"" callextension arg1" \n
"" \n
"if (!isNil ""PVDZE_plr_SetDate"") then {" \n
" setDate PVDZE_plr_SetDate;" \n
"};" \n
"" \n
"if (!isNil ""PVDZE_plr_SetDate"") then {" \n
" 0 setOvercast (zeroCurrentWeather select 0);" \n
" 0 setFog (zeroCurrentWeather select 1);" \n
" setWind [((zeroCurrentWeather select 2) select 0),((zeroCurrentWeather select 2) select 1),true];" \n
" 0 setRain (zeroCurrentWeather select 3);" \n
"};" \n
"" \n
"" \n
"diag_log (""Local Time: "" +str(PVDZE_plr_SetDate));" \n
"" \n
"//Medical" \n
init = /*%FSM<STATEINIT""">*/"//Medical" \n
"dayz_medicalH = [] execVM ""\z\addons\dayz_code\medical\init_medical.sqf""; //Medical Monitor Script (client only)" \n
"[player] call fnc_usec_damageHandle;" \n
"if (r_player_unconscious) then {" \n