pre 0.6 updates

[Added] Dynamic Debris Epoch Event. Dynamically spawns vehicle and other
debris on the roadways.
Scans the roads on startup and uses a random seed generator to determine
the locations of debris.
Debris is spawned using createSimpleObject and is made to conform with
the upper most roadway surface.

[Added]  Epoch Events 3.0
- Supports events based on server side configs and pbos.
- New server side events can be added by just dropping .pbo into
@epochhive/addons folder.
- To make your own standalone events you can use Dynamic Debris Event as
a template.

[Removed] Vehicle simulation handler, so we can use A3 Dynamic
Simulation instead.
[Changed] Safe Vehicle and token checks simplified to only check the
vehicles a player is in.
[Changed] Safe Vehicle classes can now be configured via server settings
pbo CfgSecConf >> vehicles >> safeVehicles array.
This commit is contained in:
vbawol 2017-05-26 08:32:34 -05:00
parent 45e620cdc3
commit 818289161f
22 changed files with 440 additions and 203 deletions

16
Changelogs/0.6.0.0.txt Normal file
View File

@ -0,0 +1,16 @@
== WIP ==
[Added] Option to drink from predetermined sources. @Ignatz-HeMan
[Added] Epoch Events 3.0: Allow external events based on server side configs and pbos.
New server side events can be added just dropping the pbo into @epochhive/addons folder.
To make your own use Dynamic Debris Event as a template.
[Added] Dynamic Debris Epoch Event. Dynamically spawns vehicle and other debris on the roadways.
Scans the roads on startup and uses a random seed generator to determine the locations of debris.
Debris is spawned using createSimpleObject and is made to conform with the upper most roadway surface.
[Added] Epoch Dev Libs by @raymix
[Fixed] BE kick since 1.70.

View File

@ -12,7 +12,7 @@ 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 <scalar>,rain <scalar>,fog <array>,overcast <scalar>,wind <array>}
events[] = {
{ 3600, "CarnivalSpawner", 0 , 1}, // SECOND <scalar>, EVENT <string>, INIT <scalar> 1 = run script at startup, 0 normal delay, PREPOSTFIX <scalar> 1 = use pre/postfix path (inside epoch settings pbo) 0 = use full file path
{ 3600, "CarnivalSpawner", 0 , 1}, // SECOND <scalar>, EVENT <string>, INIT <scalar> 1 = run script at startup or 0 normal delay, PREPOSTFIX <scalar> 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},

View File

@ -638,8 +638,23 @@ class CfgWorldInteractions {
class locomotive_01_v2_f_p3d : Wrecks {};
class excavator_01_abandoned_f_p3d : Wrecks {};
class Land_Wreck_Skodovka_F : Wrecks {};
class Land_Wreck_CarDismantled_F : Wrecks {};
class Land_Wreck_Truck_F : Wrecks {};
class Land_Wreck_Car2_F : Wrecks {};
class Land_Wreck_Car_F : Wrecks {};
class Land_Wreck_Car3_F : Wrecks {};
class Land_Wreck_Hunter_F : Wrecks {};
class Land_Wreck_Van_F : Wrecks {};
class Land_Wreck_Offroad_F : Wrecks {};
class Land_Wreck_UAZ_F : Wrecks {};
class Land_Wreck_Ural_F : Wrecks {};
class Land_Wreck_Truck_dropside_F : Wrecks {};
class Land_Wreck_HMMWV_F : Wrecks {};
class Land_GarbageWashingMachine_F : Trash {};
class Land_GarbageHeap_01_F : Trash {};
class Land_GarbageHeap_02_F : Trash {};
class Land_GarbageHeap_03_F : Trash {};
class Land_GarbageHeap_04_F : Trash {};
};

View File

@ -1 +1 @@
build=757;
build=773;

View File

@ -1 +1 @@
build=757;
build=773;

View File

@ -30,10 +30,8 @@ if (!isNull _player) then {
};
// Delete any left over units with same PUID
{
if ((_x getVariable["PUID", "0"]) == _uid) then {
deleteVehicle _x;
};
} forEach allUnits;
deleteVehicle _x;
} forEach (allUnits select {_x getVariable["PUID", "0"] == _uid});
_uid call EPOCH_server_disconnect;
['Disconnected', [_uid, _name]] call EPOCH_fnc_server_hiveLog;
_return

View File

@ -9,7 +9,7 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"A3_epoch_server_core","A3_epoch_config","A3_server_settings"};
requiredAddons[] = {"A3_epoch_server_core","A3_epoch_config","A3_server_settings","A3_server_events"};
#include "build.hpp"
};
};

View File

