initial version

This commit is contained in:
2023-04-26 19:56:30 -07:00
parent 1a491c228f
commit 08f8943fc7
24 changed files with 781 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
AttendanceTracker = false call CBA_fnc_createNamespace;
AttendanceTracker setVariable ["missionContext", createHashMapFromArray [
["missionName", missionName],
["briefingName", briefingName],
["missionNameSource", missionNameSource],
["onLoadName", getMissionConfigValue ["onLoadName", ""]],
["author", getMissionConfigValue ["author", ""]],
["serverName", serverName],
["serverProfile", profileName],
["missionStart", call attendanceTracker_fnc_timestamp]
]];
// store all user details in a hash when they connect so we can reference it in disconnect events
AttendanceTracker setVariable ["allUsers", createHashMap];
private _database = "AttendanceTracker" callExtension "connectDB";
systemChat "AttendanceTracker: Connecting to database...";
["Connecting to database...", "INFO"] call attendanceTracker_fnc_log;
{
if (!isServer) exitWith {};
_x params ["_ehName", "_code"];
_handle = (addMissionEventHandler [_ehName, _code]);
if (isNil "_handle") then {
[format["Failed to add Mission event handler: %1", _x], "ERROR"] call attendanceTracker_fnc_log;
false;
} else {
missionNamespace setVariable [
("AttendanceTracker" + "_MEH_" + _ehName),
_handle
];
true;
};
} forEach (call attendanceTracker_fnc_eventHandlers);