Flatfile (TinyMUX)

From TinyMUX
Jump to: navigation, search

The example at the end of this article is the flatfile for a minimal database. It contains only two objects: Limbo(#0) and Wizard(#1). No user-attributes are defined or used, but it does contain several built-in attributes.

Headers

TinyMUX Version Header

There are currently four possible TinyMUX version headers:

  • Version 1 with attribute values (+X992001)
  • Version 2 with attribute values (+X992002)
  • Version 1 without attribute values (+X1031937)
  • Version 2 without attribute values (+X1031938)

With TinyMUX 2.7, the following are possible:

  • Version 3 with attribute values (+X996099)
  • Version 3 without attribute values (+X1031939)

Unicode support was added in TinyMUX 2.7, and UTF-8 characters can appear in the database. Because of the difficulty in adapting the lock parser to deal with this parsing possibility properly, the default lock no longer appears in the header portion of each object. Instead it appears in the list of attributes like the other locks. The large difference between the v3 version string, +X996099 and the corresponding v2 version string, +X992002 reflects this.

With TinyMUX 2.10 and the addition of extra color, the following are possible:

  • Version 4 with attribute values (+X996100)
  • Version 4 without attribute values (+X1031940)

Versus a Version 3 Flatfile, a Version 4 Flatfile may contain code points U+F610 through U+F6FF, U+F710 through U+F7FF, and U+F0000 through U+F05FF. These Private Area code points are used to encode 24-bit RGB color values. The Omega Flatfile converter can down-convert this rich color down to the nearest ANSI colors used in previous versions.

Object Count

+S<objects>

In our example below, since there are two objects in the flatfile, we see "+S2" on a line by itself.

Next Free Attribute Number

+N<next attribute number>

In our example below, since there are no user-defined attributes, the next attribute number to be used will be 256. The numbers from 1 to 255 are for built-in attributes. Those names are compiled into the server and do not appear in the flatfile. We see a "+N256" on a line by itself.

Maximum Connected Player

-R<maximum players>

Since no one has connected to this example game, we see "-R0" on a line by itself.

Object

An object starts with "!<dbref>" on a line by itself and ends with "<" on a line by itself. The format of an object varies based on whether attribute values are included or excluded from the file. See the version string above. In our example, we see the following for Limbo(#0):

"Limbo" (name)
-1      (location)
-1      (zone)
1       (contents)
-1      (exits)
-1      (link)
-1      (next)
        (default @lock)
1       (owner)
-1      (parent)
0       (pennies)
0       (1st flags)
0       (2nd flags)
0       (3rd flags)
0       (1st powers)
0       (2nd powers)

Since the default lock is moved to the attribute list in TinyMUX 2.7, this becomes:

"Limbo" (name)
-1      (location)
-1      (zone)
1       (contents)
-1      (exits)
-1      (link)
-1      (next)
1       (owner)
-1      (parent)
0       (pennies)
0       (1st flags)
0       (2nd flags)
0       (3rd flags)
0       (1st powers)
0       (2nd powers)


If an object has attribute values, they will appear next. Each value requires two lines. The first line is '>' followed by the attribute number. The value (in double quotes) appears on the next line. In the case below, 218 corresponds to "Created", and the creation timestamp follows.

>218
"Fri Sep 29 17:37:27.788233 2006"

Of particular interest sometimes is the password for Wizard(#1). Attribute number 5 corresponds to "*Password", and what follows is a radix-64-encoded SHA1 hash of the password "potrzebie". We know that because it is the default password used to create this hash, but it is not feasible to take hash given below and caculate the original password. The password itself is broken down into three fields: "$SHA1" tells us which hash algorithm was used. "AWZ+Nn87KWc4" is the salt used to permute the hash in one of a large number of different ways, and "bo7kljtpjHvR1ykgRyfCCMtJ404=" is the resulting hash.

>5
"$SHA1$AWZ+Nn87KWc4$bo7kljtpjHvR1ykgRyfCCMtJ404="

Reseting the password for Wizard(#1) is as simple as replacing this attribute value with something associated with a password you know.

End Of Dump

Every flatfile ends with '*** END OF DUMP ***' on the last line.

Minimal Flatfile Example

+X992002
+S2
+N256
-R0
!0
"Limbo"
-1
-1
1
-1
-1
-1

1
-1
0
0
0
0
0
0
<
!1
"Wizard"
0
-1
-1
-1
0
-1

1
-1
1000
19
0
0
0
0
>218
"Fri Sep 29 17:37:27.788233 2006"
>219
"Fri Sep 29 17:37:27.788233 2006"
>30
"Fri Sep 29 17:37:27.788233 2006"
>49
"20"
>38
"20"
>5
"$SHA1$AWZ+Nn87KWc4$bo7kljtpjHvR1ykgRyfCCMtJ404="
<
***END OF DUMP***

For TinyMUX 2.7, this becomes:

+X996099
+S2
+N256
-R0
!0
"Limbo"
-1
-1
1
-1
-1
-1
1
-1
0
0
0
0
0
0
<
!1
"Wizard"
0
-1
-1
-1
0
-1
1
-1
1000
19
0
0
0
0
>218
"Fri Sep 29 17:37:27.788233 2006"
>219
"Fri Sep 29 17:37:27.788233 2006"
>30
"Fri Sep 29 17:37:27.788233 2006"
>49
"20"
>38
"20"
>5
"$SHA1$AWZ+Nn87KWc4$bo7kljtpjHvR1ykgRyfCCMtJ404="
<
***END OF DUMP***