lafkob / swe681_game

Our game for SWE 681.
0 stars 1 forks source link

Quit Game Error #24

Closed lafkob closed 8 years ago

lafkob commented 8 years ago

Using the test UI, I started a new game then entered the game id in and hit quit game. The result was a success but the database still has the state as WAITING_FOR_PLAYER_2. I think the playerQuit() method needs to be double checked to make sure it changes the game status accordingly? The audit table record was written correctly that the game was quit, so the REST method was successful.

StormGull commented 8 years ago

I wrote a unit test just now for the scenario and it appears to be working correctly. The board is immutable - did you assign it to a new board before you stored the status? (In fact, we should make sure you do that every time you update and store the board.)

lafkob commented 8 years ago

Ooops you're right, I forgot those GameBoards are immutable. I will have to go back through everywhere and reassign them after calling operations. Good call!

StormGull commented 8 years ago

Hah, I only know because I did it so many times myself. One of the disadvantages of having immutable classes. : /

StormGull commented 8 years ago

I think I fixed this. FindBugs pointed out all the places it could see where the methods returned something but we didn't use it. Try testing it though.