ActiveNet Distributed Password Database
To support user login across multiple servers, ActiveNet requires a
distributed password database. This will be implemented in two steps.
We will start with a one way system in which all account changes are
made at a central account server and are simply mirrored by the game
servers. Eventually, we would like to allow account changes through the
games' netshells, which will require a system for the game servers to
proxy account change requests back to the central account server.
Stage 1 Organization
On the account server machine:
- acctserv.cgi - parses cgi input, attempts to create/change/delete/
validate accounts in database (tcapw), returns html response. If
successful, writes account change data to the message queue (using
pwq interface to wmq).
- antpserv - serves file transfer requests for files in the acctserv
wmq or for the last freeze file. Resides on account server machine.
- wmqmaint (script or program) - One freeze file containing the entire
database in net transferable form is kept around for restarts (tcapw).
The message queue is kept as far back as the date of the last freeze.
Maintenance program handles freezing and deleting of wmq files older than
the freeze file as a regularly scheduled (monthly?) cron job.
On the game server machine:
- antpclnt - mirrors the latest freeze file and all message queue files
to the game server machine.
- game server - server code in servpw handles restarts (using tcapw),
watching the incoming wmq for new account changes (using the pwq
interface to wmq), and processing these changes into the local database
(using tcapw).
- wmqmaint (script or program) - One freeze file containing the entire
database in net transferable form is kept around for restarts (tcapw).
The message queue is kept as far back as the date of the last freeze.
Maintenance program handles deleting of wmq files older than
the freeze file as a regularly scheduled (monthly?) cron job.
Requirements for Stage 1
- password database interface (tcapw) - Currently, this is implemented
as an assoctab with the addition of the tcapwtab routines to freeze it to
disk in an encrypted format.
- Fix new UID generation/handling. (< 1 day - done?)
- Switch from assoctab to a real database format for efficiency.
Use old tcapwtab_freeze/thaw functions to allow net transfer of the
whole database. Without this change, the rest of the systes should
still work. (3 days)
- Message queue (wmq, pwq, antp) - An on disk message queue and an http-
like file transfer system (antp) is used to reliably and securely transfer
account change data from the account server to the game servers.
- Write a wrapper (pwq) for the generic wmq that knows the internal
format of account data sent through the wmq. (< 1 day more - done)
- antpserv/antpclnt need to allow the transfer of the entire database
in some form to allow new game servers to start up and old ones to
sync up occasionally.
Add an optional startup parameter 'dbfile'. This should be the
filename of a file with a tcapwtab-style header (an 8 byte wmq pointer
(time/offset) starting at offset 0), and should contain the status of
the full database at the time the wmq message coresponding to that
pointer was written. If the parameter is present, antpserv should
respond to FIRST requests with this file first, followed by the
wmqfiles at or later than the pointer. (1 day to write - done?)
- Game server (server, servpw) - Code in the game server to handle
account database related processing.
- server needs a few more command line parameters for the incoming
wmq directory, etc. (done?)
- All database processing should be handled in servpw. Watch the
incoming wmq and process account changes. Handle restarting.
(wmq done. tcapw end of restarting needs 1 day to write)
- Account server (acctserv) - Code for central account server.
- Interface to tcapw needs to be designed and written. (1 day - done)
- Account server and interface to CGI/other input programs needs to
be designed and written. (1 day? - done)
- Need CGI front-end to allow creation/validation of new accounts.
(1 day to write - done)
- HTML forms for CGI. (1 day)
- Wmq maintenance program (wmqmaint) - Code to handle keeping the wmq
directory clean. (2 days?)
- Testing, integration (2-3 days)