Game Development Community

dev|Pro Game Development Curriculum

User Account System

by Skylar Kelty · 11/13/2006 (4:37 pm) · 170 comments

---------------------------------------------------------------------------------------------------
Version 3
---------------------------------------------------------------------------------------------------

Version 3.3 - Updated!
download v3.3
Version 3.3 uses Web-Server Interaction and features awards, stats and member panel.
This version requires PHP, MYSQL and TorqueScript Knowledge.
If you have downloaded this before, make sure you clear your browser's cache!

Version 3.2
download v3.2
Version 3.2 uses SQLLite and features awards, stats and member panel.

Version 3.1 - Untested!
download v3.1
Version 3.1 uses xml and features awards, stats and member panel.

---------------------------------------------------------------------------------------------------
Old Versions
---------------------------------------------------------------------------------------------------

Version 2 - No longer supported!
download v2
Version 2 uses SQLite, which is more secure. Some of you may not want to use SQLite, if you dont, use v1.2

Version 1.2 - No longer supported!
download v1.2
Version 1.2 uses the fileobject

---------------------------------------------------------------------------------------------------
ChangeLog
---------------------------------------------------------------------------------------------------

UPDATES:
v1.1 - bug fixes
v1.2 - now uses c++
v2 - now uses SQLite
v3 - Fixes, Updates and 3.3 uses web-server interaction
v3.3 - Updated to.. actually work.. see comments
#21
08/02/2007 (12:17 am)
@Everyone - I'll work on version 3.0 sometime this week, if you would like to requst any features/fixes please let me know.
#22
08/02/2007 (7:33 am)
I actually figured that out right after posting. After the user logs in it takes them to my dedicated server. What I am trying to implement now is the xml file being created/stored server side instead of in the clients folder.
#23
08/02/2007 (8:06 am)
I am unfamiliar with c++. Please tell me if I am doing this the wrong way. I am wanting to have the xml file stored on the server instead of the client. I currently have it this way....

%file.openforwrite("ftp://xxx.xxx.x.xxx/data/users/" @ %username @ "/logindata.xml");

Now when the client runs registerdlg it should write and read from that location but it will not create it or read it. The ftp location has read write privileges. Anything would help.
#24
08/02/2007 (9:54 am)
Does stock TGE allow ftp?
#25
08/02/2007 (10:08 pm)
Well, that would be my feature request in v3.0 then. I have tried and tried to figure out a way for this to work. Currently I have the user going to my website to register (the webserver which resides on the same network as the game server) When the registration is complete it sends a confirmation e-mail to the user and writes the logindata.xml file in the ./users/ folder. I am still having a problem with them logging in. Somehow they need to be able to authenticate the logindata.xml file that resides on the game server from the client end.
#26
08/03/2007 (12:09 am)
Unfortunatly not everyone will want this to be from a web server, Its hard to please everyone.

I don't know what people would want most, heres what I think, Version 3 should include:
-> Web server interaction replacing mySQL from version 2
-> Full online Stats/Awards system and account management written in PHP
-> Integration of the member panel, awards and stats system
-> Examples of an implementation in TGE 1.5.2
-> Any required updates for a 1.5.2 port
-> Any fixes/updates

And to please everyone, all new features, fixes and updates will be included in version 2 and 1

This is as fair as I can be.

So:
Version 3.1 -> File Object
Version 3.2 -> MYSQL Lite
Version 3.3 -> Web server Interaction

Sound good?
#27
08/03/2007 (1:18 am)
Version 3.1 and 3.2 have been uploaded.

Version 3.3 should be released later today
#28
08/03/2007 (7:29 am)
That's awesome. I can't wait to see what you have in V3.3. Thank you for all of your hard work on this project and also combining your other resources in these updates. I had planned on using them as well.
#29
08/03/2007 (9:41 am)
Thanks :D

Actually, version 3.3 will be released tomorrow, I decided to add a lot of stuff ^^
#30
08/03/2007 (12:06 pm)
More stuff? That's awesome! Anticipation at its highest...... :) Thank you.
#31
08/04/2007 (2:26 am)
Version 3.3 Alpha is up, not feature complete, lots more stuff to come :D
David, this version is for you :P
An example of how to use a web-server in TS.

Features to come:
-> Generic PHP scripts that you can modify to fit your needs
-> Bigger Stats system
-> Award Titles
-> More details on registration
-> Detailed Stats (dmg location, weapon used etc)
-> and a secret feature... ;)

EDIT: Please note that I have NOT tested this version, and its giving me TS warning so dont expect it to work properly.
#32
08/09/2007 (9:46 am)
Ok, just to give you an update this is what I've got so far. I want the user to have to register on my website which is hosted on a virtual server using php. I have mysql running and the username and password is stored there. I am trying to just use the login portion of the uac.cs instead of the register portion. Reason: I don't just want anybody to be able to register and get a username and password. I want them to have to register on my site by way of a link through paypal email confirmation. When they register a link for the client app will be sent to their e-mail. they install and all they have to do is login. I have yet to get the uac.cs working. I have tried to compare finney's book with what you are doing. Not entirely throwing in the towel but what seems like a simple process is taking a long time. :)


I tried this:

function ServerCmdLoginCheck(%client, %AuthPass, %AuthUser)
{

%login= new MySQL();

%login.host= "mysql ip";
%login.port= 3306;

// user information

%login.user= "db_login_user";
%login.pwd= "db_login_password";

// connection flags

%login.flag_compress= false;
%login.flag_ssl= true;

// database to use

%login.db= "_db_name";

// ----------------------------------------------------
// echo

%login.ValidateSettings();

%login.Connect();

%login.Query ("SELECT * FROM myusers WHERE Username=\"" @ %AuthUser @ "\" AND Password = \"" @%AuthPass @ "\"");

%result= %login.StoreResult();
if (%login.NumRows (%result) > 0)
{
echo("Access Granted");
commandToClient(%client, 'Login');
}

if (%login.NumRows (%result) < 1)
{
echo(" ");
echo("Access Denied");
echo(" ");
commandToClient(%client, 'LoginFailed');
}

%login.FreeResult(%result);
%login.Close();
}



Couldn't get this to work either. I am currently at a loss.
#33
09/02/2007 (12:43 am)
Just thought I'd drop in a quick comment that 3.2 drops in easily into TGE 1.5.2 + RTS Kit. Now comes the fun of making the RTS login system dependent on it!
#34
09/02/2007 (1:18 pm)
I am using VS2005. How on earth do you

"Add the sqlite3 lib file to your linker input" This is the only thing standing in the way of me getting this to work.
#35
09/02/2007 (4:33 pm)
I figured out how to do the linker input. Because this wasn't working I thought I was doing it wrong but I wasn't. I keep getting a fatal error.
#36
09/02/2007 (5:52 pm)
I honestly can't say I ran into the issues you did. As I stated before, the resource works perfectly for me and installed without a hitch, and I am not even a decent coder.
#37
09/03/2007 (12:13 am)
Perhaps you could post your fatal error, and we may be able to help.
#38
09/03/2007 (7:16 am)
I will be more than happy to post the fatal error for you later.
#39
09/03/2007 (8:53 am)
David didnt have problems with this resource, he had problems trying to modify it, and ive supported him as much as I can by releasing v3.3
#40
09/03/2007 (12:48 pm)
Mhm I want to leave today with a nice round number of comments in my profile, and this resource too! so this is a spam comment to let you know that due to a number of requests (yes more than one :O shock horror!) I have decided to work on v3.3 this week and hopefully push v4 out this month, but most likely next month!

EDIT: hehe v4 is soo kewl ^^