mirror of
https://github.com/indig0fox/Arma3-AttendanceTracker.git/
synced 2025-12-08 09:51:47 -06:00
implement GORM, expand config, modify the way sessions are handled
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user