1. in fact its not about gs, for mmo's, mysql does the storing info like accounts(username/pass),character info(int,dex,str,etc.),maybe atak power and so on, it's about how you design your game.

and mysql databeses not-exactly-but-like registry more than a txt file. it has a table hierarchy, like you have a accounts table,it has rows and columns, each row is an account and columns are like id,username,passwd,email,gender.

Code:

accounts table
_____________________________
id |uname |passwd |
______|_________|____________|
1 |quads |123456 |//this one
______|_________|____________|//and this one stands for a line
2 |ryu |abcde |
______|_________|____________|
...etc.



you can make a registration page using php. the usage of functions are smiliar and queries are exactly same.(talking about php and GS)

to use this stored info in database there are functions like(i made up the func names im not sure )

handle = mysql_connect("mysqlusername","mysqlpassword",[maybe some more parameters like ip addres im not sure]);
mysql_connectdb(handle,"mydatabase");

using these you are now connected to your database

then you query your database, lets say user entered his user name as ryu and password as abcde and you want to check if that password is wrong or right.

then you make a query like(not from client to database,from server to database,i mean client sends username and password to server,server checks it)

result = mysql_query("SELECT uname,passwd FROM accounts WHERE uname = 'ryu'");

this returns a row, there are some other functions to parse them,so you get password from database only thing left is to check if it is same as the password that user entered or not.

if its right then you send(make another query) the user's characters' info.(say you have another table like:
Code:

_______________________________________
id |name |level |dex |
______|_________|____________|_________|
1 |AAAA |12 |345 |//quads' first char.
______|_________|____________|_________|
1 |asdad |34 |123 |//quads' second.
______|_________|____________|_________|
2 |ryugaa |55 |455 |//ryu's first
______|_________|____________|_________|
2 |ryuzaki |9 |23 |//ryu's second
______|_________|____________|_________|

//(id points to the account id ) chars' with id 1 belongs to account with id 1.
//or you can design that things yourself



2. im not sure i exactly understand that

servers can be like one for database server and one for Game server.
sql server(including mysql) are designed for fast-access so queries will return the result fast but, making a lot of queries for unneeded things like store every step of character with queries and send them to other clients with some other queries will make server highly loaded, it will start to lag and even it will crash. This chamges from game to game but you may try sending other characters position and angle directly without storing them at the database(like in normal mp games,dont go to sql server,send info directly over gameserver), just store the last position(say when use logs off) and user will respawn in his last position when he logs in back.

a normal hosting's server and a normal home pc cant handle these, you may need to hire or buy a server machine that only works as your server, either you can run mysql server and game server in same Machine but again, for performance issues it will be better when they are on spare machines.

and a mysql server wont do the sending info to the client part, this is game server's job, mysql servers stores info and runs queries.

sorry for the long answer.

Last edited by Quadraxas; 03/18/08 20:59.

3333333333