@ -4,15 +4,14 @@
item0[] = {"Init",0,250,600.000000,-575.000000,700.000000,-525.000000,0.000000,"Init"};
item1[] = {"_",8,218,600.000000,-500.000000,700.000000,-450.000000,0.000000,""};
item2[] = {"Process",2,250,600.000000,-350.000000,700.000000,-300.000000,0.000000,"Process"};
item3[] = {"De_simulate_Vehicle",4,218,750.000000,-225.000000,850.000000,-175.000000,2.000000,"De-simulate" \n "Vehicle Check"};
item4[] = {"Simulate_Vehicle",4,218,750.000000,-300.000000,850.000000,-250.000000,1.000000,"Simulate" \n "Vehicle Check"};
item5[] = {"CMD_queue",4,218,450.000000,-450.000000,550.000000,-400.000000,10.000000,"CMD queue"};
item6[] = {"Save_Players",4,218,450.000000,-375.000000,550.000000,-325.000000,3.000000,"Save" \n "Players"};
item7[] = {"Cleanup",4,218,750.000000,-375.000000,850.000000,-325.000000,8.000000,"Cleanup"};
item8[] = {"Events",4,4314,450.000000,-225.000000,550.000000,-175.000000,0.000000,"Events"};
item9[] = {"Save_Vehicles",4,218,450.000000,-300.000000,550.000000,-250.000000,4.000000,"Save" \n "Vehicles"};
item10[] = {"Cleanup_Handler",4,218,750.000000,-450.000000,850.000000,-400.000000,8.000000,"Cleanup" \n "Handler"};
item11[] = {"Server_FPS",4,218,600.000000,-225.000000,700.000000,-175.000000,0.000000,"Server FPS"};
item3[] = {"Vehicle_and_Player",4,218,740.131958,-228.950928,840.131958,-178.950928,1.000000,"" \n "Vehicle and Player" \n "Checks"};
item4[] = {"CMD_queue",4,218,450.000000,-450.000000,550.000000,-400.000000,10.000000,"CMD queue"};
item5[] = {"Save_Players",4,218,450.000000,-375.000000,550.000000,-325.000000,3.000000,"Save" \n "Players"};
item6[] = {"Cleanup",4,218,750.000000,-375.000000,850.000000,-325.000000,8.000000,"Cleanup"};
item7[] = {"Events_and_Resta",4,4314,450.000000,-225.000000,550.000000,-175.000000,0.000000,"Events" \n "and" \n "Restart"};
item8[] = {"Save_Vehicles",4,218,450.000000,-300.000000,550.000000,-250.000000,4.000000,"Save" \n "Vehicles"};
item9[] = {"Cleanup_Handler",4,218,750.000000,-450.000000,850.000000,-400.000000,8.000000,"Cleanup" \n "Handler"};
item10[] = {"Server_FPS",4,218,600.000000,-148.030182,700.000000,-98.030182,0.000000,"Server FPS"};
link0[] = {0,1};
link1[] = {1,2};
link2[] = {2,3};
@ -23,18 +22,16 @@ link6[] = {2,7};
link7[] = {2,8};
link8[] = {2,9};
link9[] = {2,10};
link10[] = {2,11};
link11[] = {3,2};
link12[] = {4,2};
link13[] = {5,2};
link14[] = {6,2};
link15[] = {7,2};
link16[] = {8,2};
link17[] = {9,2};
link18[] = {10,2};
link19[] = {11,2};
link10[] = {3,2};
link11[] = {4,2};
link12[] = {5,2};
link13[] = {6,2};
link14[] = {7,2};
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,968,208,1500,208,3,916};
window[] = {2,-1,-1,-32000,-32000,786,26,1318,26,3,916};
*//*%FSM</HEAD>*/
class FSM
{
@ -46,15 +43,24 @@ class FSM
{
name = "Init";
init = /*%FSM<STATEINIT""">*/"diag_log ""Loaded Server FSM"";" \n
"" \n
"_cfgSecConf = (configFile >> ""CfgSecConf"");" \n
"_cfgSecConf_vehicles = (_cfgSecConf >> ""vehicles"");" \n
"_safeVehicles = [_cfgSecConf_vehicles, ""safeVehicles"", [""I_UAV_01_F"",""B_Heli_Transport_01_F"",""Steerable_Parachute_F"",""NonSteerable_Parachute_F"",""Land_Camping_Light_F"",""container_epoch""]] call EPOCH_fnc_returnConfigEntry;" \n
"" \n
"_serverSettingsConfig = configFile >> ""CfgEpochServer"";" \n
"_ahInitAuthCfg = [_serverSettingsConfig, ""antihack_ahInitAuthCfg"", [0,180]] call EPOCH_fnc_returnConfigEntry;" \n
"_events = [_serverSettingsConfig, ""events"", []] call EPOCH_fnc_returnConfigEntry;" \n
"_simulationHandler = [_serverSettingsConfig, ""simulationHandlerOld"", false] call EPOCH_fnc_returnConfigEntry;" \n
"" \n
"_initAhInitBanOrLog = _ahInitAuthCfg select 0;" \n
"_initTimeLimit = _ahInitAuthCfg select 1;" \n
"" \n
"// 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
"} forEach (""isClass _x"" configClasses (configFile >> ""CfgEpochServerEvents""));" \n
"" \n
"_cmdDelay = EPOCH_hiveAdminCmdTime;" \n
"_cmdRun = EPOCH_hiveAdminCmdExec;" \n
"_savePlayerList = EPOCH_hiveAdminSavePlayerList;" \n
@ -66,8 +72,6 @@ class FSM
"_serverLocked = false;" \n
"_serverRestarting = false;" \n
"" \n
"_activeVehicles = [];" \n
"_toBeDesimulated = [];" \n
"_players = [];" \n
"_prevPlayers = [];" \n
"_cleanupItems = [];" \n
@ -76,8 +80,6 @@ class FSM
"_serverFpsTime = diag_tickTime;" \n
"_serverFPSCheckFine = true;" \n
"" \n
"_safeVehicles = [""I_UAV_01_F"",""B_Heli_Transport_01_F"",""Steerable_Parachute_F"",""NonSteerable_Parachute_F"",""Land_Camping_Light_F"",""container_epoch""];" \n
"" \n
"_delayTimeSim = diag_tickTime;" \n
"_delayTimeCMD = diag_tickTime;" \n
"_delayTimeDeSim = diag_tickTime;" \n
@ -91,74 +93,73 @@ class FSM
"_instanceID = call EPOCH_fn_InstanceID;" \n
"" \n
"_checkAuth = {" \n
" _puid = _this select 0;" \n
" _player = _this select 1;" \n
" if !(isNull _player) then {" \n
" if !(_puid call EPOCH_server_Authed) then {" \n
" _lastCheck = _player getVariable ""LAST_AUTH_CHECK"";" \n
" if (isNil ""_lastCheck"") then {" \n
" _player setVariable[""LAST_AUTH_CHECK"", diag_tickTime];" \n
" _lastCheck = diag_tickTime;" \n
" };" \n
" if (diag_tickTime - _lastCheck > _initTimeLimit) then {" \n
" _player setVariable[""LAST_AUTH_CHECK"", nil];" \n
" if (_initAhInitBanOrLog == 0) then {" \n
" 'epochserver' callExtension format['820|%1|EpochMod.com Autoban #R2', _puid];" \n
" ['ahb', format['%1 (%2): Player not Authenticated', name _player, _puid]] call EPOCH_fnc_server_hiveLog;" \n
" } else {" \n
" ['ahl', format['%1 (%2): Player not Authenticated', name _player, _puid]] call EPOCH_fnc_server_hiveLog;" \n
" };" \n
" };" \n
" } else {" \n
" _player setVariable[""LAST_AUTH_CHECK"", nil];" \n
" };" \n
" };" \n
" params [""_puid"",""_player""];" \n
" if !(isNull _player) then {" \n
" if !(_puid call EPOCH_server_Authed) then {" \n
" private _lastCheck = _player getVariable ""LAST_AUTH_CHECK"";" \n
" if (isNil ""_lastCheck"") then {" \n
" _player setVariable[""LAST_AUTH_CHECK"", diag_tickTime];" \n
" _lastCheck = diag_tickTime;" \n
" };" \n
" if (diag_tickTime - _lastCheck > _initTimeLimit) then {" \n
" _player setVariable[""LAST_AUTH_CHECK"", nil];" \n
" if (_initAhInitBanOrLog == 0) then {" \n
" 'epochserver' callExtension format['820|%1|EpochMod.com Autoban #R2', _puid];" \n
" ['ahb', format['%1 (%2): Player not Authenticated', name _player, _puid]] call EPOCH_fnc_server_hiveLog;" \n
" } else {" \n
" ['ahl', format['%1 (%2): Player not Authenticated', name _player, _puid]] call EPOCH_fnc_server_hiveLog;" \n
" };" \n
" };" \n
" } else {" \n
" _player setVariable[""LAST_AUTH_CHECK"", nil];" \n
" };" \n
" };" \n
"};" \n
"" \n
"_cleanIt = {" \n
" if !(isNull _this) then {" \n
" _lastCheck = _this getVariable ""LAST_CHECK"";" \n
" if (isNil ""_lastCheck"") then {" \n
" _this setVariable[""LAST_CHECK"", diag_tickTime];" \n
" _lastCheck = diag_tickTime;" \n
" };" \n
" if (diag_tickTime - _lastCheck > 1200) then {" \n
" _list = _this nearEntities[[""Epoch_Male_F"", ""Epoch_Female_F"", ""LandVehicle"", ""Ship"", ""Air"", ""Tank""], 45];" \n
" if ({ isPlayer _x }count _list == 0) then {" \n
" _this setVariable [""LAST_CHECK"",nil];" \n
" //diag_log format[""DEBUG: _cleanIT del %1"", _this];" \n
" deleteVehicle _this;" \n
"" \n
" };" \n
" };" \n
" };" \n
" if !(isNull _this) then {" \n
" private _lastCheck = _this getVariable ""LAST_CHECK"";" \n
" if (isNil ""_lastCheck"") then {" \n
" _this setVariable[""LAST_CHECK"", diag_tickTime];" \n
" _lastCheck = diag_tickTime;" \n
" };" \n
" if (diag_tickTime - _lastCheck > 1200) then {" \n
" private _list = (_this nearEntities [[""Epoch_Male_F"",""Epoch_Female_F"",""LandVehicle"",""Ship"",""Air"",""Tank""], 45]) select {isPlayer _x};" \n
" if (_list isEqualTo []) then {" \n
" _this setVariable [""LAST_CHECK"",nil];" \n
" //diag_log format[""DEBUG: _cleanIT del %1"", _this];" \n
" deleteVehicle _this;" \n
" };" \n
" };" \n
" };" \n
"};" \n
"" \n
"_cleanIt2 = {" \n
" if !(isNull _this) then {" \n
" _removed = false;" \n
" _lastCheck = _this getVariable ""LAST_CHECK"";" \n
" if (isNil ""_lastCheck"") then {" \n
" _this setVariable[""LAST_CHECK"", diag_tickTime];" \n
" _lastCheck = diag_tickTime;" \n
" };" \n
" if (diag_tickTime - _lastCheck > 1200) then {" \n
" _list = _this nearEntities[[""Epoch_Male_F"", ""Epoch_Female_F"", ""LandVehicle"", ""Ship"", ""Air"", ""Tank""], 45];" \n
" if ({ isPlayer _x }count _list == 0) then {" \n
" {" \n
" deleteVehicle _x;" \n
" }forEach nearestObjects[_this, [""WeaponHolder""], 2];" \n
" _this setVariable [""LAST_CHECK"",nil];" \n
" //diag_log format[""DEBUG: _cleanIT2 del %1"", _this];" \n
" deleteVehicle _this;" \n
" _removed = true;" \n
" };" \n
" };" \n
" if !(_removed) then {" \n
" EPOCH_cleanupQueue pushBack _this;" \n
" };" \n
" };" \n
"};"/*%FSM</STATEINIT""">*/;
" if !(isNull _this) then {" \n
" private _removed = false;" \n
" private _lastCheck = _this getVariable ""LAST_CHECK"";" \n
" if (isNil ""_lastCheck"") then {" \n
" _this setVariable[""LAST_CHECK"", diag_tickTime];" \n
" _lastCheck = diag_tickTime;" \n
" };" \n
" if (diag_tickTime - _lastCheck > 1200) then {" \n
" private _list = (_this nearEntities [[""Epoch_Male_F"",""Epoch_Female_F"",""LandVehicle"",""Ship"",""Air"",""Tank""], 45]) select {isPlayer _x};" \n
" if (_list isEqualTo []) then {" \n
" {" \n
" deleteVehicle _x;" \n
" }forEach nearestObjects[_this, [""WeaponHolder""], 2];" \n
" _this setVariable [""LAST_CHECK"",nil];" \n
" //diag_log format[""DEBUG: _cleanIT2 del %1"", _this];" \n
" deleteVehicle _this;" \n
" _removed = true;" \n
" };" \n
" };" \n
" if !(_removed) then {" \n
" EPOCH_cleanupQueue pushBack _this;" \n
" };" \n
" };" \n
"};" \n
""/*%FSM</STATEINIT""">*/;
precondition = /*%FSM<STATEPRECONDITION""">*/""/*%FSM</STATEPRECONDITION""">*/;
class Links
{
@ -203,6 +204,21 @@ class FSM
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Cleanup_Handler">*/
class Cleanup_Handler
{
priority = 8.000000;
to="Process";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastObjectCleanup) > 300)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastObjectCleanup = diag_tickTime;" \n
"" \n
"// TODO need better way allMissionObjects is not performant" \n
"if (_cleanupItems isEqualTo []) then {" \n
" _cleanupItems = allMissionObjects ""groundWeaponHolder"" + entities ""WeaponHolderSimulated"";" \n
"};"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Cleanup">*/
class Cleanup
{
@ -220,21 +236,6 @@ class FSM
"};"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Cleanup_Handler">*/
class Cleanup_Handler
{
priority = 8.000000;
to="Process";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _lastObjectCleanup) > 300)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_lastObjectCleanup = diag_tickTime;" \n
"" \n
"// TODO need better way allMissionObjects is not performant" \n
"if (_cleanupItems isEqualTo []) then {" \n
" _cleanupItems = allMissionObjects ""groundWeaponHolder"" + entities ""WeaponHolderSimulated"";" \n
"};"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Save_Vehicles">*/
class Save_Vehicles
{
@ -275,41 +276,12 @@ class FSM
"if (_savePlayerList) then {" \n
" [""PLAYERS"", (call EPOCH_fn_InstanceID), _players] call EPOCH_fnc_server_hiveSET;" \n
"};" \n
"" \n
"// Group cleanup" \n
"{if (units _x isEqualTo []) then {deleteGroup _x}}forEach allGroups"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "De_simulate_Vehicle">*/
class De_simulate_Vehicle
{
priority = 2.000000;
to="Process";
precondition = /*%FSM<CONDPRECONDITION""">*/""/*%FSM</CONDPRECONDITION""">*/;
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _delayTimeDeSim) > 12)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_delayTimeDeSim = diag_tickTime;" \n
"" \n
"if !(_activeVehicles isEqualTo []) then {" \n
" _selectedVehicle = _activeVehicles deleteAt 0;" \n
" if !(isNull _selectedVehicle) then {" \n
" _deSim = false;" \n
" if (crew _selectedVehicle isEqualTo []) then {" \n
" if ((getPos _selectedVehicle) select 2 < 1) then {" \n
" if ({isPlayer _x} count (_selectedVehicle nearEntities[[""CAManBase"", ""LandVehicle"", ""Ship"", ""Air"", ""Tank""], 300]) == 0) then {" \n
" _selectedVehicle enableSimulationGlobal false;" \n
" _deSim = true;" \n
" };" \n
" };" \n
" };" \n
" // add vehicle to back of list for later de-simulation" \n
" if !(_deSim) then {" \n
" _activeVehicles pushBack _selectedVehicle;" \n
" };" \n
" };" \n
"};"/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Simulate_Vehicle">*/
class Simulate_Vehicle
/*%FSM<LINK "Vehicle_and_Player">*/
class Vehicle_and_Player
{
priority = 1.000000;
to="Process";
@ -317,39 +289,37 @@ class FSM
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _delayTimeSim) > 5)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"_delayTimeSim = diag_tickTime;" \n
"_playersTemp = [];" \n
"{ " \n
" {" \n
" if !(typeOf _x in _safeVehicles) then {" \n
" if (_x call EPOCH_server_getVToken) then {" \n
" if (_simulationHandler && !(simulationEnabled _x)) then {" \n
" _x enableSimulationGlobal true;" \n
" _activeVehicles pushBack _x;" \n
" };" \n
" } else {" \n
" if ((objectCurators _x) isEqualTo []) then {" \n
" diag_log format[""DEBUG: Invalid Vehicle Token, deleted %1"",_x];" \n
" deleteVehicle _x;" \n
" };" \n
" };" \n
" };" \n
" }forEach (_x nearEntities[[""LandVehicle"", ""Ship"", ""Air"", ""Tank""], 300]);" \n
"{" \n
" private _vehicle = vehicle _x;" \n
" // if player is inside a vehicle check vehicle is in allowed safe vehicles list." \n
" if (_vehicle != _x && {!(typeOf _vehicle in _safeVehicles)}) then {" \n
" // check if vehicle has token set server side and ignore vehicle if was spawned by a Curator (zeus)" \n
" if ((objectCurators _vehicle) isEqualTo [] && {!(_vehicle call EPOCH_server_getVToken)}) then {" \n
" diag_log format[""ADMIN: Invalid Vehicle detected and deleted %1 with %2 driving"",_vehicle,_x];" \n
" deleteVehicle _vehicle;" \n
" };" \n
" };" \n
"" \n
" _pUID = getPlayerUID _x;" \n
" private _pUID = getPlayerUID _x;" \n
" // Add all player UIDs to array for use later." \n
" if (_pUID != """") then { _playersTemp pushBack _pUID; };" \n
"" \n
" if !(_x call EPOCH_server_isPAdmin) then {" \n
" if (isObjectHidden _x) then {" \n
" _x hideObjectGlobal false;" \n
" };" \n
" if (_pUID != """") then {" \n
" _playersTemp pushBack _pUID;" \n
" [_pUID, _x] call _checkAuth;" \n
" };" \n
" } else {" \n
" if (_pUID != """") then { _playersTemp pushBack _pUID; };" \n
" };" \n
" // If player is not admin check perform checks." \n
" if !(_x call EPOCH_server_isPAdmin) then {" \n
" // check if player is hidden and if so force back visable." \n
" if (isObjectHidden _x) then {" \n
" _x hideObjectGlobal false;" \n
" diag_log format[""ADMIN: Warning!!! player was hidden and forced visable %1"",_x];" \n
" };" \n
" // check player has authenticated with reverse token check." \n
" if (_pUID != """") then {" \n
" [_pUID, _x] call _checkAuth;" \n
" };" \n
" };" \n
"" \n
"}forEach allPlayers;" \n
"_players = _playersTemp;"/*%FSM</ACTION""">*/;
"_players = _playersTemp;" \n
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Server_FPS">*/
@ -374,8 +344,8 @@ class FSM
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
/*%FSM<LINK "Events">*/
class Events
/*%FSM<LINK "Events_and_Resta">*/
class Events_and_Resta
{
priority = 0.000000;
to="Process";
@ -383,30 +353,51 @@ class FSM
condition=/*%FSM<CONDITION""">*/"((diag_tickTime - _pvehTime) > 20)"/*%FSM</CONDITION""">*/;
action=/*%FSM<ACTION""">*/"// Epoch Events" \n
"_pvehTime = diag_tickTime;" \n
"_eventsMarkedForRemoval = [];" \n
"{" \n
" _x params [""_time"", ""_scriptName"", [""_runAtStart"",0],[""_usePrePostfix"",1]];" \n
" _eventKey = format[""EPOCH_EVENT_%1"", _forEachIndex];" \n
" _lastTime = missionNamespace getVariable _eventKey;" \n
" if (isNil ""_lastTime"") then {" \n
" _startTime = diag_tickTime;" \n
" if (_runAtStart isEqualTo 1) then {" \n
" _startTime = diag_tickTime - _time;" \n
" };" \n
" missionNamespace setVariable[_eventKey, _startTime];" \n
" _lastTime = _startTime;" \n
" };" \n
" if ((diag_tickTime - _lastTime) >= _time) then {" \n
" missionNamespace setVariable[_eventKey, diag_tickTime];" \n
" _preFix = """";" \n
" _postFix = """";" \n
" if (_usePrePostfix == 1) then {" \n
" _preFix = ""\epoch_server_settings\EpochEvents\"";" \n
" _postFix = "".sqf"";" \n
" };" \n
" _handle = [] execVM format[""%1%2%3"",_preFix,_scriptName,_postFix];" \n
" diag_log format[""DEBUG: _event %1"", _scriptName];" \n
" };" \n
" _x params [""_time"", ""_scriptName"", [""_runAtStart"",0], [""_usePrePostfix"",1], [""_runNumTimes"",-1], [""_input"",[]]];" \n
" _eventKey = format[""EPOCH_EVENT_%1"", _forEachIndex];" \n
" _eventCounter = format[""EPOCH_EVENT_COUNTER_%1"", _forEachIndex];" \n
" _lastTime = missionNamespace getVariable _eventKey;" \n
" _counter = missionNamespace getVariable [_eventCounter,0];" \n
" if (isNil ""_lastTime"") then {" \n
" _startTime = diag_tickTime;" \n
" if (_runAtStart isEqualTo 1) then {" \n
" _startTime = diag_tickTime - _time;" \n
" };" \n
" missionNamespace setVariable[_eventKey, _startTime];" \n
" _lastTime = _startTime;" \n
" };" \n
" if (_counter >= _runNumTimes && _runNumTimes != -1) then {" \n
" _eventsMarkedForRemoval pushBack _forEachIndex;" \n
" } else {" \n
" if ((diag_tickTime - _lastTime) >= _time) then {" \n
" missionNamespace setVariable[_eventKey, diag_tickTime];" \n
" _preFix = """";" \n
" _postFix = """";" \n
" if (_usePrePostfix == 1) then {" \n
" _preFix = ""\epoch_server_settings\EpochEvents\"";" \n
" _postFix = "".sqf"";" \n
" };" \n
" if (_usePrePostfix == 2) then {" \n
" _preFix = ""\epoch_server_events\EpochEvents\"";" \n
" _postFix = "".sqf"";" \n
" };" \n
" _handle = _input execVM format[""%1%2%3"",_preFix,_scriptName,_postFix];" \n
" _counter = _counter + 1;" \n
" missionNamespace setVariable[_eventCounter, _counter];" \n
" diag_log format[""DEBUG: _event %1"", _scriptName];" \n
" };" \n
" };" \n
"} forEach _events;" \n
"// remove expired events" \n
"" \n
"if !(_eventsMarkedForRemoval isEqualTo []) then {" \n
" {" \n
" _removed = _events deleteAt (_eventsMarkedForRemoval deleteAt _forEachIndex);" \n
" diag_log format[""DEBUG: removing event: %1"",_removed];" \n
" } forEach ([] + _eventsMarkedForRemoval);" \n
"};" \n
"" \n
"// restart script" \n
"if (_scriptBasedRestart) then {" \n
@ -444,7 +435,6 @@ class FSM
" };" \n
" };" \n
"};" \n
"" \n
""/*%FSM</ACTION""">*/;
};
/*%FSM</LINK>*/
@ -457,4 +447,4 @@ class FSM
{
};
};
/*%FSM</COMPILE>*/
/*%FSM</COMPILE>*/

