implement GORM, expand config, modify the way sessions are handled

This commit is contained in:
2023-07-06 01:48:32 -07:00
parent 9a859b403a
commit ee0c28d2c8
13 changed files with 324 additions and 75 deletions

View File

@@ -21,7 +21,9 @@ addMissionEventHandler ["ExtensionCallback", {
false;
};
diag_log format ["Raw callback: %1: %2", _function, _data];
if (missionNamespace getVariable ["AttendanceTracker_" + "debug", true]) then {
diag_log format ["Raw callback: %1: %2", _function, _data];
};
// Parse response from string array
private "_response";
@@ -44,12 +46,7 @@ addMissionEventHandler ["ExtensionCallback", {
case "connectDB": {
systemChat format ["AttendanceTracker: %1", _response#0];
[_response#0, _response#1, _function] call attendanceTracker_fnc_log;
if (_response#0 == "SUCCESS") then {
missionNamespace setVariable ["AttendanceTracker_DBConnected", true];
// close any null disconnect values from previous mission
"AttendanceTracker" callExtension ["fillLastMissionNull", []];
if (_response#0 == "SUCCESS") then {
// log world info
private _response = "AttendanceTracker" callExtension [
"logWorld",
@@ -65,21 +62,13 @@ addMissionEventHandler ["ExtensionCallback", {
[AttendanceTracker getVariable ["missionContext", createHashMap]] call CBA_fnc_encodeJSON
]
];
missionNamespace setVariable ["AttendanceTracker_DBConnected", true];
};
};
case "writeMissionInfo": {
case "writeMission": {
if (_response#0 == "MISSION_ID") then {
AttendanceTracker_missionId = parseNumber (_response#1);
};
};
case "writeAttendance": {
if (_response#0 == "ATT_LOG") then {
(_response#1) params ["_eventType", "_netId", "_rowId"];
private _storeIndex = ["SERVER", "MISSION"] find _eventType;
((AttendanceTracker getVariable ["rowIds", createHashMap]) getOrDefault [
_netId,
[nil, nil]
]) set [_storeIndex, _rowId];
AttendanceTracker_missionId = _response#1;
};
};
default {