From 8dc7ce4250d883dd39624c11398bd7db9e504f61 Mon Sep 17 00:00:00 2001 From: "[VB]AWOL" Date: Tue, 18 Feb 2014 10:36:23 -0600 Subject: [PATCH] fixed Instance already initialized --- SQF/dayz_server/system/server_monitor.sqf | 49 ++++++++++++------ .../@DayZ_Epoch_Server/addons/dayz_server.pbo | Bin 1669558 -> 1670228 bytes 2 files changed, 33 insertions(+), 16 deletions(-) diff --git a/SQF/dayz_server/system/server_monitor.sqf b/SQF/dayz_server/system/server_monitor.sqf index 232de972b..4357c6b78 100644 --- a/SQF/dayz_server/system/server_monitor.sqf +++ b/SQF/dayz_server/system/server_monitor.sqf @@ -1,8 +1,10 @@ -private ["_nul","_result","_pos","_wsDone","_dir","_block","_isOK","_countr","_objWpnTypes","_objWpnQty","_dam","_selection","_totalvehicles","_object","_idKey","_type","_ownerID","_worldspace","_intentory","_hitPoints","_fuel","_damage","_key","_vehLimit","_hiveResponse","_objectCount","_codeCount","_data","_status","_val","_traderid","_retrader","_traderData","_id","_lockable","_debugMarkerPosition","_vehicle_0","_bQty","_vQty","_BuildingQueue","_objectQueue"]; +private ["_nul","_result","_pos","_wsDone","_dir","_isOK","_countr","_objWpnTypes","_objWpnQty","_dam","_selection","_totalvehicles","_object","_idKey","_type","_ownerID","_worldspace","_intentory","_hitPoints","_fuel","_damage","_key","_vehLimit","_hiveResponse","_objectCount","_codeCount","_data","_status","_val","_traderid","_retrader","_traderData","_id","_lockable","_debugMarkerPosition","_vehicle_0","_bQty","_vQty","_BuildingQueue","_objectQueue","_superkey","_shutdown","_res","_hiveLoaded"]; dayz_versionNo = getText(configFile >> "CfgMods" >> "DayZ" >> "version"); dayz_hiveVersionNo = getNumber(configFile >> "CfgMods" >> "DayZ" >> "hiveVersion"); +_hiveLoaded = false; + waitUntil{initialized}; //means all the functions are now defined diag_log "HIVE: Starting"; @@ -42,7 +44,15 @@ if (isServer and isNil "sm_done") then { _key = format["CHILD:302:%1:", dayZ_instance]; _hiveResponse = _key call server_hiveReadWrite; if ((((isnil "_hiveResponse") || {(typeName _hiveResponse != "ARRAY")}) || {((typeName (_hiveResponse select 1)) != "SCALAR")})) then { - diag_log ("HIVE: connection problem... HiveExt response:"+str(_hiveResponse)); + if ((_hiveResponse select 1) == "Instance already initialized") then { + _superkey = profileNamespace getVariable "SUPERKEY"; + _shutdown = format["CHILD:400:%1:", _superkey]; + _res = _shutdown call server_hiveReadWrite; + diag_log ("HIVE: attempt to kill.. HiveExt response:"+str(_res)); + } else { + diag_log ("HIVE: connection problem... HiveExt response:"+str(_hiveResponse)); + + }; _hiveResponse = ["",0]; } else { @@ -55,6 +65,13 @@ if (isServer and isNil "sm_done") then { _objectQueue = []; if ((_hiveResponse select 0) == "ObjectStreamStart") then { + + // save superkey + profileNamespace setVariable ["SUPERKEY",(_hiveResponse select 2)]; + saveProfileNamespace; + + _hiveLoaded = true; + diag_log ("HIVE: Commence Object Streaming..."); _key = format["CHILD:302:%1:", dayZ_instance]; _objectCount = _hiveResponse select 1; @@ -249,7 +266,6 @@ if (isServer and isNil "sm_done") then { }; } forEach (_BuildingQueue + _objectQueue); // # END SPAWN OBJECTS # - // preload server traders menu data into cache if !(DZE_ConfigTrader) then { @@ -290,16 +306,19 @@ if (isServer and isNil "sm_done") then { } forEach serverTraders; }; - // spawn_vehicles - _vehLimit = MaxVehicleLimit - _totalvehicles; - if(_vehLimit > 0) then { - diag_log ("HIVE: Spawning # of Vehicles: " + str(_vehLimit)); - for "_x" from 1 to _vehLimit do { - [] spawn spawn_vehicles; + if (_hiveLoaded) then { + // spawn_vehicles + _vehLimit = MaxVehicleLimit - _totalvehicles; + if(_vehLimit > 0) then { + diag_log ("HIVE: Spawning # of Vehicles: " + str(_vehLimit)); + for "_x" from 1 to _vehLimit do { + [] spawn spawn_vehicles; + }; + } else { + diag_log "HIVE: Vehicle Spawn limit reached!"; }; - } else { - diag_log "HIVE: Vehicle Spawn limit reached!"; }; + // spawn_roadblocks diag_log ("HIVE: Spawning # of Debris: " + str(MaxDynamicDebris)); for "_x" from 1 to MaxDynamicDebris do { @@ -326,13 +345,10 @@ if (isServer and isNil "sm_done") then { OldHeliCrash = false; }; - allowConnection = true; - // [_guaranteedLoot, _randomizedLoot, _frequency, _variance, _spawnChance, _spawnMarker, _spawnRadius, _spawnFire, _fadeFire] if(OldHeliCrash) then { _nul = [3, 4, (50 * 60), (15 * 60), 0.75, 'center', HeliCrashArea, true, false] spawn server_spawnCrashSite; }; - if (isDedicated) then { // Epoch Events _id = [] spawn server_spawnEvents; @@ -355,9 +371,7 @@ if (isServer and isNil "sm_done") then { if(isnil "spawnMarkerCount") then { spawnMarkerCount = 10; }; - actualSpawnMarkerCount = 0; - // count valid spawn marker positions for "_i" from 0 to spawnMarkerCount do { if (!([(getMarkerPos format["spawn%1", _i]), [0,0,0]] call BIS_fnc_areEqual)) then { @@ -369,8 +383,11 @@ if (isServer and isNil "sm_done") then { }; diag_log format["Total Number of spawn locations %1", actualSpawnMarkerCount]; + + endLoadingScreen; }; + allowConnection = true; sm_done = true; publicVariable "sm_done"; }; diff --git a/Server Files/@DayZ_Epoch_Server/addons/dayz_server.pbo b/Server Files/@DayZ_Epoch_Server/addons/dayz_server.pbo index 6365508f670725217ddcf569ff87e89f00b010cb..b6941e9e60fca1680e5f315377effa8947971177 100644 GIT binary patch delta 1631 zcmZWme@q)?81_bc?e%)?QA+6tQ;yD=k>LhL7lpAg2g(M)0hKtagM%L9;Al(lpunc9 znx&bL4EbWvhDjz$Bc^!F+mqig!soanK3L`ri=5(T=cuLqgTD;%YD!D zzVGwC@AF-{BYpFSH20dt^5u9=D}2K;XkGaIq1HlJ!ula^jhfI4Rvyk+MOu$j4)}Vm z4_>!&a2K6L_0inIBF$5#G&DJA;}`z6oidZKonhe&lT~}2A##o^s?Wi}MaRn~HTX2! zZ-$rIJ~OOyN@kdJI^b8%4l~uj4VvLwoCmIPU1sVLmkSQNvYOs<$q%f!!ujELw-YAa z;)Xc|@V;9yp*=hcC;4s@Xe4ygB5> zLtd&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