View File

@ -1 +1 @@
build=757;
build=773;

View File

@ -0,0 +1,110 @@
/*
Author/s:
Aaron Clark - EpochMod.com
Description:
Spawns Debris Dynamically on Roadways.
Improvements and or bugfixes and other contributions are welcome via the github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server_settings/EpochEvents/DebrisSpawner.sqf
*/
//[[[cog import generate_private_arrays ]]]
private ["_allRoads","_debris","_debrisCounter","_debrisLocations","_debrisLocationsKey","_expiresDebris","_export","_hiveKey","_instanceID","_intersections","_marker","_maxDebrisLimit","_object","_offsetX","_offsetY","_position","_response","_rng","_seed","_selectedDebris","_worldSize"];
//[[[end]]]
_expiresDebris = 604800;
_debris = [
"Land_GarbageBags_F",
"Land_GarbagePallet_F",
"Land_GarbageWashingMachine_F",
"Land_GarbageHeap_01_F",
"Land_GarbageHeap_03_F",
"Land_GarbageHeap_04_F",
"Land_Wreck_Skodovka_F",
"Land_Wreck_CarDismantled_F",
"Land_Wreck_Truck_F",
"Land_Wreck_Car2_F",
"Land_Wreck_Car_F",
"Land_Wreck_Car3_F",
"Land_Wreck_Hunter_F",
"Land_Wreck_Van_F",
"Land_Wreck_Offroad_F",
"Land_Wreck_UAZ_F",
"Land_Wreck_Ural_F",
"Land_Wreck_Truck_dropside_F",
"Land_Wreck_HMMWV_F"
];
_debrisCounter = 0;
_worldSize = worldSize/2;
_instanceID = call EPOCH_fn_InstanceID;
_maxDebrisLimit = 500;
_debrisLocationsKey = format ["%1:%2", _instanceID, worldname];
_response = ["DebrisLocations", _debrisLocationsKey] call EPOCH_fnc_server_hiveGETRANGE;
_response params [["_status",0],["_data",[]] ];
_debrisLocations = [];
if (_status == 1 && _data isEqualType [] && !(_data isEqualTo [])) then {
_debrisLocations = _data;
} else {
diag_log format["DEBUG: Generating new Debris Locations... this is only done once every %1 days.",(_expiresDebris/86400)];
_allRoads = [_worldSize,_worldSize] nearRoads _worldSize;
_seed = random 999999;
diag_log format["DEBUG: Generating new Debris Locations... with seed %1",_seed];
{
_position = getPosWorld _x;
_position params ["_posX","_posY"];
_rng = _seed random [_posX,_posY];
if (_rng > 0.95) then {
_debrisLocations pushBack _position;
};
} forEach _allRoads;
["DebrisLocations", _debrisLocationsKey, _expiresDebris, _debrisLocations] call EPOCH_fnc_server_hiveSETEX;
};
for "_i" from 1 to _maxDebrisLimit do {
_hiveKey = format ["%1:%2", _instanceID, _i];
_response = ["Debris", _hiveKey] call EPOCH_fnc_server_hiveGETRANGE;
_response params [["_status",0],["_data",[]] ];
if (_status == 1 && _data isEqualType [] && !(_data isEqualTo [])) then {
_data params ["_selectedDebris","_posWorld", "_vectorDir", "_vectorUp"];
_object = createSimpleObject [_selectedDebris, _posWorld];
_object setVectorDirAndUp [_vectorDir,_vectorUp];
_object setPosWorld _posWorld;
_debrisCounter = _debrisCounter + 1;
} else {
_position = selectRandom _debrisLocations;
_debrisLocations = _debrisLocations - _position;
_marker = createMarker[str(_position), _position];
_marker setMarkerShape "ICON";
_marker setMarkerType "waypoint";
_marker setMarkerColor "ColorGreen";
_selectedDebris = selectRandom _debris;
_offsetX = (random 10) - 5;
_offsetY = (random 10) - 5;
_position set [0,(_position select 0) + _offsetX];
_position set [1,(_position select 1) + _offsetY];
_position set [2,0];
_intersections = lineIntersectsSurfaces [[_position select 0,_position select 1,1000], _position, objNull, objNull, true, 1];
if !(_intersections isEqualTo []) then {
(_intersections select 0) params ["_intersectPosASL","_surfaceNormal","_intersectObject","_parentObject"];
_object = createSimpleObject [_selectedDebris, _intersectPosASL];
_object setDir random 360;
_object setVectorUp _surfaceNormal;
_object setPosASL _intersectPosASL;
_export = [_selectedDebris,getPosWorld _object, vectorDir _object, vectorUp _object];
["Debris", _hiveKey, _expiresDebris, _export] call EPOCH_fnc_server_hiveSETEX;
_debrisCounter = _debrisCounter + 1;
};
};
};
EP = _debrisCounter;

