cs340tabyu / cs340Winter2017

3 stars 0 forks source link

PHASE 4: Current Client closing errors #1219

Closed scottjordanchristensen closed 7 years ago

scottjordanchristensen commented 7 years ago

After playing a number of games and dropping clients, it looks like when a player comes back up they are getting back more commands than have happened in the game and it looks like they are as duplicate commands. Pretty sure these duplicate commands are commands that are private to them, like commands done by another player.

For example, Player B drew a face up locomotive card and went up to 5 train cards in hand. Then once his turn had passed to PlayerC, PlayerB sent the 'Chat2 on Player2's turn' chat. Then PlayerC sent the Chat3 on Player2's turn.' chat. Then I dropped PlayerC. When PlayerC came back up, it looked like PlayerC was displaying the correct number of cards in both player's hands displayed for a split second, then ticked PlayerB's trains cards up by one. Also,when going to the chat, they had PlayerB's chat again! Thus, PlayerC had to have gotten PlayerB's last 2 commands twice! (Picture of this at the bottom)

I showed this to Tyler and we both think that all we'd need to do to fix this is have the server keep track of what command index each player is at so no one gets extra commands back.

screenshot 6