Question first, then explanation second.
How can a webservice backend to a game modify and alter the server game state while the game simultaneously accepts webservice calls from other users of the game?
These are my assumptions of how browser-based games work. They may be full of misconceptions, and please correct me if I am wrong!
- Turn-based games are intuitively games that would best be represented by a single instance of a game.
- Turn-based browser games with a server backend would typically call a sort-of "webservice" on the server.
- A webservice has to complete its entire operation and then return.
I'm getting confused during the conversion between the "entire operation" part of the webservice and the non-static "single instance" of the game backend itself. How can a webservice, with their static nature, modify and alter a game while the game simultaneously accepts webservice calls from other users of the game? The only way I can see this occurring with static method calls is that the webservice saves and loads the game for each call, which seems horrifically wasteful on resources.
For example, consider a 3-player connect-four board, where only one player can play at once but users can change their color at will. The user should be able to change their color while waiting for the other players to play.
The question I have here is both conceptual and implementation-oriented, although it's mainly the conceptual that I'm curious about.