Skip to content

Commit

Permalink
Added RPT Logging to fnc_goAFK.sqf
Browse files Browse the repository at this point in the history
ignore the fact that I semi-doxed myself in the last commit
  • Loading branch information
h4ppy2243 committed Aug 24, 2022
1 parent 6a530bd commit e456a50
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions addons/core/functions/fnc_goAFK.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
*/

if (!hasInterface) exitWith {};

This comment has been minimized.

Copy link
@SiegeToaster

SiegeToaster Aug 24, 2022

Member

in the exitWith, log that the function was not executed on a client machine. See https://github.com/Soliders-in-Arms-Arma-3-Group/sia3f/blob/main/addons/radio/functions/fnc_acreRadioSetup.sqf#L28-L30 for an example.

LOG("fnc_goAFK.sqf has started.");

private _unit = player; // ToDo: replace with param & execute func on server

Expand All @@ -38,12 +39,17 @@ if ("@ace" call FUNC(checkModPresence)) then {
[objNull, _unit] call ace_medical_treatment_fnc_fullHeal;
};
_unit setVariable [QGVAR(isAFK), true];
MESSAGE_WITH_TITLE("player has been fully healed and set to AFK.", "/z/sia3f/addons/core/fucntions/fnc_goAFK.sqf:37-41");

This comment has been minimized.

Copy link
@SiegeToaster

SiegeToaster Aug 24, 2022

Member

MESSAGE_WITH_TITLE automatically logs file name and line, this is good enough for us to understand what is going on if we ever need to look more closely at this error.

This comment has been minimized.

Copy link
@h4ppy2243

h4ppy2243 Aug 24, 2022

Author Contributor

my bad, i misread what the output was including in the RPT logging section on the wiki


[(name _unit + " is now AFK.")] remoteExec ["systemChat"]; // "<player> is now AFK" system chat message.
5 cutText ["You are now AFK\nYou may exit in " + (str TIMEOUT) + " seconds.", "PLAIN", -1, true];
MESSAGE_WITH_TITLE("5 second cutscene has completed.", "/z/sia3f/addons/core/functions/fnc_goAFK.sqf:45");

This comment has been minimized.

Copy link
@SiegeToaster

SiegeToaster Aug 24, 2022

Member

imo, this is not needed. Simply logging when the goAFK dialog was created is good enough.


sleep TIMEOUT;
MESSAGE_WITH_TITLE("sleep TIMEOUT has completed.", "/z/sia3f/addons/core/functions/fnc_goAFK.sqf:46");

This comment has been minimized.

Copy link
@SiegeToaster

SiegeToaster Aug 24, 2022

Member

see comment on line 46


if (!alive player) exitWith {};

createDialog QGVAR(goAFK); // open exit dialog

INFO("fnc_goAFK.sqf fully executed.");

0 comments on commit e456a50

Please sign in to comment.