Compare commits
6 Commits
6eb598b660
...
3e4b0c76b9
| Author | SHA1 | Date | |
|---|---|---|---|
| 3e4b0c76b9 | |||
| 072975c99e | |||
|
cada98e15a
|
|||
|
f77e418ac8
|
|||
|
93204f7d36
|
|||
|
49fb1bb7fa
|
@@ -39,11 +39,13 @@ addMissionEventHandler ["HandleChatMessage",
|
|||||||
|
|
||||||
|
|
||||||
["ace_arsenal_displayClosed", {
|
["ace_arsenal_displayClosed", {
|
||||||
player remoteExec["milsim_fnc_logPlayerInventory", 0];
|
private _lines = [player] call milsim_fnc_logPlayerInventory;
|
||||||
|
["milsim_logText", [_lines]] call CBA_fnc_globalEvent;
|
||||||
}] call CBA_fnc_addEventHandler;
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
[missionNamespace, "arsenalClosed", {
|
[missionNamespace, "arsenalClosed", {
|
||||||
player remoteExec["milsim_fnc_logPlayerInventory", 0];
|
private _lines = [player] call milsim_fnc_logPlayerInventory;
|
||||||
|
["milsim_logText", [_lines]] call CBA_fnc_globalEvent;
|
||||||
}] call BIS_fnc_addScriptedEventHandler;
|
}] call BIS_fnc_addScriptedEventHandler;
|
||||||
|
|
||||||
diag_log text "[MILSIM] (client) event handlers bound";
|
diag_log text "[MILSIM] (client) event handlers bound";
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
if ( !hasInterface ) exitWith {};
|
if ( !hasInterface ) exitWith {};
|
||||||
|
|
||||||
|
if (!isServer) then {
|
||||||
|
["milsim_logText", {
|
||||||
|
params [["_strArray", [""], [[]]]];
|
||||||
|
{
|
||||||
|
diag_log text _x;
|
||||||
|
} forEach _strArray;
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
};
|
||||||
|
|
||||||
["InitializePlayer", [player, true]] call BIS_fnc_dynamicGroups;
|
["InitializePlayer", [player, true]] call BIS_fnc_dynamicGroups;
|
||||||
|
|
||||||
nil;
|
nil;
|
||||||
@@ -53,7 +53,12 @@ publicVariable "milsim_var_rotaryAssets";
|
|||||||
// Initializes the Dynamic Groups framework and groups
|
// Initializes the Dynamic Groups framework and groups
|
||||||
["Initialize", [true]] call BIS_fnc_dynamicGroups;
|
["Initialize", [true]] call BIS_fnc_dynamicGroups;
|
||||||
|
|
||||||
|
["milsim_logText", {
|
||||||
|
params [["_strArray", [""], [[]]]];
|
||||||
|
{
|
||||||
|
diag_log text _x;
|
||||||
|
} forEach _strArray;
|
||||||
|
}] call CBA_fnc_addEventHandler;
|
||||||
|
|
||||||
missionNamespace setVariable ["milsim_complete", true];
|
missionNamespace setVariable ["milsim_complete", true];
|
||||||
diag_log text "[MILSIM] (initServer) milsim_complete: version 2.3";
|
diag_log text "[MILSIM] (initServer) milsim_complete: version 2.3";
|
||||||
|
|||||||
@@ -1,38 +1,27 @@
|
|||||||
|
/*
|
||||||
|
Function: milsim_fnc_logPlayerInventory
|
||||||
|
|
||||||
|
Description:
|
||||||
|
Checks a player's inventory for non-compliant items and logs results to all machines.
|
||||||
|
|
||||||
|
Author: Hizumi, EagleTrooper, IndigoFox
|
||||||
|
|
||||||
|
Parameters:
|
||||||
|
0: _player - <OBJECT> - Player to check inventory of.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
<ARRAY> - Array of strings to be logged.
|
||||||
|
|
||||||
|
*/
|
||||||
params [
|
params [
|
||||||
["_player", objNull, [objNull]]
|
["_player", objNull, [objNull]]
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!isPlayer _player) exitWith { diag_log("exitWith logPlayerInventory")};
|
if (!isPlayer _player) exitWith {
|
||||||
|
["[MILSIM] (logPlayerInventory): ERROR :: _player is not a player"]
|
||||||
_items = [];
|
};
|
||||||
_ietms pushback headgear _player;
|
|
||||||
_items pushback uniform _player;
|
|
||||||
_items append uniformItems _player;
|
|
||||||
_items pushback vest _player;
|
|
||||||
_items append vestItems _player;
|
|
||||||
_items pushback backpack _player;
|
|
||||||
_items append backpackItems _player;
|
|
||||||
_items pushback hmd _player;
|
|
||||||
_items pushback binocular _player;
|
|
||||||
_items pushback primaryWeapon _player;
|
|
||||||
_items append primaryWeaponItems _player;
|
|
||||||
_items pushback secondaryWeapon _player;
|
|
||||||
_items append secondaryWeaponItems _player;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
_unlisted = [];
|
|
||||||
|
|
||||||
_restricted = [];
|
|
||||||
_blacklist = [];
|
|
||||||
_tabbed = [];
|
|
||||||
_meme = [];
|
|
||||||
|
|
||||||
diag_log text format["[MILSIM] (logPlayerInventory): Checking %1 inventory.", name _player];
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
|
// DEFINITIONS
|
||||||
_blackListItems = [ // Items that NO member is allowed to use.
|
_blackListItems = [ // Items that NO member is allowed to use.
|
||||||
"17BN_ANPVS14", // NVG AN/PVS-14
|
"17BN_ANPVS14", // NVG AN/PVS-14
|
||||||
"USP_PVS_14", // NVG AN/PVS-14
|
"USP_PVS_14", // NVG AN/PVS-14
|
||||||
@@ -131,7 +120,7 @@ diag_log text format["[MILSIM] (logPlayerInventory): Checking %1 inventory.", na
|
|||||||
"SMA_ACRREMGL", //Remington ACR 556+6.5
|
"SMA_ACRREMGL", //Remington ACR 556+6.5
|
||||||
"LMG_Mk200_F", //Mk200 Series
|
"LMG_Mk200_F", //Mk200 Series
|
||||||
"LMG_Mk200_black_F" //Mk200 Series
|
"LMG_Mk200_black_F" //Mk200 Series
|
||||||
]
|
];
|
||||||
|
|
||||||
_restrictedItems = [ // Items that are allowed for Specific USE Case (RRC / Marksman / etc.)
|
_restrictedItems = [ // Items that are allowed for Specific USE Case (RRC / Marksman / etc.)
|
||||||
"A3_GPNVG18b_REC_TI", // Thermal Quad
|
"A3_GPNVG18b_REC_TI", // Thermal Quad
|
||||||
@@ -224,21 +213,81 @@ diag_log text format["[MILSIM] (logPlayerInventory): Checking %1 inventory.", na
|
|||||||
"Tier1_MK48_Mod0_Para_Desert", // Mk48 Series
|
"Tier1_MK48_Mod0_Para_Desert", // Mk48 Series
|
||||||
"Tier1_MK48_Mod1", // Mk48 Series
|
"Tier1_MK48_Mod1", // Mk48 Series
|
||||||
"Tier1_MK48_Mod1_Desert" // Mk48 Series
|
"Tier1_MK48_Mod1_Desert" // Mk48 Series
|
||||||
]
|
];
|
||||||
|
|
||||||
_memeItems = [ // Items that serve no purpose other than to MEME
|
_memeItems = [ // Items that serve no purpose other than to MEME
|
||||||
"UK3CB_Cocaine_Brick",
|
"UK3CB_Cocaine_Brick",
|
||||||
"ACE_Banana"
|
"ACE_Banana"
|
||||||
]
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// INSTANTIATE VARS
|
||||||
|
private _returnLines = [];
|
||||||
|
|
||||||
|
_unlisted = [];
|
||||||
|
|
||||||
|
_restricted = [];
|
||||||
|
_blacklist = [];
|
||||||
|
_tabbed = [];
|
||||||
|
_meme = [];
|
||||||
|
|
||||||
|
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 _playerInfoString = {
|
||||||
|
params ["_playerObj"];
|
||||||
|
format["playerName=""%1"" playerUID=""%2"" playerGroup=""%3""", name _playerObj, getPlayerUID _playerObj, groupId (group _playerObj)];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// GATHER INVENTORY
|
||||||
|
// _items = [];
|
||||||
|
// _items pushback headgear _player;
|
||||||
|
// _items pushback uniform _player;
|
||||||
|
// _items append uniformItems _player;
|
||||||
|
// _items pushback vest _player;
|
||||||
|
// _items append vestItems _player;
|
||||||
|
// _items pushback backpack _player;
|
||||||
|
// _items append backpackItems _player;
|
||||||
|
// _items pushback hmd _player;
|
||||||
|
// _items pushback binocular _player;
|
||||||
|
// _items pushback primaryWeapon _player;
|
||||||
|
// _items append primaryWeaponItems _player;
|
||||||
|
// _items pushback secondaryWeapon _player;
|
||||||
|
// _items append secondaryWeaponItems _player;
|
||||||
|
|
||||||
|
_items = [
|
||||||
|
_player, // Unit
|
||||||
|
true, // Include weapons, attachments, loaded magazines
|
||||||
|
true, // Include items in backpack
|
||||||
|
true, // Include items in vest
|
||||||
|
true, // Include items in uniform
|
||||||
|
true, // Include assigned items
|
||||||
|
true // Include not loaded magazines
|
||||||
|
] call CBA_fnc_uniqueUnitItems;
|
||||||
|
|
||||||
|
_items pushBack (headgear _player);
|
||||||
|
_items pushBack (uniform _player);
|
||||||
|
|
||||||
|
// CHECK INVENTORY
|
||||||
|
_returnLines pushBack (format[
|
||||||
|
"[MILSIM] (logPlayerInventory): CHECKING :: %1",
|
||||||
|
[_player] call _playerInfoString
|
||||||
|
]);
|
||||||
|
|
||||||
|
{
|
||||||
_item = _x;
|
_item = _x;
|
||||||
_modes = getArray(configfile >> "CfgWeapons" >> _item >> "visionMode");
|
_modes = getArray(configfile >> "CfgWeapons" >> _item >> "visionMode");
|
||||||
|
|
||||||
@@ -254,7 +303,7 @@ diag_log text format["[MILSIM] (logPlayerInventory): Checking %1 inventory.", na
|
|||||||
};
|
};
|
||||||
|
|
||||||
if ( _item in _restrictedItems ) then {
|
if ( _item in _restrictedItems ) then {
|
||||||
_restrcited pushBackUnique _item;
|
_restricted pushBackUnique _item;
|
||||||
};
|
};
|
||||||
|
|
||||||
if ( _item in _tabbedItems ) then {
|
if ( _item in _tabbedItems ) then {
|
||||||
@@ -274,28 +323,44 @@ diag_log text format["[MILSIM] (logPlayerInventory): Checking %1 inventory.", na
|
|||||||
|
|
||||||
} forEach _items;
|
} forEach _items;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
diag_log text format["[MILSIM] (logPlayerInventory): %1 has a blacklisted inventory item: %2", name _player, getText( configfile >> "CfgWeapons" >> _x >> "displayName" )];
|
_nonCompliantItemsCount = _nonCompliantItemsCount + 1;
|
||||||
|
[_player, "BLACKLISTED", _x] call _logItem;
|
||||||
} forEach _blacklist;
|
} forEach _blacklist;
|
||||||
|
|
||||||
{
|
{
|
||||||
diag_log text format["[MILSIM] (logPlayerInventory): %1 has a restricted inventory item: %2", name _player, getText( configfile >> "CfgWeapons" >> _x >> "displayName" )];
|
_nonCompliantItemsCount = _nonCompliantItemsCount + 1;
|
||||||
} forEach _restrcited;
|
[_player, "RESTRICTED", _x] call _logItem;
|
||||||
|
} forEach _restricted;
|
||||||
|
|
||||||
{
|
{
|
||||||
diag_log text format["[MILSIM] (logPlayerInventory): %1 has a tabbed inventory item: %2", name _player, getText( configfile >> "CfgWeapons" >> _x >> "displayName" )];
|
_nonCompliantItemsCount = _nonCompliantItemsCount + 1;
|
||||||
|
[_player, "TABBED", _x] call _logItem;
|
||||||
} forEach _tabbed;
|
} forEach _tabbed;
|
||||||
|
|
||||||
{
|
{
|
||||||
diag_log text format["[MILSIM] (logPlayerInventory): %1 has a meme inventory item: %2", name _player, getText( configfile >> "CfgWeapons" >> _x >> "displayName" )];
|
_nonCompliantItemsCount = _nonCompliantItemsCount + 1;
|
||||||
|
[_player, "MEME", _x] call _logItem;
|
||||||
} forEach _meme;
|
} forEach _meme;
|
||||||
|
|
||||||
{
|
{
|
||||||
diag_log text format["[MILSIM] (logPlayerInventory): %1 has an unlisted thermal item: %2", name _player, getText( configfile >> "CfgWeapons" >> _x >> "displayName" )];
|
if (
|
||||||
|
_x in _blackListItems ||
|
||||||
|
_x in _restrictedItems
|
||||||
|
) then {continue}; // Skip items that are already checked
|
||||||
|
_nonCompliantItemsCount = _nonCompliantItemsCount + 1;
|
||||||
|
[_player, "UNLISTED THERMAL", _x] call _logItem;
|
||||||
} forEach _unlisted;
|
} forEach _unlisted;
|
||||||
|
|
||||||
if (((count _blacklist) isEqualTo 0) && ((count _restrcited) isEqualTo 0) && ((count _tabbed) isEqualTo 0) && ((count _meme) isEqualTo 0) && ((count _unlisted) isEqualTo 0)) then {
|
if (_nonCompliantItemsCount isEqualTo 0) then {
|
||||||
diag_log text format["[MILSIM] (logPlayerInventory): %1 inventory in fully base inventory compliant.", name _player];
|
_returnLines pushBack (format[
|
||||||
}
|
"[MILSIM] (logPlayerInventory): COMPLIANT :: %1",
|
||||||
|
[_player] call _playerInfoString
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
|
||||||
nil
|
// returns array of strings
|
||||||
|
_returnLines;
|
||||||
Reference in New Issue
Block a user