- Fixed Null Pointer

- Build Should pass

Tags: #story[1245]
This commit is contained in:
Alistair McIntyre
2017-09-14 15:10:48 +12:00
parent cc124b2d19
commit 482d987839
3 changed files with 7 additions and 8 deletions
@@ -341,10 +341,10 @@ public class GameClient {
} }
if (raceFinished) { if (raceFinished) {
System.out.println(raceViewController);
raceViewController.showFinishDialog(finishedBoats); raceViewController.showFinishDialog(finishedBoats);
Sounds.playFinishSound(); Sounds.playFinishSound();
close(); close();
ViewManager.getInstance().getGameClient().stopGame();
//loadFinishScreenView(); //loadFinishScreenView();
} }
raceState.setRaceFinished(); raceState.setRaceFinished();
@@ -450,7 +450,7 @@ public class GameClient {
if (server != null) server.terminate(); if (server != null) server.terminate();
if (socketThread != null) socketThread.setSocketToClose(); if (socketThread != null) socketThread.setSocketToClose();
server = null; server = null;
socketThread = null; // socketThread = null;
} }
public Map<Integer, ClientYacht> getAllBoatsMap() { public Map<Integer, ClientYacht> getAllBoatsMap() {
@@ -200,7 +200,6 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
public void showFinishDialog(ArrayList<ClientYacht> finishedBoats) { public void showFinishDialog(ArrayList<ClientYacht> finishedBoats) {
raceState.setRaceStarted(false); raceState.setRaceStarted(false);
finishDialogController.setFinishedBoats(finishedBoats); finishDialogController.setFinishedBoats(finishedBoats);
ViewManager.getInstance().getGameClient().stopGame();
finishScreenDialog.show(); finishScreenDialog.show();
} }
@@ -61,7 +61,7 @@ public class ChatCommandsTest {
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
ie.printStackTrace(); ie.printStackTrace();
} }
host.sendChatterMessage("[time_prefix] <name_prefix> >finish"); host.sendChatterMessage("[time_prefix] <name_prefix> /finish");
dcSent = true; dcSent = true;
try { try {
Thread.sleep(2000); Thread.sleep(2000);
@@ -104,7 +104,7 @@ public class ChatCommandsTest {
ie.printStackTrace(); ie.printStackTrace();
} }
mst.startGame(); mst.startGame();
host.sendChatterMessage("[time_prefix] <name_prefix> >speed 5"); host.sendChatterMessage("[time_prefix] <name_prefix> /speed 5");
try { try {
Thread.sleep(100); Thread.sleep(100);
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
@@ -143,7 +143,7 @@ public class ChatCommandsTest {
ie.printStackTrace(); ie.printStackTrace();
} }
mst.startGame(); mst.startGame();
host.sendChatterMessage("[time_prefix] <name_prefix> >speed fdgdgdfg"); host.sendChatterMessage("[time_prefix] <name_prefix> /speed fdgdgdfg");
try { try {
Thread.sleep(100); Thread.sleep(100);
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
@@ -188,7 +188,7 @@ public class ChatCommandsTest {
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
ie.printStackTrace(); ie.printStackTrace();
} }
client.sendChatterMessage("[time_prefix] <name_prefix> >speed 5.0"); client.sendChatterMessage("[time_prefix] <name_prefix> /speed 5.0");
try { try {
Thread.sleep(200); Thread.sleep(200);
} catch (InterruptedException ie) { } catch (InterruptedException ie) {
@@ -248,7 +248,7 @@ public class ChatCommandsTest {
} catch (IOException ioe) { } catch (IOException ioe) {
ioe.printStackTrace(); ioe.printStackTrace();
} }
host.sendChatterMessage("[time_prefix] <name_prefix> >finish"); host.sendChatterMessage("[time_prefix] <name_prefix> /finish");
dcSent = true; dcSent = true;
} }
} }