An example for inserting a new user:
- Code: Select all
INSERT INTO Accounts (AcctName, HashedPassword, IsActive, AcctUUID) VALUES ('Nadnerb','463418FA8261503A2B70C403F7DFBB34',1,'7FB62651-3E81-11DD-AE16-0800200C9A6A');
Note that HashedPassword is a hex digest of an MD5 hash of the password,
using all capital letters, AcctUUID is a GUID for the player, which you should generate, and AcctName and IsActive should be self explanatory. The rest of the columns will be filled in automatically if you don't specify values.
Edit: D'oh, read your post again and realized you were just asking for the part about adding users. former first half of post below <_<
- Show Spoiler
I seem to recall the authserver creating the auth tables automatically once started, and it only needed filling in, but I may be misremembering.
Either way, you need the following tables in your auth database:
- Code: Select all
CREATE TABLE Accounts (
Idx int(10) unsigned NOT NULL auto_increment,
AutoTime timestamp(14) NOT NULL,
AcctName varchar(32) NOT NULL default '',
AcctType int(11) NOT NULL default '0',
Password varchar(32) NOT NULL default '',
HashedPassword varchar(32) NOT NULL default '',
IsActive int(11) NOT NULL default '0',
CreatedOn datetime NOT NULL default '0000-00-00 00:00:00',
ExpiresOn datetime NOT NULL default '0000-00-00 00:00:00',
NeverExpires int(11) NOT NULL default '0',
BillingIdx int(10) unsigned NOT NULL default '0',
AcctUUID varchar(40) NOT NULL default '',
PRIMARY KEY (Idx),
UNIQUE KEY NamePasswdUnique (AcctName,Password),
KEY AcctName (AcctName)
);
CREATE TABLE DatabaseVersion (
DatabaseVersionNumber int(11) NOT NULL default '0',
PRIMARY KEY (DatabaseVersionNumber)
);
CREATE TABLE Permissions (
AcctName varchar(32) NOT NULL default '',
AcctStatus enum('KLINE','PRIVATE','ADMIN') default NULL,
UNIQUE KEY AcctName (AcctName)
);
CREATE TABLE TableVersions (
Idx int(10) unsigned NOT NULL auto_increment,
TableName varchar(64) NOT NULL default '',
TableVersion int(10) unsigned NOT NULL default '0',
PRIMARY KEY (Idx),
UNIQUE KEY TableName (TableName)
);