fixes reinsertion formatting and includes groups in diaglog
This commit is contained in:
@@ -25,9 +25,10 @@ if (isServer) then {
|
|||||||
params ["_unit", "_closestBaseName", "_time"];
|
params ["_unit", "_closestBaseName", "_time"];
|
||||||
milsim_respawn_reinsertionQueue pushBackUnique [_unit, _closestBaseName, _time];
|
milsim_respawn_reinsertionQueue pushBackUnique [_unit, _closestBaseName, _time];
|
||||||
diag_log text format [
|
diag_log text format [
|
||||||
"[milsim] (respawn_reinsertion) ADDED name=%1 playerUID=%2 filedAtBase=%3",
|
"[milsim] (respawn_reinsertion) ADDED name=%1 playerUID=%2 group=%3 filedAtBase=%4",
|
||||||
name _unit,
|
name _unit,
|
||||||
getPlayerUID _unit,
|
getPlayerUID _unit
|
||||||
|
groupId (group _unit),
|
||||||
_closestBaseName
|
_closestBaseName
|
||||||
];
|
];
|
||||||
publicVariable "milsim_respawn_reinsertionQueue";
|
publicVariable "milsim_respawn_reinsertionQueue";
|
||||||
@@ -44,9 +45,10 @@ if (isServer) then {
|
|||||||
}, "DESCEND"] call BIS_fnc_sortBy;
|
}, "DESCEND"] call BIS_fnc_sortBy;
|
||||||
(_unitArrs#0) params ["_unit", "_baseName", "_timeFiled"]; // _unitArr = [unit, baseName, timeInQueue]
|
(_unitArrs#0) params ["_unit", "_baseName", "_timeFiled"]; // _unitArr = [unit, baseName, timeInQueue]
|
||||||
private _timeInQueue = diag_tickTime - (_timeFiled);
|
private _timeInQueue = diag_tickTime - (_timeFiled);
|
||||||
diag_log text format ["[milsim] (respawn_reinsertion) REMOVED BY REQUEST name=%1 playerUID=%2 filedAtBase=%3 inQueue=%4s",
|
diag_log text format ["[milsim] (respawn_reinsertion) REMOVED BY REQUEST name=%1 playerUID=%2 group=%3 filedAtBase=%4 inQueue=%5s",
|
||||||
name _unit,
|
name _unit,
|
||||||
getPlayerUID _unit,
|
getPlayerUID _unit,
|
||||||
|
groupId (group _unit),
|
||||||
_baseName,
|
_baseName,
|
||||||
_timeInQueue
|
_timeInQueue
|
||||||
];
|
];
|
||||||
@@ -76,9 +78,10 @@ if (isServer) then {
|
|||||||
_stillValid pushBackUnique _x;
|
_stillValid pushBackUnique _x;
|
||||||
} else {
|
} else {
|
||||||
diag_log text format [
|
diag_log text format [
|
||||||
"[milsim] (respawn_reinsertion) REMOVED AUTOMATICALLY name=%1 playerUID=%2 filedAtBase=%3 nearestBaseDistance=%4m inQueue=%5s",
|
"[milsim] (respawn_reinsertion) REMOVED AUTOMATICALLY name=%1 playerUID=%2 group=%3 filedAtBase=%4 nearestBaseDistance=%5m inQueue=%6s",
|
||||||
name _player,
|
name _player,
|
||||||
getPlayerUID _player,
|
getPlayerUID _player,
|
||||||
|
groupId (group _player),
|
||||||
_baseName,
|
_baseName,
|
||||||
_nearestDistance,
|
_nearestDistance,
|
||||||
diag_tickTime - _timeFiled
|
diag_tickTime - _timeFiled
|
||||||
@@ -97,23 +100,27 @@ if (isServer) then {
|
|||||||
diag_tickTime - milsim_respawn_reinsertionOverTimeoutLastNotificationTime > 60*5; // if last notification was more than 5 minutes ago
|
diag_tickTime - milsim_respawn_reinsertionOverTimeoutLastNotificationTime > 60*5; // if last notification was more than 5 minutes ago
|
||||||
if (_needNotification) then {
|
if (_needNotification) then {
|
||||||
private _timeout = missionNamespace getVariable ["milsim_respawn_setting_reinsertion_timeout", 60*20]; // default 20 minutes
|
private _timeout = missionNamespace getVariable ["milsim_respawn_setting_reinsertion_timeout", 60*20]; // default 20 minutes
|
||||||
private _timeoutPlayers = milsim_respawn_reinsertionQueue select {alive (_x#0) && (diag_tickTime - (_x#2)) > _timeout};
|
private _timeoutPlayers = milsim_respawn_reinsertionQueue select {
|
||||||
|
alive (_x#0) &&
|
||||||
|
(diag_tickTime - (_x#2)) > _timeout
|
||||||
|
};
|
||||||
if (count _timeoutPlayers > 0) then {
|
if (count _timeoutPlayers > 0) then {
|
||||||
// sort _timeoutPlayers by time in queue, descending
|
// sort _timeoutPlayers by time in queue, descending
|
||||||
_timeoutPlayers = [_timeoutPlayers, [], {
|
_timeoutPlayers = [_timeoutPlayers, [], {
|
||||||
_x#2
|
_x#2
|
||||||
}, "DESCEND"] call BIS_fnc_sortBy;
|
}, "DESCEND"] call BIS_fnc_sortBy;
|
||||||
private _playerLines = _timeoutPlayers apply {
|
private _playerLines = ["Players are still waiting for Re-insert!"];
|
||||||
|
{
|
||||||
private _timeInQueue = diag_tickTime - (_x#2);
|
private _timeInQueue = diag_tickTime - (_x#2);
|
||||||
private _groupId = groupID (_x#0);
|
private _groupId = groupID (group (_x#0));
|
||||||
[format [
|
_playerLines pushBack ([format [
|
||||||
"%1: %2 [%2s]",
|
"%1: %2 [%3]",
|
||||||
_groupId,
|
_groupId,
|
||||||
name (_x#0),
|
name (_x#0),
|
||||||
[_timeInQueue, "MM:SS"] call BIS_fnc_secondsToString
|
[_timeInQueue, "MM:SS"] call BIS_fnc_secondsToString
|
||||||
], 0.8, [0.8, 0.8, 0.8, 1]];
|
], 0.8, [0.8, 0.8, 0.8, 1]]);
|
||||||
};
|
} forEach _timeoutPlayers;
|
||||||
["Players are still waiting for Re-insert!", _playerLines] remoteExec ["CBA_fnc_notify", -2];
|
_playerLines remoteExec ["CBA_fnc_notify", [0, -2] select isDedicated];
|
||||||
|
|
||||||
milsim_respawn_reinsertionOverTimeoutLastNotificationTime = diag_tickTime;
|
milsim_respawn_reinsertionOverTimeoutLastNotificationTime = diag_tickTime;
|
||||||
|
|
||||||
@@ -123,8 +130,8 @@ if (isServer) then {
|
|||||||
_timeoutPlayers apply {
|
_timeoutPlayers apply {
|
||||||
format[
|
format[
|
||||||
"%1: %2 [%3]",
|
"%1: %2 [%3]",
|
||||||
groupID (_x#0),
|
groupId (group (_x#0)),
|
||||||
name _x#0,
|
name (_x#0),
|
||||||
diag_tickTime - (_x#2)
|
diag_tickTime - (_x#2)
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,9 +5,25 @@ private _baseNames = (missionNamespace getVariable ["milsim_respawn_reinsertionQ
|
|||||||
private _peopleAtThisBase = (missionNamespace getVariable ["milsim_respawn_reinsertionQueue", []]) select {
|
private _peopleAtThisBase = (missionNamespace getVariable ["milsim_respawn_reinsertionQueue", []]) select {
|
||||||
_x#1 isEqualTo _baseName
|
_x#1 isEqualTo _baseName
|
||||||
} apply {
|
} apply {
|
||||||
[name (_x#0), 0.7, [1,1,1,1]];
|
private _timeInQueue = diag_tickTime - (_x#2);
|
||||||
|
[
|
||||||
|
format [
|
||||||
|
"%1: %2 [%3]",
|
||||||
|
groupId (group (_x#0)),
|
||||||
|
name (_x#0),
|
||||||
|
[_timeInQueue, "MM:SS"] call BIS_fnc_secondsToString
|
||||||
|
],
|
||||||
|
0.7,
|
||||||
|
[1,1,1,1]
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_peopleAtThisBase = [
|
||||||
|
_peopleAtThisBase,
|
||||||
|
[],
|
||||||
|
{_x#0}
|
||||||
|
] call BIS_fnc_sortBy;
|
||||||
|
|
||||||
private _playerCountText = "";
|
private _playerCountText = "";
|
||||||
switch (count _peopleAtThisBase) do {
|
switch (count _peopleAtThisBase) do {
|
||||||
case 0: {
|
case 0: {
|
||||||
|
|||||||
Reference in New Issue
Block a user