- Home /
Need suggestion about connection flow between client, server and database for online game
Hi, I'm developing an online game for iOS. It's not an MMORPG. It's just that player data and progress has to be saved to server database. I don't have experience developing an online game. So, I want to ask what's the appropriate way to design communication between client, server and database. These are my current ideas. I'm not sure if they are suitable or not or which is better. I use uLink in this project.
When client login to the server, server will create new gameobject to handle that player data. Server will read data for that player from database and copy it to that gameobject. This way, the server will have to handle important data (some data is saved on the client side) for each online player and write those data to database periodically.
Server doesn't create gameobject to handle each player data. When client has sent request about data changing, server will read/write those data from/to database directly. In this case, server is acting like a relay message between client and database. Server will , of course, have method to check the validity of data before writing it to database and response accordingly but I will not mention it.
I really need a suggestion from experienced developer about this. Thank you very much.
I haven't used uLink, so I can't talk about the best way to use it.
Is this a multiplayer game, or are you talking about cloud saves?
Here's some general info. The safest (and most expensive in development/servers) way is to pass nothing but inputs (and verify them) the cheapest way is a simple pass-through. The problem with a simple pass-though is how easy it is to hack.
Where you want to fall on this spectrum is up to you.
It's not a multiplayer game (for now). I'm talking about how to save/load player data in online game. So, I think that you are correct about cloud saves.
Answer by RalphTrickey · Jun 09, 2013 at 05:14 PM
Caveat:I'm not a unity or ulink expert.
For this problem, as a first cut, I'd follow the KISS principle and just pass the object data through to be saved as an atomic chunk.
Multi-player is going to be more complex. Everything I've seen says that you should be doing message passing of input events to do it right. It's possible that a small team on Unity may be able to take some shortcuts, but I don't know what those might be.
Your answer
Follow this Question
Related Questions
MMORPG Server, Database, Client 1 Answer
mystery MYSQL error .. 2 Answers
Login System Using XML Server/Client 1 Answer