|
发表于 2010-5-21 21:05:07
|
显示全部楼层
数据库都应该可以。http://github.com/nickgammon/plugins/blob/master/ATCP_Mapper.xml这里可以看到表结构,其实和zmud的内容差不多。可以细细观察。表结构如下:
-
- function create_tables ()
- -- create rooms table
- dbcheck (db:execute[[
-
- PRAGMA foreign_keys = ON;
-
- CREATE TABLE IF NOT EXISTS areas (
- areaid INTEGER PRIMARY KEY AUTOINCREMENT,
- uid TEXT NOT NULL, -- vnum or how the MUD identifies the area
- name TEXT, -- name of area
- date_added DATE, -- date added to database
- UNIQUE (uid)
- );
- CREATE TABLE IF NOT EXISTS environments (
- environmentid INTEGER PRIMARY KEY AUTOINCREMENT,
- uid TEXT NOT NULL, -- code for the environment
- name TEXT, -- name of environment
- color INTEGER, -- ANSI colour code
- date_added DATE, -- date added to database
- UNIQUE (uid)
- );
- CREATE INDEX IF NOT EXISTS name_index ON environments (name);
-
- CREATE TABLE IF NOT EXISTS rooms (
- roomid INTEGER PRIMARY KEY AUTOINCREMENT,
- uid TEXT NOT NULL, -- vnum or how the MUD identifies the room
- name TEXT, -- name of room
- area TEXT, -- which area
- building TEXT, -- which building it is in
- terrain TEXT, -- eg. road OR water
- info TEXT, -- eg. shop,postoffice
- notes TEXT, -- player notes
- x INTEGER,
- y INTEGER,
- z INTEGER,
- date_added DATE, -- date added to database
- UNIQUE (uid)
- );
- CREATE INDEX IF NOT EXISTS info_index ON rooms (info);
- CREATE INDEX IF NOT EXISTS terrain_index ON rooms (terrain);
- CREATE INDEX IF NOT EXISTS area_index ON rooms (area);
- CREATE TABLE IF NOT EXISTS exits (
- exitid INTEGER PRIMARY KEY AUTOINCREMENT,
- dir TEXT NOT NULL, -- direction, eg. "n", "s"
- fromuid STRING NOT NULL, -- exit from which room (in rooms table)
- touid STRING NOT NULL, -- exit to which room (in rooms table)
- date_added DATE, -- date added to database
- FOREIGN KEY(fromuid) REFERENCES rooms(uid)
- );
- CREATE INDEX IF NOT EXISTS fromuid_index ON exits (fromuid);
- CREATE INDEX IF NOT EXISTS touid_index ON exits (touid);
-
- ]])
-
复制代码
[ 本帖最后由 killunix 于 2010-5-21 09:10 PM 编辑 ] |
|