mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Terminated the game server socket when click exit lobby button
- the whole server thread should be terminated instead. To be fixed in the future. #story[1047] #issue[28]
This commit is contained in:
@@ -8,6 +8,7 @@ import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.layout.GridPane;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javafx.scene.text.Text;
|
||||
import seng302.gameServer.GameServerThread;
|
||||
import seng302.gameServer.GameStages;
|
||||
import seng302.gameServer.GameState;
|
||||
|
||||
@@ -32,6 +33,7 @@ public class LobbyController {
|
||||
@FXML
|
||||
private TableColumn readyTableColumn;
|
||||
|
||||
private GameServerThread gameServerThread;
|
||||
|
||||
private void setContentPane(String jfxUrl) {
|
||||
try {
|
||||
@@ -54,7 +56,8 @@ public class LobbyController {
|
||||
// TODO: 10/07/17 wmu16 - Finish function!
|
||||
setContentPane("/views/StartScreenView.fxml");
|
||||
System.out.println("Leaving lobby!");
|
||||
|
||||
GameState.setCurrentStage(GameStages.CANCELLED);
|
||||
gameServerThread.terminateGame();
|
||||
}
|
||||
|
||||
|
||||
@@ -62,4 +65,8 @@ public class LobbyController {
|
||||
public void readyButtonPressed() {
|
||||
GameState.setCurrentStage(GameStages.RACING);
|
||||
}
|
||||
|
||||
protected void setGameServerThread(GameServerThread gameServerThread) {
|
||||
this.gameServerThread = gameServerThread;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user