PlaneShift

Development => Development Deliberation => Topic started by: virajithj on November 09, 2010, 04:26:24 pm

Title: using a PS server compiled from source
Post by: virajithj on November 09, 2010, 04:26:24 pm
Hi,

I am trying to use a PS server compiled from source. I was able to run the server but how can i register a user on this server? Do I have to add a user directly to the db? If so how can I do this (I am new to dbs so a bit of detailed info would be really helpful).

Thanks a lot
Virajith
Title: Re: using a PS server compiled from source
Post by: Aiwendil on November 09, 2010, 05:47:54 pm
The SVN-database already comes with a few accounts. So you might want to look into the "src/server/database/mysql/accounts.sql" files to see how they were inserted:

Code: [Select]
...
#
# Dumping data for table accounts
#

#password is "keith"
INSERT INTO `accounts` VALUES (1,'vengeance','8dd9fa632ca161d0ca1929a4d99cbe77','2006-06-24 00:47:50','0000-00-00 00:00:00','127.0.0.1',30,'','US','M',1980,'A',0,0,'none','',0, '', '', '');

#password is "guest"
INSERT INTO `accounts` VALUES (3,'guest','084e0343a0486ff05530df6c705c8bb4','2003-07-22 00:31:36','0000-00-00 00:00:00','127.0.0.1',30,'','US','M',1980,'A',0,0,'none','',0, '', '', '');

#password is "andrew"
INSERT INTO `accounts` VALUES (5,'acraig','d914e3ecf6cc481114a3f534a5faf90b','0000-00-00 00:00:00','0000-00-00 00:00:00','',0,'','US','M',1980,'A',0,0,'none','',0, '', '', '');
...

Maybe it's also worth to have a look at the documentation for the AccountsTable in the wiki (http://planeshift.ezpcusa.com/pswiki/index.php?title=AccountsTable) for an explanation what the fields in that table do.
Not really sure what is needed for the md5 password....but you can try to create one with "echo <password>|md5sum" in a shell and see if it works.


So, basically it should be something along the lines:
Code: [Select]
mysql -uplaneshift -p
> INSERT INTO `accounts` VALUES (<unique ID>,<name>,<MD5-password>,'0000-00-00 00:00:00',<Acount-creation-data>,'',<GM-Level>,'',<country>,<gender>,<birth-year>,'A',0,0,<additional-comments>,<real-name>,0, '', '', '');

Title: Re: using a PS server compiled from source
Post by: LigH on November 09, 2010, 06:10:56 pm
MySQL also supports the MD5() function (http://dev.mysql.com/doc/refman/5.1/en/encryption-functions.html#function_md5) in INSERT statements; so you can "insert the MD5 sum of your password".