From acfba073fcad8101d01106ffa6ed64d055bf52ff Mon Sep 17 00:00:00 2001 From: vbawol Date: Sun, 17 Sep 2017 12:11:40 -0500 Subject: [PATCH] added disallowed events per worldName bunker test code updates --- Server_Install_Pack/@epochhive/epochconfig.hpp | 14 +++++++------- Sources/epoch_server/system/server_monitor.fsm | 12 ++++++------ .../EpochEvents/DynamicBunker.sqf | 13 ++++++++++++- Sources/epoch_server_debris_event/config.cpp | 1 + Sources/epoch_server_vip_event/config.cpp | 1 + 5 files changed, 27 insertions(+), 14 deletions(-) diff --git a/Server_Install_Pack/@epochhive/epochconfig.hpp b/Server_Install_Pack/@epochhive/epochconfig.hpp index dc8791a7..96fcd9e0 100644 --- a/Server_Install_Pack/@epochhive/epochconfig.hpp +++ b/Server_Install_Pack/@epochhive/epochconfig.hpp @@ -12,15 +12,15 @@ lootMultiplier = 0.5; // 1 = max loot bias. This controls how much loot can payo // Events WeatherStaticForecast[] = {}; // Default: {75.5,0,{0,0,0},0,{1,1}}; // Clear day; {19,1,{1,1,40},1,{5,5}}; // Cold Foggy Rainy Overcast Windy; Format: {temp ,rain ,fog ,overcast ,wind } events[] = { - { 3600, "CarnivalSpawner", 0 , 1}, // SECOND , EVENT , INIT 1 = run script at startup or 0 normal delay, PREPOSTFIX 1 = use pre/postfix path (inside epoch settings pbo) 0 = use full file path + { 3600, "CarnivalSpawner", 0 , 1, -1, {"VR"}}, // SECOND , EVENT , INIT 1 = run script at startup or 0 normal delay, PREPOSTFIX 1 = use pre/postfix path (inside epoch settings pbo) 0 = use full file path // { 1800, "PaydayEvent", 0, 1}, // { 1200, "MessageServer", 0, 1}, - { 2700, "AirDrop", 0 , 1}, - { 2400, "EarthQuake", 0 , 1}, - { 2700, "Satellite", 0 , 1}, - { 900, "ChangeWeather", 1 , 1}, - { 1200, "ContainerSpawner", 0 , 1}, - { 300, "PlantSpawner", 0 , 1} //No comma on last Entry + { 2700, "AirDrop", 0 , 1, -1, {"VR"}}, + { 2400, "EarthQuake", 0 , 1, -1, {"VR"}}, + { 2700, "Satellite", 0 , 1, -1, {"VR"}}, + { 900, "ChangeWeather", 1 , 1, -1, {"VR"}}, + { 1200, "ContainerSpawner", 0 , 1, -1, {"VR"}}, + { 300, "PlantSpawner", 0 , 1 , -1, {"VR"}} //No comma on last Entry }; // Antagonists diff --git a/Sources/epoch_server/system/server_monitor.fsm b/Sources/epoch_server/system/server_monitor.fsm index 6aef5288..ccb43c72 100644 --- a/Sources/epoch_server/system/server_monitor.fsm +++ b/Sources/epoch_server/system/server_monitor.fsm @@ -31,7 +31,7 @@ link15[] = {8,2}; link16[] = {9,2}; link17[] = {10,2}; globals[] = {0.000000,0,0,0,0,640,480,1,3,6316128,1,275.180084,1161.319580,208.497711,-659.879456,898,884,1}; -window[] = {2,-1,-1,-1,-1,786,26,1318,26,3,916}; +window[] = {2,-1,-1,-32000,-32000,994,234,1526,234,3,916}; *//*%FSM*/ class FSM { @@ -58,7 +58,7 @@ class FSM "// Load Epoch Events 3.0" \n "{" \n " diag_log format[""Loading Settings for %1 event..."",configName _x];" \n - " _events pushBack [getNumber (_x >> ""delay""),getText (_x >> ""script""),getNumber (_x >> ""runOnStart""),getNumber (_x >> ""usePrefix""),getNumber (_x >> ""runNumTimes"")];" \n + " _events pushBack [getNumber (_x >> ""delay""),getText (_x >> ""script""),getNumber (_x >> ""runOnStart""),getNumber (_x >> ""usePrefix""),getNumber (_x >> ""runNumTimes""),getArray (_x >> ""disallowedWorlds"")];" \n "} forEach (""isClass _x"" configClasses (configFile >> ""CfgEpochServerEvents""));" \n "" \n "_cmdDelay = EPOCH_hiveAdminCmdTime;" \n @@ -355,7 +355,7 @@ class FSM "_pvehTime = diag_tickTime;" \n "_newEvents = [];" \n "{" \n - " _x params [""_time"", ""_scriptName"", [""_runAtStart"",0], [""_usePrePostfix"",1], [""_runNumTimes"",-1], [""_input"",[]]];" \n + " _x params [""_time"", ""_scriptName"", [""_runAtStart"",0], [""_usePrePostfix"",1], [""_runNumTimes"",-1], [""_input"",[]], [""_disallowedWorlds"",[]] ];" \n " _eventKey = format[""EPOCH_EVENT_%1"", _forEachIndex];" \n " _eventCounter = format[""EPOCH_EVENT_COUNTER_%1"", _forEachIndex];" \n " _lastTime = missionNamespace getVariable _eventKey;" \n @@ -368,8 +368,8 @@ class FSM " missionNamespace setVariable[_eventKey, _startTime];" \n " _lastTime = _startTime;" \n " };" \n - " if (_counter >= _runNumTimes && _runNumTimes != -1) then {" \n - " diag_log format[""DEBUG: server event expired %1"", _scriptName];" \n + " if ((_counter >= _runNumTimes && _runNumTimes != -1) || worldName in _disallowedWorlds) then {" \n + " diag_log format[""DEBUG: server event removed %1"", _scriptName];" \n " } else {" \n " _newEvents pushBack _x;" \n " if ((diag_tickTime - _lastTime) >= _time) then {" \n @@ -442,4 +442,4 @@ class FSM { }; }; -/*%FSM*/ \ No newline at end of file +/*%FSM*/ diff --git a/Sources/epoch_server_bunker_event/EpochEvents/DynamicBunker.sqf b/Sources/epoch_server_bunker_event/EpochEvents/DynamicBunker.sqf index a88f08a7..0d642105 100644 --- a/Sources/epoch_server_bunker_event/EpochEvents/DynamicBunker.sqf +++ b/Sources/epoch_server_bunker_event/EpochEvents/DynamicBunker.sqf @@ -9,7 +9,7 @@ https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server_bunker_event/EpochEvents/BunkerSpawner.sqf */ //[[[cog import generate_private_arrays ]]] -private ["_allBunkers","_animationStates","_bunkerClasses","_bunkerCounter","_bunkerLocationsKey","_bunkerLocationsTMP","_colCount","_debug","_debugLocation","_expiresBunker","_instanceID","_list","_loc1","_location","_maxBunkerLimitPerRow","_maxBunkerLimitSlots","_maxColumns","_memoryPoints","_modelInfo","_newBunkerCounter","_object","_originalLocation","_pOffset","_response","_rng","_rngChance","_rowCount","_score","_scriptHiveKey","_seed","_selectedBunker","_size","_veh"]; +private ["_allBunkers","_animationStates","_bunkerClasses","_bunkerCounter","_bunkerLocationsKey","_bunkerLocationsTMP","_colCount","_debug","_debugLocation","_expiresBunker","_firstBunker","_instanceID","_list","_loc1","_location","_maxBunkerLimitPerRow","_maxBunkerLimitSlots","_maxColumns","_memoryPoints","_modelInfo","_newBunkerCounter","_object","_originalLocation","_pOffset","_response","_rng","_rngChance","_rowCount","_score","_scriptHiveKey","_seed","_selectedBunker","_size","_veh"]; //[[[end]]] if (worldName == "VR") then { @@ -33,6 +33,8 @@ if (worldName == "VR") then { _response = [_scriptHiveKey, _bunkerLocationsKey] call EPOCH_fnc_server_hiveGETRANGE; _response params [["_status",0],["_data",[]] ]; + _firstBunker = objNull; + // check for proper return and data type if (_status == 1 && _data isEqualType [] && !(_data isEqualTo [])) then { @@ -41,6 +43,7 @@ if (worldName == "VR") then { if (_x isEqualType [] && !(_x isEqualTo [])) then { _x params ["_selectedBunker", "_posWorld", ["_memoryPointsStatus",[]] ]; _object = createSimpleObject [_selectedBunker, _posWorld]; + if (isNull _firstBunker) then {_firstBunker = _object;}; { _object animate [_x,(_memoryPointsStatus param [_forEachIndex,1]),true]; } forEach _memoryPoints; @@ -80,6 +83,7 @@ if (worldName == "VR") then { if (_rng > _rngChance) then { _selectedBunker = selectRandom _bunkerClasses; _object = createSimpleObject [_selectedBunker, _location]; + if (isNull _firstBunker) then {_firstBunker = _object;}; _allBunkers pushBack _object; //_bunkerLocationsTMP pushBack [_selectedBunker,getPosWorld _object, vectorDir _object, vectorUp _object]; _newBunkerCounter = _newBunkerCounter + 1; @@ -107,6 +111,7 @@ if (worldName == "VR") then { _score = _score + 1; _animationStates pushBack 0 } else { + _veh animate [_x,1,true]; _animationStates pushBack 1 }; }; @@ -119,6 +124,12 @@ if (worldName == "VR") then { [_scriptHiveKey, _bunkerLocationsKey, _expiresBunker, _bunkerLocationsTMP] call EPOCH_fnc_server_hiveSETEX; }; + // move respawn point into first bunker. + if (!(isNull _firstBunker) && {_firstBunker distance _debugLocation > 2}) then { + deleteMarker "respawn_west"; + createMarker ["respawn_west", getposATL _firstBunker]; + }; + if (_debug) then { diag_log format["DEBUG: Spawned %1 Existing Bunker",_bunkerCounter]; if (_newBunkerCounter > 0) then { diff --git a/Sources/epoch_server_debris_event/config.cpp b/Sources/epoch_server_debris_event/config.cpp index 85252174..2ee61ce3 100644 --- a/Sources/epoch_server_debris_event/config.cpp +++ b/Sources/epoch_server_debris_event/config.cpp @@ -33,5 +33,6 @@ class CfgEpochServerEvents usePrefix = 0; // usePrefix: 1 = pre/postfix path (use if file is inside epoch settings pbo EpochEvents folder), 2 = pre/postfix path (use if file inside epoch events pbo EpochEvents folder), 0 = use full file path runNumTimes = 1; // runNumTimes: -1 = no limit, 0 = disabled, 1+ = number of times to execute before removing event. input[] = {}; // array input to execVM at time of run and accessed with _this inside of script. + disallowedWorlds = {"VR"}; }; }; diff --git a/Sources/epoch_server_vip_event/config.cpp b/Sources/epoch_server_vip_event/config.cpp index 031ab351..d3a3aaf7 100644 --- a/Sources/epoch_server_vip_event/config.cpp +++ b/Sources/epoch_server_vip_event/config.cpp @@ -33,5 +33,6 @@ class CfgEpochServerEvents usePrefix = 0; // usePrefix: 0 = use full file path, 1 = pre/postfix path (use if file is inside epoch settings pbo EpochEvents folder), 2 = pre/postfix path (use if file inside epoch events pbo EpochEvents folder). runNumTimes = -1; // runNumTimes: 0 = disabled, 1+ = number of times to execute before removing event, -1 = no limit. input[] = {"ItemBriefcaseGold100oz"}; // array input to execVM at time of run and accessed with _this inside of script. + disallowedWorlds = {"VR"}; }; };