Added chat functionality & timer back into the game + bug fixes

- Added chat back into the game
- Fixed a bug where the timer would show "race finished" when the race hadn't started
- Fixed a bug where resources weren't being deallocated when the game was closed

Tags: #story[1246]
This commit is contained in:
Michael Rausch
2017-09-12 01:31:38 +12:00
parent d223d393fa
commit 5dd936f8f1
11 changed files with 166 additions and 68 deletions
@@ -91,6 +91,17 @@ public class ViewManager {
Sounds.stopMusic();
Sounds.playMenuMusic();
decorator.setOnCloseButtonAction(() -> {
try {
ServerAdvertiser.getInstance().unregister();
} catch (IOException e) {
logger.warn("Couldn't unregister server");
}
gameClient.stopGame();
System.exit(0);
});
}
private void checkCompatibility() {
@@ -207,8 +218,14 @@ public class ViewManager {
}
});
Sounds.stopMusic();
Sounds.playRaceMusic();
while (loader.getController() == null){
try {
Thread.sleep(50);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
return loader.getController();
}