big refactor, WIP!

This commit is contained in:
2024-02-06 01:52:25 -08:00
parent f588ffa4a0
commit 0a64d9e170
74 changed files with 1024 additions and 701 deletions

View File

@@ -1,3 +1,5 @@
#include "..\script_component.hpp"
params [
["_player", objNull, [objNull]],
["_base", objNull, [objNull]],
@@ -6,51 +8,54 @@ params [
if (!isServer) exitWith {
[
"respawn_reinsertion",
LEVEL_ERROR,
QUOTE(COMPONENT),
"ATTEMPTED RUN ON CLIENT",
[
["player", _player],
["base", _base]
]
] call milsim_util_fnc_log;
] call EFUNC(common,log);
["ATTEMPTED RUN ON CLIENT"] call BIS_fnc_error;
};
if (
isNull _player ||
isNull _base
) exitWith {
[
"respawn_reinsertion",
LEVEL_ERROR,
QUOTE(COMPONENT),
"NULL PARAMETERS",
[
["player", _player],
["base", _base]
]
] call milsim_util_fnc_log;
] call EFUNC(common,log);
["NULL PARAMETERS"] call BIS_fnc_error;
};
private _maxRangeToReady = missionNamespace getVariable ["milsim_reinsert_setting_reinsertion_maxRangeToReady", 400];
private _maxRangeToReady = missionNamespace getVariable [QGVAR(setting_maxRangeToReady), 400];
// nearest base here is the same as the base sent
private _nearestBase = _base;
milsim_reinsert_reinsertionQueue pushBackUnique [
GVAR(reinsertionQueue) pushBackUnique [
_player, _base, _timeFiled
];
// broadcast new list to all machines
publicVariable "milsim_reinsert_reinsertionQueue";
publicVariable QGVAR(reinsertionQueue);
// log to rpt
private _logParams = [
["filedAtBase", [_base] call milsim_util_fnc_getNameOfBase],
["filedAtBaseDistance", _player distance _base],
["closestBase", [_nearestBase] call milsim_util_fnc_getNameOfBase],
["closestBaseDistance", _player distance _nearestBase],
["maxDistanceSetting", _maxRangeToReady],
["inQueueDuration", diag_tickTime - _timeFiled]
];
_logParams = [_player, _logParams] call milsim_util_fnc_addPlayerInfoToArray;
[
"respawn_reinsertion",
LEVEL_INFO,
QUOTE(COMPONENT),
"PLAYER FILED REQUEST",
_logParams
] call milsim_util_fnc_log;
[_player, [
["filedAtBase", [_base] call EFUNC(common,getNameOfBase)],
["filedAtBaseDistance", _player distance _base],
["closestBase", [_nearestBase] call EFUNC(common,getNameOfBase)],
["closestBaseDistance", _player distance _nearestBase],
["maxDistanceSetting", _maxRangeToReady],
["inQueueDuration", diag_tickTime - _timeFiled]
]] call EFUNC(common,addPlayerInfoToArray)
] call EFUNC(common,log);