<!-- MHonArc v2.4.4 --> <!--X-Subject: [MUD-Dev] Re: [DevMUD] Re: Database module --> <!--X-From-R13: X Q Znjerapr <pynjNxnatn.ah> --> <!--X-Date: Mon, 21 Dec 1998 20:30:42 -0800 --> <!--X-Message-Id: E0zsJT0-0006tq-00#mail,kanga.nu --> <!--X-Content-Type: text/plain --> <!--X-Reference: 19981220120557.C17441#divcom,slimy.com --> <!--X-Head-End--> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>MUD-Dev message, [MUD-Dev] Re: [DevMUD] Re: Database module</title> <!-- meta name="robots" content="noindex,nofollow" --> <link rev="made" href="mailto:claw#kanga,nu"> </head> <body background="/backgrounds/paperback.gif" bgcolor="#ffffff" text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000"> <font size="+4" color="#804040"> <strong><em>MUD-Dev<br>mailing list archive</em></strong> </font> <br> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] <br clear=all><hr> <!--X-Body-Begin--> <!--X-User-Header--> <!--X-User-Header-End--> <!--X-TopPNI--> Date: [ <a href="msg01035.html">Previous</a> | <a href="msg01037.html">Next</a> ] Thread: [ <a href="msg01045.html">Previous</a> | <a href="msg01037.html">Next</a> ] Index: [ <A HREF="author.html#01036">Author</A> | <A HREF="#01036">Date</A> | <A HREF="thread.html#01036">Thread</A> ] <!--X-TopPNI-End--> <!--X-MsgBody--> <!--X-Subject-Header-Begin--> <H1>[MUD-Dev] Re: [DevMUD] Re: Database module</H1> <HR> <!--X-Subject-Header-End--> <!--X-Head-of-Message--> <UL> <LI><em>To</em>: <A HREF="mailto:devmud#kanga,nu">devmud#kanga,nu</A>, <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> <LI><em>Subject</em>: [MUD-Dev] Re: [DevMUD] Re: Database module </LI> <LI><em>From</em>: J C Lawrence <<A HREF="mailto:claw#kanga,nu">claw#kanga,nu</A>></LI> <LI><em>Date</em>: Mon, 21 Dec 1998 20:30:42 -0800</LI> <LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI> </UL> <!--X-Head-of-Message-End--> <!--X-Head-Body-Sep-Begin--> <HR> <!--X-Head-Body-Sep-End--> <!--X-Body-of-Message--> <PRE> Crossed to MUD-Dev as the discussion of ObjectID's is generic to server designe as versus DevMUD. On Sun, 20 Dec 1998 12:05:57 -0800 Jon Leonard<jleonard#divcom,slimy.com> wrote: > Things that we want to look up in the database have numeric IDs to > identify them, and there are newid() and recycle_id() to allocate > new ones and to tell the database than an ID is no longer in use. I > was planning on using unsigned longs as the ID type (64-bit on > frost). I went thru the problem of ObjectID's and their re-use on MUD-Dev extensively. A key problem is that there may be pointers or references to an object after the object has been destructed, and that once you have an ObjectID->human_readable->ObjectID translation mapping, you can never guarantee that a reference count is accurate. What happens when someone hardcodes a literate human_readable ObjectID in user code, and that object is deleted and the objectID recycled? You can't track it with reference counting, and you can't guarantee at the time of coding even that the ObjectID points at the object that the programmer things it does as versus a newly recycled object. The solution I came to was that ObjectIDs are comprised of two 32bit integers. One 32 bit value is a signed integer, and is used as a record ID with the high bit used as a "deleted" flag. The other 32 bits are the time_t at the instant the object was created. The only requirement then for objectID recycling are that that an object may not be deleted and recycled within a period of one second or less. A simple deletedID cache in the recycler which imposes wait periods for ID's handles that one simply enough. > Within each ID, there's a mapping from keys to values. I was > thinking of using strings as keys, and having a few types of > results. The functions would be something like: For human-readable objectID's I came up with a hacked base 64 represenation of the above 64bit keys. Essentially it is ala hexadecimal except that I use all 52 upper and lower case letters, the 10 digits, and the punctuation symbols '.' and '-'. > lookup_type(id,key) lookup_value(id,key) set_value(id,key,value) For the mapping of arbitrary unique strings to object ID's (eg $box$ to the box base class object), I use an attribute off the root object (object with a record ID of 0 -- no other peculiarities) of the DB which contains an associative array of strings and ObjectID's. -- J C Lawrence Internet: claw#kanga,nu ----------(*) Internet: coder#kanga,nu ...Honorary Member of Clan McFud -- Teamer's Avenging Monolith... </PRE> <!--X-Body-of-Message-End--> <!--X-MsgBody-End--> <!--X-Follow-Ups--> <HR> <ul compact><li><strong>Follow-Ups</strong>: <ul> <li><strong><A NAME="01037" HREF="msg01037.html">[MUD-Dev] Re: [DevMUD] Re: Database module</A></strong> <ul compact><li><em>From:</em> cynbe#muq,org</li></ul> </UL></LI></UL> <!--X-Follow-Ups-End--> <!--X-References--> <!--X-References-End--> <!--X-BotPNI--> <UL> <LI>Prev by Date: <STRONG><A HREF="msg01035.html">[MUD-Dev] Re: Response (Was Re: MUD Design doc (long))</A></STRONG> </LI> <LI>Next by Date: <STRONG><A HREF="msg01037.html">[MUD-Dev] Re: [DevMUD] Re: Database module</A></STRONG> </LI> <LI>Prev by thread: <STRONG><A HREF="msg01045.html">[MUD-Dev] [RRE]AAAI 1999 Fall Symposium: Narrative Intelligence</A></STRONG> </LI> <LI>Next by thread: <STRONG><A HREF="msg01037.html">[MUD-Dev] Re: [DevMUD] Re: Database module</A></STRONG> </LI> <LI>Index(es): <UL> <LI><A HREF="index.html#01036"><STRONG>Date</STRONG></A></LI> <LI><A HREF="thread.html#01036"><STRONG>Thread</STRONG></A></LI> </UL> </LI> </UL> <!--X-BotPNI-End--> <!--X-User-Footer--> <!--X-User-Footer-End--> <ul><li>Thread context: <BLOCKQUOTE><UL> <LI><strong><A NAME="01052" HREF="msg01052.html">[MUD-Dev] META: 1998 Topic Summary</A></strong>, Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sun 27 Dec 1998, 09:49 GMT <LI><strong><A NAME="01051" HREF="msg01051.html">[MUD-Dev] Terragen</A></strong>, Vadim Tkachenko <a href="mailto:vt#freehold,crocodile.org">vt#freehold,crocodile.org</a>, Fri 25 Dec 1998, 07:49 GMT <LI><strong><A NAME="01046" HREF="msg01046.html">[MUD-Dev] (fwd) Re: DESIGN: Proposed topic of Discussion (Injecting Pure Signal)</A></strong>, J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Wed 23 Dec 1998, 02:37 GMT <LI><strong><A NAME="01045" HREF="msg01045.html">[MUD-Dev] [RRE]AAAI 1999 Fall Symposium: Narrative Intelligence</A></strong>, Bruce Mitchener, Jr. <a href="mailto:bruce#puremagic,com">bruce#puremagic,com</a>, Wed 23 Dec 1998, 00:47 GMT <LI><strong><A NAME="01036" HREF="msg01036.html">[MUD-Dev] Re: [DevMUD] Re: Database module</A></strong>, J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Tue 22 Dec 1998, 04:30 GMT <UL> <LI><strong><A NAME="01037" HREF="msg01037.html">[MUD-Dev] Re: [DevMUD] Re: Database module</A></strong>, cynbe <a href="mailto:cynbe#muq,org">cynbe#muq,org</a>, Tue 22 Dec 1998, 05:32 GMT <UL> <LI><strong><A NAME="01038" HREF="msg01038.html">[MUD-Dev] Re: [DevMUD] Re: Database module</A></strong>, J C Lawrence <a href="mailto:claw#kanga,nu">claw#kanga,nu</a>, Tue 22 Dec 1998, 06:24 GMT <UL> <LI><strong><A NAME="01039" HREF="msg01039.html">[MUD-Dev] Re: [DevMUD] Re: Database module</A></strong>, cynbe <a href="mailto:cynbe#muq,org">cynbe#muq,org</a>, Tue 22 Dec 1998, 10:14 GMT </LI> </UL> </LI> <LI><strong><A NAME="01040" HREF="msg01040.html">[MUD-Dev] Re: [DevMUD] Re: Database module</A></strong>, Jay Carlson <a href="mailto:nop#mitre,org">nop#mitre,org</a>, Tue 22 Dec 1998, 15:02 GMT </LI> </UL> </LI> </UL> </LI> </UL></BLOCKQUOTE> </ul> <hr> <center> [ <a href="../">Other Periods</a> | <a href="../../">Other mailing lists</a> | <a href="/search.php3">Search</a> ] </center> <hr> </body> </html>