--- deliantra/server/include/object.h 2006/09/12 18:15:34 1.32 +++ deliantra/server/include/object.h 2006/09/13 02:05:19 1.34 @@ -58,6 +58,13 @@ shstr key, value; }; +struct UUID +{ + uint64 seq; +}; + +extern void init_uuid (); +extern UUID gen_uuid (); /* Definition for WILL_APPLY values. Replaces having harcoded values * sprinkled in the code. Note that some of these also replace fields @@ -70,7 +77,6 @@ #define WILL_APPLY_DOOR 0x08 #define WILL_APPLY_FOOD 0x10 - /* However, if you're keeping a pointer of some sort, you probably * don't just want it copied, so you'll need to add to common/object.C, * e.g. copy_object. @@ -81,6 +87,7 @@ struct object_keep : refcounted { tag_t ACC (RW, count); /* Unique object number for this object */ + UUID uuid; // Unique Identifier, survives saves etc. /* These variables are not changed by copy_object() */ struct pl *ACC (RW, contr); /* Pointer to the player which control this object */ @@ -236,9 +243,21 @@ void clear (); void clone (object *destination); + void instantiate () + { + if (!uuid.seq) // HACK + uuid = gen_uuid (); + + attachable::instantiate (); + } + void set_owner (object *owner); object *get_owner (); + // info must hold 256 * 3 bytes currently + const char *debug_desc (char *info) const; + const char *debug_desc () const; + // fully recursive iterator struct iterator_base {