Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm playing around with creating a game in C# using the XNA Framework. I've decided to use technologies that I'm pretty much familiar with and create things from scratch. There are probably frameworks out there that would take away all of the difficulties that I'm encountering but I find it fun to dive into these challenges and over come them manually if you will.

My current issue is that when I play MMO type games I know the general setup. I must login (authenticate) and then select a server to begin playing on. Once I log into the server I'm generally met with a Character Select screen of some sort before I actually "log in to the game".

With that said, my initial attempt at developing a database system was this:

  1. Authentication Database - table for user information, table for server information
  2. Game Database - table for characters, table for inventories, items, etc...

After I created these I noticed a key missing problem. Users are linked to characters and characters are linked to a server. I currently have these pieces of information spread over 2 databases. I thought to myself, maybe this isn't a good idea?

I guess I could: Game Client can store the reference to the account identifier in the code once login was successful, but doesn't that sound like a security issue?

Anyone have thoughts or suggestions? Or a good book recommendation for development in this area?

Note I'm not trying to develop an absolute perfect system that I can release and make money off of. I'm more doing this for experience, fun and enjoyment so my solution doesn't have to be perfect, but I don't want it to be the worst possible solution either :)

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

This is fine if you use a multi-process setup that involves a gateway daemon and an actual world server daemon (which can be further split into other sub daemons for processing of data in the world; but this is a whole other story on its own...)

To use the setup you have, you just setup some communication between the two servers. The servers initially connect to the gateway server login, process and do all the work through that vein. Then, when everything is confirmed the player sends a packet and the gateway daemon sends an OK and passes the OK to the client and the internal world server. The client is given a token which is then sent to the world server to prove who they are - then the world server takes the data the gateway daemon gave it and constructs the player and everything needed from the shard specific data.

There's a lot of topics on this, so see:

Information on seamless MMO server architecture Loadbalancing Questions Should I keep login server apart from game server?

share|improve this answer
    
Awesome! Thanks for your response. So it sounds like my missing piece is the bridge between the authenication server and the game server who will simply share user ids and their tokens. Then as the client connects to the game server it should be validated by the token it has (should match the token provided by the auth server). Thanks! –  Tada Mar 7 '13 at 5:05
    
Yup, that's correct! A GUID is decent token as it's pretty random if you were wondering. –  Vaughan Hilts Mar 7 '13 at 5:12
    
Aye I was thinking GUID, especially since my implementation is rather trivial and I don't expect to ever see anyone's eyes other than my own and maybe a few friends :) –  Tada Mar 7 '13 at 5:13
    
Why do you think you need 2 databases? I can understand why the separate servers but they both can point to the same backend database. –  RobCurr Mar 7 '13 at 6:32
    
@RobCurr This is usually so sharding can occur - one entry for login for multiple worlds. This might not be neccessary in the OPs case; but it's certainly a scalability feature. WoW uses Battle.NET to authenticate (a separate table all together I imagine) and then passes off to a world server / zone server, just like I've described here. –  Vaughan Hilts Mar 7 '13 at 12:19
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.