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 :)


1 Answer 1


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?

  • \$\begingroup\$ 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! \$\endgroup\$
    – Tada
    Commented Mar 7, 2013 at 5:05
  • \$\begingroup\$ Yup, that's correct! A GUID is decent token as it's pretty random if you were wondering. \$\endgroup\$ Commented Mar 7, 2013 at 5:12
  • \$\begingroup\$ 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 :) \$\endgroup\$
    – Tada
    Commented Mar 7, 2013 at 5:13
  • \$\begingroup\$ 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. \$\endgroup\$
    – RobCurr
    Commented Mar 7, 2013 at 6:32
  • \$\begingroup\$ @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. \$\endgroup\$ Commented Mar 7, 2013 at 12:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .