From 8c4e0ff2972a91fd10d8e9e235c79dcf7f18b99b Mon Sep 17 00:00:00 2001 From: eraser1 Date: Wed, 2 Sep 2015 13:01:39 -0500 Subject: [PATCH] HC Logging + Fix? Test please :) --- @ExileServer/addons/a3_dms/fn_DMS_postInit.sqf | 6 ++++++ .../addons/a3_dms/scripts/AILocalityManager.sqf | 6 +++++- README.md | 10 +++++++--- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/@ExileServer/addons/a3_dms/fn_DMS_postInit.sqf b/@ExileServer/addons/a3_dms/fn_DMS_postInit.sqf index 0456ab8..2aa69b9 100644 --- a/@ExileServer/addons/a3_dms/fn_DMS_postInit.sqf +++ b/@ExileServer/addons/a3_dms/fn_DMS_postInit.sqf @@ -15,6 +15,12 @@ EAST setFriend[RESISTANCE,0]; EAST setFriend[WEST,0]; WEST setFriend[EAST,0]; +"DMS_HC_INIT" addPublicVariableEventHandler +{ + DMS_HC_Object = _this select 1 select 0; + diag_log format ["DMS Headless Client :: DMS_HC_Object = %1 | serverTime: %2",DMS_HC_Object,(_this select 1 select 1)]; +}; + if(DMS_StaticMission) then { call compileFinal preprocessFileLineNumbers "\x\addons\dms\static\static_init.sqf";//<---- TODO }; diff --git a/@ExileServer/addons/a3_dms/scripts/AILocalityManager.sqf b/@ExileServer/addons/a3_dms/scripts/AILocalityManager.sqf index d787567..ae0f22f 100644 --- a/@ExileServer/addons/a3_dms/scripts/AILocalityManager.sqf +++ b/@ExileServer/addons/a3_dms/scripts/AILocalityManager.sqf @@ -19,6 +19,10 @@ if !(DMS_ai_offload_to_client) exitWith {}; { if (isNull DMS_HC_Object) then { + if (DMS_DEBUG) then + { + diag_log format ["DMS_DEBUG AILocalityManager :: DMS_HC_Object is null! Finding owner for group: %1",_group]; + }; _owner = objNull; { @@ -39,7 +43,7 @@ if !(DMS_ai_offload_to_client) exitWith {}; { if (DMS_DEBUG) then { - diag_log format ["Setting ownership of group %1 to HC (%2)",_group,DMS_HC_Object]; + diag_log format ["DMS_DEBUG AILocalityManager :: Setting ownership of group %1 to HC (%2)",_group,DMS_HC_Object]; }; _group setGroupOwner (owner DMS_HC_Object); }; diff --git a/README.md b/README.md index 77198a8..ecc2254 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,14 @@ Repack the a3_dms folder with a PBO tool and follow the "To install:" steps :D HEADLESS CLIENT: -Add this code to the TOP if your initPlayerLocal.sqf +Add this code to the TOP of your initPlayerLocal.sqf if (!hasInterface && !isServer) then { - DMS_HC_Object = player; - publicVariableServer "DMS_HC_Object"; + 1 spawn + { + waitUntil {player==player}; + DMS_HC_INIT = [player,serverTime]; + publicVariableServer "DMS_HC_INIT"; + }; }; \ No newline at end of file