Online-TicTacToe

Log | Files | Refs | README | LICENSE

commit e3553b15806e4bc4d083324590ec76ec14bb1f07
parent f8634d7cea1d57a3958970f9d6c3a4642809d2c4
Author: William Lindholm <william_lindholm@outlook.com>
Date:   Wed, 27 Nov 2024 18:55:48 +0000

No longer allows you to create a game if you are already host of a game

Diffstat:
MTicTacToeClient/src/main/java/com/groupproject/tictactoeclient/ContentPanes/MainContentPanel.java | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git a/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/ContentPanes/MainContentPanel.java b/TicTacToeClient/src/main/java/com/groupproject/tictactoeclient/ContentPanes/MainContentPanel.java @@ -125,6 +125,11 @@ public class MainContentPanel extends CustomPanel { }); createGameButton.addActionListener(e -> { + if (!client.HOST_UID.isEmpty()) { + JOptionPane.showMessageDialog(null, "You cannot create a new game since you already have one.", "NOO.", JOptionPane.INFORMATION_MESSAGE); + return; + } + client.GID = client.proxy.newGame(Integer.parseInt(client.UID)); if (client.GID != null && !client.GID.isEmpty()) {