View File

@ -0,0 +1 @@
build=773;

View File

@ -0,0 +1,37 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
Epoch Server Event (DynamicDebris)
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server_settngs/config.cpp
*/
#define _ARMA_
class CfgPatches {
class A3_server_debris_event {
requiredVersion = 0.1;
requiredAddons[] = {"A3_server_events"};
#include "build.hpp"
};
};
// import settings
class CfgEpochServerEvents
{
class DynamicDebris {
delay = 120; // delay in seconds between executions <SCALAR>,
script = "\epoch_server_debris_event\EpochEvents\DynamicDebris.sqf"; // script: name or full path if usePrefix is set to 0
runOnStart = 1; // runOnStart: 1 = run script at startup, 0 normal delay
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.
};
};

View File

@ -0,0 +1,9 @@
Epoch Mod for Arma 3
http://epochmod.com
by Epoch Mod Team
https://github.com/EpochModTeam/Epoch
The contents of this pbo are under the following license:
http://www.bistudio.com/community/licenses/arma-public-license-share-alike
Keep this file and file headers with attribution intact for proper use.

Binary file not shown.

View File

@ -0,0 +1 @@
build=773;

View File

@ -0,0 +1,47 @@
/*
Author: Aaron Clark - EpochMod.com
Contributors:
Description:
BASE Epoch Server Events !!!DO NOT EDIT THIS FILE!!! Copy the epoch_server_debris_event to make new ones.
Licence:
Arma Public License Share Alike (APL-SA) - https://www.bistudio.com/community/licenses/arma-public-license-share-alike
Github:
https://github.com/EpochModTeam/Epoch/tree/release/Sources/epoch_server_settngs/config.cpp
*/
#define _ARMA_
class CfgPatches {
class A3_server_events {
requiredVersion = 0.1;
requiredAddons[] = {};
#include "build.hpp"
};
};
// import settings
class CfgEpochServerEvents
{
/* EXAMPLES ONLY !!! DO NOT EDIT THIS FILE make a copy of the Dynamic Debris Event !!!
class ContainerSpawner {
delay = 1200; // delay in seconds between executions <SCALAR>,
script = "\epoch_server_events\EpochEvents\ContainerSpawner.sqf"; // script: name or full path if usePrefix is set to 0
runOnStart = 0; // runOnStart: 1 = run script at startup, 0 normal delay
usePrefix = 0; // usePrefix: 1 = use pre/postfix path (inside epoch settings 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.
};
class AirDrop {
delay = 2700; // delay in seconds between executions <SCALAR>,
script = "AirDrop"; // script: name or full path if usePrefix is set to 0
runOnStart = 0; // runOnStart: 1 = run script at startup, 0 normal delay
usePrefix = 2; // usePrefix: 1 = use pre/postfix path (inside epoch settings 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.
};
*/
};

View File

@ -0,0 +1,9 @@
Epoch Mod for Arma 3
http://epochmod.com
by Epoch Mod Team
https://github.com/EpochModTeam/Epoch
The contents of this pbo are under the following license:
http://www.bistudio.com/community/licenses/arma-public-license-share-alike
Keep this file and file headers with attribution intact for proper use.

Binary file not shown.

View File

@ -1 +1 @@
build=757;
build=773;

View File

@ -16,6 +16,10 @@ class CfgSecConf
{
debug = "false";
class vehicles {
safeVehicles[] = {"I_UAV_01_F","B_Heli_Transport_01_F","Steerable_Parachute_F","NonSteerable_Parachute_F","Land_Camping_Light_F","container_epoch"};
};
class remoteExecClient{
functions[] = {"bankBalance", "resetGroup", "groupUpdate", "groupUidUpdate", "healPlayer","tradeComplete"};
// code

View File

@ -1 +1 @@
757
773