changes logging, and eval inv on server only

This commit is contained in:
2024-01-30 18:22:45 -08:00
parent dbff8d31d4
commit 44d9ba3b07
2 changed files with 29 additions and 29 deletions

View File

@@ -42,12 +42,12 @@ addMissionEventHandler ["HandleChatMessage",
["ace_arsenal_displayClosed", {
private _lines = [player] call milsim_fnc_logPlayerInventory;
[player] remoteExec ["milsim_fnc_logPlayerInventory", 2];
["milsim_logText", [_lines]] call CBA_fnc_globalEvent;
}] call CBA_fnc_addEventHandler;
[missionNamespace, "arsenalClosed", {
private _lines = [player] call milsim_fnc_logPlayerInventory;
[player] remoteExec ["milsim_fnc_logPlayerInventory", 2];
["milsim_logText", [_lines]] call CBA_fnc_globalEvent;
}] call BIS_fnc_addScriptedEventHandler;

View File

@@ -18,7 +18,11 @@ params [
];
if (!isPlayer _player) exitWith {
["[MILSIM] (logPlayerInventory): ERROR :: _player is not a player"]
[
"logPlayerInventory",
"PARAM PLAYER IS NOT A PLAYER",
[["player", _player]]
] call milsim_fnc_log;
};
// DEFINITIONS
@@ -236,22 +240,19 @@ private _nonCompliantItemsCount = 0;
// PRIVATE FUNCTIONS
private _logItem = {
params ["_playerObj", "_categoryText", "_itemClassName"];
private _cfg = _itemClassName call CBA_fnc_getItemConfig;
_returnLines pushBack (format[
"[MILSIM] (logPlayerInventory): %1 :: className=""%2"" displayName=""%3"" %4",
_categoryText,
_itemClassName,
[_cfg] call BIS_fnc_displayName,
[_playerObj] call _playerInfoString
]);
private _itemConfig = _itemClassName call CBA_fnc_getItemConfig;
// Log to RPT
[
"logPlayerInventory",
"NON-COMPLIANT ITEM",
[_playerObj, [
["category", _categoryText],
["className", _itemClassName],
["displayName", [_itemConfig] call BIS_fnc_displayName]
]] call milsim_fnc_addPlayerInfoToArray
] call milsim_fnc_log;
};
private _playerInfoString = {
params ["_playerObj"];
format["playerName=""%1"" playerUID=""%2"" playerGroup=""%3""", name _playerObj, getPlayerUID _playerObj, groupId (group _playerObj)];
};
// GATHER INVENTORY
// _items = [];
// _items pushback headgear _player;
@@ -282,10 +283,11 @@ _items pushBack (headgear _player);
_items pushBack (uniform _player);
// CHECK INVENTORY
_returnLines pushBack (format[
"[MILSIM] (logPlayerInventory): CHECKING :: %1",
[_player] call _playerInfoString
]);
[
"logPlayerInventory",
"CHECKING PLAYER INVENTORY",
[_player] call milsim_fnc_addPlayerInfoToArray
] call milsim_fnc_log;
{
_item = _x;
@@ -356,11 +358,9 @@ _returnLines pushBack (format[
} forEach _unlisted;
if (_nonCompliantItemsCount isEqualTo 0) then {
_returnLines pushBack (format[
"[MILSIM] (logPlayerInventory): COMPLIANT :: %1",
[_player] call _playerInfoString
]);
};
// returns array of strings
_returnLines;
[
"logPlayerInventory",
"PLAYER INVENTORY IS COMPLIANT",
[_player] call milsim_fnc_addPlayerInfoToArray
] call milsim_fnc_log;
};