QUOTE(fyrestorm @ 28 Jun, 2007 - 07:40 PM)

they way you wrote out your response makes me feel as though you think i'm a student trying to get a solution to my homework
Not what I was thinking... Must be my writing style. From your level of activity in the forum I'd guess you were professional/experienced in a number of areas; I was trying to probe what things you might have already thought about or know about, rather than jumping straight in with advice that might not be any use.
On to the task at hand: Game State management. The essential problem for the web game scenario is that web pages are Stateless. Rather, we can only handle the current state of the application at the time of a HTTP request, usually accompanied by GET/POST data which provides our application an update of the
user's state. Between such requests, the application's entire state is stored away in Session.
The complication is that we have multiple clients in this scenario, each talking to the server at unpredictable times. Basically, each player's game (as a client-server interaction) needs to be thought of as an independantly running application, even though they all run from the same scripts. Server-side, each one's Session stores an ID which references game state information stored in a Games table. This table will need an ActivePlayer field to indicate whose turn it is.
If the current Session's PlayerID is the same as ActivePlayer, and they've submitted a move with this request, update the game state and submit a response, also updating the value of ActivePlayer to the next one in sequence. (If there are any computer players immediately next, their moves should be made, and ActivePlayer passes to the next human.)
If the current player is NOT the ActivePlayer, simply return an update on the state of play, so that user can see what's going on.
You'll also need a GamePlayers table to indicate which players are currently participating in which games.
You'll need another table - perhaps CommandQueue - if you want players to be able to send commands to the game whilst they're not the ActivePlayer (the situation we need to avoid would be two processes both trying to update the game state at the same time, so some form of command stack allowing them to share information would be needed).
You also need to consider timeouts, for a user either
a) disconnecting (and remember they could have just had a flaky connection for a short while)

dawdling (possibly some sort of kick system could appear when a user has waited tool long)
I could go into more detail on some of this, but that's about all I can think of up to here.
--serializer