'best practice' for server with several games

Options
BesoC
BesoC ✭✭
edited June 2013 in Photon Server
HI

I'm thinking of creating a server that will have several games and one authentication server. Besides authentication this server should make sure that one user will not connect more then once at a time

My current scheme:

1. Peer connects to the Authentication Server and authenticates
2. if authentication successful, the peer receives unique ID and games list with appropriate game server addresses
3. peer disconnects from authentication server and connects to some game server by user's choice
4. peer passes it's unique id and IP to game server. game server verifies them against authentication server (Server2Server).
5. if passed unique id is OK, user can start play the game on game server

Looks kinda complicated, but i can't think of other way that will have centralized authentication and provide good level of security

Do you think this way is OK or there are some better solutions - 'best practices' ?

Comments

  • Kaiserludi
    Options
    Hi BesoC.

    The best practice would be to just use the LoadBalancing application that gets already provided by us, as that's already doing all the complex stuff of a multi-gameserver setup under the hood, while providing you an easy to use API, so that your app code barely has to be aware of the fact that there are multiple gameservers, at all. The gamecode can just pretend that there is just "the Photon server", although it may in fact be hundreds of servers and the LoadBalancing layer will handle stuff like server-switches under the hood.
    Your current scheme basically is just reinventing the wheel.

    PS:
    Please pay attention that Photon server licenses when not explicitly stated otherwise are per server, so you would either need multiple licenses or an enterprise license.
  • Yes, that's basically what our Loadbalancing application already does.

    1. There is already a dummy "authentication" operation in the Master application - you'll need to add your own authentication code there.
    2. The master chooses the most suitable GS (with the smallest "load" (which could be determined by several factors, like CPU load, user count, bandwidth usage etc.)) and returns it's IP to the client.
    3. The client disconnects from Master and connects to the GS
    4. Authentication needs to be implemented, again depending on your needs
    5. Rooms are created on the GS.

    Voila, almost done. ;) Check our Loadbalancing documentation here for more info: http://doc.exitgames.com/photon-server/LoadBalancing/
  • BesoC
    BesoC ✭✭
    Options
    Thanks for clarifications. Glad I've moved to the right direction ;)