Author Topic: Different Server (Lobby Server, Data Server and clientside Game Server)  (Read 4334 times)

EdLan

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Dear Cummunity

I would like to realize a game with the following server / client concept:

- A Master Lobby Server (TNet Lobby Server Client)
- A Master Data Server (TNet Server / Client ) (for Login evaluation, centralized profile storage, etc.) This server should be connected from every game client directly to load / save profile data (for example). This server has a connection to a database with user and group data.
- And last but not least a Game Server (TNet Server / Client ) which is local. This should handle the normal game object sync.

Currently I have a centralized lobby server and the "local" game server which handles the object syncing, and so on. But I'm not sure what's the best way to realize the centralised Master Data Server. Should I create a second TNet Instance which communicates to the master server? This may could be fine because of the RFC event system. Or should I implement an own TCP handler to communicate to the master server, but

The reason for the "Master Data Server" is, that I don't want, that the game clients directly access the main database.

The reason for the "local" Game clients is simple the performance and the bandwidth saving, so that only the game result, login, and so on has to be sent to the Master Data Server.

Has anyone experience what the best and most robust solution for this scenario would / could be?

Or is there another simpler solution for that? Maybe I don't see the most obvious solution for that, because I was studying around the concept too long...
 
Another question is the related to custom packages: Is there an elegant way to realize custom packages without messing around ever and ever again when a new version of TNet is released and I would keep my code up to date?

Thanks in advance, EdLan

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
You can load / save files on the lobby server. You don't need the middle man. Connect to the lobby server, load all you need, get the list of game servers, and proceed to connect to the game server while remaining connected to the lobby server. Time to save? Save on the lobby server.

EdLan

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Hi ArenMook

Thanks for your reply. The idea is that I have also some dynamic data inside of an SQL DB (like for example user verification data, game informations, and so on). The "Master Data Server" should connect to that SQL DB and responds to requests from each game client. So the load / save data seems not to be the an elegant way to handle this...

Thanks a lot, EdLan

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
You can create a custom lobby server that will talk with your SQL database. Either way, do this on the lobby server, not on the game server.

EdLan

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 14
    • View Profile
Hi Aren

Thanks for your feedback. This seems to work fine and I'm currently at the implementation of my new TCP lobby packages.

One further question: What's the best way to create custom events / delegates when the TNTcpLobbyLink gets a TCP package from the lobby server. I want to fire en event / define a delegate, which can be handled in our main class, when use TNTcpLobbyLink gets a package.

Is there something built in which I can use / extend?

Cheers, EdLan

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
I recommend creating your own lobby server. Either derive from, or better still -- create a copy of the lobby server you want to start with, and implement all the functionality you need.