Skip to content

Commit

Permalink
Fix bug of bot not sending results.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkosman committed Jan 30, 2024
1 parent e49d539 commit 54e6b47
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions go_server/src/main/java/com/go_game/server/BotThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,15 @@ public boolean isGameOver() throws IOException, ClassNotFoundException

sendMessage(new ResultsNegotiationMsg(description, territoryScore, capturedStones));

ResultsNegotiationMsg playerResults = (ResultsNegotiationMsg) playerConnection.receiveMessage();
int playerProposition = playerResults.getPlayerProposition();
territoryScore[0] = playerProposition;

playerConnection.sendMessage(new ResultsNegotiationMsg(territoryScore[1]));

ResultsNegotiationMsg negotiationMsg = (ResultsNegotiationMsg) playerConnection.receiveMessage();


if (negotiationMsg.getAgreement() == AgreementState.AGREE)
{
int[] finalTerritoryScore = new int[2];
Expand Down

0 comments on commit 54e6b47

Please sign in to comment.