So I am developing a poker card game using JS +node.js + socket.io.
It is turn-based game. There will be a host and 4 other players.The flow is the players need to make a yes/no choice, then the host need to make a yes/no choice upon players' move, then players will need to make another yes/no choice, then the server will determine who wins.
Put simply,
1:Host set up the hand ----->2: inform all players----> 3:A player make a move(ticking yes or no) --> 4:this move will show up on the host's screen--->5:the host need to make his/her move(ticking yes or no)--->6: the host's move show up on players' screen, they make another yes/no choice----> 7:the server determine who wins.
The issue lies on step 5.
There will be multiple moves waiting for the host to process. Now the current design is all moves are shown by the form of a custom confirm box. It has yes/no button. It works perfect when there is only one host and one player. But when there is more than 2 players, there is a serious clashing problem.
If player A makes a move, it shows on the host's screen, and before the host ticking anything, player B makes a move and then player B's move (confirm box) will replace player A 's confirm box. In this case the host will not be able to process player A's move and the game cannot finalise.
How to get this clashing issue sorted? I hope I am not making this issue sound too complicated but I have been scratching my head.