diff --git a/src/main/java/logic/GameHandler.java b/src/main/java/logic/GameHandler.java index 96d7c24..9bef3ff 100644 --- a/src/main/java/logic/GameHandler.java +++ b/src/main/java/logic/GameHandler.java @@ -38,7 +38,7 @@ public GameHandler(Server server, Hyperlink userName, GameMain gameController, C public void updateUI() { Task task = new Task() { @Override - public Void call() throws Exception { + public Void call() { while(true) { String data = server.peekData(); if (data != null) { @@ -77,7 +77,7 @@ public Void call() throws Exception { public void updateClientUI() { Task task = new Task() { @Override - public Void call() throws Exception { + public Void call() { while(true) { String data = client.returnSocketData(); if (data != null) { @@ -112,7 +112,7 @@ public Void call() throws Exception { public void updateGameBoard(GridPane playerRow, GridPane opponentRow) { Task task = new Task() { @Override - public Void call() throws Exception { + public Void call() { boolean endStateOne = true; boolean endStateTwo = true; while(endStateOne || endStateTwo) { @@ -157,7 +157,7 @@ public Void call() throws Exception { public void listenForTurnCompletionServer() { Task task = new Task() { @Override - public Void call() throws Exception { + public Void call() { while(true) { String data = client.peekData(); if (data != null) { @@ -193,7 +193,7 @@ public Void call() throws Exception { public void listenForTurnCompletionClient() { Task task = new Task() { @Override - public Void call() throws Exception { + public Void call() { while(true) { String data = server.peekData(); if (data != null) { @@ -235,7 +235,7 @@ public void listenForServerCards() { AtomicReference tempData = new AtomicReference<>(); Task task = new Task() { @Override - public Void call() throws Exception { + public Void call() { while(true) { String data = client.peekData(); if (data != null) { @@ -275,7 +275,7 @@ public void listenForClientCards() { AtomicReference tempData = new AtomicReference<>(); Task task = new Task() { @Override - public Void call() throws Exception { + public Void call() { while(true) { String data = server.peekData(); if (data != null) { diff --git a/src/main/java/scenes/SceneController.java b/src/main/java/scenes/SceneController.java index 157bfd2..fd0b3b9 100644 --- a/src/main/java/scenes/SceneController.java +++ b/src/main/java/scenes/SceneController.java @@ -61,7 +61,7 @@ public void setScene(int state) { } public void passClient(Client client) { - this.client = client; + SceneController.client = client; }