add squad params to identity

This commit is contained in:
2023-04-13 00:11:09 -07:00
parent 67541f46f9
commit 042ddf0e34
2 changed files with 52 additions and 2 deletions

View File

@@ -3,6 +3,8 @@ if (!RangerMetrics_run) exitWith {};
params ["_playerID", "_ownerId", "_playerUID", "_profileName", "_displayName", "_steamName", "_clientState", "_isHC", "_adminState", "_networkInfo", "_unit", ["_jip", false]];
// _networkInfo params ["_avgPing", "_avgBandwidth", "_desync"];
private _fields = [
["string", "playerID", _playerID],
["string", "ownerId", _ownerId],
@@ -14,6 +16,55 @@ private _fields = [
["bool", "isJip", _jip]
];
try {
// Get Squad Info of Player
(squadParams _unit) params [
"_squadInfo",
"_unitInfo",
"_squadId",
"_a3unitsId"
];
// For each section, we'll define the format and save to fields
_squadInfoDataFormat = [
"squadNick",
"squadName",
"squadEmail",
"squadWeb",
"squadLogo",
"squadTitle"
];
{
_fields pushBack [
"string",
_squadInfoDataFormat select _forEachIndex,
_squadInfo select _forEachIndex
];
} forEach _squadInfoDataFormat;
_unitInfoDataFormat =[
"unitUid",
"unitName",
"unitFullName",
"unitICQ",
"unitRemark"
];
{
_fields pushBack [
"string",
_unitInfoDataFormat select _forEachIndex,
_unitInfo select _forEachIndex
];
} forEach _unitInfoDataFormat;
} catch {
// If we fail to get squad info, we'll just skip it
[format["Failed to get squad info for %1", _playerUID]] call RangerMetrics_fnc_log;
};
// Role description
private _roleDescription = roleDescription _unit;
if (_roleDescription isNotEqualTo "") then {

View File

@@ -5,7 +5,7 @@ params [
];
if (isNull _unit) exitWith {false};
// if (!isPlayer _unit) exitWith {};
if (!isPlayer _unit) exitWith {};
// do not check more than once every 15 seconds
_checkDelay = 15;
@@ -47,7 +47,6 @@ if (_unitId isEqualTo -1) exitWith {false};
"unit_loadout",
[
["string", "playerUID", _playerUID],
["string", "unitId", str _unitId],
["string", "format", "className"]
],
_classItemCounts,