Fix Now the new Object Streaming way + much better performance

This commit is contained in:
Skaronator
2013-12-23 14:46:39 +01:00
parent 57688bf8c1
commit 092c437c63

View File

@@ -52,37 +52,35 @@ if (isServer and isNil "sm_done") then {
_BuildingQueue = []; _BuildingQueue = [];
_objectQueue = []; _objectQueue = [];
_finalEpochObjArray = [];
if ((_hiveResponse select 0) == "ObjectStreamStart") then { if ((_hiveResponse select 0) == "ObjectStreamStart") then {
diag_log ("HIVE: Commence Object Streaming..."); diag_log ("HIVE: Commence Object Streaming...");
_objectCount = _hiveResponse select 1;
_key = format["CHILD:302:%1:", dayZ_instance]; _key = format["CHILD:302:%1:", dayZ_instance];
_objectCount = _hiveResponse select 1;
for "_i" from 1 to _objectCount do { for "_i" from 1 to _objectCount do {
_hiveResponse = _key call server_hiveReadWriteLarge; _hiveResponse = _key call server_hiveReadWriteLarge;
//diag_log (format["HIVE dbg %1 %2", typeName _hiveResponse, _hiveResponse]); //diag_log (format["HIVE dbg %1 %2", typeName _hiveResponse, _hiveResponse]);
if ((_hiveResponse select 2) isKindOf "ModularItems") then {
if (((_hiveResponse select _i) select 2) isKindOf "ModularItems") then {
_BuildingQueue set [(count _BuildingQueue),_hiveResponse]; _BuildingQueue set [(count _BuildingQueue),_hiveResponse];
} else { } else {
_objectQueue set [(count _objectQueue),_hiveResponse]; _objectQueue set [(count _objectQueue),_hiveResponse];
}; };
diag_log ("HIVE: got " + str(_BuildingQueue) + " Epoch objects and" + str(_objectQueue) + " Vehicles");
}; };
}; };
diag_log ("HIVE: got " + str(count(_BuildingQueue)) + " Epoch Objects and " + str(count(_objectQueue)) + " Vehicles");
_spawnSort = [_BuildingQueue,_objectQueue]; // Put arrays in order that you wish them to spawn _finalEpochObjArray = _BuildingQueue + _objectQueue;
// # NOW SPAWN OBJECTS # // # NOW SPAWN OBJECTS #
_totalvehicles = 0; _totalvehicles = 0;
{
{ {
_idKey = _x select 1; _idKey = _x select 1;
_type = _x select 2; _type = _x select 2;
_ownerID = _x select 3; _ownerID = _x select 3;
_worldspace = _x select 4; _worldspace = _x select 4;
_intentory= _x select 5; _intentory = _x select 5;
_hitPoints= _x select 6; _hitPoints = _x select 6;
_fuel = _x select 7; _fuel = _x select 7;
_damage = _x select 8; _damage = _x select 8;
@@ -250,8 +248,7 @@ if (isServer and isNil "sm_done") then {
//Monitor the object //Monitor the object
PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object]; PVDZE_serverObjectMonitor set [count PVDZE_serverObjectMonitor,_object];
}; };
} forEach _x; } forEach _finalEpochObjArray;
} forEach _spawnSort;
// # END SPAWN OBJECTS # // # END SPAWN OBJECTS #