Flatfile (PennMUSH)
Even a minimal PennMUSH flatfile containing only two objects is too large to be included here, but an abbreviated example appears at the end of this article.
Headers
PennMUSH Version Header
A PennMUSH version header begins with +V, and continues with a number, n, where (n mod 256) = 2:
+V2143284226
The real flags are found with (n/256 - 5). The 5 seems to be a secondary version number indicating NO_CHAT. The alternative is 6 which indicates CHAT, but this is no longer used. The remaining bits indicate optional capabilities. PennMUSH manages format changes primarily with capability bits -- leaving the primary and secondary version numbers unchanged. In our example, the number indicates the following capabilities (oldest first):
NO_CHAT_SYSTEM WARNINGS CREATION_TIMES NEW_STRINGS TYPE_GARBAGE SPLIT_IMMORTAL NO_TEMPLE LESS_GARBAGE AF_VISUAL VALUE_IS_COST LINK_ANYWHERE NO_STARTUP_FLAG AF_NODUMP SPIFFY_LOCKS NEW_FLAGS NEW_POWERS POWERS_LOGGED LABELS SPIFFY_AF_ANSI HEAR_CONNECT
SPIFFY_LOCKS was introduced with PennMUSH 1.7.5p0 (11/14/2001), nearly ten years ago. Capabilities earlier in the list are older. NEW_FLAGS, NEW_POWERS, POWERS_LOGGED, and LABELS were introduced with PennMUSH 1.7.7p40 (12/01/2004). The other capabilities do not affect the format of the flatfile.
So, if SPIFFY_LOCKS does not appear, the flatfile is older than ten years, and LABELS indicates whether the flatfile is 'new' or 'old'.
Object Count
~<objects>
In our example (which contains only three objects), we see a "~3" on a line by itself which indicates the size of the dataabase. This field could also be called a size hint because PennMUSH could either pre-allocate memory for the objects which are to follow or ignore the hint and accept each object as it appears.
End Of Dump
Every flatfile ends with '***END OF DUMP***' on the last line.
Minimal Flatfile Example
The following is the 'new' style:
+V2143284226 savedtime "Sat Jul 10 14:45:02 2010" +FLAGS LIST flagcount 62 name "CHOWN_OK" letter "C" type "ROOM EXIT THING" perms "" negate_perms "" name "DARK" letter "D" type "PLAYER ROOM EXIT THING" perms "" negate_perms "" ... remaining 60 flags not shown ... flagaliascount 17 name "LISTEN_PARENT" alias "^" name "CHAN_USEFIRSTMATCH" alias "CHAN_FIRSTMATCH" ... remaining 15 flag aliases not shown ... +POWER LIST flagcount 34 name "Announce" letter "" type "PLAYER ROOM EXIT THING" perms "wizard log" negate_perms "wizard" name "Boot" letter "" type "PLAYER ROOM EXIT THING" perms "wizard log" negate_perms "wizard" ... remaining 32 powers not shown ... flagaliascount 8 name "Cemit" alias "@cemit" name "Announce" alias "@wall" ... remaining 6 power aliases not shown ... ~3 !0 name "Room Zero" location #-1 contents #1 exits #-1 next #-1 parent #-1 lockcount 0 owner #1 zone #-1 pennies 0 type 1 flags "LINK_OK" powers "" warnings "" created 1278000353 modified 1278000353 attrcount 1 name "DESCRIBE" owner #1 flags "no_command visual prefixmatch" derefs 3 value "You are in Room Zero." !1 name "One" location #0 contents #-1 exits #0 next #-1 parent #-1 lockcount 3 type "Basic" creator #1 flags "no_inherit" derefs 0 key "=#1" type "Enter" creator #1 flags "no_inherit" derefs 0 key "=#1" type "Use" creator #1 flags "no_inherit" derefs 0 key "=#1" owner #1 zone #-1 pennies 150 type 8 flags "WIZARD CONNECTED" powers "" warnings "" created 1278000353 modified 0 attrcount 8 name "DESCRIBE" owner #1 flags "no_command visual prefixmatch" derefs 1 value "You see Number One." name "LAST" owner #1 flags "wizard visual locked prefixmatch" derefs 0 value "Sat Jul 10 07:44:34 2010" name "LASTFAILED" owner #1 flags "wizard locked prefixmatch" derefs 0 value " " name "LASTIP" owner #1 flags "wizard locked prefixmatch" derefs 0 value "::ffff:127.0.0.1" name "LASTSITE" owner #1 flags "wizard locked prefixmatch" derefs 0 value "sdennis@localhost" name "MAILCURF" owner #1 flags "no_command wizard locked" derefs 0 value "0" name "MAILFOLDERS" owner #1 flags "no_command wizard locked prefixmatch" derefs 0 value "0:INBOX:0 " name "XYXXY" owner #1 flags "no_command wizard locked internal" derefs 0 value "XX41009057111400169070" !2 name "Master Room" location #-1 contents #-1 exits #-1 next #-1 parent #-1 lockcount 0 owner #1 zone #-1 pennies 0 type 1 flags "FLOATING" powers "" warnings "" created 1278000353 modified 1278000353 attrcount 1 name "DESCRIBE" owner #1 flags "no_command visual prefixmatch" derefs 1 value "This is the master room. Any exit in here is considered global. The same is true for objects with $-commands placed here." ***END OF DUMP***