2016-10-22 21:15:11 +00:00
/*
2018-01-07 07:02:29 +00:00
By Ghostrider-GRG-
2017-03-15 04:36:06 +00:00
--------------------------
License
--------------------------
All the code and information provided here is provided under an Attribution Non-Commercial ShareAlike 4.0 Commons License.
http://creativecommons.org/licenses/by-nc-sa/4.0/
2016-10-22 21:15:11 +00:00
*/
2017-10-19 02:31:53 +00:00
if ( !(isServer) || hasInterface) exitWith{};
2018-11-18 19:29:07 +00:00
#include "blck_defines.hpp";
2017-03-15 04:36:06 +00:00
2016-11-13 11:59:40 +00:00
if !(isNil "blck_Initialized") exitWith{};
2018-07-21 21:04:50 +00:00
private _blck_loadingStartTime = diag_tickTime;
2016-11-12 12:05:45 +00:00
#include "\q\addons\custom_server\init\build.sqf";
2017-10-19 02:31:53 +00:00
diag_log format["[blckeagls] Loading Server Mission System Version %2 Build Date %1",_blck_versionDate,_blck_version];
2016-10-22 21:15:11 +00:00
// compile functions
call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\blck_functions.sqf";
waitUntil {(isNil "blck_functionsCompiled") isEqualTo false;};
waitUntil{blck_functionsCompiled};
blck_functionsCompiled = nil;
2018-10-21 11:56:34 +00:00
diag_log format["[blckeagls] functions compiled at %1",diag_tickTime];
2016-11-12 12:05:45 +00:00
2018-06-13 23:55:59 +00:00
blck_modType = call blck_fnc_getModType;
publicVariable "blck_modType";
2017-03-18 10:45:32 +00:00
execVM "\q\addons\custom_server\Configs\blck_configs.sqf";
waitUntil {(isNil "blck_configsLoaded") isEqualTo false;};
waitUntil{blck_configsLoaded};
blck_configsLoaded = nil;
2018-10-21 11:56:34 +00:00
diag_log format["[blckeagls] blck_useHC = %1 | blck_simulationManager = %2 ",blck_useHC,blck_simulationManager];
diag_log format["[blckeagls] debug mode settings:blck_debugON = %1 blck_debugLevel = %2",blck_debugON,blck_debugLevel];
2018-07-06 23:38:03 +00:00
// Load any user-defined specifications or overrides
call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Configs\blck_custom_config.sqf";
2018-10-21 11:56:34 +00:00
diag_log format["[blckeagls] configurations loaded at %1",diag_tickTime];
call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\Compiles\blck_variables.sqf";
waitUntil {(isNil "blck_variablesLoaded") isEqualTo false;};
waitUntil{blck_variablesLoaded};
blck_variablesLoaded = nil;
diag_log format["[blckeagls] blck_variables loaded at %1",diag_tickTime];
2018-07-06 23:38:03 +00:00
2017-01-03 14:24:27 +00:00
// spawn map addons to give the server time to position them before spawning in crates etc.
if (blck_spawnMapAddons) then
{
call compileFinal preprocessFileLineNumbers "\q\addons\custom_server\MapAddons\MapAddons_init.sqf";
}else{
2018-10-21 11:56:34 +00:00
diag_log "[blckeagls] Map Addons disabled";
2017-01-03 14:24:27 +00:00
};
blck_spawnMapAddons = nil;
2016-10-22 21:15:11 +00:00
diag_log "[blckeagls] Loading Map-specific information";
2018-07-21 21:04:50 +00:00
execVM "\q\addons\custom_server\init\GMS_fnc_findWorld.sqf";
2016-10-22 21:15:11 +00:00
waitUntil {(isNil "blck_worldSet") isEqualTo false;};
waitUntil{blck_worldSet};
blck_worldSet = nil;
2018-11-18 19:29:07 +00:00
#ifdef GRG_TestServer
//[] execVM "\q\addons\custom_server\init\testCrateLoading.sqf";
#endif
2016-10-22 21:15:11 +00:00
// set up the lists of available missions for each mission category
diag_log "[blckeagls] Loading Mission Lists";
#include "\q\addons\custom_server\Missions\GMS_missionLists.sqf";
2018-07-06 23:38:03 +00:00
diag_log "[blckeagls] Mission Lists Loaded Successfully";
2016-11-12 12:05:45 +00:00
2018-07-06 23:38:03 +00:00
[] execVM "\q\addons\custom_server\Missions\Static\GMS_StaticMissions_init.sqf";
[] execVM "q\addons\custom_server\Missions\UMS\GMS_UMS_init.sqf"; // loads functions and spawns any static missions.
2018-10-21 11:56:34 +00:00
diag_log "[blckeagls] blck_init_server: ->> Static and UMS systems initialized.";
2018-07-06 23:38:03 +00:00
2018-10-21 11:56:34 +00:00
switch (blck_simulationManager) do
{
case 2: {diag_log "[blckeagls] dynamic simulation manager enabled"};
case 1: {diag_log "[blckeagls] blckeagls simulation manager enabled"};
case 0: {diag_log "[blckeagls] simulation management disabled"};
};
2018-11-18 19:29:07 +00:00
diag_log "[blckeagls] Running GhostriderGaming Version";
#endif
2017-05-01 01:58:38 +00:00
if !(blck_debugON || (blck_debugLevel isEqualTo 0)) then
2017-01-12 09:27:58 +00:00
{
2018-06-13 23:55:59 +00:00
waitUntil{{isPlayer _x}count allPlayers > 0};
2017-05-01 01:58:38 +00:00
diag_log "[blckeagls] Player Connected, spawning missions";
} else {
diag_log "[blckeagls] spawning Missions";
2017-01-12 09:27:58 +00:00
};
2016-10-22 21:15:11 +00:00
2018-11-18 19:29:07 +00:00
2016-12-20 05:08:37 +00:00
if (blck_spawnStaticLootCrates) then
{
// Start the static loot crate spawner
2017-05-01 01:58:38 +00:00
diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner Started";
2018-07-06 23:38:03 +00:00
[] execVM "\q\addons\custom_server\SLS\SLS_init.sqf";
waitUntil {(isNil "blck_SLSComplete") isEqualTo false;};
waitUntil {blck_SLSComplete};
blck_SLSComplete = nil;
2017-05-01 01:58:38 +00:00
diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner Done";
2016-12-20 05:08:37 +00:00
}else{
diag_log "[blckeagls] SLS:: -- >> Static Loot Spawner disabled";
};
2018-07-21 21:04:50 +00:00
if (true /*blck_blacklistTraderCities*/) then
{
execVM "\q\addons\custom_server\init\GMS_fnc_getTraderCites.sqf";
};
2018-11-18 19:29:07 +00:00
diag_log format["[blckeagls] _init_server: blck_enableOrangeMissions = %1",blck_enableOrangeMissions];
2016-10-22 21:15:11 +00:00
//Start the mission timers
2016-12-23 01:02:19 +00:00
if (blck_enableOrangeMissions > 0) then
2016-10-22 21:15:11 +00:00
{
2017-01-22 11:48:41 +00:00
//[_missionListOrange,_pathOrange,"OrangeMarker","orange",blck_TMin_Orange,blck_TMax_Orange] spawn blck_fnc_missionTimer;//Starts major mission system (Orange Map Markers)
[_missionListOrange,_pathOrange,"OrangeMarker","orange",blck_TMin_Orange,blck_TMax_Orange,blck_enableOrangeMissions] call blck_fnc_addMissionToQue;
2016-10-22 21:15:11 +00:00
};
2018-11-18 19:29:07 +00:00
diag_log format["[blckeagls] _init_server: blck_enableGreenMissions = %1",blck_enableGreenMissions];
2016-12-23 01:02:19 +00:00
if (blck_enableGreenMissions > 0) then
2016-10-22 21:15:11 +00:00
{
2017-01-22 11:48:41 +00:00
//[_missionListGreen,_pathGreen,"GreenMarker","green",blck_TMin_Green,blck_TMax_Green] spawn blck_fnc_missionTimer;//Starts major mission system 2 (Green Map Markers)
[_missionListGreen,_pathGreen,"GreenMarker","green",blck_TMin_Green,blck_TMax_Green,blck_enableGreenMissions] call blck_fnc_addMissionToQue;
2016-10-22 21:15:11 +00:00
};
2018-11-18 19:29:07 +00:00
diag_log format["[blckeagls] _init_server: blck_enableRedMissions = %1",blck_enableRedMissions];
2016-12-23 01:02:19 +00:00
if (blck_enableRedMissions > 0) then
2016-10-22 21:15:11 +00:00
{
2017-01-22 11:48:41 +00:00
//[_missionListRed,_pathRed,"RedMarker","red",blck_TMin_Red,blck_TMax_Red] spawn blck_fnc_missionTimer;//Starts minor mission system (Red Map Markers)//Starts minor mission system 2 (Red Map Markers)
[_missionListRed,_pathRed,"RedMarker","red",blck_TMin_Red,blck_TMax_Red,blck_enableRedMissions] call blck_fnc_addMissionToQue;
2016-10-22 21:15:11 +00:00
};
2018-11-18 19:29:07 +00:00
diag_log format["[blckeagls] _init_server: blck_enableBlueMissions = %1",blck_enableBlueMissions];
2016-12-23 01:02:19 +00:00
if (blck_enableBlueMissions > 0) then
2016-10-22 21:15:11 +00:00
{
2017-01-22 11:48:41 +00:00
//[_missionListBlue,_pathBlue,"BlueMarker","blue",blck_TMin_Blue,blck_TMax_Blue] spawn blck_fnc_missionTimer;//Starts minor mission system (Blue Map Markers)
[_missionListBlue,_pathBlue,"BlueMarker","blue",blck_TMin_Blue,blck_TMax_Blue,blck_enableBlueMissions] call blck_fnc_addMissionToQue;
2016-10-22 21:15:11 +00:00
};
2017-12-17 22:51:44 +00:00
2017-01-25 06:01:16 +00:00
// start the main thread for the mission system which monitors missions running and stuff to be cleaned up
[] spawn blck_fnc_mainThread;
2017-10-19 02:31:53 +00:00
2018-07-06 23:38:03 +00:00
diag_log "[blckeagls] < MISSION SYSTEM FULLY INITIALIZED AND RUNNING >";