diff --git a/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo b/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo index f1b0c78f..aee91737 100644 Binary files a/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo and b/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo differ diff --git a/Sources/epoch_code/System/Trader_Missions_UAV.fsm b/Sources/epoch_code/System/Trader_Missions_UAV.fsm index fa79ef90..f58732b4 100644 --- a/Sources/epoch_code/System/Trader_Missions_UAV.fsm +++ b/Sources/epoch_code/System/Trader_Missions_UAV.fsm @@ -1319,8 +1319,8 @@ class FSM "" \n "_copterPos = (getPosATL _plyr) findEmptyPosition [1,500,""I_Heli_light_03_unarmed_EPOCH""];" \n "" \n - "EPOCH_createObject_PVS = [player,Epoch_personalToken,_uavclass,true,_copterPos,""CAN_COLLIDE"","""","""","""","""",true];" \n - "publicVariableServer ""EPOCH_createObject_PVS"";" \n + "" \n + "[player,Epoch_personalToken,_uavclass,true,_copterPos,""CAN_COLLIDE"","""","""","""","""",true] remoteExec [""EPOCH_Server_createObject"",2];" \n "" \n "" \n "" \n diff --git a/Sources/epoch_code/System/Trader_Missions_VIP.fsm b/Sources/epoch_code/System/Trader_Missions_VIP.fsm index d4717094..b290ac61 100644 --- a/Sources/epoch_code/System/Trader_Missions_VIP.fsm +++ b/Sources/epoch_code/System/Trader_Missions_VIP.fsm @@ -502,8 +502,8 @@ class FSM "_boats = [];" \n "_findTimer = diag_TickTime;" \n "" \n - "EPOCH_createObject_PVS = [player,Epoch_personalToken,""I_Boat_Armed_01_minigun_F"",true,axeGeneralBoatPos,""CAN_COLLIDE"","""","""","""","""",true];" \n - "publicVariableServer ""EPOCH_createObject_PVS"";" \n + "" \n + "[player,Epoch_personalToken,""I_Boat_Armed_01_minigun_F"",true,axeGeneralBoatPos,""CAN_COLLIDE"","""","""","""","""",true] remoteExec [""EPOCH_Server_createObject"",2];" \n "" \n "" \n ""/*%FSM*/; diff --git a/Sources/epoch_code/compile/functions/EPOCH_pushCustomVar.sqf b/Sources/epoch_code/compile/functions/EPOCH_pushCustomVar.sqf index 7812790f..f4040da3 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_pushCustomVar.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_pushCustomVar.sqf @@ -38,9 +38,7 @@ if ((diag_tickTime - _EPOCH_lastSave) >= _time) then { _customVars pushBack (missionNamespace getVariable format["EPOCH_player%1",_x select 0]); } forEach _customVarsInit; - // TODO: use remoteExec here - missionNamespace setVariable ["EPOCH_pushPlayer_PVS",[player,_customVars,missionNamespace getVariable "Epoch_personalToken"]]; - publicVariableServer "EPOCH_pushPlayer_PVS"; + [player,_customVars,missionNamespace getVariable "Epoch_personalToken"] remoteExec ["EPOCH_fnc_savePlayer",2]; missionNamespace setVariable["EPOCH_lastSave", diag_tickTime]; }; diff --git a/Sources/epoch_config/Configs/CfgRemoteExec.hpp b/Sources/epoch_config/Configs/CfgRemoteExec.hpp index 08f38374..c6c890fe 100644 --- a/Sources/epoch_config/Configs/CfgRemoteExec.hpp +++ b/Sources/epoch_config/Configs/CfgRemoteExec.hpp @@ -183,6 +183,15 @@ class CfgRemoteExec allowedTargets=2; jip = 0; }; + class EPOCH_Server_createObject { + allowedTargets=2; + jip = 0; + }; + class EPOCH_fnc_savePlayer { + allowedTargets=2; + jip = 0; + }; + }; class Commands {mode=0;}; }; diff --git a/Sources/epoch_server/compile/epoch_player/fn_savePlayer.sqf b/Sources/epoch_server/compile/epoch_player/fn_savePlayer.sqf new file mode 100644 index 00000000..cac90a26 --- /dev/null +++ b/Sources/epoch_server/compile/epoch_player/fn_savePlayer.sqf @@ -0,0 +1 @@ +if([_this select 1 select 0,_this select 1 select 2]call EPOCH_server_getPToken)then{(_this select 1)call EPOCH_server_savePlayer} diff --git a/Sources/epoch_server/config.cpp b/Sources/epoch_server/config.cpp index 57003af3..d80130e0 100644 --- a/Sources/epoch_server/config.cpp +++ b/Sources/epoch_server/config.cpp @@ -39,6 +39,11 @@ class cfgFunctions file = "\x\addons\a3_epoch_server\compile\epoch_bases\fn_saveBuilding.sqf"; }; }; + class players { + class savePlayer { + file = "\x\addons\a3_epoch_server\compile\epoch_player\fn_savePlayer.sqf"; + }; + }; }; }; diff --git a/Sources/epoch_server/init/server_publicEH.sqf b/Sources/epoch_server/init/server_publicEH.sqf index 5e75095d..b6e8ad1f 100644 --- a/Sources/epoch_server/init/server_publicEH.sqf +++ b/Sources/epoch_server/init/server_publicEH.sqf @@ -7,7 +7,7 @@ // "EPOCH_checkPlayer_PVS" addPublicVariableEventHandler{(_this select 1)call EPOCH_server_checkPlayer}; // "EPOCH_respawnPlayer_PVS" addPublicVariableEventHandler{(_this select 1)call EPOCH_server_respawnPlayer}; // "EPOCH_S_S_VEHICLES" addPublicVariableEventHandler{(_this select 1)call EPOCH_server_save_vehicles}; -"EPOCH_pushPlayer_PVS" addPublicVariableEventHandler{if([_this select 1 select 0,_this select 1 select 2]call EPOCH_server_getPToken)then{(_this select 1)call EPOCH_server_savePlayer}}; +// "EPOCH_pushPlayer_PVS" addPublicVariableEventHandler{(_this select 1) call EPOCH_fnc_savePlayer}; // "EPOCH_deadPlayer_PVS" addPublicVariableEventHandler{(_this select 1)call EPOCH_server_deadPlayer}; // "EPOCH_destroyTrash" addPublicVariableEventHandler{(_this select 1)call EPOCH_server_destroyTrash}; // "EPOCH_knockDownTree" addPublicVariableEventHandler{(_this select 1)call EPOCH_server_knockDownTree}; @@ -46,4 +46,4 @@ // "EPOCH_FillContainer_PVS" addPublicVariableEventHandler{(_this select 1)call EPOCH_server_fillContainer}; // "EPOCH_SapperObjs_PVS" addPublicVariableEventHandler{(_this select 1)call EPOCH_server_handle_sapperObjs}; // "EPOCH_createAirDrop_PVS" addPublicVariableEventHandler{ (_this select 1)call EPOCH_Server_createAirDrop }; -"EPOCH_airDropCrate_PVS" addPublicVariableEventHandler{ (_this select 1)call EPOCH_server_airDropCrate }; +// "EPOCH_airDropCrate_PVS" addPublicVariableEventHandler{ (_this select 1)call EPOCH_server_airDropCrate };