bug fixes/debugging

This commit is contained in:
2023-06-17 22:34:52 -07:00
parent f6ff42e467
commit 8f971d9887
9 changed files with 36 additions and 24 deletions

View File

@@ -21,7 +21,8 @@ class CfgFunctions {
class logMissionEvent {};
class logServerEvent {};
class timestamp {};
class getHash {};
class getMissionHash {};
class getWorldInfo {};
};
};
};

View File

@@ -61,13 +61,13 @@ addMissionEventHandler ["ExtensionCallback", {
};
case "writeMissionInfo": {
if (_response#0 == "MISSION_ID") then {
AttendanceTracker_missionId = parseNumber _response;
AttendanceTracker_missionId = parseNumber (_response#1);
};
};
case "writeAttendance": {
if (_response#0 == "ATT_LOG") then {
_response params ["_netId", "_rowId"];
((AttendanceTracker getVariable ["allUsers", createHashMap]) get _netId) set ["_rowID", _rowID];
((AttendanceTracker getVariable ["allUsers", createHashMap]) get _netId) append _rowID;
};
};
default {

View File

@@ -5,8 +5,14 @@
[format ["(EventHandler) OnUserConnected fired: %1", _this], "DEBUG"] call attendanceTracker_fnc_log;
private _userInfo = (getUserInfo _networkId);
if (isNil "_userInfo") exitWith {
[format ["(EventHandler) OnUserConnected: No user info found for %1", _networkId], "DEBUG"] call attendanceTracker_fnc_log;
};
_userInfo params ["_playerID", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit"];
if (_isHC) exitWith {};
if (_isHC) exitWith {
[format ["(EventHandler) OnUserConnected: %1 is HC, skipping", _playerID], "DEBUG"] call attendanceTracker_fnc_log;
};
(AttendanceTracker getVariable ["allUsers", createHashMap]) set [_networkId, _userInfo];
[
@@ -16,7 +22,7 @@
_profileName,
_steamName,
nil // send rowId on d/c only
] call attendanceTracker_fnc_writeAttendance;
] call attendanceTracker_fnc_logServerEvent;
}],
["OnUserDisconnected", {
@@ -25,10 +31,14 @@
[format ["(EventHandler) OnUserDisconnected fired: %1", _this], "DEBUG"] call attendanceTracker_fnc_log;
private _userInfo = (AttendanceTracker getVariable ["allUsers", createHashMap]) get _networkId;
if (isNil "_userInfo") exitWith {};
if (isNil "_userInfo") exitWith {
[format ["(EventHandler) OnUserDisconnected: No user info found for %1", _networkId], "DEBUG"] call attendanceTracker_fnc_log;
};
_userInfo params ["_playerID", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit", "_rowId"];
if (_isHC) exitWith {};
if (_isHC) exitWith {
[format ["(EventHandler) OnUserDisconnected: %1 is HC, skipping", _playerID], "DEBUG"] call attendanceTracker_fnc_log;
};
[
"Server",
@@ -37,7 +47,7 @@
_profileName,
_steamName,
(if (!isNil "_rowId") then {_rowId} else {nil}) // send rowId on d/c only
] call attendanceTracker_fnc_writeAttendance;
] call attendanceTracker_fnc_logServerEvent;
}],
["PlayerConnected", {
params ["_id", "_uid", "_name", "_jip", "_owner", "_idstr"];
@@ -45,10 +55,14 @@
[format ["(EventHandler) PlayerConnected fired: %1", _this], "DEBUG"] call attendanceTracker_fnc_log;
private _userInfo = (getUserInfo _idstr);
if (isNil "_userInfo") exitWith {};
if (isNil "_userInfo") exitWith {
[format ["(EventHandler) PlayerConnected: No user info found for %1", _idstr], "DEBUG"] call attendanceTracker_fnc_log;
};
_userInfo params ["_playerID", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit"];
if (_isHC) exitWith {};
if (_isHC) exitWith {
[format ["(EventHandler) PlayerConnected: %1 is HC, skipping", _playerID], "DEBUG"] call attendanceTracker_fnc_log;
};
(AttendanceTracker getVariable ["allUsers", createHashMap]) set [_playerID, _userInfo];
[
@@ -74,7 +88,9 @@
};
_userInfo params ["_playerID", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit", "_rowId"];
if (_isHC) exitWith {};
if (_isHC) exitWith {
[format ["(EventHandler) HandleDisconnect: %1 is HC, skipping", _playerID], "DEBUG"] call attendanceTracker_fnc_log;
};
[
"Mission",

View File

@@ -9,7 +9,7 @@ params [
private _hash = + (AttendanceTracker getVariable ["missionContext", createHashMap]);
_hash set ["networkId", netID player]
_hash set ["networkId", netID player];
_hash set ["eventType", _eventType];
_hash set ["playerId", _playerId];
_hash set ["playerUID", _playerUID];

View File

@@ -8,7 +8,7 @@ systemTimeUTC params [
"_day",
"_hour",
"_minute",
"_second"
"_second",
"_millisecond"
];