Brandon's Blog

1/26/2005

(No Title)

MUD Update (What Else, Lately?):

- The “go” command (as well as appropriate symcommands “west”, “east”, “north”, “south”, “up”, “down”) work on what we might call a pseudorandom basis, meaning that go doesn’t listen to the arguments passed to it (like “west”), it just picks an available exit and goes there.  I’m just too lazy and preoccupied with other things to write a token parser right now.

- We are (AFAIK) segfault-free.  Nice to fix the problem by upgrading a shared library (written by someone else).  Affirming to know it was their problem, in a weird sort of way.

- Multi-area, multi-file XML importing and parsing is fully enabled for room data.  It’s wonderful to use open standards for such a normally-closed file format.

- The Python embedding/extending concept was proved this morning.  No real work, but I’ve pulled in the header files and am linking against libpython2.3.so right now, so that looks great.  I ran some null code through it hard-coded and it didn’t take a dump on me (I’m just realizing the pun potential with “core dump.”  Goodness gratious.)  For the skeptical out there, I also ran some “bad” (erroneous) null code and it DID take a dump.  Gracefully.

- Looking into a concept called “functors” (classes that encapsulate functions using an overloaded parenthesis operator).  Mucho weirdo, but I’m currently fighting to get class member functions (i.e., accessors and modifiers [gosh I hate those terms]) that will provide a Python interface for the master players list, etc.  The Python interpreter will only hold pointers to C-style static functions as opposed to class functions (which actually are called with a hidden Class this pointer).  The idiot solution I came up with in bed this morning:
<br />Server</strong> ServerObject(Server* server = NULL)<br />{<br /> static Server* the_server;<br /> if (server)<br />  the_server = server;<br /> return the_server;<br />}<br />
I could “register” my server class in the static variable with this function at the beginning of API registration and then call it to retrieve the pointer from API functions.  Functors might smooth this out, but I have a lot of reading to do (since today is the first time I’ve been exposed to them, thanks Google).

Anyway, off to shower.