Simple question in case anyone has done the testing to figure this out definitively. I'm wondering whether a call of ObjectToInt or ObjectToString will stay the same for a given object (specifically a player) over the duration of a server's uptime. Ie. is it unique until server shutdown or will it get reset by relogging?
Are ObjectToInt and ObjectToString invariant during uptime?
#1
Posté 13 juillet 2014 - 06:59
#2
Posté 15 juillet 2014 - 05:36
Good question. Not certain. The only thing i do know that is related is that local vars stored on PCs do persist between relogs but not between server reboots. It may indicate some sort of persistence.
I'd guess the answer is no though, because i have a henchman system which stores the object ID of the owner on it, and after a relog you couldn't command it. I had to change it to use the character name instead to remember who its owner was between crashes/relogs. I think anyway... it was a while ago.
#3
Posté 01 septembre 2014 - 08:09
Posting for the record & future searches, even though this is a somewhat old topic --
While an object exists, object IDs don't change until the server is rebooted. Object IDs are unique in the system and are not reused until reset. The module object and all non-player objects start at object ID 0 and count monotonically upwards each new object, whereas PC objects start at object ID 0x7FFFFFFF and count monotonically downwards for each new PC object. Object ID 0x7F000000 is the manifest "invalid object" constant. Internally, an object ID is used as an index into a hash table to find the engine's internal representation of an object.
However, PC objects are reconstituted anew (with some state copied over from temporary storage created when a player logs out) on log on, similar for familiars. You can think of this as the PC object being destroyed at logout and a new PC object being created again at log on.
Storing a character name is a reasonable approach, although it may break down on modules where a character can be renamed (i.e. using DMFI). Account name and bic filename might be a better approximation. There may be other alternatives, i.e. storing as a local variable on an undroppable item a sequence number / identifier unique to that player.





Retour en haut






