change root level folder name to framework, update resupply+vehicleflags
tested locally
This commit is contained in:
50
framework/reinsert/server/fn_initServer.sqf
Normal file
50
framework/reinsert/server/fn_initServer.sqf
Normal file
@@ -0,0 +1,50 @@
|
||||
// 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_baseObjects = allMissionObjects "ModuleRespawnPosition_F";
|
||||
publicVariable "milsim_baseObjects";
|
||||
|
||||
// register queue
|
||||
milsim_reinsert_reinsertionQueue = [];
|
||||
publicVariable "milsim_reinsert_reinsertionQueue";
|
||||
|
||||
|
||||
// server mission start time
|
||||
milsim_reinsert_missionStartServerTime = serverTime;
|
||||
|
||||
// FILE REQUEST CBA HANDLER
|
||||
["milsim_reinsert_fileReinsertRequest", {
|
||||
params ["_player", "_base"];
|
||||
[_player, _base] call milsim_reinsert_fnc_addToQueue;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
// REMOVE REQUEST CBA HANDLER
|
||||
["milsim_reinsert_removeReinsertRequest", {
|
||||
params ["_player"];
|
||||
[_player] call milsim_reinsert_fnc_removeFromQueue;
|
||||
}] call CBA_fnc_addEventHandler;
|
||||
|
||||
|
||||
// automated wait threshold timer
|
||||
milsim_reinsert_reinsertionOverTimeoutLastNotificationTime = 0;
|
||||
|
||||
[{ // every 60 seconds
|
||||
|
||||
// validate queue
|
||||
call milsim_reinsert_fnc_validateQueue;
|
||||
|
||||
// check if last overTimeout notification was sent more than X minutes ago
|
||||
if (
|
||||
diag_tickTime - milsim_reinsert_reinsertionOverTimeoutLastNotificationTime > 60*5
|
||||
) then {
|
||||
// show global queue notification with any players that are over timeout
|
||||
call milsim_reinsert_fnc_globalShowQueue;
|
||||
};
|
||||
|
||||
}, 60] call CBA_fnc_addPerFrameHandler;
|
||||
|
||||
Reference in New Issue
Block a user