From a2fb60cf355bfb44754cf23fa09bab266e985f57 Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Sun, 24 Dec 2023 23:58:51 -0800 Subject: [PATCH] Fix handling finished acey-deucey games --- pkg/server/server.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/server/server.go b/pkg/server/server.go index 2f01d76..7154978 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -950,6 +950,8 @@ COMMANDS: if clientGame == nil { cmd.client.sendNotice("You are not currently in a match.") continue + } else if clientGame.Winner != 0 { + continue } if clientGame.Turn != cmd.client.playerNumber { @@ -992,6 +994,8 @@ COMMANDS: if clientGame == nil { cmd.client.sendNotice("You are not currently in a match.") continue + } else if clientGame.Winner != 0 { + continue } gameState := &bgammon.GameState{ @@ -1074,6 +1078,8 @@ COMMANDS: Reason: "You are not currently in a match.", }) continue + } else if clientGame.Winner != 0 { + continue } opponent := clientGame.opponent(cmd.client) @@ -1199,6 +1205,9 @@ COMMANDS: Reason: "You are not currently in a match.", }) continue + } else if clientGame.Winner != 0 { + clientGame.sendBoard(cmd.client) + continue } if clientGame.Turn != cmd.client.playerNumber { @@ -1379,6 +1388,8 @@ COMMANDS: if clientGame == nil { cmd.client.sendNotice("You are not currently in a match.") continue + } else if clientGame.Winner != 0 { + continue } if clientGame.Turn != cmd.client.playerNumber { @@ -1413,6 +1424,8 @@ COMMANDS: if clientGame == nil { cmd.client.sendNotice("You are not currently in a match.") continue + } else if clientGame.Winner != 0 { + continue } opponent := clientGame.opponent(cmd.client)