Player Login rework

This commit is contained in:
He-Man 2018-05-05 17:47:53 +02:00
parent ac337459ff
commit 14587e6c4e
8 changed files with 230 additions and 195 deletions

View File

@ -1 +1 @@
5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_(checkplayer|save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player) \[.+\]" !="epoch_server_((upgrade|updateplayer|inviteplayer|create|delete)(Temp|)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|make(marker|SP)|removemarker) \[.+\]" !="epoch_server_(upgrade_vehicle|knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(paycrypto|tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject|fnc_updateplayerstats) \[.+\]" !="cup_fnc_handletow \[.+\]" !="bis_fnc_reviveinitaddplayer \[.+\]"
5 "" !="bis_fnc_execvm \[\[.+\],\"initPlayerServer.sqf\"]" !="bis_fnc_effectkilled(airdestruction|secondaries) \[.+\]" !="epoch_server_(checkplayer|save(_vehicles|building)|(lock|pack)Storage|(upgrade|remove|paint|maint)build) \[.+\]" !="epoch_server_((load|respawn|dead|invite|revive|teleport)Player) \[.+\]" !="epoch_server_((upgrade|updateplayer|inviteplayer|create|delete)(Temp|)Group) \[.+\]" !="epoch_server_(deadplayerdetonate|triggerantagonist|playersetvariable|missioncomms|make(marker|SP)|removemarker) \[.+\]" !="epoch_server_(upgrade_vehicle|knockDownTree|mineRocks|lootAnimal|handle_(say3d|switchmove|sapperObjs)) \[.+\]" !="epoch_server_((repair|fill|lock)Vehicle|(loot|fill)Container|(store|take)Crypto|make(NPC|)Trade) \[.+\]" !="epoch_server_(paycrypto|tradeRequest|equippeditem|packJack|create(object|AirDrop)|airDropCrate|destroytrash|unpackBackpack|setfinalplayerpos) \[.+\]" !="epoch_(localcleanup|fnc_saveplayer|client_bitePlayer|serverlootobject|fnc_updateplayerstats) \[.+\]" !="cup_fnc_handletow \[.+\]" !="bis_fnc_reviveinitaddplayer \[.+\]"

View File

@ -1,8 +1,8 @@
/*%FSM<COMPILE "F:\Program Files (x86)\Steam\steamapps\common\Arma 3 Tools\FSMEditor\scriptedFSM.cfg, Epoch Login">*/
/*%FSM<COMPILE "scriptedFSM.cfg, Epoch Login">*/
/*%FSM<HEAD>*/
/*
item0[] = {"INIT",0,250,-25.000000,-375.000000,75.000000,-325.000000,0.000000,"INIT"};
item1[] = {"FINISH",1,250,-149.463196,1518.792480,-49.463196,1568.792480,0.000000,"FINISH"};
item1[] = {"FINISH",1,250,-156.564148,1645.189819,-56.564148,1695.189819,0.000000,"FINISH"};
item2[] = {"true",8,218,-150.000000,-125.000000,-50.000000,-75.000000,0.000000,"true"};
item3[] = {"Version_Check",2,250,-25.000000,-75.000000,75.000000,-25.000000,0.000000,"Version Check"};
item4[] = {"Player_Object_Re",4,218,-150.000000,75.000000,-50.000000,125.000000,0.000000,"Player" \n "Object Ready"};
@ -17,23 +17,23 @@ item12[] = {"Empty_PlayerUID",4,218,125.000000,125.000000,225.000000,175.000000,
item13[] = {"ERROR_PlayerUID",2,250,275.000000,125.000000,375.000000,175.000000,0.000000,"ERROR" \n "PlayerUID Empty"};
item14[] = {"",7,210,471.000061,145.999908,478.999939,154.000092,0.000000,""};
item15[] = {"Timeout_No_Respo",4,218,125.000000,875.000000,225.000000,925.000000,0.000000,"Timeout" \n "No Response"};
item16[] = {"Response",4,4314,-150.000000,825.000000,-50.000000,875.000000,0.000000,"Response"};
item17[] = {"Setup_Player_Var",2,250,-25.000000,1075.000000,75.000000,1125.000000,0.000000,"Setup Player" \n "Variables"};
item16[] = {"Response",4,218,-150.000000,825.000000,-50.000000,875.000000,0.000000,"Response"};
item17[] = {"Setup_Player_Var",2,250,-32.100952,1201.397339,67.899048,1251.397339,0.000000,"Setup Player" \n "Variables"};
item18[] = {"Request_Hive",2,250,-25.000000,575.000000,75.000000,625.000000,0.000000,"Request Hive"};
item19[] = {"Timeout_No_Respo",4,218,125.000000,575.000000,225.000000,625.000000,0.000000,"Timeout" \n "No Response"};
item20[] = {"ERROR_Server_not",2,250,275.000000,875.000000,375.000000,925.000000,0.000000,"ERROR" \n "Server not" \n "Response"};
item21[] = {"",7,210,471.000000,895.999939,479.000000,904.000061,0.000000,""};
item22[] = {"Timeout_No_Respo",4,218,125.000000,775.000000,225.000000,825.000000,0.000000,"Timeout" \n "No Response"};
item23[] = {"Wrong_Server_Ver",4,218,125.000000,475.000000,225.000000,525.000000,10.000000,"Wrong" \n "Server Version"};
item24[] = {"Player_In_Game",8,218,-150.000000,1125.000000,-50.000000,1175.000000,0.000000,"Player" \n "In Game"};
item24[] = {"Player_In_Game",8,218,-157.100952,1251.397339,-57.100952,1301.397339,0.000000,"Player" \n "In Game"};
item25[] = {"ERROR_Wrong_Server",2,250,275.000000,475.000000,375.000000,525.000000,0.000000,"ERROR" \n "Wrong" \n "Server Version"};
item26[] = {"Display_Message",4,218,600.000000,1150.000000,700.000000,1200.000000,0.000000,"" \n "Display Message" \n "Wait..."};
item27[] = {"Setup_Player_Obj",2,250,-25.000000,975.000000,75.000000,1025.000000,0.000000,"Setup Player" \n "Object"};
item27[] = {"Setup_Player_Obj",2,250,-32.100952,1101.397339,67.899048,1151.397339,0.000000,"Setup Player" \n "Object"};
item28[] = {"Check_if_Player",4,218,750.000000,1225.000000,850.000000,1275.000000,0.000000,"Check if" \n "Player got Kicked"};
item29[] = {"Preload_done",8,218,-150.000000,1425.000000,-50.000000,1475.000000,0.000000,"Preload" \n "done"};
item29[] = {"Preload_done",8,218,-157.100952,1551.397339,-57.100952,1601.397339,0.000000,"Preload" \n "done"};
item30[] = {"",7,210,471.000000,796.000000,479.000000,804.000000,0.000000,""};
item31[] = {"",7,210,471.000000,796.000000,479.000000,804.000000,0.000000,""};
item32[] = {"true",8,218,425.000000,1075.000000,525.000000,1125.000000,0.000000,"true"};
item32[] = {"true",8,218,417.899048,1201.397339,517.899048,1251.397339,0.000000,"true"};
item33[] = {"Display_Message",2,250,600.000000,1075.000000,700.000000,1125.000000,0.000000,"Display" \n "Message"};
item34[] = {"Server_Ready",4,218,-25.000000,300.000000,75.000000,350.000000,0.000000,"Server" \n "Ready"};
item35[] = {"Check_Server",2,250,-25.000000,375.000000,75.000000,425.000000,0.000000,"Check Server"};
@ -50,26 +50,26 @@ item45[] = {"Arma_Version_Che",2,250,-25.000000,25.000000,75.000000,75.000000,0.
item46[] = {"Outdated_Version",4,218,125.000000,25.000000,225.000000,75.000000,10.000000,"Outdated" \n "Version"};
item47[] = {"ERROR_Wrong_Version_1",2,250,275.000000,25.000000,375.000000,75.000000,0.000000,"ERROR" \n "Wrong Version" \n "ArmA"};
item48[] = {"",7,210,471.000061,45.999908,478.999939,54.000092,0.000000,""};
item49[] = {"new_player_____p",4,218,-150.000000,1025.000000,-50.000000,1075.000000,0.000000,"new player == " \n "player"};
item50[] = {"Setup_EH_s_and_H",2,250,-25.000000,1175.000000,75.000000,1225.000000,0.000000,"Setup EH's" \n "and" \n "HitPoints"};
item51[] = {"no_weapons",4,218,-25.000000,1275.000000,75.000000,1325.000000,0.000000,"no weapons"};
item52[] = {"Process",2,250,-25.000000,1375.000000,75.000000,1425.000000,0.000000,"Process"};
item53[] = {"Has_Current_Weap",4,218,100.000000,1175.000000,200.000000,1225.000000,10.000000,"Has" \n "Current" \n "Weapon"};
item54[] = {"Find_Active_Weap",2,250,225.000000,1175.000000,325.000000,1225.000000,0.000000,"Find" \n "Active" \n "Weapon"};
item55[] = {"Current_Weapon_Not",4,218,150.000000,1225.000000,250.000000,1275.000000,0.000000,"Current" \n "Weapon" \n "Not Selected"};
item56[] = {"Current_Weapon_S",4,218,300.000000,1225.000000,400.000000,1275.000000,0.000000,"Current" \n "Weapon" \n "Selected"};
item57[] = {"Select_Weapon",2,250,150.000000,1300.000000,250.000000,1350.000000,0.000000,"Select" \n "Weapon"};
item58[] = {"true",8,218,225.000000,1375.000000,325.000000,1425.000000,0.000000,"true"};
item59[] = {"Do_nothing",2,250,300.000000,1300.000000,400.000000,1350.000000,0.000000,"Do nothing"};
item60[] = {"Check_New_Player",2,250,-25.000000,875.000000,75.000000,925.000000,0.000000,"Check" \n "New Player" \n "Setup"};
item61[] = {"check_new__player",4,218,-150.000000,925.000000,-50.000000,975.000000,0.000000,"check new " \n "player not null"};
item49[] = {"new_player_____p",4,218,-157.100952,1151.397339,-57.100952,1201.397339,0.000000,"new player == " \n "player"};
item50[] = {"Setup_EH_s_and_H",2,250,-32.100952,1301.397339,67.899048,1351.397339,0.000000,"Setup EH's" \n "and" \n "HitPoints"};
item51[] = {"no_weapons",4,218,-32.100952,1401.397339,67.899048,1451.397339,0.000000,"no weapons"};
item52[] = {"Process",2,250,-32.100952,1501.397339,67.899048,1551.397339,0.000000,"Process"};
item53[] = {"Has_Current_Weap",4,218,92.899048,1301.397339,192.899048,1351.397339,10.000000,"Has" \n "Current" \n "Weapon"};
item54[] = {"Find_Active_Weap",2,250,217.899048,1301.397339,317.899048,1351.397339,0.000000,"Find" \n "Active" \n "Weapon"};
item55[] = {"Current_Weapon_Not",4,218,142.899048,1351.397339,242.899048,1401.397339,0.000000,"Current" \n "Weapon" \n "Not Selected"};
item56[] = {"Current_Weapon_S",4,218,292.899048,1351.397339,392.899048,1401.397339,0.000000,"Current" \n "Weapon" \n "Selected"};
item57[] = {"Select_Weapon",2,250,142.899048,1426.397339,242.899048,1476.397339,0.000000,"Select" \n "Weapon"};
item58[] = {"true",8,218,217.899048,1501.397339,317.899048,1551.397339,0.000000,"true"};
item59[] = {"Do_nothing",2,250,292.899048,1426.397339,392.899048,1476.397339,0.000000,"Do nothing"};
item60[] = {"Check_New_Player",2,250,-20.739410,880.680786,79.260590,930.680786,0.000000,"Check" \n "New Player"};
item61[] = {"check_1_new__pla",4,218,-147.159637,930.680786,-47.159637,980.680786,0.000000,"check 1 new " \n "player"};
item62[] = {"true",4,218,-150.000000,-325.000000,-60.000000,-275.000000,0.000000,"true"};
item63[] = {"Process_1",2,250,-25.000000,-275.000000,75.000000,-225.000000,0.000000,"Process"};
item64[] = {"Wait_ArmA_Loading",4,218,-150.000000,-225.000000,-50.000000,-175.000000,0.000000,"Wait ArmA" \n "Loading Screen" \n "Done"};
item65[] = {"Start_Loading_Sc",2,250,-25.000000,-175.000000,75.000000,-125.000000,0.000000,"Start Loading" \n "Screen"};
item66[] = {"Timeout_",4,218,125.000000,975.000000,225.000000,1025.000000,0.000000,"" \n "Timeout" \n ""};
item67[] = {"ERROR_Player_Setup",2,250,275.000000,975.000000,375.000000,1025.000000,0.000000,"ERROR" \n "Player Setup" \n "Invalid"};
item68[] = {"",7,210,471.000000,996.000000,479.000000,1004.000000,0.000000,""};
item66[] = {"Timeout_",4,218,117.899048,1101.397339,217.899048,1151.397339,0.000000,"" \n "Timeout" \n ""};
item67[] = {"ERROR_Player_Setup",2,250,267.899048,1101.397339,367.899048,1151.397339,0.000000,"ERROR" \n "Player Setup" \n "Invalid"};
item68[] = {"",7,210,463.899048,1122.397339,471.899048,1130.397339,0.000000,""};
item69[] = {"Server_Version_C",2,250,-25.000000,475.000000,75.000000,525.000000,0.000000,"Server Version" \n "Check"};
item70[] = {"Version_Okay",4,218,-125.000000,525.000000,-25.000000,575.000000,0.000000,"Version" \n "Okay"};
item71[] = {"",7,210,471.000000,496.000000,479.000000,504.000000,0.000000,""};
@ -86,6 +86,11 @@ item81[] = {"Timeout",4,218,-350.000000,750.000000,-250.000000,800.000000,0.0000
item82[] = {"Send_character_s",2,250,-400.000000,825.000000,-300.000000,875.000000,0.000000,"Send" \n "character" \n "selection"};
item83[] = {"Process_3",2,250,-25.000000,775.000000,75.000000,825.000000,0.000000,"Process"};
item84[] = {"ERROR_Server_not_4",2,250,275.000000,775.000000,375.000000,825.000000,0.000000,"ERROR" \n "Server not" \n "Response"};
item85[] = {"Check_New_Player_1",2,250,-29.260529,995.716492,70.739471,1045.716309,0.000000,"Check" \n "New Player" \n "Setup"};
item86[] = {"check_2_new__pla",4,4314,-154.260574,1044.296387,-54.260574,1094.296387,0.000000,"check 2 new " \n "player"};
item87[] = {"Timeout_No_Respo",4,218,127.840363,997.136780,227.840363,1047.136475,0.000000,"Timeout" \n "No Response"};
item88[] = {"ERROR_Server_not_5",2,250,266.478851,995.716614,366.478851,1045.716309,0.000000,"ERROR" \n "Server not" \n "Response"};
item89[] = {"",7,210,466.446442,1000.643677,474.446442,1008.643677,0.000000,""};
link0[] = {0,62};
link1[] = {2,3};
link2[] = {3,7};
@ -109,7 +114,7 @@ link19[] = {18,19};
link20[] = {18,75};
link21[] = {19,72};
link22[] = {20,21};
link23[] = {21,68};
link23[] = {21,89};
link24[] = {22,84};
link25[] = {23,25};
link26[] = {24,50};
@ -154,7 +159,7 @@ link64[] = {58,52};
link65[] = {59,58};
link66[] = {60,15};
link67[] = {60,61};
link68[] = {61,27};
link68[] = {61,85};
link69[] = {62,63};
link70[] = {63,64};
link71[] = {64,65};
@ -183,8 +188,14 @@ link93[] = {82,76};
link94[] = {83,16};
link95[] = {83,22};
link96[] = {84,31};
globals[] = {0.000000,0,0,0,0,640,480,1,247,6316128,1,-279.414825,540.037537,1629.530029,374.077881,577,884,1};
window[] = {2,-1,-1,-1,-1,819,52,1036,52,3,595};
link97[] = {85,86};
link98[] = {85,87};
link99[] = {86,27};
link100[] = {87,88};
link101[] = {88,89};
link102[] = {89,68};
globals[] = {0.000000,0,0,0,0,640,480,1,258,6316128,1,-228.686249,247.871552,1378.466309,648.349915,577,884,1};
window[] = {2,-1,-1,-1,-1,845,78,1062,78,3,595};
*//*%FSM</HEAD>*/
class FSM
{
@ -517,7 +528,7 @@ class FSM
priority = 0.000000;
to="ERROR_Server_not_3";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 120"/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 30"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
@ -615,7 +626,7 @@ class FSM
priority = 0.000000;
to="ERROR_Player_Setup";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 60"/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 30"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
@ -1044,48 +1055,37 @@ class FSM
name = "Check_New_Player";
itemno = 60;
init = /*%FSM<STATEINIT""">*/"_myTime = diag_tickTime;" \n
"" \n
"player reveal _playerObject;" \n
"" \n
"_playerPos = getpos _playerObject;" \n
"" \n
"""Loading Player Inventory... Please wait!"" call Epoch_updateLoadingScreen;" \n
"progressLoadingScreen 0.6;" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "check_new__player">*/
class check_new__player
/*%FSM<LINK "check_1_new__pla">*/
class check_1_new__pla
{
itemno = 61;
priority = 0.000000;
to="Setup_Player_Obj";
to="Check_New_Player_1";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"" \n
"_state = false;" \n
condition=/*%FSM<CONDITION""">*/"_state = false;" \n
"_playerCheck = !(isNull _playerObject);" \n
"_playerCheckSetup = false;" \n
"_playerCheckObjectsReady = false;" \n
"_playerCheckFinal = false;" \n
"_PlayerPosCheck = false;" \n
"_playerCheckMass = false;" \n
"if (_playerCheck) then {" \n
" _playerCheckSetup = _playerObject getVariable [""SETUP"",false];" \n
" if (_playerCheckSetup) then {" \n
" _playerCheckObjectsReady = _playerPos nearObjectsReady 10;" \n
" if (_playerCheckObjectsReady) then {" \n
" _playerCheckFinal = (_mass isEqualTo (loadAbs _playerObject));" \n
" if (_playerCheckFinal) then {" \n
" _state = true;" \n
" };" \n
" _PlayerPosCheck = !((_playerObject getVariable [""FinalDest"",[]]) isequalto []);" \n
" if (_PlayerPosCheck) then {" \n
" _playerCheckMass = (_loadabs == (loadabs _playerObject));" \n
" if (_playerCheckMass) then {" \n
" _state = true;" \n
" };" \n
" };" \n
"};" \n
"if (_debug) then {" \n
" diag_log format[""DEBUG: Checking Player Object: %1"", [""FAILED"",""OK""] select _playerCheck];" \n
" diag_log format[""DEBUG: Checking Player is setup: %1"", [""FAILED"",""OK""] select _playerCheckSetup];" \n
" diag_log format[""DEBUG: Checking world preloaded: %1"", [""FAILED"",""OK""] select _playerCheckObjectsReady];" \n
" diag_log format[""DEBUG: Final Player mass check: %1 (%2 != %3)"", [""FAILED"",""OK""] select _playerCheckFinal, _mass, (loadAbs _playerObject)];" \n
" diag_log format[""DEBUG: Pos check: %1 == %2"", getpos _playerObject, getpos player];" \n
" diag_log format[""DEBUG: Checking Player PosVar: %1"", [""FAILED"",""OK""] select _PlayerPosCheck];" \n
" diag_log format[""DEBUG: Final Player mass check: %1 (%2 != %3)"", [""FAILED"",""OK""] select _playerCheckMass, _loadabs, (loadabs _playerObject)];" \n
"};" \n
"_state"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
@ -1098,7 +1098,7 @@ class FSM
priority = 0.000000;
to="ERROR_Server_not";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 120"/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 30"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
@ -1373,7 +1373,7 @@ class FSM
priority = 0.000000;
to="ERROR_Server_not_4";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 120"/*%FSM</CONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 30"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
@ -1388,7 +1388,7 @@ class FSM
action=/*%FSM<ACTION""">*/"_playerObject = _C_SET deleteAt 0;" \n
"_playerVariables = _C_SET deleteAt 0;" \n
"_currentWeapon = _C_SET deleteAt 0;" \n
"_mass = _C_SET deleteAt 0;" \n
"_loadabs = _C_SET deleteAt 0;" \n
"" \n
"Epoch_my_GroupUID = _C_SET deleteAt 0;" \n
"Epoch_my_tempGroupUID = """";" \n
@ -1436,6 +1436,103 @@ class FSM
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "Check_New_Player_1">*/
class Check_New_Player_1
{
name = "Check_New_Player_1";
itemno = 85;
init = /*%FSM<STATEINIT""">*/"_myTime = diag_tickTime;" \n
"_playerPos = (_playerObject getvariable [""FinalDest"",[[0,0,0],0]]) select 0;" \n
"[player,_playerobject] remoteexec [""EPOCH_server_SetFinalPlayerPos"",2];" \n
"""Setting final Player Position... Please wait!"" call Epoch_updateLoadingScreen;" \n
"progressLoadingScreen 0.7;" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "Timeout_No_Respo">*/
class Timeout_No_Respo
{
itemno = 87;
priority = 0.000000;
to="ERROR_Server_not_5";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"(diag_tickTime - _myTime) > 30"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "check_2_new__pla">*/
class check_2_new__pla
{
itemno = 86;
priority = 0.000000;
to="Setup_Player_Obj";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"_state = false;" \n
"_playerCheck = !(isNull _playerObject);" \n
"_playerCheckSetup = false;" \n
"_playerCheckObjectsReady = false;" \n
"_playerPosCheck = false;" \n
"_HiddenCheck = false;" \n
"if (_playerCheck) then {" \n
" _playerCheckSetup = _playerObject getVariable [""SETUP"",false];" \n
" if (_playerCheckSetup) then {" \n
" _playerCheckObjectsReady = _playerPos nearObjectsReady 10;" \n
" if (_playerCheckObjectsReady) then {" \n
" _playerPosCheck = (getposatl _playerObject distance _playerPos < 100);" \n
" if (_playerPosCheck) then {" \n
" _HiddenCheck = !(isObjectHidden _playerObject);" \n
" if (_HiddenCheck) then {" \n
" _state = true;" \n
" };" \n
" };" \n
" };" \n
" };" \n
"};" \n
"if (_debug) then {" \n
" diag_log format[""DEBUG: Checking Player Object: %1"", [""FAILED"",""OK""] select _playerCheck];" \n
" diag_log format[""DEBUG: Checking Player is setup: %1"", [""FAILED"",""OK""] select _playerCheckSetup];" \n
" diag_log format[""DEBUG: Checking world preloaded: %1"", [""FAILED"",""OK""] select _playerCheckObjectsReady];" \n
" diag_log format[""DEBUG: Pos check: _playerObj: %1 - Player: %2 - dist: %3"", getposatl _playerObject, _playerPos, getposatl _playerObject distance _playerPos];" \n
" diag_log format[""DEBUG: Checking is Object is visible: %1"", [""FAILED"",""OK""] select _HiddenCheck];" \n
"};" \n
"_state"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
/*%FSM<STATE "ERROR_Server_not_5">*/
class ERROR_Server_not_5
{
name = "ERROR_Server_not_5";
itemno = 88;
init = /*%FSM<STATEINIT""">*/"_msg = ""Authentication Failed, Disconnect and try again"";" \n
"_msg call Epoch_updateLoadingScreen;" \n
"diag_log _msg;" \n
"" \n
"_rejectPlayer = {" \n
" PLAYER_REJECT_NoResponse2 = true;" \n
" publicVariableServer ""PLAYER_REJECT_NoResponse2"";" \n
"};"/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
/*%FSM<LINK "true">*/
class true
{
itemno = 32;
priority = 0.000000;
to="Display_Message";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"true"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
};
};
/*%FSM</STATE>*/
};
initState="INIT";
finalStates[] =

