diff --git a/Sources/epoch_code/System/player_login.fsm b/Sources/epoch_code/System/player_login.fsm index 3c08596f..40eb0198 100644 --- a/Sources/epoch_code/System/player_login.fsm +++ b/Sources/epoch_code/System/player_login.fsm @@ -1,8 +1,8 @@ -/*%FSM*/ +/*%FSM*/ /*%FSM*/ /* -item0[] = {"INIT",0,4346,-25.000000,-375.000000,75.000000,-325.000000,0.000000,"INIT"}; -item1[] = {"FINISH",1,250,-25.000000,1475.000000,75.000000,1525.000000,0.000000,"FINISH"}; +item0[] = {"INIT",0,250,-25.000000,-375.000000,75.000000,-325.000000,0.000000,"INIT"}; +item1[] = {"FINISH",1,4346,-25.000000,1475.000000,75.000000,1525.000000,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"}; @@ -183,1171 +183,1256 @@ 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,-328.063843,350.313202,140.961456,-412.815704,813,880,1}; -window[] = {2,-1,-1,-1,-1,897,-1550,-566,130,3,831}; +globals[] = {0.000000,0,0,0,0,640,480,1,247,6316128,1,-534.004700,883.834412,1895.573975,986.017029,1287,884,1}; +window[] = {2,-1,-1,-32000,-32000,1149,2931,3915,382,3,1305}; *//*%FSM*/ class FSM { - fsmName = "Epoch Login"; - class States - { - /*%FSM*/ - class INIT - { - name = "INIT"; - init = /*%FSM*/"titleCut ["""", ""BLACK FADED"", 1337];" \n - "0 fadeSound 0;" \n - "//player enableSimulation false;" \n - "" \n - "_debug = true;" \n - "_myTime = diag_tickTime;" \n - "if (_debug) then {" \n - " diag_log ""EPOCH-LOGIN: Init"";" \n - "};" \n - "" \n - "_finalPlayerObjectCheck = {" \n - " (_mass == (loadAbs _playerObject))" \n - "};" \n - "" \n - "EPOCH_loginFSM = _thisFSM;" \n - "EPOCH_playerLoginInit = {" \n - " EPOCH_loginFSM setFSMVariable [_this select 0, _this select 1];" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true + fsmName = "Epoch Login"; + class States { - priority = 0.000000; - to="Process_1"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; + /*%FSM*/ + class INIT + { + name = "INIT"; + itemno = 0; + init = /*%FSM*/"titleCut ["""", ""BLACK FADED"", 1337];" \n + "0 fadeSound 0;" \n + "//player enableSimulation false;" \n + "" \n + "_debug = true;" \n + "_myTime = diag_tickTime;" \n + "if (_debug) then {" \n + " diag_log ""EPOCH-LOGIN: Init"";" \n + "};" \n + "" \n + "_finalPlayerObjectCheck = {" \n + " (_mass == (loadAbs _playerObject))" \n + "};" \n + "" \n + "EPOCH_loginFSM = _thisFSM;" \n + "EPOCH_playerLoginInit = {" \n + " EPOCH_loginFSM setFSMVariable [_this select 0, _this select 1];" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 62; + priority = 0.000000; + to="Process_1"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class FINISH + { + name = "FINISH"; + itemno = 1; + init = /*%FSM*/"[] spawn {" \n + " disableSerialization;" \n + " waitUntil{!isNull (findDisplay 46)};" \n + " _display = findDisplay 46;" \n + " {" \n + " _display displayAddEventHandler [_x,([""CfgEpochClient"", _x, """"] call EPOCH_fnc_returnConfigEntryV2)];" \n + " } forEach ([""CfgEpochClient"", ""displayAddEventHandler"", []] call EPOCH_fnc_returnConfigEntryV2);" \n + " call epoch_dynamicHUD_start; " \n + " player switchMove """";" \n + "};" \n + "" \n + "3 fadeSound 1;" \n + "" \n + "if (_debug) then {" \n + " diag_log ""EPOCH-LOGIN: Finish!"";" \n + "};" \n + "" \n + "EPOCH_loginFSM = nil;" \n + "EPOCH_playerLoginInit = nil;" \n + "" \n + "//player enableSimulation true;" \n + "" \n + "titleCut ["""", ""BLACK IN"", 1];" \n + "1338 cutText ["""",""PLAIN"",0]; " \n + "" \n + "progressLoadingScreen 1.0;" \n + "" \n + "endLoadingScreen;" \n + "EPOCH_loadingScreenDone = true;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + /*%FSM*/ + class Version_Check + { + name = "Version_Check"; + itemno = 3; + init = /*%FSM*/"if (_debug) then {" \n + " diag_log ""EPOCH-LOGIN: Version Check"";" \n + "};" \n + "" \n + "// SHOULD BE:" \n + "_epoch_assets0 = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_assets"");" \n + "_epoch_assets1 = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_assets_1"");" \n + "_epoch_assets2 = getText(configFile >> ""Epoch"" >> ""Version"" >> ""epoch_objects"");" \n + "_epoch_assets3 = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_assets_3"");" \n + "_epoch_config = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_config"");" \n + "_epoch_language = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_language"");" \n + "_epoch_underground = getText(configFile >> ""Epoch"" >> ""Version"" >> ""Underground_Epoch"");" \n + "_epoch_vehicles = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_vehicles"");" \n + "_epoch_weapons = getText(configFile >> ""Epoch"" >> ""Version"" >> ""a3_epoch_weapons"");" \n + "" \n + "" \n + "// IS:" \n + "_my_epoch_assets0 = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_assets"" >> ""epochVersion"");" \n + "_my_epoch_assets1 = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_assets_1"" >> ""epochVersion"");" \n + "_my_epoch_assets2 = getText(configFile >> ""CfgPatches"" >> ""epoch_objects"" >> ""epochVersion"");" \n + "_my_epoch_assets3 = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_assets_3"" >> ""epochVersion"");" \n + "_my_epoch_config = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_config"" >> ""epochVersion"");" \n + "_my_epoch_language = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_language"" >> ""epochVersion"");" \n + "_my_epoch_underground = getText(configFile >> ""CfgPatches"" >> ""Underground_Epoch"" >> ""epochVersion"");" \n + "_my_epoch_vehicles = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_vehicles"" >> ""epochVersion"");" \n + "_my_epoch_weapons = getText(configFile >> ""CfgPatches"" >> ""a3_epoch_weapons"" >> ""epochVersion"");" \n + "" \n + "progressLoadingScreen 0.1;" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Wrong_Version + { + itemno = 7; + priority = 10.000000; + to="ERROR_Wrong_Version"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_epoch_assets0 != _epoch_assets0 ||" \n + "_my_epoch_assets1 != _epoch_assets1 ||" \n + "_my_epoch_assets2 != _epoch_assets2 ||" \n + "_my_epoch_assets3 != _epoch_assets3 ||" \n + "_my_epoch_config != _epoch_config ||" \n + "_my_epoch_language != _epoch_language ||" \n + "_my_epoch_underground != _epoch_underground ||" \n + "_my_epoch_vehicles != _epoch_vehicles ||" \n + "_my_epoch_weapons != _epoch_weapons"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class true + { + itemno = 44; + priority = 0.000000; + to="Arma_Version_Che"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Check_Player_UID + { + name = "Check_Player_UID"; + itemno = 5; + init = /*%FSM*/"if (_debug) then {" \n + " diag_log ""EPOCH-LOGIN: Check PlayerUID"";" \n + "};" \n + "" \n + "_playerUID = getPlayerUID player;" \n + "" \n + "progressLoadingScreen 0.2;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class PlayerUID_Okay + { + itemno = 6; + priority = 10.000000; + to="Check_Server_1"; + precondition = /*%FSM*/"!isNil ""_playerUID"""/*%FSM*/; + condition=/*%FSM*/"_playerUID != """""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Empty_PlayerUID + { + itemno = 12; + priority = 0.000000; + to="ERROR_PlayerUID"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ERROR_Wrong_Version + { + name = "ERROR_Wrong_Version"; + itemno = 9; + init = /*%FSM*/"_msg = ""You have an outdated version of Epoch"";" \n + "_msg call Epoch_updateLoadingScreen;" \n + "diag_log _msg;" \n + "" \n + "_rejectPlayer = {" \n + " PLAYER_REJECT_EPOCHVERSION = true;" \n + " publicVariableServer ""PLAYER_REJECT_EPOCHVERSION"";" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 32; + priority = 0.000000; + to="Display_Message"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Disconnect + { + name = "Disconnect"; + itemno = 10; + init = /*%FSM*/"endLoadingScreen;" \n + "1338 cutText [_msg,""PLAIN"",0]; " \n + "deleteVehicle player;" \n + "call _rejectPlayer;" \n + "_myTime = diag_tickTime;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Check_if_Player + { + itemno = 28; + priority = 0.000000; + to="Reject_without_B"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 2"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ERROR_PlayerUID + { + name = "ERROR_PlayerUID"; + itemno = 13; + init = /*%FSM*/"_msg = ""Can not setup Player Object! (Error 01)"";" \n + "_msg call Epoch_updateLoadingScreen;" \n + "diag_log _msg;" \n + "" \n + "_rejectPlayer = {" \n + " PLAYER_REJECT_UID = true;" \n + " publicVariableServer ""PLAYER_REJECT_UID"";" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 32; + priority = 0.000000; + to="Display_Message"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Setup_Player_Var + { + name = "Setup_Player_Var"; + itemno = 17; + init = /*%FSM*/"diag_log format[""DEBUG TIME WAITED: %1"", (diag_tickTime - _myTime)];" \n + "{" \n + " missionNamespace setVariable[(format[""EPOCH_player%1"", EPOCH_customVars select _forEachIndex]), _x];" \n + "} forEach _playerVariables;" \n + """Loading Player Variables... Please wait!"" call Epoch_updateLoadingScreen;" \n + "progressLoadingScreen 0.7;" \n + "if (_debug) then {" \n + " diag_log ""EPOCH-LOGIN: Setup Player Variables"";" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 24; + priority = 0.000000; + to="Setup_EH_s_and_H"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Request_Hive + { + name = "Request_Hive"; + itemno = 18; + init = /*%FSM*/"_myTime = diag_tickTime;" \n + "" \n + "[player] remoteExec [""EPOCH_server_checkPlayer"",2];" \n + "" \n + """Loading Player Data... Please wait!"" call Epoch_updateLoadingScreen;" \n + "progressLoadingScreen 0.5;" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Hive_Response + { + itemno = 75; + priority = 0.000000; + to="Process_2"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!isNil ""_checkPlayer_PVC"""/*%FSM*/; + action=/*%FSM*/"_newChar = _checkPlayer_PVC;" \n + "_checkPlayer_PVC = nil;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Timeout_No_Respo + { + itemno = 19; + priority = 0.000000; + to="ERROR_Server_not_3"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 120"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ERROR_Server_not + { + name = "ERROR_Server_not"; + itemno = 20; + init = /*%FSM*/"_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*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 32; + priority = 0.000000; + to="Display_Message"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ERROR_Wrong_Server + { + name = "ERROR_Wrong_Server"; + itemno = 25; + init = /*%FSM*/"_msg = format[""Server and Client running with different Version! (You: %1 // Server: %2)"",getText(configFile >> ""CfgMods"" >> ""Epoch"" >> ""version""),_serverVersion];" \n + "_msg call Epoch_updateLoadingScreen;" \n + "diag_log _msg;" \n + "" \n + "_rejectPlayer = {" \n + " PLAYER_REJECT_ServerVersion = true;" \n + " publicVariableServer ""PLAYER_REJECT_ServerVersion"";" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 32; + priority = 0.000000; + to="Display_Message"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Setup_Player_Obj + { + name = "Setup_Player_Obj"; + itemno = 27; + init = /*%FSM*/"_ply = player;" \n + "_group = group player;" \n + "" \n + "selectPlayer _playerObject;" \n + "" \n + "deleteVehicle _ply;" \n + "deleteGroup _group;" \n + "" \n + """Loading Player Body... Please wait!"" call Epoch_updateLoadingScreen;" \n + "progressLoadingScreen 0.8;" \n + "" \n + "if (_debug) then {" \n + " diag_log ""EPOCH-LOGIN: Setup Player Object"";" \n + "};" \n + "" \n + "_myTime = diag_tickTime;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Timeout_ + { + itemno = 66; + priority = 0.000000; + to="ERROR_Player_Setup"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 60"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class new_player_____p + { + itemno = 49; + priority = 0.000000; + to="Setup_Player_Var"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_playerObject == player"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Display_Message + { + name = "Display_Message"; + itemno = 33; + init = /*%FSM*/"[] spawn {" \n + " waitUntil{!isNull (findDisplay 46)};" \n + " (findDisplay 46) displayAddEventHandler [""KeyDown"",""true""];" \n + " (findDisplay 46) displayAddEventHandler [""KeyUp"",""true""];" \n + "};" \n + "_myTime = diag_tickTime;" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Display_Message + { + itemno = 26; + priority = 0.000000; + to="Disconnect"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 10"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Check_Server + { + name = "Check_Server"; + itemno = 35; + init = /*%FSM*/"_myTime = diag_tickTime;" \n + "if (_debug) then {" \n + " diag_log ""EPOCH-LOGIN: Check Server"";" \n + "};" \n + """Checking Server... Please wait!"" call Epoch_updateLoadingScreen;" \n + "progressLoadingScreen 0.4;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Server_not_worki + { + itemno = 36; + priority = 10.000000; + to="ERROR_Server_not_1"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!isNil ""EPOCH_BADHIVE""" \n + ""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Server_Okay + { + itemno = 11; + priority = 0.000000; + to="Server_Version_C"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!isNil ""Epoch_ServerVersion"""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ERROR_Server_not_1 + { + name = "ERROR_Server_not_1"; + itemno = 37; + init = /*%FSM*/"_msg = ""Server not Ready (Error 03)"";" \n + "_msg call Epoch_updateLoadingScreen;" \n + "diag_log _msg;" \n + "" \n + "_rejectPlayer = {" \n + " PLAYER_REJECT_NotReady2 = true;" \n + " publicVariableServer ""PLAYER_REJECT_NotReady2"";" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 32; + priority = 0.000000; + to="Display_Message"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Check_Server_1 + { + name = "Check_Server_1"; + itemno = 39; + init = /*%FSM*/"progressLoadingScreen 0.3;" \n + """Server initializing... Please wait!"" call Epoch_updateLoadingScreen;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Timeout_No_Respo + { + itemno = 40; + priority = 0.000000; + to="ERROR_Server_not_2"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 180"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Server_Ready + { + itemno = 34; + priority = 0.000000; + to="Check_Server"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!isNil ""EPOCH_SERVER_READY"""/*%FSM*/; + action=/*%FSM*/"EPOCH_SERVER_READY = nil;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ERROR_Server_not_2 + { + name = "ERROR_Server_not_2"; + itemno = 41; + init = /*%FSM*/"_msg = ""Server not Ready (Error 02)"";" \n + "_msg call Epoch_updateLoadingScreen;" \n + "diag_log _msg;" \n + "" \n + "_rejectPlayer = {" \n + " PLAYER_REJECT_NotReady1 = true;" \n + " publicVariableServer ""PLAYER_REJECT_NotReady1"";" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 32; + priority = 0.000000; + to="Display_Message"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Reject_without_B + { + name = "Reject_without_B"; + itemno = 43; + init = /*%FSM*/"[] spawn {" \n + " waitUntil{!isNull (findDisplay 46)};" \n + " waitUntil {" \n + " (findDisplay 46) closeDisplay 0;" \n + " isNull (findDisplay 46)" \n + " };" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + }; + }; + /*%FSM*/ + /*%FSM*/ + class Arma_Version_Che + { + name = "Arma_Version_Che"; + itemno = 45; + init = /*%FSM*/"progressLoadingScreen 0.15;" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Outdated_Version + { + itemno = 46; + priority = 10.000000; + to="ERROR_Wrong_Version_1"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"productVersion select 2 < getNumber(configFile >> ""CfgMods"" >> ""Epoch"" >> ""ArmAVersion"")"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Player_Object_Re + { + itemno = 4; + priority = 0.000000; + to="Check_Player_UID"; + precondition = /*%FSM*/"!isNull player"/*%FSM*/; + condition=/*%FSM*/"player == player"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ERROR_Wrong_Version_1 + { + name = "ERROR_Wrong_Version_1"; + itemno = 47; + init = /*%FSM*/"_msg = ""You have an outdated version of ArmA 3"";" \n + "_msg call Epoch_updateLoadingScreen;" \n + "diag_log _msg;" \n + "" \n + "_rejectPlayer = {" \n + " PLAYER_REJECT_ARMAVERSION = true;" \n + " publicVariableServer ""PLAYER_REJECT_ARMAVERSION"";" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 32; + priority = 0.000000; + to="Display_Message"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Setup_EH_s_and_H + { + name = "Setup_EH_s_and_H"; + itemno = 50; + init = /*%FSM*/"{" \n + " player addEventHandler [_x,([""CfgEpochClient"", _x, """"] call EPOCH_fnc_returnConfigEntryV2)];" \n + "} forEach ([""CfgEpochClient"", ""addEventHandler"", []] call EPOCH_fnc_returnConfigEntryV2);" \n + "" \n + "if (count EPOCH_playerHitPoints isEqualTo count ((getAllHitPointsDamage player) param [0,[]])) then {" \n + " {" \n + " player setHitIndex [_forEachIndex, _x];" \n + " }forEach EPOCH_playerHitPoints;" \n + "};" \n + "" \n + "[] spawn EPOCH_masterLoop;" \n + "true call EPOCH_fnc_Weather;" \n + "[5,100] spawn EPOCH_niteLight;" \n + "" \n + "if (_debug) then {" \n + " diag_log ""EPOCH-LOGIN: Setup EH's"";" \n + "};" \n + "" \n + """Loading... Please wait!"" call Epoch_updateLoadingScreen;" \n + "progressLoadingScreen 0.9;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Has_Current_Weap + { + itemno = 53; + priority = 10.000000; + to="Find_Active_Weap"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_currentWeapon != """""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class no_weapons + { + itemno = 51; + priority = 0.000000; + to="Process"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_currentWeapon == """""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Process + { + name = "Process"; + itemno = 52; + init = /*%FSM*/"progressLoadingScreen 0.975;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Preload_done + { + itemno = 29; + priority = 0.000000; + to="FINISH"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"preloadCamera _playerPos"/*%FSM*/; + action=/*%FSM*/"call compile _extraPayload;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Find_Active_Weap + { + name = "Find_Active_Weap"; + itemno = 54; + init = /*%FSM*/"_activeWeapon = currentWeapon player;" \n + "progressLoadingScreen 0.95;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Current_Weapon_S + { + itemno = 56; + priority = 0.000000; + to="Do_nothing"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_activeWeapon == _currentWeapon"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Current_Weapon_Not + { + itemno = 55; + priority = 0.000000; + to="Select_Weapon"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_activeWeapon != _currentWeapon"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Select_Weapon + { + name = "Select_Weapon"; + itemno = 57; + init = /*%FSM*/"_currentWeapon spawn {" \n + " uiSleep 1; " \n + " player selectWeapon _this;" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 58; + priority = 0.000000; + to="Process"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Do_nothing + { + name = "Do_nothing"; + itemno = 59; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 58; + priority = 0.000000; + to="Process"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Check_New_Player + { + name = "Check_New_Player"; + itemno = 60; + init = /*%FSM*/"_myTime = diag_tickTime;" \n + "" \n + "player reveal _playerObject;" \n + "" \n + "_playerPos = getpos _playerObject;" \n + "" \n + "" \n + """Loading Player Inventory... Please wait!"" call Epoch_updateLoadingScreen;" \n + "progressLoadingScreen 0.6;" \n + ""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class check_new__player + { + itemno = 61; + priority = 0.000000; + to="Setup_Player_Obj"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!(isNull _playerObject) && {_playerObject getVariable [""SETUP"",false]} && {_playerPos nearObjectsReady 10} && {call _finalPlayerObjectCheck}"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Timeout_No_Respo + { + itemno = 15; + priority = 0.000000; + to="ERROR_Server_not"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 120"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Process_1 + { + name = "Process_1"; + itemno = 63; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Wait_ArmA_Loading + { + itemno = 64; + priority = 0.000000; + to="Start_Loading_Sc"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!(call BIS_fnc_isLoading)"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Start_Loading_Sc + { + name = "Start_Loading_Sc"; + itemno = 65; + init = /*%FSM*/"startLoadingScreen ["""",""EpochLoadingScreen""];" \n + "if (_debug) then {" \n + " diag_log ""EPOCH-LOGIN: Start Loadingscreen"";" \n + "};" \n + """Starting Epoch... Please wait!"" call Epoch_updateLoadingScreen;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 2; + priority = 0.000000; + to="Version_Check"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ERROR_Player_Setup + { + name = "ERROR_Player_Setup"; + itemno = 67; + init = /*%FSM*/"_msg = ""Problem setting up player"";" \n + "_msg call Epoch_updateLoadingScreen;" \n + "diag_log _msg;" \n + "" \n + "_rejectPlayer = {" \n + " PLAYER_REJECT_InvaildSetup = true;" \n + " publicVariableServer ""PLAYER_REJECT_InvaildSetup"";" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 32; + priority = 0.000000; + to="Display_Message"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Server_Version_C + { + name = "Server_Version_C"; + itemno = 69; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Wrong_Server_Ver + { + itemno = 23; + priority = 10.000000; + to="ERROR_Wrong_Server"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"Epoch_ServerVersion != getText(configFile >> ""CfgMods"" >> ""Epoch"" >> ""version"")"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Version_Okay + { + itemno = 70; + priority = 0.000000; + to="Request_Hive"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ERROR_Server_not_3 + { + name = "ERROR_Server_not_3"; + itemno = 72; + init = /*%FSM*/"_msg = ""Authentication Failed, Disconnect and try again"";" \n + "_msg call Epoch_updateLoadingScreen;" \n + "diag_log _msg;" \n + "" \n + "_rejectPlayer = {" \n + " PLAYER_REJECT_HiveNotResponse = true;" \n + " publicVariableServer ""PLAYER_REJECT_HiveNotResponse"";" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 32; + priority = 0.000000; + to="Display_Message"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Process_2 + { + name = "Process_2"; + itemno = 77; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class new_character + { + itemno = 74; + priority = 10.000000; + to="Open_Gender_Selection"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"_newChar"/*%FSM*/; + action=/*%FSM*/"endLoadingScreen;" \n + "_myGenderTime = diag_tickTime;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class load_old_charact + { + itemno = 76; + priority = 0.000000; + to="Process_3"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/"_myTime = diag_tickTime;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Open_Gender_Selection + { + name = "Open_Gender_Selection"; + itemno = 78; + init = /*%FSM*/"createdialog ""SelectGender"";"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Gender_Selected + { + itemno = 80; + priority = 10.000000; + to="Send_character_s"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!isNil ""EPOCH_PlayerIsMale"""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Timeout + { + itemno = 81; + priority = 0.000000; + to="Send_character_s"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"((diag_tickTime - _myGenderTime) > 30)"/*%FSM*/; + action=/*%FSM*/"EPOCH_PlayerIsMale = true;" \n + "closeDialog 0;"/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Reopen_when_client + { + itemno = 79; + priority = 0.000000; + to="Open_Gender_Selection"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!dialog && isNil ""EPOCH_PlayerIsMale"""/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Send_character_s + { + name = "Send_character_s"; + itemno = 82; + init = /*%FSM*/"startLoadingScreen ["""",""EpochLoadingScreen""];" \n + """Gender Selected... Please wait!"" call Epoch_updateLoadingScreen;" \n + "" \n + "[player,EPOCH_PlayerIsMale] remoteExec [""EPOCH_server_loadPlayer"",2];" \n + "EPOCH_PlayerIsMale = nil;"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class load_old_charact + { + itemno = 76; + priority = 0.000000; + to="Process_3"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/""/*%FSM*/; + action=/*%FSM*/"_myTime = diag_tickTime;"/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class Process_3 + { + name = "Process_3"; + itemno = 83; + init = /*%FSM*/""/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class Timeout_No_Respo + { + itemno = 22; + priority = 0.000000; + to="ERROR_Server_not_4"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"(diag_tickTime - _myTime) > 120"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + /*%FSM*/ + class Response + { + itemno = 16; + priority = 0.000000; + to="Check_New_Player"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"!isNil ""_C_SET"""/*%FSM*/; + action=/*%FSM*/"_playerObject = _C_SET deleteAt 0;" \n + "_playerVariables = _C_SET deleteAt 0;" \n + "_currentWeapon = _C_SET deleteAt 0;" \n + "_mass = _C_SET deleteAt 0;" \n + "" \n + "Epoch_my_GroupUID = _C_SET deleteAt 0;" \n + "Epoch_canBeRevived = _C_SET deleteAt 0;" \n + "Epoch_personalToken = _C_SET deleteAt 0;" \n + "Epoch_my_Group = _C_SET deleteAt 0;" \n + "" \n + "_extraPayload = _C_SET deleteAt 0;" \n + "" \n + ""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ + /*%FSM*/ + class ERROR_Server_not_4 + { + name = "ERROR_Server_not_4"; + itemno = 84; + init = /*%FSM*/"_msg = ""Authentication Failed, Disconnect and try again"";" \n + "_msg call Epoch_updateLoadingScreen;" \n + "diag_log _msg;" \n + "" \n + "_rejectPlayer = {" \n + " PLAYER_REJECT_HiveLoadChar = true;" \n + " publicVariableServer ""PLAYER_REJECT_HiveLoadChar"";" \n + "};"/*%FSM*/; + precondition = /*%FSM*/""/*%FSM*/; + class Links + { + /*%FSM*/ + class true + { + itemno = 32; + priority = 0.000000; + to="Display_Message"; + precondition = /*%FSM*/""/*%FSM*/; + condition=/*%FSM*/"true"/*%FSM*/; + action=/*%FSM*/""/*%FSM*/; + }; + /*%FSM*/ + }; + }; + /*%FSM*/ }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class FINISH - { - name = "FINISH"; - init = /*%FSM*/"[] spawn {" \n - " disableSerialization;" \n - " waitUntil{!isNull (findDisplay 46)};" \n - " _display = findDisplay 46;" \n - " {" \n - " _display displayAddEventHandler [_x,([""CfgEpochClient"", _x, """"] call EPOCH_fnc_returnConfigEntryV2)];" \n - " } forEach ([""CfgEpochClient"", ""displayAddEventHandler"", []] call EPOCH_fnc_returnConfigEntryV2);" \n - " " \n - " player switchMove """";" \n - "};" \n - "" \n - "3 fadeSound 1;" \n - "" \n - "if (_debug) then {" \n - " diag_log ""EPOCH-LOGIN: Finish!"";" \n - "};" \n - "" \n - "EPOCH_loginFSM = nil;" \n - "EPOCH_playerLoginInit = nil;" \n - "" \n - "//player enableSimulation true;" \n - "" \n - "titleCut ["""", ""BLACK IN"", 1];" \n - "1338 cutText ["""",""PLAIN"",0]; " \n - "" \n - "progressLoadingScreen 1.0;" \n - "" \n - "endLoadingScreen;" \n - "EPOCH_loadingScreenDone = true;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - }; - }; - /*%FSM*/ - /*%FSM*/ - class Version_Check - { - name = "Version_Check"; - init = /*%FSM*/"if (_debug) then {" \n - " diag_log ""EPOCH-LOGIN: Version Check"";" \n - "};" \n - "" \n - "// SHOULD BE:" \n - "_epoch_assets0 = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_assets"");" \n - "_epoch_assets1 = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_assets_1"");" \n - "_epoch_assets2 = getText(configFile >> ""Epoch"" >> ""Version"" >> ""epoch_objects"");" \n - "_epoch_assets3 = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_assets_3"");" \n - "_epoch_config = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_config"");" \n - "_epoch_language = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_language"");" \n - "_epoch_underground = getText(configFile >> ""Epoch"" >> ""Version"" >> ""Underground_Epoch"");" \n - "_epoch_vehicles = getText(configFile >> ""Epoch"" >> ""Version"" >> ""A3_epoch_vehicles"");" \n - "_epoch_weapons = getText(configFile >> ""Epoch"" >> ""Version"" >> ""a3_epoch_weapons"");" \n - "" \n - "" \n - "// IS:" \n - "_my_epoch_assets0 = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_assets"" >> ""epochVersion"");" \n - "_my_epoch_assets1 = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_assets_1"" >> ""epochVersion"");" \n - "_my_epoch_assets2 = getText(configFile >> ""CfgPatches"" >> ""epoch_objects"" >> ""epochVersion"");" \n - "_my_epoch_assets3 = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_assets_3"" >> ""epochVersion"");" \n - "_my_epoch_config = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_config"" >> ""epochVersion"");" \n - "_my_epoch_language = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_language"" >> ""epochVersion"");" \n - "_my_epoch_underground = getText(configFile >> ""CfgPatches"" >> ""Underground_Epoch"" >> ""epochVersion"");" \n - "_my_epoch_vehicles = getText(configFile >> ""CfgPatches"" >> ""A3_epoch_vehicles"" >> ""epochVersion"");" \n - "_my_epoch_weapons = getText(configFile >> ""CfgPatches"" >> ""a3_epoch_weapons"" >> ""epochVersion"");" \n - "" \n - "progressLoadingScreen 0.1;" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Wrong_Version + initState="INIT"; + finalStates[] = { - priority = 10.000000; - to="ERROR_Wrong_Version"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_epoch_assets0 != _epoch_assets0 ||" \n - "_my_epoch_assets1 != _epoch_assets1 ||" \n - "_my_epoch_assets2 != _epoch_assets2 ||" \n - "_my_epoch_assets3 != _epoch_assets3 ||" \n - "_my_epoch_config != _epoch_config ||" \n - "_my_epoch_language != _epoch_language ||" \n - "_my_epoch_underground != _epoch_underground ||" \n - "_my_epoch_vehicles != _epoch_vehicles ||" \n - "_my_epoch_weapons != _epoch_weapons"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; + "FINISH", + "Reject_without_B", }; - /*%FSM*/ - /*%FSM*/ - class true - { - priority = 0.000000; - to="Arma_Version_Che"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/""/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Check_Player_UID - { - name = "Check_Player_UID"; - init = /*%FSM*/"if (_debug) then {" \n - " diag_log ""EPOCH-LOGIN: Check PlayerUID"";" \n - "};" \n - "" \n - "_playerUID = getPlayerUID player;" \n - "" \n - "progressLoadingScreen 0.2;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class PlayerUID_Okay - { - priority = 10.000000; - to="Check_Server_1"; - precondition = /*%FSM*/"!isNil ""_playerUID"""/*%FSM*/; - condition=/*%FSM*/"_playerUID != """""/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Empty_PlayerUID - { - priority = 0.000000; - to="ERROR_PlayerUID"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ERROR_Wrong_Version - { - name = "ERROR_Wrong_Version"; - init = /*%FSM*/"_msg = ""You have an outdated version of Epoch"";" \n - "_msg call Epoch_updateLoadingScreen;" \n - "diag_log _msg;" \n - "" \n - "_rejectPlayer = {" \n - " PLAYER_REJECT_EPOCHVERSION = true;" \n - " publicVariableServer ""PLAYER_REJECT_EPOCHVERSION"";" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Display_Message"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Disconnect - { - name = "Disconnect"; - init = /*%FSM*/"endLoadingScreen;" \n - "1338 cutText [_msg,""PLAIN"",0]; " \n - "deleteVehicle player;" \n - "call _rejectPlayer;" \n - "_myTime = diag_tickTime;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Check_if_Player - { - priority = 0.000000; - to="Reject_without_B"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(diag_tickTime - _myTime) > 2"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ERROR_PlayerUID - { - name = "ERROR_PlayerUID"; - init = /*%FSM*/"_msg = ""Can not setup Player Object! (Error 01)"";" \n - "_msg call Epoch_updateLoadingScreen;" \n - "diag_log _msg;" \n - "" \n - "_rejectPlayer = {" \n - " PLAYER_REJECT_UID = true;" \n - " publicVariableServer ""PLAYER_REJECT_UID"";" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Display_Message"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Setup_Player_Var - { - name = "Setup_Player_Var"; - init = /*%FSM*/"diag_log format[""DEBUG TIME WAITED: %1"", (diag_tickTime - _myTime)];" \n - "{" \n - " missionNamespace setVariable[(format[""EPOCH_player%1"", EPOCH_customVars select _forEachIndex]), _x];" \n - "} forEach _playerVariables;" \n - """Loading Player Variables... Please wait!"" call Epoch_updateLoadingScreen;" \n - "progressLoadingScreen 0.7;" \n - "if (_debug) then {" \n - " diag_log ""EPOCH-LOGIN: Setup Player Variables"";" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Setup_EH_s_and_H"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Request_Hive - { - name = "Request_Hive"; - init = /*%FSM*/"_myTime = diag_tickTime;" \n - "" \n - "[player] remoteExec [""EPOCH_server_checkPlayer"",2];" \n - "" \n - """Loading Player Data... Please wait!"" call Epoch_updateLoadingScreen;" \n - "progressLoadingScreen 0.5;" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Hive_Response - { - priority = 0.000000; - to="Process_2"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!isNil ""_checkPlayer_PVC"""/*%FSM*/; - action=/*%FSM*/"_newChar = _checkPlayer_PVC;" \n - "_checkPlayer_PVC = nil;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Timeout_No_Respo - { - priority = 0.000000; - to="ERROR_Server_not_3"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(diag_tickTime - _myTime) > 120"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ERROR_Server_not - { - name = "ERROR_Server_not"; - init = /*%FSM*/"_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*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Display_Message"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ERROR_Wrong_Server - { - name = "ERROR_Wrong_Server"; - init = /*%FSM*/"_msg = format[""Server and Client running with different Version! (You: %1 // Server: %2)"",getText(configFile >> ""CfgMods"" >> ""Epoch"" >> ""version""),_serverVersion];" \n - "_msg call Epoch_updateLoadingScreen;" \n - "diag_log _msg;" \n - "" \n - "_rejectPlayer = {" \n - " PLAYER_REJECT_ServerVersion = true;" \n - " publicVariableServer ""PLAYER_REJECT_ServerVersion"";" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Display_Message"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Setup_Player_Obj - { - name = "Setup_Player_Obj"; - init = /*%FSM*/"_ply = player;" \n - "_group = group player;" \n - "" \n - "selectPlayer _playerObject;" \n - "" \n - "deleteVehicle _ply;" \n - "deleteGroup _group;" \n - "" \n - """Loading Player Body... Please wait!"" call Epoch_updateLoadingScreen;" \n - "progressLoadingScreen 0.8;" \n - "" \n - "if (_debug) then {" \n - " diag_log ""EPOCH-LOGIN: Setup Player Object"";" \n - "};" \n - "" \n - "_myTime = diag_tickTime;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Timeout_ - { - priority = 0.000000; - to="ERROR_Player_Setup"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(diag_tickTime - _myTime) > 60"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class new_player_____p - { - priority = 0.000000; - to="Setup_Player_Var"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_playerObject == player"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Display_Message - { - name = "Display_Message"; - init = /*%FSM*/"[] spawn {" \n - " waitUntil{!isNull (findDisplay 46)};" \n - " (findDisplay 46) displayAddEventHandler [""KeyDown"",""true""];" \n - " (findDisplay 46) displayAddEventHandler [""KeyUp"",""true""];" \n - "};" \n - "_myTime = diag_tickTime;" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Display_Message - { - priority = 0.000000; - to="Disconnect"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(diag_tickTime - _myTime) > 10"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Check_Server - { - name = "Check_Server"; - init = /*%FSM*/"_myTime = diag_tickTime;" \n - "if (_debug) then {" \n - " diag_log ""EPOCH-LOGIN: Check Server"";" \n - "};" \n - """Checking Server... Please wait!"" call Epoch_updateLoadingScreen;" \n - "progressLoadingScreen 0.4;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Server_not_worki - { - priority = 10.000000; - to="ERROR_Server_not_1"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!isNil ""EPOCH_BADHIVE""" \n - ""/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Server_Okay - { - priority = 0.000000; - to="Server_Version_C"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!isNil ""Epoch_ServerVersion"""/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ERROR_Server_not_1 - { - name = "ERROR_Server_not_1"; - init = /*%FSM*/"_msg = ""Server not Ready (Error 03)"";" \n - "_msg call Epoch_updateLoadingScreen;" \n - "diag_log _msg;" \n - "" \n - "_rejectPlayer = {" \n - " PLAYER_REJECT_NotReady2 = true;" \n - " publicVariableServer ""PLAYER_REJECT_NotReady2"";" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Display_Message"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Check_Server_1 - { - name = "Check_Server_1"; - init = /*%FSM*/"progressLoadingScreen 0.3;" \n - """Server initializing... Please wait!"" call Epoch_updateLoadingScreen;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Timeout_No_Respo - { - priority = 0.000000; - to="ERROR_Server_not_2"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(diag_tickTime - _myTime) > 180"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Server_Ready - { - priority = 0.000000; - to="Check_Server"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!isNil ""EPOCH_SERVER_READY"""/*%FSM*/; - action=/*%FSM*/"EPOCH_SERVER_READY = nil;"/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ERROR_Server_not_2 - { - name = "ERROR_Server_not_2"; - init = /*%FSM*/"_msg = ""Server not Ready (Error 02)"";" \n - "_msg call Epoch_updateLoadingScreen;" \n - "diag_log _msg;" \n - "" \n - "_rejectPlayer = {" \n - " PLAYER_REJECT_NotReady1 = true;" \n - " publicVariableServer ""PLAYER_REJECT_NotReady1"";" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Display_Message"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Reject_without_B - { - name = "Reject_without_B"; - init = /*%FSM*/"[] spawn {" \n - " waitUntil{!isNull (findDisplay 46)};" \n - " waitUntil {" \n - " (findDisplay 46) closeDisplay 0;" \n - " isNull (findDisplay 46)" \n - " };" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - }; - }; - /*%FSM*/ - /*%FSM*/ - class Arma_Version_Che - { - name = "Arma_Version_Che"; - init = /*%FSM*/"progressLoadingScreen 0.15;" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Outdated_Version - { - priority = 10.000000; - to="ERROR_Wrong_Version_1"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"productVersion select 2 < getNumber(configFile >> ""CfgMods"" >> ""Epoch"" >> ""ArmAVersion"")"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Player_Object_Re - { - priority = 0.000000; - to="Check_Player_UID"; - precondition = /*%FSM*/"!isNull player"/*%FSM*/; - condition=/*%FSM*/"player == player"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ERROR_Wrong_Version_1 - { - name = "ERROR_Wrong_Version_1"; - init = /*%FSM*/"_msg = ""You have an outdated version of ArmA 3"";" \n - "_msg call Epoch_updateLoadingScreen;" \n - "diag_log _msg;" \n - "" \n - "_rejectPlayer = {" \n - " PLAYER_REJECT_ARMAVERSION = true;" \n - " publicVariableServer ""PLAYER_REJECT_ARMAVERSION"";" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Display_Message"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Setup_EH_s_and_H - { - name = "Setup_EH_s_and_H"; - init = /*%FSM*/"{" \n - " player addEventHandler [_x,([""CfgEpochClient"", _x, """"] call EPOCH_fnc_returnConfigEntryV2)];" \n - "} forEach ([""CfgEpochClient"", ""addEventHandler"", []] call EPOCH_fnc_returnConfigEntryV2);" \n - "" \n - "if (count EPOCH_playerHitPoints isEqualTo count ((getAllHitPointsDamage player) param [0,[]])) then {" \n - " {" \n - " player setHitIndex [_forEachIndex, _x];" \n - " }forEach EPOCH_playerHitPoints;" \n - "};" \n - "" \n - "[] spawn EPOCH_masterLoop;" \n - "true call EPOCH_fnc_Weather;" \n - "[5,100] spawn EPOCH_niteLight;" \n - "" \n - "if (_debug) then {" \n - " diag_log ""EPOCH-LOGIN: Setup EH's"";" \n - "};" \n - "" \n - """Loading... Please wait!"" call Epoch_updateLoadingScreen;" \n - "progressLoadingScreen 0.9;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Has_Current_Weap - { - priority = 10.000000; - to="Find_Active_Weap"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_currentWeapon != """""/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class no_weapons - { - priority = 0.000000; - to="Process"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_currentWeapon == """""/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Process - { - name = "Process"; - init = /*%FSM*/"progressLoadingScreen 0.975;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Preload_done - { - priority = 0.000000; - to="FINISH"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"preloadCamera _playerPos"/*%FSM*/; - action=/*%FSM*/"call compile _extraPayload;"/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Find_Active_Weap - { - name = "Find_Active_Weap"; - init = /*%FSM*/"_activeWeapon = currentWeapon player;" \n - "progressLoadingScreen 0.95;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Current_Weapon_S - { - priority = 0.000000; - to="Do_nothing"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_activeWeapon == _currentWeapon"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Current_Weapon_Not - { - priority = 0.000000; - to="Select_Weapon"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_activeWeapon != _currentWeapon"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Select_Weapon - { - name = "Select_Weapon"; - init = /*%FSM*/"_currentWeapon spawn {" \n - " uiSleep 1; " \n - " player selectWeapon _this;" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Process"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Do_nothing - { - name = "Do_nothing"; - init = /*%FSM*/""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Process"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Check_New_Player - { - name = "Check_New_Player"; - init = /*%FSM*/"_myTime = diag_tickTime;" \n - "" \n - "player reveal _playerObject;" \n - "" \n - "_playerPos = getpos _playerObject;" \n - "" \n - "" \n - """Loading Player Inventory... Please wait!"" call Epoch_updateLoadingScreen;" \n - "progressLoadingScreen 0.6;" \n - ""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class check_new__player - { - priority = 0.000000; - to="Setup_Player_Obj"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!(isNull _playerObject) && {_playerObject getVariable [""SETUP"",false]} && {_playerPos nearObjectsReady 10} && {call _finalPlayerObjectCheck}"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Timeout_No_Respo - { - priority = 0.000000; - to="ERROR_Server_not"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(diag_tickTime - _myTime) > 120"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Process_1 - { - name = "Process_1"; - init = /*%FSM*/""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Wait_ArmA_Loading - { - priority = 0.000000; - to="Start_Loading_Sc"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!(call BIS_fnc_isLoading)"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Start_Loading_Sc - { - name = "Start_Loading_Sc"; - init = /*%FSM*/"startLoadingScreen ["""",""EpochLoadingScreen""];" \n - "if (_debug) then {" \n - " diag_log ""EPOCH-LOGIN: Start Loadingscreen"";" \n - "};" \n - """Starting Epoch... Please wait!"" call Epoch_updateLoadingScreen;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Version_Check"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ERROR_Player_Setup - { - name = "ERROR_Player_Setup"; - init = /*%FSM*/"_msg = ""Problem setting up player"";" \n - "_msg call Epoch_updateLoadingScreen;" \n - "diag_log _msg;" \n - "" \n - "_rejectPlayer = {" \n - " PLAYER_REJECT_InvaildSetup = true;" \n - " publicVariableServer ""PLAYER_REJECT_InvaildSetup"";" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Display_Message"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Server_Version_C - { - name = "Server_Version_C"; - init = /*%FSM*/""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Wrong_Server_Ver - { - priority = 10.000000; - to="ERROR_Wrong_Server"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"Epoch_ServerVersion != getText(configFile >> ""CfgMods"" >> ""Epoch"" >> ""version"")"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Version_Okay - { - priority = 0.000000; - to="Request_Hive"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/""/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ERROR_Server_not_3 - { - name = "ERROR_Server_not_3"; - init = /*%FSM*/"_msg = ""Authentication Failed, Disconnect and try again"";" \n - "_msg call Epoch_updateLoadingScreen;" \n - "diag_log _msg;" \n - "" \n - "_rejectPlayer = {" \n - " PLAYER_REJECT_HiveNotResponse = true;" \n - " publicVariableServer ""PLAYER_REJECT_HiveNotResponse"";" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Display_Message"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Process_2 - { - name = "Process_2"; - init = /*%FSM*/""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class new_character - { - priority = 10.000000; - to="Open_Gender_Selection"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"_newChar"/*%FSM*/; - action=/*%FSM*/"endLoadingScreen;" \n - "_myGenderTime = diag_tickTime;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class load_old_charact - { - priority = 0.000000; - to="Process_3"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/""/*%FSM*/; - action=/*%FSM*/"_myTime = diag_tickTime;"/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Open_Gender_Selection - { - name = "Open_Gender_Selection"; - init = /*%FSM*/"createdialog ""SelectGender"";"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Gender_Selected - { - priority = 10.000000; - to="Send_character_s"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!isNil ""EPOCH_PlayerIsMale"""/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Timeout - { - priority = 0.000000; - to="Send_character_s"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"((diag_tickTime - _myGenderTime) > 30)"/*%FSM*/; - action=/*%FSM*/"EPOCH_PlayerIsMale = true;" \n - "closeDialog 0;"/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Reopen_when_client - { - priority = 0.000000; - to="Open_Gender_Selection"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!dialog && isNil ""EPOCH_PlayerIsMale"""/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Send_character_s - { - name = "Send_character_s"; - init = /*%FSM*/"startLoadingScreen ["""",""EpochLoadingScreen""];" \n - """Gender Selected... Please wait!"" call Epoch_updateLoadingScreen;" \n - "" \n - "[player,EPOCH_PlayerIsMale] remoteExec [""EPOCH_server_loadPlayer"",2];" \n - "EPOCH_PlayerIsMale = nil;"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class load_old_charact - { - priority = 0.000000; - to="Process_3"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/""/*%FSM*/; - action=/*%FSM*/"_myTime = diag_tickTime;"/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class Process_3 - { - name = "Process_3"; - init = /*%FSM*/""/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class Timeout_No_Respo - { - priority = 0.000000; - to="ERROR_Server_not_4"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"(diag_tickTime - _myTime) > 120"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - /*%FSM*/ - class Response - { - priority = 0.000000; - to="Check_New_Player"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"!isNil ""_C_SET"""/*%FSM*/; - action=/*%FSM*/"_playerObject = _C_SET deleteAt 0;" \n - "_playerVariables = _C_SET deleteAt 0;" \n - "_currentWeapon = _C_SET deleteAt 0;" \n - "_mass = _C_SET deleteAt 0;" \n - "" \n - "Epoch_my_GroupUID = _C_SET deleteAt 0;" \n - "Epoch_canBeRevived = _C_SET deleteAt 0;" \n - "Epoch_personalToken = _C_SET deleteAt 0;" \n - "Epoch_my_Group = _C_SET deleteAt 0;" \n - "" \n - "_extraPayload = _C_SET deleteAt 0;" \n - "" \n - ""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - /*%FSM*/ - class ERROR_Server_not_4 - { - name = "ERROR_Server_not_4"; - init = /*%FSM*/"_msg = ""Authentication Failed, Disconnect and try again"";" \n - "_msg call Epoch_updateLoadingScreen;" \n - "diag_log _msg;" \n - "" \n - "_rejectPlayer = {" \n - " PLAYER_REJECT_HiveLoadChar = true;" \n - " publicVariableServer ""PLAYER_REJECT_HiveLoadChar"";" \n - "};"/*%FSM*/; - precondition = /*%FSM*/""/*%FSM*/; - class Links - { - /*%FSM*/ - class true - { - priority = 0.000000; - to="Display_Message"; - precondition = /*%FSM*/""/*%FSM*/; - condition=/*%FSM*/"true"/*%FSM*/; - action=/*%FSM*/""/*%FSM*/; - }; - /*%FSM*/ - }; - }; - /*%FSM*/ - }; - initState="INIT"; - finalStates[] = - { - "FINISH", - "Reject_without_B", - }; }; /*%FSM*/ \ No newline at end of file diff --git a/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_adjust.sqf b/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_adjust.sqf new file mode 100644 index 00000000..636848c9 --- /dev/null +++ b/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_adjust.sqf @@ -0,0 +1,50 @@ +/* + Author: Raimonds Virtoss - EpochMod.com + + Contributors: + + Description: + Creates special dialog that allows players to reposition (move) all HUD groups on the screen and save to profile + + 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_code/gui/scripts/dynamicHUD/Epoch_dynamicHUD_adjust.sqf +*/ +_this spawn { + disableSerialization; + (findDisplay 49) closeDisplay 0; + + waitUntil {isNull (findDisplay 49)}; + + if (_this) then { + findDisplay 46 createDisplay "rmx_moveDynamicHUD"; + _dsp = findDisplay 66666; + rmx_var_dynamicHUD_groupsAdjust = []; + rmx_var_drag_MouseDown = false; + { + _c = _dsp ctrlCreate ["rmx_drag_RscActivePicture", call epoch_getIDC]; + _c ctrlSetText "#(rgb,8,8,3)color(1,1,1,1)"; + _c ctrlSetPosition (ctrlPosition _x); + _c ctrlCommit 0; + rmx_var_dynamicHUD_groupsAdjust set [_forEachIndex, _c]; + } forEach rmx_var_dynamicHUD_groups; + + waitUntil {!isNull (findDisplay 66666)}; + while {!isNull (findDisplay 66666)} do { + if !(rmx_var_drag_MouseDown) then { + { + _c = (rmx_var_dynamicHUD_groups select _forEachIndex); + _c ctrlSetPosition (ctrlPosition _x); + _c ctrlCommit 0; + } forEach rmx_var_dynamicHUD_groupsAdjust; + }; + uiSleep 0.1; + }; + } else { + //reset hud positions + }; +}; + +true diff --git a/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_loadSave.sqf b/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_loadSave.sqf new file mode 100644 index 00000000..a6028f9d --- /dev/null +++ b/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_loadSave.sqf @@ -0,0 +1,13 @@ +/* + Author: Raimonds Virtoss - EpochMod.com + + Contributors: + + Description: + + 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_code/gui/scripts/dynamicHUD/Epoch_loadSave.sqf +*/ \ No newline at end of file diff --git a/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_start.sqf b/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_start.sqf new file mode 100644 index 00000000..8244f6f2 --- /dev/null +++ b/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_dynamicHUD_start.sqf @@ -0,0 +1,126 @@ +/* + Author: Raimonds Virtoss - EpochMod.com + + Contributors: + + Description: + Creates special HUD Groups defined in CfgDynamicHUD.hpp at the start of the game. + + 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_code/gui/scripts/dynamicHUD/Epoch_dynamicHUD_start.sqf +*/ +#include "\A3\ui_f\hpp\defineCommonGrids.inc" + +_cfg = "rmx_dynamicHUD" call EPOCH_returnConfig; +_configs = "true" configClasses _cfg; + +setMousePosition [0.5,0.5]; + +disableSerialization; +_dsp = findDisplay 46; + +rmx_var_dynamicHUD_groups = []; +rmx_var_dynamicHUD_groupCTRL = []; + +{ + _group = _dsp ctrlCreate ["rscControlsGroup", call Epoch_getIDC]; + rmx_var_dynamicHUD_groups set [_forEachIndex, _group]; + + _defaultPopulate = getNumber (_x >> "defaultPopulate"); + _defaultPos = getNumber (_x >> "defaultPos"); + _arraySize = getNumber (_x >> "arraySize"); + _classname = getText (_x >> "classname"); + _offsetX = getNumber (_x >> "offSetX"); + _offsetY = getNumber (_x >> "offSetY"); + _height = getNumber (_x >> "height"); + _width = getNumber (_x >> "width"); + + _wCtrl = _width * GUI_GRID_W; + _hCtrl = _height * GUI_GRID_H; + _oX = _offsetX * _wCtrl; + _oY = _offsetY * _hCtrl; + + _w = 0; _h = 0; + if (_defaultPopulate in [0,1,4]) then { + _w = _arraySize * _width * GUI_GRID_W; + _h = _height * GUI_GRID_H; + } else { + _w = _width * GUI_GRID_W; + _h = _arraySize * _height * GUI_GRID_H; + }; + + _groupPos = switch _defaultPos do { + case 0: {[SafezoneX, safezoneY, _w, _h]}; + case 1: {[0.5 - _w/2, safezoneY, _w, _h]}; + case 2: {[(safezoneW + safezoneX) - _w, safezoneY, _w, _h]}; + case 3: {[SafezoneX, 0.5 - _h/2, _w, _h]}; + case 4: {[0.5 - _w/2, 0.5 - _h/2, _w, _h]}; + case 5: {[(safezoneW + safezoneX) - _w, 0.5 - _h/2, _w, _h]}; + case 6: {[SafezoneX, (safezoneH + safezoneY) - _h, _w, _h]}; + case 7: {[0.5 - _w/2, (safezoneH + safezoneY) - _h, _w, _h]}; + case 8: {[(safezoneW + safezoneX) - _w, (safezoneH + safezoneY) - _h, _w, _h]}; + default {[0,0,0,0]}; + }; + + _groupPos set [0, (_groupPos select 0)+_oX]; + _groupPos set [1, (_groupPos select 1)+_oY]; + _group ctrlSetPosition _groupPos; + _group ctrlCommit 0; + + _evenOdd = true; + rmx_var_dynamicHUD_groupCTRL set [_forEachIndex, [(configName _x)]]; + + for "_i" from 0 to (_arraySize - 1) do { + _c = _dsp ctrlCreate [_classname, call Epoch_getIDC, _group]; + (rmx_var_dynamicHUD_groupCTRL select _forEachIndex) pushBack _c; + + _cPos = switch _defaultPopulate do { + case 0: {[_i * _wCtrl,0,_wCtrl, _hCtrl]}; + case 1: {[(_arraySize - 1 - _i) * _wCtrl,0,_wCtrl, _hCtrl]}; + case 2: {[0,_i * _hCtrl,_wCtrl, _hCtrl]}; + case 3: {[0,(_arraySize - 1 - _i) * _hCtrl,_wCtrl, _hCtrl]}; + case 4: + { + _center = _w/2 - _wCtrl/2; + + _result = if (_i == 0) then { + [_center, 0, _wCtrl, _hCtrl] + } else { + if _evenOdd then { + [_wCtrl * _i/2 + _center, 0, _wCtrl, _hCtrl] + } else { + [(_center - _wCtrl/2) - (_wCtrl * _i/2), 0, _wCtrl, _hCtrl] + }; + }; + _evenOdd = !_evenOdd; + _result + }; + case 5: + { + _center = _h/2 - _hCtrl/2; + + _result = if (_i == 0) then { + [0, _center, _wCtrl, _hCtrl] + } else { + if _evenOdd then { + [0, _hCtrl * _i/2 + _center, _wCtrl, _hCtrl] + } else { + [0, (_center - _hCtrl/2) - (_hCtrl * _i/2), _wCtrl, _hCtrl] + }; + }; + _evenOdd = !_evenOdd; + _result + }; + default {[0,0,0,0]}; + }; + _c ctrlSetPosition _cPos; + _c ctrlCommit 0; + }; +} forEach _configs; + + //dump default positions into an array + +true diff --git a/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_getHUDCtrl.sqf b/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_getHUDCtrl.sqf new file mode 100644 index 00000000..780d857c --- /dev/null +++ b/Sources/epoch_code/gui/scripts/dynamicHUD/epoch_getHUDCtrl.sqf @@ -0,0 +1,32 @@ +/* + Author: Raimonds Virtoss - EpochMod.com + + Contributors: + + Description: + Returns Control from Dynamic HUD to be manipulated externally. See CfgDynamicHUD.hpp on how to create your own HUD groups. + + 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_code/gui/scripts/dynamicHUD/Epoch_getHUDCtrl.sqf + + Usage: + [_configName, _index] call epoch_getHUDCtrl; + ["myHudName", 2] call epoch_getHUDCtrl; +*/ + +if !(_this isEqualTypeArray ["",0]) exitWith {controlNull}; + +params ["_gName","_cIdx"]; + +_gIdx = -1; + +{ + if ((_x select 0) isEqualTo _gName) exitWith {_gIdx = _forEachIndex}; +} forEach rmx_var_dynamicHUD_groupCTRL; + +if (_gIdx == -1) exitWith {controlNull}; + +(rmx_var_dynamicHUD_groupCTRL select _gIdx) select _cIdx diff --git a/Sources/epoch_code/gui/scripts/epoch_dragControl.sqf b/Sources/epoch_code/gui/scripts/epoch_dragControl.sqf new file mode 100644 index 00000000..7e774750 --- /dev/null +++ b/Sources/epoch_code/gui/scripts/epoch_dragControl.sqf @@ -0,0 +1,26 @@ +/* + Author: Raimonds Virtoss - EpochMod.com + + Contributors: + + Description: + Gives ability to move active controls like RscActivePicture (see Epoch_GUI_rmx.hpp for an example). + + 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_code/gui/scripts/Epoch_dragControl.sqf + + Usage: + No direct usage, simply create your control in configs following example in HPP mentioned in description +*/ +private ["_ctrl","_curr","_mpos"]; +_ctrl = param [0]; +_curr = ctrlPosition _Ctrl; +_mpos = getmousePosition; + +if (rmx_var_drag_MouseDown) then { + _ctrl ctrlSetPosition [(_mpos select 0) - (_curr select 2) / 2, (_mpos select 1) - (_curr select 3) / 2 ]; + _ctrl ctrlCommit 0; +}; \ No newline at end of file diff --git a/Sources/epoch_code/init/client_init.sqf b/Sources/epoch_code/init/client_init.sqf index c1151e81..7a4033cb 100644 --- a/Sources/epoch_code/init/client_init.sqf +++ b/Sources/epoch_code/init/client_init.sqf @@ -55,6 +55,7 @@ EPOCH_arr_interactedObjs = []; EPOCH_buildOption = 0; EPOCH_nearestLocations = []; EPOCH_lastFiredLocation = []; +rmx_var_drag_MouseDown = false; ["EPOCH_onEachFrame", "onEachFrame", EPOCH_onEachFrame] call BIS_fnc_addStackedEventHandler; diff --git a/Sources/epoch_config/Configs/CfgClientFunctions.hpp b/Sources/epoch_config/Configs/CfgClientFunctions.hpp index 10cd1ca9..da80895d 100644 --- a/Sources/epoch_config/Configs/CfgClientFunctions.hpp +++ b/Sources/epoch_config/Configs/CfgClientFunctions.hpp @@ -178,6 +178,7 @@ class CfgClientFunctions class secureStorageHandler {}; class genderSelection {}; class getColorScheme {}; + class dragControl {}; }; class config { @@ -191,7 +192,15 @@ class CfgClientFunctions class dynamicMenuPopulate {}; class dynamicMenuCleanup {}; }; - + + class dynamicHUD { + file = "epoch_code\gui\scripts\dynamicHUD"; + class dynamicHUD_adjust {}; + class dynamicHUD_loadSave {}; + class dynamicHUD_start {}; + class getHUDCtrl {}; + }; + class gui_craft { file = "epoch_code\gui\scripts\craftingv2"; class crafting_animate {}; diff --git a/Sources/epoch_config/Configs/CfgDynamicHUD.hpp b/Sources/epoch_config/Configs/CfgDynamicHUD.hpp new file mode 100644 index 00000000..fc998a0f --- /dev/null +++ b/Sources/epoch_config/Configs/CfgDynamicHUD.hpp @@ -0,0 +1,60 @@ +/* +defaultPos: + 0 - top left + 1 - top center + 2 - top right + 3 - mid left + 4 - mid center + 5 - mid right + 6 - bottom left + 7 - bottom center + 8 - bottom right + +defaultPopulate: + 0 - right + 1 - left + 2 - down + 3 - up + 4 - horizontal grow + 5 - vertical grow + +offSetX: Positive = right, Negative = left +offSetY: Positive = down, Negative = up + Offsets group of controls, unit measurement is width or height of group. The bigger the group the more it will be offset. + Offsets are optional, don't have to be included + +classname: + https://community.bistudio.com/wiki/ctrlCreate/classnames + +Obtaining Controls: + use epoch_getHUDCtrl function to obtain controls for manipulation + _name = Config name of your group + _index = each group hosts multiple elements, each element has it's index, starting from 0 + [_ConfigName, _index] call epoch_getHUDCtrl; + ["myHUDname", 3] call epoch_getHUDCtrl; +*/ + +class rmx_dynamicHUD +{ + class topRight //ConfigName matters to be able to use function! + { + classname = "RscPicture"; + defaultPos = 2; + defaultPopulate = 1; + arraySize = 8; + width = 4; + height = 4; + offSetX = 0; + offSetY = 0; + }; + class botcenter + { + classname = "RscPicture"; + defaultPos = 7; + defaultPopulate = 4; + arraySize = 9; + width = 5; + height = 5; + }; + +}; \ No newline at end of file diff --git a/Sources/epoch_config/Configs/CfgEpochConfiguration.hpp b/Sources/epoch_config/Configs/CfgEpochConfiguration.hpp index bfcabbc6..bcb0e55f 100644 --- a/Sources/epoch_config/Configs/CfgEpochConfiguration.hpp +++ b/Sources/epoch_config/Configs/CfgEpochConfiguration.hpp @@ -23,6 +23,13 @@ class CfgEpochConfiguration icon = "\x\addons\a3_epoch_code\Data\owner.paa"; controlGroup = "EpochConfigKeyMap"; }; + class HUD + { + name = "Customize HUD (WIP)"; + color[] = {1,1,1,1}; + icon = "\x\addons\a3_epoch_code\Data\owner.paa"; + controlGroup = "Epoch_main_config_dynamicHUD"; + }; class html { name = "Changelog"; diff --git a/Sources/epoch_config/sandbox_config.hpp b/Sources/epoch_config/sandbox_config.hpp index 78a520f7..7e10c420 100644 --- a/Sources/epoch_config/sandbox_config.hpp +++ b/Sources/epoch_config/sandbox_config.hpp @@ -57,6 +57,7 @@ disableRandomization[] = {"All"}; #include "Configs\CfgMissionsTasks.hpp" #include "Configs\cfgCrafting.hpp" #include "Configs\cfgPricing.hpp" +#include "Configs\CfgDynamicHUD.hpp" #include "Configs\CfgEpochClient.hpp"