some timezone corrections to UTC, write readme

This commit is contained in:
2023-07-06 09:44:37 -07:00
parent ee0c28d2c8
commit c250310d58
10 changed files with 281 additions and 107 deletions

View File

@@ -55,6 +55,15 @@ addMissionEventHandler ["ExtensionCallback", {
]
];
missionNamespace setVariable ["AttendanceTracker_DBConnected", true];
};
};
case "writeWorldInfo": {
if (_response#0 == "WORLD_ID") then {
AttendanceTracker_worldId = _response#1;
// world info written. mission info depends on that, so now we'll write it
// log mission info and get back the row Id to send with future messages
private _response = "AttendanceTracker" callExtension [
"logMission",
@@ -62,12 +71,11 @@ addMissionEventHandler ["ExtensionCallback", {
[AttendanceTracker getVariable ["missionContext", createHashMap]] call CBA_fnc_encodeJSON
]
];
missionNamespace setVariable ["AttendanceTracker_DBConnected", true];
};
};
case "writeMission": {
if (_response#0 == "MISSION_ID") then {
// mission has written so lets finish out init and set missionId for the returned PK, activating the ability for attendance records to send.
AttendanceTracker_missionId = _response#1;
};
};

View File

@@ -40,6 +40,19 @@ AttendanceTracker setVariable ["missionContext", createHashMapFromArray [
AttendanceTracker setVariable ["allUsers", createHashMap];
AttendanceTracker setVariable ["rowIds", createHashMap];
// update the extension with the current server time to identify restarts
[
{
'AttendanceTracker' callExtension [
"updateServerTime",
[
round(diag_tickTime)
]
]
},
30
] call CBA_fnc_addPerFrameHandler;
{
if (!isServer) exitWith {};
_x params ["_ehName", "_code"];

View File

@@ -13,7 +13,7 @@ systemTimeUTC apply {if (_x < 10) then {"0" + str _x} else {str _x}} params [
];
format[
"%1-%2-%3 %4:%5:%6",
"%1-%2-%3T%4:%5:%6.000Z",
_year,
_month,
_day,

View File

@@ -19,7 +19,10 @@ _hash set ["isJIP", _isJIP];
_hash set ["roleDescription", _roleDescription];
[
{missionNamespace getVariable ["AttendanceTracker_DBConnected", false]},
{
missionNamespace getVariable ["AttendanceTracker_DBConnected", false] &&
missionNamespace getVariable ["AttendanceTracker_missionId", -1] > 0
},
{"AttendanceTracker" callExtension ["writeAttendance", [[_this] call CBA_fnc_encodeJSON]]},
_hash, // args
30 // timeout in seconds. if DB never connects, we don't want these building up

View File

@@ -19,7 +19,10 @@ _hash set ["isJIP", _isJIP];
_hash set ["roleDescription", _roleDescription];
[
{missionNamespace getVariable ["AttendanceTracker_DBConnected", false]},
{
missionNamespace getVariable ["AttendanceTracker_DBConnected", false] &&
missionNamespace getVariable ["AttendanceTracker_missionId", -1] > 0
},
{"AttendanceTracker" callExtension ["writeDisconnectEvent", [[_this] call CBA_fnc_encodeJSON]]},
_hash, // args
30 // timeout in seconds. if DB never connects, we don't want these building up

View File

@@ -8,6 +8,8 @@
},
"armaConfig": {
"dbUpdateIntervalSeconds": 90,
"serverEventFillNullMinutes": 90,
"missionEventFillNullMinutes": 15,
"debug": false
}
}