View File

@ -26,6 +26,11 @@ class CfgRemoteExec
{
mode = 1;
jip = 0;
class EPOCH_server_SetFinalPlayerPos
{
allowedTargets=2;
jip = 0;
};
class bis_fnc_reviveinitaddplayer
{
allowedTargets = 2;

View File

@ -0,0 +1,43 @@
/*
Author: He-Man - EpochMod.com
Contributors:
Description:
Set final Player position on login
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server/compile/epoch_player/EPOCH_server_SetFinalPlayerPos.sqf
*/
params ["_player","_newPlyr"];
private ["_finalpos","_fallbackpos"];
if (isnull _player || isnull _newPlyr) exitwith {
diag_log "DEBUG: SetFinalPlayerPos failed - Player or PlayerObj is Null";
};
if !(typeof _player isequalto "VirtualMan_EPOCH") exitwith {
diag_log "DEBUG: SetFinalPlayerPos failed - PlayerObj != VirtualMan_EPOCH";
};
_finalpos = _newPlyr getvariable ["FinalDest",[]];
if (_finalpos isequalto []) exitwith {
diag_log "DEBUG: SetFinalPlayerPos failed - No FinalPos Variable set";
};
if !(_finalpos isequaltype []) exitwith {
diag_log "DEBUG: SetFinalPlayerPos failed - FinalPos is not an Array";
};
if (count _finalpos < 2) exitwith {
diag_log "DEBUG: SetFinalPlayerPos failed - count FinalPos < 2";
};
_fallbackpos = getmarkerpos "respawn_west";
_fallbackpos set [2,0];
_finalpos params [["_location",_fallbackpos],["_dir",0]];
_newPlyr setDir _dir;
_newPlyr setPosATL _location;
_newPlyr setVariable["SETUP", true, true];
_player setPosATL _location;
_newPlyr allowdamage true;
_newPlyr hideobjectglobal false;

View File

@ -61,7 +61,7 @@ if (_playerObj isEqualType objNull) then {
[_fsmHandle,['_checkPlayer_PVC', _dead]] remoteExecCall ['setFSMVariable', _playerObj];
if (!_dead) then { //Load old Char
[_playerObj, _isMale, _fsmHandle] call EPOCH_server_loadPlayer;
[_playerObj, _isMale, _fsmHandle, _arr] call EPOCH_server_loadPlayer;
};
};
};

View File

@ -17,7 +17,7 @@ private ["_Primary","_CheckLocation","_allGroupMembers","_alreadyDead","_assigne
//[[[end]]]
_reject = true;
params [["_player",objNull,[objNull]],["_isMale",true],["_fsmHandle",0]];
params [["_player",objNull,[objNull]],["_isMale",true],["_fsmHandle",0],["_playerData",[]]];
if (!isNull _player) then {
@ -30,16 +30,17 @@ if (!isNull _player) then {
if (_playerUID != "") then {
// Make Hive call
_playerData = [];
(["Player", _playerUID] call EPOCH_fnc_server_hiveGETRANGE) params [
["_status", 0 ],
["_playerDataTmp", [] ]
];
if (_status == 1 && _playerDataTmp isEqualType []) then {
_playerData = _playerDataTmp;
if (_playerdata isequalto []) then {
// Make Hive call
(["Player", _playerUID] call EPOCH_fnc_server_hiveGETRANGE) params [
["_status", 0 ],
["_playerDataTmp", [] ]
];
if (_status == 1 && _playerDataTmp isEqualType []) then {
_playerData = _playerDataTmp;
};
};
// Apperance defaults
_uniform = [_serverSettingsConfig, "defaultUniformFemale", "U_Test_uniform"] call EPOCH_fnc_returnConfigEntry;
_class = "Epoch_Female_F";
@ -178,6 +179,7 @@ if (!isNull _player) then {
};
_newPlyr = _group createUnit[_class, getMarkerPos "respawn_west", [], 0, "CAN_COLLIDE"];
_newPlyr hideobjectglobal true;
if !(isNull _newPlyr) then {
// disable AI on temp unit
@ -198,122 +200,14 @@ if (!isNull _player) then {
_newPlyr allowDamage false;
// set player loadout
if (_schemaVersion >= 1.0) then {
_playerData params ["","","_appearance","","","_loadout"];
// get current weapon to send to param for selectWeapon
_currentWeapon = _appearance param [4,""];
_playerData params ["","","_appearance","","","_loadout"];
// get current weapon to send to param for selectWeapon
_currentWeapon = _appearance param [4,""];
// _newPlyr setUnitLoadout [_loadout, false];
// Workaround for Client / Server synchronizing issue in SetUnitLoadout
[_newPlyr,_loadout] call Epoch_server_SetUnitLoadout;
diag_log format["DEBUG: loaded player %1 with new schema Version %2", _newPlyr, _schemaVersion];
} else {
// Legacy code start
// Apperance + Weapons
_playerData params ["","","_appearance","","","_weaponsAndItems","_linkedItems","_normalMagazines","_itemsInContainers","_weaponsInContainers"];
// load Apperance
_appearance params ["_goggles","_headgear","_vest","_backpack","_uniform"];
// old data format for 0.5 and prior.
// Load Apperance START
if (_uniform != "") then {
_newPlyr addUniform _uniform;
};
if (_backpack != "") then {
_newPlyr addBackpack _backpack;
};
if (_goggles != "") then {
_newPlyr addGoggles _goggles;
};
if (_headgear != "") then {
_newPlyr addHeadgear _headgear;
};
if (_vest != "") then {
_newPlyr addVest _vest;
};
// Load Apperance END
// Load inventory + defaults START
if (count _weaponsAndItems >= 3) then {
_weaponsAndItems params ["_currentWeaponTmp","_weaponsAndItemsArray","_equipped"];
_currentWeapon = _currentWeaponTmp;
{
_weapon = _x deleteAt 0;
_type = getNumber(configfile >> "cfgweapons" >> _weapon >> "type");
_attachments = [];
_wMags = false;
_wMagsArray = [];
// suppressor, laser, optics, magazines(array), bipods
{
// magazines
if (_x isEqualType []) then{
_wMags = true;
_wMagsArray pushback _x;
} else {
// attachments
if (_x != "") then{
_attachments pushBack _x;
};
};
} forEach _x;
if (_wMags) then {
{
_newPlyr addMagazine _x;
} foreach _wMagsArray;
};
// add weapon if equiped
if (_weapon in _equipped) then {
_equipped = _equipped - [_weapon];
if (_weapon != "") then {
_newPlyr addWeapon _weapon;
};
switch (_type) do {
case 1: { // primary
removeAllPrimaryWeaponItems _newPlyr;
{ _newPlyr addPrimaryWeaponItem _x } forEach _attachments;
};
case 2: { // handgun
removeAllHandgunItems _newPlyr;
{ _newPlyr addHandgunItem _x } forEach _attachments;
};
case 4: { // secondary
// removeAllSecondaryWeaponItems player; does not exist ?
{
_newPlyr removeSecondaryWeaponItem _x;
} forEach (secondaryWeaponItems _newPlyr);
{ _newPlyr addSecondaryWeaponItem _x } forEach _attachments;
};
};
}else{
{
_newPlyr addItem _x;
} forEach _attachments;
};
} forEach _weaponsAndItemsArray;
};
// Linked items
{
if (_x in["Binocular", "Rangefinder","Laserdesignator","Laserdesignator_02","Laserdesignator_03","Laserdesignator_01_khk_F","Laserdesignator_02_ghex_F"]) then {
_newPlyr addWeapon _x;
} else {
_newPlyr linkItem _x;
};
} forEach _linkedItems;
// add items to containers
[_newPlyr, _itemsInContainers] call EPOCH_fnc_addItemToX;
// add weapons to containers
[_newPlyr, _weaponsInContainers] call EPOCH_fnc_addItemToX;
// Add magazines
{_newPlyr addMagazine _x} forEach _normalMagazines;
// Load inventory + defaults END
// Legacy code stop
};
// Workaround for Client / Server synchronizing issue in SetUnitLoadout
[_newPlyr,_loadout] call Epoch_server_SetUnitLoadout;
_loadabs = loadabs _newPlyr;
// Final Push
if (isNull _player) then {
@ -350,21 +244,14 @@ if (!isNull _player) then {
_newPlyr setVariable["COMMUNITY_STATS", _communityStats];
// Flag new body as ready for use.
_newPlyr setVariable["SETUP", true, true];
_newPlyr setVariable["FinalDest", [_location,_dir], true];
// Send message to player so they can take over the new body.
_player setPosATL _location;
_newPlyr setDir _dir;
_newPlyr setPosATL _location;
[_playerNetID, _playerUID, [_newPlyr, _vars, _currentWeapon, loadAbs _newPlyr, _playerGroup, _canBeRevived, _newPlyr call EPOCH_server_setPToken,_playerGroupArray, _communityStats, _hitpoints], _fsmHandle, _player] call EPOCH_server_pushPlayer;
// diag_log str([_playerNetID, _playerUID, _player, [_newPlyr, (_player isEqualTo _newPlyr), _vars, _currentWeapon, loadAbs _newPlyr, _playerGroup, _canBeRevived, [],_playerGroupArray, _communityStats, _hitpoints], _fsmHandle]);
[_playerNetID, _playerUID, [_newPlyr, _vars, _currentWeapon, _loadabs, _playerGroup, _canBeRevived, _newPlyr call EPOCH_server_setPToken,_playerGroupArray, _communityStats, _hitpoints], _fsmHandle, _player] call EPOCH_server_pushPlayer;
// revive test
_newPlyr setVariable ['#rev_enabled', true, true];
// [] remoteExec ["bis_fnc_reviveInit",_player];
// re enable damage server side
_newPlyr allowDamage true;
// new Dynamicsimulation
if([configFile >> "CfgEpochServer", "playerDynamicSimulationSystem", true] call EPOCH_fnc_returnConfigEntry)then

View File

@ -95,9 +95,11 @@ if (_allowSave) then{
// change this if needed
_schemaVersion = 1.0;
// save player
_return = ["Player", _playerUID, EPOCH_expiresPlayer, [[getDir _player, _pos, (call EPOCH_fn_InstanceID), _schemaVersion], _medical, _appearance, _server_vars, _vars, _loadout, [], [], [], [], _group, _revive]] call EPOCH_fnc_server_hiveSETEX;
// Finally check, if Loadout is a valid Array (will never return an empty Array on units!)
if !(_loadout isequalto []) then {
// save player
_return = ["Player", _playerUID, EPOCH_expiresPlayer, [[getDir _player, _pos, (call EPOCH_fn_InstanceID), _schemaVersion], _medical, _appearance, _server_vars, _vars, _loadout, [], [], [], [], _group, _revive]] call EPOCH_fnc_server_hiveSETEX;
};
// save community stats
_stats = _player getVariable["COMMUNITY_STATS", EPOCH_defaultStatVars];
_return2 = ["CommunityStats", _playerUID, EPOCH_expiresCommunityStats, [_stats]] call EPOCH_fnc_server_hiveSETEX;

View File

@ -74,6 +74,7 @@ class CfgServerFunctions
class server_PayCrypto{};
class fnc_updatePlayerStats{};
class server_updatePlayerStats{};
class server_SetFinalPlayerPos{};
};
class epoch_traders {
class server_loadTraders {};