--- deliantra/server/common/object.C 2008/01/13 08:55:41 1.200 +++ deliantra/server/common/object.C 2008/04/10 15:35:15 1.202 @@ -35,9 +35,8 @@ #include -int nrofallocobjects = 0; -static UUID uuid; -const uint64 UUID_SKIP = 1<<19; +UUID UUID::cur; +static const uint64 UUID_SKIP = 1<<19; objectvec objects; activevec actives; @@ -72,7 +71,7 @@ return; } - fprintf (fp, "<1,%llx>\n", (unsigned long long)uuid.seq + UUID_SKIP * 2); + fprintf (fp, "<1,%llx>\n", (unsigned long long)UUID::cur.seq + UUID_SKIP * 2); fclose (fp); rename (filename2, filename1); } @@ -91,7 +90,7 @@ if (errno == ENOENT) { LOG (llevInfo, "RESET uid to 1\n"); - uuid.seq = 0; + UUID::cur.seq = 0; write_uuid (); return; } @@ -108,27 +107,27 @@ _exit (1); } - uuid.seq = uid; + UUID::cur.seq = uid; write_uuid (); LOG (llevDebug, "read UID: %" PRId64 "\n", uid); fclose (fp); } UUID -gen_uuid () +UUID::gen () { UUID uid; - uid.seq = ++uuid.seq; + uid.seq = ++cur.seq; - if (!(uuid.seq & (UUID_SKIP - 1))) + if (!(cur.seq & (UUID_SKIP - 1))) write_uuid (); return uid; } void -init_uuid () +UUID::init () { read_uuid (); } @@ -431,12 +430,6 @@ return op; } -void -free_all_object_data () -{ - LOG (llevDebug, "%d allocated objects\n", nrofallocobjects); -} - /* * Sets the owner and sets the skill and exp pointers to owner's current * skill and experience objects. @@ -605,7 +598,7 @@ object::instantiate () { if (!uuid.seq) // HACK - uuid = gen_uuid (); + uuid = UUID::gen (); speed_left = -0.1f; /* copy the body_info to the body_used - this is only really @@ -774,7 +767,7 @@ void object::link () { assert (!index);//D - uuid = gen_uuid (); + uuid = UUID::gen (); count = ++object_count; refcnt_inc (); @@ -937,6 +930,7 @@ freed_map->name = "/internal/freed_objects_map"; freed_map->width = 3; freed_map->height = 3; + freed_map->nodrop = 1; freed_map->alloc (); freed_map->in_memory = MAP_IN_MEMORY;