Chapter 7. Database System

As of Jaymod 2.1.0 a new text-based database file structure has been created. Replacing the old data files are new .db files. These files, when possible, store information in human-readable ASCII format.

[Important]Important
All .db files are loaded into memory at game-init (map begin) time, and subsequently saved out to disk (overwriting the files) at game-shutdown (map end) time. This means any manual edits made to the database files will be lost at game-shutdown time. The best practice for manual edits (eg: adding levels to level.db file) is to first shutdown the server before editing database files.

The following table describes the new locations for old data.

Table 7.1. Data Transition

pre-2.1.02.1.0DATA DESCRIPTION
shrubbot.cfglevel.dbaccess levels
shrubbot.cfguser.dbadmin and bans
xpbackup.datuser.dbsaved xp
recspree.datmap.dbtop killing sprees
seendb.datuser.dbadmin and bans

level.db

Stores access levels available for promoting users to higher levels of access. Data maintenance on this file is done manually with a text editor. ET color codes are supported. The following sample shows a default level=0 record and a manually edited level=1 record with full access.

Figure 7.1. level.db Sample

level = 0
flags = ACXahiu
name = default
greetingtext = 
greetingaudio = 

level = 1
flags = *
name = ^3god
greetingtext = 
greetingaudio = 

user.db

Stores user related information. Most data maintenance on this file can be done in-game, however some things such as greetingtext must manually be edited. You cannot edit xpSkills. The following sample shows a typical user with authLevel=0 which corresponds to the level=0 record in level.db.

Figure 7.2. user.db Sample

guid = 9b830ff2b957a1c6bf28fce9e7a765e9
timestamp = 1168172721 # Sun Jan  7 07:25:21 2007
ip = 127.0.0.1
mac = f4:e5:d6:cc:b8:a9
name = Mr.Mxyzptlk
namex = ^oMr.^xMxyzptlk
authLevel = 0
authFlags = 
greetingtext = 
greetingaudio = 
xpSkills = UyHf9+YAoWDqH5c+RsnNn/7eaxFnn3lKPgyLHdOsgjs=