From 6fae1a12f573be0982488f29c02e0646623bedd2 Mon Sep 17 00:00:00 2001 From: vbawol Date: Thu, 12 Nov 2015 12:01:19 -0600 Subject: [PATCH] 0.3.5.033 --- Changelogs/0.3.5.0.txt | 32 ++- .../@epochhive/addons/a3_epoch_server.pbo | Bin 359169 -> 360839 bytes .../addons/a3_epoch_server_settings.pbo | Bin 273726 -> 274216 bytes .../@epochhive/addons/epoch_server_core.pbo | Bin 14116 -> 14116 bytes Server_Install_Pack/sc/battleye/attachto.txt | 2 +- .../epoch_code/compile/EPOCH_onEachFrame.sqf | 6 +- .../compile/building/EPOCH_staticMove.sqf | 52 ++-- .../EPOCH_fn_returnConfigEntryV2.sqf | 8 +- Sources/epoch_config/Configs/CfgPricing.hpp | 4 +- .../epoch_config/Configs/CfgSnapChecks.hpp | 48 ++++ Sources/epoch_config/Configs/CfgVehicles.hpp | 11 +- Sources/epoch_config/config.cpp | 1 + .../compile/epoch_bases/fn_saveBuilding.sqf | 15 +- .../epoch_player/EPOCH_server_loadPlayer.sqf | 260 +++++++++--------- .../epoch_vehicle/EPOCH_load_vehicles.sqf | 4 +- .../epoch_server/init/server_variables.sqf | 14 +- 16 files changed, 263 insertions(+), 194 deletions(-) create mode 100644 Sources/epoch_config/Configs/CfgSnapChecks.hpp diff --git a/Changelogs/0.3.5.0.txt b/Changelogs/0.3.5.0.txt index 1e0b67b5..82341eaf 100644 --- a/Changelogs/0.3.5.0.txt +++ b/Changelogs/0.3.5.0.txt @@ -1,24 +1,30 @@ +**Client** [Added] Metal Floors as upgrade in-place option for wood floors. [Added] Gender selection screen improvements. [Added] New interaction system. -[Added] Documentation on server core framework functions and hive calls. [Added] Persistent wood and metal spike traps. [Added] New custom 3x wide hesco type barrier. [Added] New custom tank trap. [Added] Updated version of the Fishing Rod. -[Added] muzzle_snds_338_sand to loot and pricing tables. -[Added] Client side master loop is now fully config (CfgMasterLoop) based. -[Changed] Final overhaul of secure storage system with support for new UI. -[Changed] Increased reverse token check timeout from 90 to 180 seconds. -[Changed] Server pack Tools folder now contains InstalEpoch.cmd that is an updated version of the command line download Epoch client files download script for steam workshop. -[Fixed] Was unable to use cursorTarget underwater, added new function EPOCH_fnc_cursorTarget that works everywhere. +[Changed] Players now start with a Quartz radio by default. +[Changed] Overhaul of secure storage system to make it faster. +[Fixed] Was unable to use cursorTarget underwater, fixed using new custom made function. [Fixed] NPC item trades that cannot fit in the players inventory will be placed at the feet of the player. -[Fixed] If player started a trade with a zero Krypto and then obtained Krypto they had to relog to be able to trade again. -[Fixed] Removed forced weather sync on server startup from server init phase so weather changes are now solely dependent on Epoch Events weather script. -[Fixed] Added private array to all Epoch Event scripts due to feedback. [Fixed] Not loosing Stamina while swimming. [Fixed] Removed extra roadway on top of columns. -[Fixed] Force trader data save to save when loading starter items. +[Fixed] Error Zero divisor in client side master loop. +[Fixed] .rpt error after gutting animal. + +**Server** +[Added] Documentation on server core framework functions and hive calls. +[Added] muzzle_snds_338_sand to loot and pricing tables. +[Added] Client side master loop is now fully config (CfgMasterLoop) based. +[Added] Ability to fully change default player loadouts via CfgEpochServer configs: +(defaultGoggles, defaultHeadgear, defaultBackpack, defaultVestFemale, defaultVestMale, defaultUniformFemale, defaultUniformMale, itemsInContainers, weaponsInContainers, normalMagazines, weaponsAndItems) +[Changed] Increased reverse token check timeout from 90 to 180 seconds. [Fixed] Dynamic traders did not correctly track the stored vehicle count and limits. -[Fixed] Error Zero divisor in master loop. -[Fixed] .rpt error after gutting animal added by adding isNull check to animal brain. +[Fixed] Force trader data save to save when loading starter items. +[Fixed] Added private array to all Epoch Event scripts due to feedback. +[Fixed] Removed forced weather sync on server startup from server init phase so weather changes are now solely dependent on Epoch Events weather script. +[Fixed] EPOCH_fnc_returnConfigEntry and V2 functions did not use defaults properly. +[Info] Server pack Tools folder now contains InstalEpoch.cmd that is an updated version of the command line download Epoch client files download script for steam workshop. diff --git a/Server_Install_Pack/@epochhive/addons/a3_epoch_server.pbo b/Server_Install_Pack/@epochhive/addons/a3_epoch_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L7oUzfAScR^V5_wT)bgdeeJJ}077HB>F z1-l(pZZ{(*Os_(cT^brsB9#MU)KnqQ#BlTw@?jTjszSM1i3|L=8WqAwHIiA+3~;Xs z*~pgv6hqlJ(J@%5#TgJQ!V-*v#!yu1s~XcEk|RCwdisGBwb74W?p3?!5h6ds>@23@ zK!yJY{fcq@Qx4>!EwxtB!cUabS8nHQWXS*eq-KpLJyeyP=|nTMsWI_FVD~dPqroq) z>7(CLhZ)NTjn}W*2-G796nVl8_0$OTtvxcuAQ1QoEXH?CX9(jmu-yq10GH3VrW9 zbDNqLc`D`gMPH%$8x;-1W|Ay!W|!F|HX!~~ zi^-)n4j2&iP{ewuASf&zD&8yw55=3Hl%7NoJ?KrrnGH);aAEd+Z{GLjecyZYvGv*K z)`h9q%-o1P>ht*&9p}`1k75`sX@0C+EA8_?SnrqPwTB(S`E#)3S#W_9iLcN5D z0!_=!uc$cdVo01p1eu18O~hZ}Wf^K|4?fTFG=f$Ek&yyCjPqzpEjsL+P80_aoXv1C zoXUpt!1eIx3g89`+rgKheRdBh3t~8AuSLKsA?fkcH1DoMfh4bccW`wtu%&bV?J24l z5vZAs={TzwPvb0_;i>zap_Pd_jvzT@s0zYXW7CFb#|QU=01#90`fw*$+8IxUL*Y;= z6`e$;1&I~4nDhFtPGH+Fy1F7vg+To@P_lJoP@GSl^v3krZ71OQ4;EK_6+n4uZQIB|{&$GkMT zu+BUNhRJW)B_=-LWtx{Z@x2z1oGi_#4Wc|4HNk53$^z9ivWrdbX9OvlJdY8q>J+02 zi1&ff3`A)#nKE6NH#wfkh}GrOhR~A9)0lKwK{g0aKEY(bS_Tx`IQcJ=7TWSFZkc%kPfLy_Q~o M@u%mp3)hbU0M@*EIRF3v diff --git a/Server_Install_Pack/@epochhive/addons/epoch_server_core.pbo b/Server_Install_Pack/@epochhive/addons/epoch_server_core.pbo index d8187ec1efae2d167fb15408a095eb59bcd6e22a..cd6da19cf49ff0cca44fad213780ff872fb6ef5b 100644 GIT binary patch delta 210 zcmZ3Iwu3R_=24pY|s4jsOB*o9qg(;=U0+RA# zlw<=boX-y8^)QNqdD39sdqp%8K{mUAE#qVoVVV{(S)R#`sV`!3Jd-VmH;+k{xu(^5 s^FAg=6IF8~6B7e71BN^%sGGi;o)q|;|Dy6u3fsIixiCMbiMq-Yd&R+=8z9c)^_=X&49H*^P+bBmNQ$4I3sXvy1tjIg zD9Hv=IG-KF>tPfJ^Q6JN_ljsHf^2pJTgJ&G!n7=HvOJR=)4a6F@l3WL-aIB*=2OQs sH}7L|G*LA*H8U_VF=EJLg1Tw@*QI^;Go^~m4<8BKa=op&({r~^~ diff --git a/Server_Install_Pack/sc/battleye/attachto.txt b/Server_Install_Pack/sc/battleye/attachto.txt index bbbda9d3..aea73eda 100644 --- a/Server_Install_Pack/sc/battleye/attachto.txt +++ b/Server_Install_Pack/sc/battleye/attachto.txt @@ -1 +1 @@ -5 "" !WeaponHolderSimulated !Shot !"(Safe|LockBox|FirePlace|PlotPole|Jack|SolarGen)_EPOCH" !"Jack_SIM_EPOCH" !"LockBox_Ghost_EPOCH" !"CinderWallHalf_Ghost_EPOCH" !"(Tipi|Workbench|StorageShelf|Wood(Floor|LargeWall|Stairs|Ramp|Ladder|Tower)_Ghost_EPOCH" !="(Hesco3|Metal|Foundation)_Ghost_EPOCH" !"Land_Cages_F" !"Epoch_Sapper_F" +5 "" !WeaponHolderSimulated !Shot !"(Safe|LockBox|FirePlace|PlotPole|Jack|SolarGen)_EPOCH" !"Jack_SIM_EPOCH" !"LockBox_Ghost_EPOCH" !"CinderWallHalf_Ghost_EPOCH" !"(Tipi|Workbench|StorageShelf|Wood(Floor|LargeWall|Stairs|Ramp|Ladder|Tower)_Ghost_EPOCH" !"(Hesco3|Metal|Foundation)_Ghost_EPOCH" !"Land_Cages_F" !"Epoch_Sapper_F" diff --git a/Sources/epoch_code/compile/EPOCH_onEachFrame.sqf b/Sources/epoch_code/compile/EPOCH_onEachFrame.sqf index 68a1d560..89bb5b7c 100644 --- a/Sources/epoch_code/compile/EPOCH_onEachFrame.sqf +++ b/Sources/epoch_code/compile/EPOCH_onEachFrame.sqf @@ -32,14 +32,14 @@ if (!isNull EPOCH_currentTarget && vehicle player == player) then { _stability = 0; _color = [1, 1, 1, 0.7]; - _text = format ["Press (%1)",EPOCH_keysAction call BIS_fnc_keyCode]; + _text = format ["Hold (%1)",EPOCH_keysAction call BIS_fnc_keyCode]; _icon = "\x\addons\a3_epoch_code\Data\UI\ui_question_ca.paa"; _interactOption = getNumber(configFile >> "cfgVehicles" >> typeOf _currentTarget >> "interactMode"); switch _interactOption do { case 0: { - _stability = 100 - round(damage _currentTarget) * 10; + _stability = 100 - round(damage _currentTarget * 10); _icon = "\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa"; _text = "Press (Inventory)"; }; @@ -58,7 +58,7 @@ if (!isNull EPOCH_currentTarget && vehicle player == player) then { case 2: { if (alive _currentTarget) then{ _text = format["%1 - Press (Ctrl+%2)", if (isStreamFriendlyUIEnabled) then[{"Player"}, { name _currentTarget }],EPOCH_keysAcceptTrade call BIS_fnc_keyCode]; - _stability = 100 - round(damage _currentTarget) * 10; + _stability = 100 - round(damage _currentTarget * 10); _icon = "\x\addons\a3_epoch_code\Data\UI\loading_bar_%1.paa"; if (_stability < 50) then{ diff --git a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf index 96e824fb..15b822d5 100644 --- a/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf +++ b/Sources/epoch_code/compile/building/EPOCH_staticMove.sqf @@ -21,6 +21,7 @@ if (_energyCost == 0) then { _class = getText(configfile >> "cfgVehicles" >> _objType >> "GhostPreview"); _maxHeight = getNumber(configfile >> "cfgVehicles" >> _objType >> "maxHeight"); _simulClass = getText(configFile >> "CfgVehicles" >> _objType >> "simulClass"); +_snapChecks = getArray(configFile >> "CfgSnapChecks" >> _objType >> "nails"); _maxSnapDistance = 1; _lastCheckTime = diag_tickTime; _stabilityCheck = false; @@ -109,6 +110,13 @@ if (_class != "") then { EPOCH_target attachTo[player]; }; + if (EPOCH_space) then { + _dir2 = [vectorDir player, EPOCH_buildDirection] call EPOCH_returnVector; + _up2 = (vectorUp player); + EPOCH_space = false; + EPOCH_target setVectorDirAndUp [_dir2,_up2]; + }; + { _nearestObject = _x; if !(isNull EP_snap) then { @@ -282,37 +290,27 @@ if (_class != "") then { _offsetZPos = [_currentPos select 0, _currentPos select 1, (_currentPos select 2) - 0.5]; if !(terrainIntersect[_currentPos, _offsetZPos]) then { - // check below for static object - if (lineintersectsobjs[ATLtoASL _currentPos, ATLtoASL _offsetZPos, _currentTarget, objNull, false, 2] isEqualTo[]) then { + _numberOfContacts = 0; + { + _pos1 = _currentTarget modelToWorld (_x select 0); + _pos2 = _currentTarget modelToWorld (_x select 1); + _ins = lineIntersectsSurfaces [AGLToASL _pos1, AGLToASL _pos2,player,_currentTarget,true,1,"VIEW","FIRE"]; + if (count _ins > 0) then { + _numberOfContacts = _numberOfContacts + 1; + }; + } forEach _snapChecks; - _currentDir = getDir _currentTarget; - _objSize = sizeOf _objType / 3.5; - _numberOfContacts = 0; - { - // check all four sides (must have two or more) - if !(lineintersectsobjs[ATLtoASL _currentPos, ATLtoASL([_currentTarget, _objSize, _currentDir + _x] call BIS_fnc_relPos), _currentTarget, objNull, false, 2] isEqualTo[]) then { - _numberOfContacts = _numberOfContacts + 1; - }; - } forEach[0, 90, 180, 270]; - - if (_numberOfContacts < 2) then { - - // TODO: foundations need to be handled - - // change to sim - _worldspace = [getposATL _currentTarget, vectordir _currentTarget, vectorup _currentTarget]; - - deleteVehicle _currentTarget; - - _currentTarget = createVehicle[_simulClass, (_worldspace select 0), [], 0, "CAN_COLLIDE"]; - _currentTarget setVectorDirAndUp[_worldspace select 1, _worldspace select 2]; - _currentTarget setposATL(_worldspace select 0); - - }; + if (_numberOfContacts < 2) then { + // TODO: foundations need to be handled + // change to sim + _worldspace = [getposATL _currentTarget, vectordir _currentTarget, vectorup _currentTarget]; + deleteVehicle _currentTarget; + _currentTarget = createVehicle[_simulClass, (_worldspace select 0), [], 0, "CAN_COLLIDE"]; + _currentTarget setVectorDirAndUp[_worldspace select 1, _worldspace select 2]; + _currentTarget setposATL(_worldspace select 0); }; }; }; - _currentTarget spawn EPOCH_countdown; }; }; diff --git a/Sources/epoch_code/compile/functions/EPOCH_fn_returnConfigEntryV2.sqf b/Sources/epoch_code/compile/functions/EPOCH_fn_returnConfigEntryV2.sqf index 32fd4175..c2bb720d 100644 --- a/Sources/epoch_code/compile/functions/EPOCH_fn_returnConfigEntryV2.sqf +++ b/Sources/epoch_code/compile/functions/EPOCH_fn_returnConfigEntryV2.sqf @@ -11,10 +11,10 @@ if (isClass(_config)) then{ _finalconfig = _config >> (_this select 1); if (configName(_finalconfig) == (_this select 1)) then{ _varData = switch (typeName _defaultData) do { - case "SCALAR": {getNumber _finalconfig}; - case "BOOL": {(getNumber _finalconfig) == 1}; - case "ARRAY": {getArray _finalconfig}; - case "STRING": {getText _finalconfig}; + case "SCALAR": {if (isNumber (_finalconfig)) then { getNumber _finalconfig } else {_defaultData} }; + case "BOOL": {if (isText (_finalconfig)) then { (getText _finalconfig) isEqualTo "true" } else {_defaultData} }; + case "ARRAY": {if (isArray (_finalconfig)) then { getArray _finalconfig } else {_defaultData} }; + case "STRING": {if (isText (_finalconfig)) then { getText _finalconfig } else {_defaultData} }; default {_defaultData}; }; } else { diff --git a/Sources/epoch_config/Configs/CfgPricing.hpp b/Sources/epoch_config/Configs/CfgPricing.hpp index f70b6df2..1a746f38 100644 --- a/Sources/epoch_config/Configs/CfgPricing.hpp +++ b/Sources/epoch_config/Configs/CfgPricing.hpp @@ -320,7 +320,7 @@ class CfgPricing class muzzle_snds_338_black { price = 3; }; class muzzle_snds_338_green { price = 3; }; class muzzle_snds_338_sand { price = 3; }; - + class muzzle_snds_93mmg { price = 3; }; class muzzle_snds_93mmg_tan { price = 3; }; @@ -358,6 +358,8 @@ class CfgPricing class KitWoodStairs {price = 10;}; class KitWoodTower {price = 10;}; class KitWoodRamp {price = 14;}; + class KitSpikeTrap {price = 25;}; + class KitMetalTrap {price = 25;}; class KitTankTrap {price = 25;}; class KitHesco3 { price = 25; }; class KitWoodLadder { price = 10; }; diff --git a/Sources/epoch_config/Configs/CfgSnapChecks.hpp b/Sources/epoch_config/Configs/CfgSnapChecks.hpp new file mode 100644 index 00000000..5db34b15 --- /dev/null +++ b/Sources/epoch_config/Configs/CfgSnapChecks.hpp @@ -0,0 +1,48 @@ +// Snap Checks - EpochMod.com +class Hesco3_EPOCH { + nails[] = { + {{0,0,-0.6},{0,0,-0.75}}, + {{1.6,0,-0.0307557},{1.8625,0,-0.0307557}}, + {{-1.6,0,-0.0307557},{-1.8625,0,-0.0307557}} + }; +}; +class WoodLargeWall_EPOCH { + nails[] = { + {{0,0,0.120775},{0,0,-0.190775}}, + {{2.46932,0,1.5},{2.76932,0,1.5}}, + {{-2.46932,0,1.5},{-2.76932,0,1.5}} + }; +}; +class WoodWall1_EPOCH : WoodLargeWall_EPOCH {}; +class WoodWall2_EPOCH : WoodLargeWall_EPOCH {}; +class WoodWall3_EPOCH : WoodLargeWall_EPOCH {}; +class WoodWall4_EPOCH : WoodLargeWall_EPOCH {}; +class WoodLargeWallCor_EPOCH : WoodLargeWall_EPOCH {}; +class WoodLargeWallDoorway_EPOCH : WoodLargeWall_EPOCH {}; +class WoodLargeWallDoor_EPOCH : WoodLargeWall_EPOCH {}; +class WoodLargeWallDoorL_EPOCH : WoodLargeWall_EPOCH {}; +class CinderWallGarage_EPOCH : WoodLargeWall_EPOCH {}; +class CinderWall_EPOCH : WoodLargeWall_EPOCH {}; +class CinderWallHalf_EPOCH : WoodLargeWall_EPOCH {}; +class WoodFloor_Epoch { + nails[] = { + {{2.5555,0,0.15},{2.8555,0,0.15}}, + {{0,-2.5555,0.15},{0,2.8555,0.15}}, + {{-2.5555,0,0.15},{-2.8555,0,0.15}}, + {{0,-2.5555,0.15},{0,-2.8555,0.15}}, + + {{2.5555,0,0.15},{2.5555,0,-0.15}}, + {{-2.5555,0,0.15},{-2.5555,0,-0.15}}, + {{0,-2.5555,0.15},{0,-2.5555,-0.15}}, + {{0,2.5555,0.15},{0,2.5555,-0.15}} + }; +}; +class MetalFloor_EPOCH : WoodFloor_Epoch {}; +class WoodStairs_EPOCH { + nails[] = { + {{0,0,0.05},{0,0,-0.20}} + }; +}; +class WoodStairs2_EPOCH : WoodStairs_EPOCH {}; +class WoodTower_EPOCH : WoodStairs_EPOCH {}; +class WoodRamp_EPOCH : WoodStairs_EPOCH {}; diff --git a/Sources/epoch_config/Configs/CfgVehicles.hpp b/Sources/epoch_config/Configs/CfgVehicles.hpp index 192c3084..bd717e18 100644 --- a/Sources/epoch_config/Configs/CfgVehicles.hpp +++ b/Sources/epoch_config/Configs/CfgVehicles.hpp @@ -3851,7 +3851,7 @@ class CfgVehicles bypassJammer = 1; }; - class Hesco3_EPOCH: Constructions_static_F + class Hesco3_EPOCH: Const_All_Walls_F { scope = 2; model = "\x\addons\a3_epoch_assets_3\CfgVehicles\Defense\hesco.p3d"; @@ -4092,6 +4092,15 @@ class CfgVehicles snapPointsPerp[] = { "N", "S", "E", "W", "CinN", "CinS", "CinE", "CinW" }; allowedSnapPoints[] = { "NF", "SF", "EF", "WF", "C" }; energyCost = 0.5; + armor = 15000; + + selectionDamage = "zbytek"; + class Damage + { + tex[] = {}; + // TODO: make seperate rvmat for destruction check for issues due to camo zbytek applying to all mats + mat[] = { "x\addons\a3_epoch_assets_1\textures\metal_floor.rvmat", "x\addons\a3_epoch_assets\textures\PlyPlank_destruct50.rvmat", "x\addons\a3_epoch_assets\textures\PlyPlank_destruct50.rvmat" }; + }; }; // Wood wall seed item lvl 0 diff --git a/Sources/epoch_config/config.cpp b/Sources/epoch_config/config.cpp index 324b8a70..f19e196b 100644 --- a/Sources/epoch_config/config.cpp +++ b/Sources/epoch_config/config.cpp @@ -42,6 +42,7 @@ class CfgAddons #include "\x\addons\a3_epoch_config\Configs\CfgEpochClient.hpp" #include "\x\addons\a3_epoch_config\Configs\CfgMasterLoop.hpp" #include "\x\addons\a3_epoch_config\Configs\CfgBaseBuilding.hpp" +#include "\x\addons\a3_epoch_config\Configs\CfgSnapChecks.hpp" #include "\x\addons\a3_epoch_config\Configs\CfgBuildingLootPos.hpp" #include "\x\addons\a3_epoch_config\Configs\CfgActionMenu\CfgActionMenu_core.hpp" #include "\x\addons\a3_epoch_config\Configs\CfgEpochConfiguration.hpp" diff --git a/Sources/epoch_server/compile/epoch_bases/fn_saveBuilding.sqf b/Sources/epoch_server/compile/epoch_bases/fn_saveBuilding.sqf index b3168a1d..e1e05668 100644 --- a/Sources/epoch_server/compile/epoch_bases/fn_saveBuilding.sqf +++ b/Sources/epoch_server/compile/epoch_bases/fn_saveBuilding.sqf @@ -8,17 +8,18 @@ private ["_class","_worldspace","_objHiveKey","_animPhases","_VAL","_return","_o _return = false; if !(isNull _this) then { _objSlot = _this getVariable["BUILD_SLOT", -1]; + diag_log format["DEBUG: Building Save function BUILD_SLOT %1",_objSlot]; if (_objSlot != -1) then{ _this setDamage 0; _class = typeOf _this; _worldspace = [(getposATL _this call EPOCH_precisionPos), vectordir _this, vectorup _this]; - _objHiveKey = format["%1:%2", (call EPOCH_fn_InstanceID), _objSlot]; - _animPhases = []; - { - _animPhases pushBack (_this animationPhase _x) - } foreach (getArray(configFile >> "CfgVehicles" >> _class >> "persistAnimations")); - _VAL = [_class, _worldspace, _this getVariable["EPOCH_secureStorage", "-1"], _this getVariable["BUILD_OWNER", "-1"], _this getVariable["TEXTURE_SLOT", 0], _animPhases]; - ["Building", _objHiveKey, EPOCH_expiresBuilding, _VAL] call EPOCH_fnc_server_hiveSETEX; + _objHiveKey = format["%1:%2", (call EPOCH_fn_InstanceID), _objSlot]; + _animPhases = []; + { + _animPhases pushBack (_this animationPhase _x) + } foreach (getArray(configFile >> "CfgVehicles" >> _class >> "persistAnimations")); + _VAL = [_class, _worldspace, _this getVariable["EPOCH_secureStorage", "-1"], _this getVariable["BUILD_OWNER", "-1"], _this getVariable["TEXTURE_SLOT", 0], _animPhases]; + ["Building", _objHiveKey, EPOCH_expiresBuilding, _VAL] call EPOCH_fnc_server_hiveSETEX; _return = true; }; }; diff --git a/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf b/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf index b95b7de8..a472d5d6 100644 --- a/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf +++ b/Sources/epoch_server/compile/epoch_player/EPOCH_server_loadPlayer.sqf @@ -4,12 +4,33 @@ Epoch Mod - EpochMod.com All Rights Reserved. */ -private["_reject", "_plyr", "_instanceID", "_plyrNetID", "_plyrUID", "_response", "_arr", "_defaultUniform", "_class", "_vest", "_medical", "_alreadyDead", "_worldspace", "_dir", "_location", "_prevInstance", "_plyrGroup", "_canBeRevived", "_vars", "_hitpoints", "_group", "_newPlyr", "_currWeap", "_apperance", "_goggles", "_headgear", "_backpack", "_uniform", "_weaponsAndItems", "_equipped", "_weapon", "_type", "_attachments", "_attachment", "_wMags", "_itemSlot", "_itemqtys", "_found", "_contentArray", "_deadPlayer"]; +private ["_arr","_uniform","_class","_vest","_vars","_canBeRevived","_dir","_location","_group","_apperance","_goggles","_headgear","_backpack","_weaponsAndItems","_linkedItems","_normalMagazines","_itemsInContainers","_weaponsInContainers","_wMags","_wMagsArray","_equipped","_weapon","_type","_attachments","_currWeap","_found","_contentArray","_plyrGroup","_response","_reject","_fnc_addItemToX","_worldspace","_prevInstance","_medical","_server_vars","_hitpoints","_deadPlayer","_alreadyDead","_newPlyr","_plyrUID","_serverSettingsConfig","_plyr","_instanceID","_plyrNetID"]; _reject = true; +_fnc_addItemToX = { + private ["_itemSlot","_itemqtys","_newPlyr"]; + _newPlyr = _this select 0; + { + _itemSlot = _forEachIndex; + _itemqtys = _x select 1; + { + for "_i" from 1 to (_itemqtys select _forEachIndex) do { + switch _itemSlot do { + case 0: { _newPlyr addItemToUniform _x }; + case 1: { _newPlyr addItemToVest _x }; + case 2: { _newPlyr addItemToBackpack _x }; + }; + }; + } forEach(_x select 0); + } forEach (_this select 1); +}; + if (typename _this == "ARRAY") then { + // load server settings + _serverSettingsConfig = configFile >> "CfgEpochServer"; + _plyr = _this select 0; _instanceID = call EPOCH_fn_InstanceID; @@ -26,31 +47,43 @@ if (typename _this == "ARRAY") then { if ((_response select 0) == 1 && typeName(_response select 1) == "ARRAY") then { _arr = (_response select 1); }; - _defaultUniform = "U_Test_uniform"; + + // Apperance defaults + _uniform = [_serverSettingsConfig, "defaultUniformFemale", "U_Test_uniform"] call EPOCH_fnc_returnConfigEntry; _class = "Epoch_Female_F"; - _vest = "V_F41_EPOCH"; + _vest = [_serverSettingsConfig, "defaultVestFemale", "V_F41_EPOCH"] call EPOCH_fnc_returnConfigEntry; if (_this select 1) then { //true == male - _defaultUniform = "U_Test1_uniform"; + _uniform = [_serverSettingsConfig, "defaultUniformMale", "U_Test1_uniform"] call EPOCH_fnc_returnConfigEntry; _class = "Epoch_Male_F"; - _vest = "V_41_EPOCH"; + _vest = [_serverSettingsConfig, "defaultVestMale", "V_41_EPOCH"] call EPOCH_fnc_returnConfigEntry; }; + _goggles = [_serverSettingsConfig, "defaultGoggles", ""] call EPOCH_fnc_returnConfigEntry; + _headgear = [_serverSettingsConfig, "defaultHeadgear", ""] call EPOCH_fnc_returnConfigEntry; + _backpack = [_serverSettingsConfig, "defaultBackpack", ""] call EPOCH_fnc_returnConfigEntry; + + // Inventory defaults + _linkedItems = [_serverSettingsConfig, "linkedItems", ["ItemMap","EpochRadio0"]] call EPOCH_fnc_returnConfigEntry; + _itemsInContainers = [_serverSettingsConfig, "itemsInContainers", []] call EPOCH_fnc_returnConfigEntry; + _weaponsInContainers = [_serverSettingsConfig, "weaponsInContainers", []] call EPOCH_fnc_returnConfigEntry; + _normalMagazines = [_serverSettingsConfig, "normalMagazines", []] call EPOCH_fnc_returnConfigEntry; + _weaponsAndItems = [_serverSettingsConfig, "weaponsAndItems", ["", []]] call EPOCH_fnc_returnConfigEntry; + + diag_log format["DEBUG (Load Player) _linkedItems 1: %1", _linkedItems]; if (count _arr < 11) then { // invaild format attempt to override - _arr = [[0, [], _instanceID], [0, 0, 1, 0, []], ["", "", _vest, "", _defaultUniform, _class], [""], [] + EPOCH_defaultVars_SEPXVar, ["", []], ["ItemMap"], [], [], [], "", true]; + _arr = [[0, [], _instanceID], [0, 0, 1, 0, []], [_goggles, _headgear, _vest, _backpack, _uniform, _class], [""], [] + EPOCH_defaultVars_SEPXVar, _weaponsAndItems, _linkedItems, _normalMagazines, _itemsInContainers, _weaponsInContainers, "", true]; }; _worldspace = _arr select 0; _dir = _worldspace select 0; _location = _worldspace select 1; _prevInstance = _worldspace select 2; - _medical = _arr select 1; + _server_vars = _arr select 3; + _vars = _arr select 4; _plyrGroup = _arr select 10; _canBeRevived = _arr select 11; - - _server_vars = _arr select 3; - _vars = _arr select 4; _hitpoints = _vars select 11; @@ -76,12 +109,13 @@ if (typename _this == "ARRAY") then { }; } forEach allUnits; + // find existing group if (_plyrGroup != "") then { - { - if ((_x getVariable["GROUP", ""]) == _plyrGroup) exitWith{ - _group = group _x; - }; - } forEach playableUnits; + { + if ((_x getVariable["GROUP", ""]) == _plyrGroup) exitWith{ + _group = group _x; + }; + } forEach playableUnits; }; if (isNull _group) then { @@ -117,63 +151,64 @@ if (typename _this == "ARRAY") then { _backpack = _apperance select 3; _uniform = _apperance select 4; - if (_uniform != "") then { - _newPlyr addUniform _uniform; - }; - if (_backpack != "") then { - _newPlyr addBackpack _backpack; - }; - if (_goggles != "") then { - _newPlyr addGoggles _goggles; - }; - if (_headgear != "") then { - _newPlyr addHeadgear _headgear; - }; - if (_vest != "") then { - _newPlyr addVest _vest; - }; - // Weapons _weaponsAndItems = _arr select 5; - if (count _weaponsAndItems >= 2) then { + _linkedItems = _arr select 6; + _normalMagazines = _arr select 7; + _itemsInContainers = _arr select 8; + _weaponsInContainers = _arr select 9; + }; - _equipped = _weaponsAndItems select 2; + // Load Apperance START + if (_uniform != "") then { + _newPlyr addUniform _uniform; + }; + if (_backpack != "") then { + _newPlyr addBackpack _backpack; + }; + if (_goggles != "") then { + _newPlyr addGoggles _goggles; + }; + if (_headgear != "") then { + _newPlyr addHeadgear _headgear; + }; + if (_vest != "") then { + _newPlyr addVest _vest; + }; + // Load Apperance END + + // Load inventory + defaults START + if (count _weaponsAndItems >= 2) then { + _equipped = _weaponsAndItems select 2; + { + _weapon = _x deleteAt 0; + _type = getNumber(configfile >> "cfgweapons" >> _weapon >> "type"); + _attachments = []; + _wMags = false; + _wMagsArray = []; + // suppressor, laser, optics, magazines(array), bipods { - _weapon = _x deleteAt 0; - _type = getNumber(configfile >> "cfgweapons" >> _weapon >> "type"); - - _attachments = []; - _wMags = false; - _wMagsArray = []; - // suppressor, laser, optics, magazines(array), bipods - { - // magazines - if (typeName(_x) == "ARRAY") then{ - _wMags = true; - _wMagsArray = _x; - } - else { - // attachments - if (_x != "") then{ - _attachments pushBack _x; - }; + // magazines + if (typeName(_x) == "ARRAY") then{ + _wMags = true; + _wMagsArray = _x; + } else { + // attachments + if (_x != "") then{ + _attachments pushBack _x; }; - } forEach _x; - - // add weapon if equiped - if (_weapon in _equipped) then { - - _equipped = _equipped - [_weapon]; - - if (_wMags) then { - _newPlyr addMagazine _wMagsArray; - }; - - if (_weapon != "") then { - _newPlyr addWeapon _weapon; - }; - - switch _type do { + }; + } forEach _x; + // add weapon if equiped + if (_weapon in _equipped) then { + _equipped = _equipped - [_weapon]; + if (_wMags) then { + _newPlyr addMagazine _wMagsArray; + }; + if (_weapon != "") then { + _newPlyr addWeapon _weapon; + }; + switch _type do { case 1: { // primary removeAllPrimaryWeaponItems _newPlyr; { _newPlyr addPrimaryWeaponItem _x } forEach _attachments; @@ -187,69 +222,41 @@ if (typename _this == "ARRAY") then { { _newPlyr removeSecondaryWeaponItem _x; } forEach (secondaryWeaponItems _newPlyr); + { _newPlyr addSecondaryWeaponItem _x } forEach _attachments; }; - }; - } - else { // overflow need to add these items to storage - { - _newPlyr addItem _x; - } forEach _attachments; - - if (_wMags) then { - _newPlyr addMagazine _wMagsArray; - }; }; - } forEach(_weaponsAndItems select 1); - - _currWeap = _weaponsAndItems select 0; - }; - - // Linked items - { - if (_x in["Binocular", "Rangefinder"]) then { - _newPlyr addWeapon _x; - } - else { - _newPlyr linkItem _x; + } else { + // overflow need to add these items to storage + { + _newPlyr addItem _x; + } forEach _attachments; + if (_wMags) then { + _newPlyr addMagazine _wMagsArray; + }; }; - } forEach(_arr select 6); - - // add items to containers - { - _itemSlot = _forEachIndex; - _itemqtys = _x select 1; - { - for "_i" from 1 to(_itemqtys select _forEachIndex) do { - switch _itemSlot do { - case 0: { _newPlyr addItemToUniform _x }; - case 1: { _newPlyr addItemToVest _x }; - case 2: { _newPlyr addItemToBackpack _x }; - }; - }; - } forEach(_x select 0); - } forEach(_arr select 8); - - // add weapons to containers - { - _itemSlot = _forEachIndex; - _itemqtys = _x select 1; - { - for "_i" from 1 to(_itemqtys select _forEachIndex) do { - switch _itemSlot do { - case 0: { _newPlyr addItemToUniform _x }; - case 1: { _newPlyr addItemToVest _x }; - case 2: { _newPlyr addItemToBackpack _x }; - }; - }; - } forEach(_x select 0); - } forEach(_arr select 9); - - // Add magazines - { - _newPlyr addMagazine _x; - } forEach(_arr select 7); + } forEach(_weaponsAndItems select 1); + _currWeap = _weaponsAndItems select 0; }; + // Linked items + { + if (_x in["Binocular", "Rangefinder"]) then { + _newPlyr addWeapon _x; + } else { + _newPlyr linkItem _x; + }; + } forEach _linkedItems; + diag_log format["DEBUG (Load Player) _linkedItems: %1", _linkedItems]; + + // add items to containers + [_newPlyr, _itemsInContainers] call _fnc_addItemToX; + + // add weapons to containers + [_newPlyr, _weaponsInContainers] call _fnc_addItemToX; + + // Add magazines + {_newPlyr addMagazine _x} forEach _normalMagazines; + // Load inventory + defaults END // Final Push if (isNull _plyr) then { @@ -292,9 +299,6 @@ if (typename _this == "ARRAY") then { }; diag_log format["DEBUG (Load Player) Set Group: %1", _plyrGroup]; }; - - // may not be needed, just here to see if we can force the data to sync quicker - // _plyr setPosATL _location; _newPlyr setVariable["SETUP", true]; _newPlyr setVariable["PUID", _plyrUID]; diff --git a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf index 9161472b..859a7467 100644 --- a/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf +++ b/Sources/epoch_server/compile/epoch_vehicle/EPOCH_load_vehicles.sqf @@ -55,7 +55,7 @@ for "_i" from 1 to _this do { _vehicle call EPOCH_server_setVToken; _vehicle setposATL _location; - + _vehicle setVectorDirAndUp _worldspace; _vehicle setDamage _damage; @@ -248,6 +248,6 @@ if (_immuneVehicleSpawn) then{ addToRemainsCollector _allVehicles; -diag_log format ["VEH SPAWN TIMER %1, LOADED 2% VEHICLES", diag_tickTime - _diag, count _allVehicles]; +diag_log format ["VEH SPAWN TIMER %1, LOADED %2 VEHICLES", diag_tickTime - _diag, count _allVehicles]; true diff --git a/Sources/epoch_server/init/server_variables.sqf b/Sources/epoch_server/init/server_variables.sqf index 3121ed3c..cad64de7 100644 --- a/Sources/epoch_server/init/server_variables.sqf +++ b/Sources/epoch_server/init/server_variables.sqf @@ -45,7 +45,7 @@ _configArray = [ ["B_Heli_Light_01_EPOCH", 2], ["B_SDV_01_EPOCH", 2], ["B_MRAP_01_EPOCH", 3], - ["I_MRAP_03_EPOCH", 3], + ["I_MRAP_03_EPOCH", 3], ["B_Truck_01_transport_EPOCH", 1], ["B_Truck_01_covered_EPOCH", 2], ["B_Truck_01_mover_EPOCH", 1], @@ -69,7 +69,7 @@ _configArray = [ ["K04", 2], ["ebike_epoch", 7], ["mosquito_epoch", 5], - ["C_Heli_Light_01_civil_EPOCH",5] + ["C_Heli_Light_01_civil_EPOCH",5] ] ], ["taxRate", 0.1], @@ -94,13 +94,13 @@ _configArray = [ EPOCH_fnc_returnConfigEntry = { private["_defaultData", "_config", "_varData"]; _defaultData = _this select 2; - _config = (_this select 0) >> (_this select 1); if (isClass(_this select 0)) then{ + _config = (_this select 0) >> (_this select 1); _varData = switch (typeName _defaultData) do { - case "SCALAR": {getNumber _config}; - case "BOOL": {(getNumber _config) == 1}; - case "ARRAY": {getArray _config}; - case "STRING": {getText _config}; + case "SCALAR": {if (isNumber (_config)) then { getNumber _config } else {_defaultData} }; + case "BOOL": {if (isText (_config)) then { (getText _config) isEqualTo "true" } else {_defaultData} }; + case "ARRAY": {if (isArray (_config)) then { getArray _config } else {_defaultData} }; + case "STRING": {if (isText (_config)) then { getText _config } else {_defaultData} }; default {_defaultData}; }; } else {