Link to the old Meta-server
CREATE TABLE
GAMES
(
SERVER CHAR(200) NOT NULL, #// hostname
PORT INT NOT NULL,
STARTTIME INT, #// I would yust store time_t time() here perhaps you have a better idea
ADMIN CHAR(20), # foreign key to PLAYERS table
LASTMSG INT, #// time again
LEVELNAME CHAR(200),
COMMENT CHAR(250), #// missing in the ER-diag.
MAXPL INT, #// how much clients are accepted
SETPL INT, #// No. of startpositions (not the same as maxpl)
VERSION CHAR(20), #// server version
PVERSION CHAR(20), #// protocol version (both are missing in tge ER diagram)
PRIMARY KEY(SERVER,PORT)
)
CREATE TABLE CONNECTEDPL
(
NICK CHAR(20) NOT NULL,
SERVER CHAR(200) NOT NULL,
PORT INT NOT NULL,
IDONSERVER INT NOT NULL, #// is needed because it is allowed to connect twice
#// (also it doesn't work yet) - is missing in the ER-diagram
UNITS INT NOT NULL DEFAULT 0,
PING INT,
REALSKIN CHAR(200) NOT NULL, #// player perhaps doesn't have/use a own skin
VERSION CHAR(20), #// client ver., doesn't need protocol ver.
#// because he only is allowed to connect to the server \
#// if the versions match
PRIMARY KEY(NICK,SERVER,PORT,IDONSERVER)
)
CREATE TABLE PLAYERS
(
NICK CHAR(20) NOT NULL,
SKIN CHAR(200),
EMAIL CHAR(200),
POINTS DOUBLE(8,2) NOT NULL DEFAULT 100,
COMMENT CHAR(250),
PASSWORD CHAR(100) NOT NULL,
GAPLAYED INT NOT NULL DEFAULT 0,
EXPIRE INT, # once again a time
PRIMARY KEY(NICK)
)
| Type | Content | Comment | Return Value |
| Game started | SERVER,PORT,VERSION,PVERSION,ADMIN,PASSWORD,LEVELNAME,MAXPL,SETPL,COMMENT | STARTTIME and LASTMSG must be set,ADMIN PASSWORD must be checked | SUCCESS<=>PASSWORD correct |
| Game end | SERVER,PORT,PASSWORD,WINNERS,LOOSERS | ADMIN PASSWORD must be checked, calculate new player points based on WINNERS and LOOSERS (both are lists of IDONSERVER and can't be calculated by the meta-server) | SUCCESS<=>PASSWORD correct |
| Client info update | NICK,SERVER,PORT,IDONSERVER,UNITS,PING,REALSKIN,VERSION,CLIENTPASSWD,SERVERPASSWD | LASTMSG must be set, both passwords must be checked, if player not already there insert him | SUCCESS<=>passwords correct |
| Client left game | SERVER,PORT,IDONSERVER,CLIENTPASSWD,SERVERPASSWD | LASTMSG must be set, both passwords must be checked | SUCCESS<=>passwords correct and player was there |