kikyou2,
digged into the hive again as i was in the need of a modification for my server. would like to be able to spawn vehicles to the running server which are published to the database and also correctly updated and streamed after restart.
remember i'm talking about plain vanilla dayz here!
anyway, here my findings:
from what i could see, ObjectUID is not used at all! there is just one situation where ObjectUID is created and written to the database. its in
server_publishObject.sqf
ObjectUID is never read from the database, at least i did not find a single place where its read!
in all situations ObjectID is first used to reference objects in the database. only if ObjectID is not available for any reason, ObjectUID will be used!
as ObjectID is read from the database during streaming of objects at server start - as you already know, we run into a problem when objects are published to the database during server runtime.
i solved this for me by modifying the 308 function to return ObjectID when a new object is published to the database and set the variable ObjectID on the newly published object.
besides using my modified
HiveExt.dll:
http://www.megafileupload.com/en/file/471565/HiveExt-zip.html
you also have to change
server_publishObject.sqf (thats how it looks like on vanilla dayz, might be different for epoch!):
search for
Code:
_key call server_hiveWrite;
and replace with
Code:
//_key call server_hiveWrite;
private ["_result", "_objectID"];
_result = _key call server_hiveReadWrite;
if ((_result select 0) == "PASS") then {
_objectID = _result select 1;
_object setVariable ["ObjectID", _objectID, true];
} else {
diag_log ("server_publishObject: HIVE: READWRITE: read ObjectID for Object " + str(_uid) + " failed");
};
if you use your own script to publish objects to the database keep in mind:
_key is used as before no changes here:
_key = format["CHILD:308:%1:%2:%3:%4:%5:%6:%7:%8:%9:", dayZ_instance, _class, 0 , _charID, _worldspace, [], [], 0,_uid];
the important part is "
_result =" which receives the ObjectID from the database and to use
server_hiveReadWrite instead of
server_hiveWrite:
_result = _key call server_hiveReadWrite;
_result is an array, where element 0 holds the string "PASS" and
element 1 holds the ObjectID which is returned as a string.
as long as u don't use ObjectUID anywhere in your code you are fine. as said before ObjectUID is not used in plain vanilla dayz at all and from what i have seen its the same in epoch when using the standard functions.
when using the 999 function its up to you to decide whether to use ObjectID or ObjectUID. as ObjectID is at your hand now, there is no reason to use ObjectUID anywhere ...