Player Server

Blitz3D Forums/Blitz3D Beginners Area/Player Server

Buggy(Posted 2007) [#1]
If I had a game (hah! What a joke!) that had a lot of players, all of which who sign on with usernames and passwords, and I wanted them to check their inputted name and password against a master server's, how would I go about doing this? Does the server need to be constantly running a custom program that I also make?


stayne(Posted 2007) [#2]
You could use SQL to store the user data. Have your program send the data and retrieve/match it when the user submits the login.


Buggy(Posted 2007) [#3]
And - I know this sounds stupid - what is SQL? How do I implement it?


caff_(Posted 2007) [#4]
SQL is a database. Well, technically SQL is actually the language you use to communicate with a database, but people often call databases 'SQL'. Microsoft have a database engine that is called 'Microsoft SQL Server'.

An actual database itself is a bunch of tables, with lists of data in. Each column has a column name, e.g. 'Username', 'Password', 'EmailAddress'. Then you have one rows in the table for each user. e.g. "John Smith", "pass123", "jsmith@..."

What you would need is to create a program that acts as your server - this is connected to the internet. Your server program would simply accept and validate logins (e.g. from your actual 'game' you send the username and password over the internet to the server).

The server would check in it's database (i.e. list of users) to check your information is entered correctly - if so, you're allowed to continue and enter the game.

Your server could also track positions of players (e.g. their X, Y and Z values if your game is 3D), and stuff like their hair colour etc.

Have a look at Gnet (look at the top of this page on the menu) to understand how client to server connections work. That should be your first step.

Then have a look at how databases work - perhaps look at Microsoft Access if you have it, as it's a fairly simple introduction to how databases work. Then look at MySQL, which is a fairly standard database that can run on a server and could be used in a game.


Buggy(Posted 2007) [#5]
So, to connect to a MySQL database, how would that work? Does the database have to be online (i.e. on a website) or does the computer just have to be online and I can access the database via TCP stream somehow?


RepeatUntil(Posted 2007) [#6]
ETNA was written specifically for what you need, Buggy. You can download it in my signature.
But first you will need to get some ideas on what is mySQL and php (or just looked at examples, exactly how I learned).


Buggy(Posted 2007) [#7]
Thanks... I'll try.


octothorpe(Posted 2007) [#8]
Yes, the authentication server needs to be online all the time.

Sending usernames and passwords in plaintext is poor security: you would want to put them through a one-way hash first so no one could sniff them (or use a secure connection.)

MySQL is one of the better free SQL servers, and there are plenty of tutorials on how to set it up.