I am trying to create a game for users to play online using their mobile phones, via an application, similar to Words With Friends, or other “* With Friends” games. Since I have no experience with implementing such games, I am unsure of the best practices. Do I want to minimize the amount of code that should have to run on the server, or the amount of code that should run on the client?
My intuition is to use JSON files on the server side, which stores the game state for the current game. Then every time a client opens, have it get the latest game state from the server, and prompt the user accordingly. This eliminates the need for any game-related code to run on the server, and allows the server to merely act as a middleman between all participating clients.
But what if I want the server to be aware enough to notify clients B and C when client A has completed its turn, and B and C can now take action? Do I need to then run code on the server to determine this, or can I have the client inform the server that it is/maybe time for the other clients to take a turn?
I realize that the answers to this are slightly relative, or maybe even obvious, but I was hoping to find some general direction/guidance on the matter so I can know in which direction to begin, and start thinking about the structure of my code/game mechanic.
You might want to examine the code of existing open-source social games to get an idea of how they do it.