If someone could please validate the model for the following would be appreciated, I'm still into beginning stages of TNet and having a hard time wrapping my head around the DB communication between client and host. This is for a small online RPG, think less than 50 players at a time who can only load 1 room in the game at a time each.
My setup is as follows:
1) Lobby server and Game host both sit on a VPS. Game host client connects and registers a server on Lobby, no one else can register a channel.
2) Other clients(players) connect to lobby to join the one server.
3) Game host has a sqlite DB with all player data/game data that needs to be stored persistently. Only the host client should be able to update this DB directly.
4) Player clients also have a sqlite DB but it is a subset only containing non-sensitive data such as room/map information, items, etc.
5) The sqlite DB on client needs to be updated periodically from server DB, ie lets say via sequence numbers for objects or rows that should match
Question of the day is: Is this entirely crazy or does this sound ok? The idea being if I arrange it this way I only maintain one project which handles both my server and client code, making liberal use of .isHost checks. I am a bit confused however on how I pass DB info from the host to the clients since I can't instantiate a object which relies on data that resides on a remote sqlite DB.
If possible was hoping not to hardcode the DB middleware logic into the server itself and keep it all in Unity for ease of development.
Sorry this got a bit wordy!