51 lines
1.7 KiB
Plaintext
51 lines
1.7 KiB
Plaintext
// if a player files for reinsert using self-interaction
|
|
// they're added to the queue along with their nearest base location and the time they filed
|
|
// if a player's time in the queue exceeds the configured timeout, a message will be posted every 5 minutes on a cycle based around
|
|
// the player's time in the queue stating how long they have been waiting, their name, and their group's name
|
|
|
|
if (!isServer) exitWith {};
|
|
|
|
// array of all respawn modules in the mission, used as 'base' locations for reinsertion
|
|
milsim_respawn_bases = allMissionObjects "ModuleRespawnPosition_F";
|
|
publicVariable "milsim_respawn_bases";
|
|
|
|
// register queue
|
|
milsim_respawn_reinsertionQueue = [];
|
|
publicVariable "milsim_respawn_reinsertionQueue";
|
|
|
|
|
|
// server mission start time
|
|
milsim_respawn_missionStartServerTime = serverTime;
|
|
|
|
// FILE REQUEST CBA HANDLER
|
|
["milsim_respawn_fileReinsertRequest", {
|
|
params ["_player", "_base"];
|
|
[_player, _base] call milsim_respawn_fnc_addToQueue;
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
// REMOVE REQUEST CBA HANDLER
|
|
["milsim_respawn_removeReinsertRequest", {
|
|
params ["_player"];
|
|
[_player] call milsim_respawn_fnc_removeFromQueue;
|
|
}] call CBA_fnc_addEventHandler;
|
|
|
|
|
|
// automated wait threshold timer
|
|
milsim_respawn_reinsertionOverTimeoutLastNotificationTime = 0;
|
|
|
|
[{ // every 60 seconds
|
|
|
|
// validate queue
|
|
call milsim_respawn_fnc_validateQueue;
|
|
|
|
// check if last overTimeout notification was sent more than X minutes ago
|
|
if (
|
|
diag_tickTime - milsim_respawn_reinsertionOverTimeoutLastNotificationTime > 60*5
|
|
) then {
|
|
// show global queue notification with any players that are over timeout
|
|
call milsim_respawn_fnc_globalShowQueue;
|
|
};
|
|
|
|
}, 60] call CBA_fnc_addPerFrameHandler;
|
|
|