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:
@@ -256,8 +256,9 @@ public class GameServerThread implements Runnable, Observer, ClientConnectionDel
|
||||
}
|
||||
|
||||
acceptConnection();
|
||||
acceptConnection();
|
||||
// acceptConnection();
|
||||
// acceptConnection();
|
||||
System.out.println("well, hit here now");
|
||||
|
||||
for (Player player : GameState.getPlayers()) {
|
||||
System.out.println(player);
|
||||
@@ -399,4 +400,13 @@ public class GameServerThread implements Runnable, Observer, ClientConnectionDel
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
public void terminateGame() {
|
||||
try {
|
||||
//TODO: for now, I just close the socket, but i think we should terminate the whole thread instead. -hyi25 13 July
|
||||
server.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@ public enum GameStages {
|
||||
LOBBYING(0),
|
||||
PRE_RACE(1),
|
||||
RACING(2),
|
||||
FINISHED(3);
|
||||
FINISHED(3),
|
||||
CANCELLED(4);
|
||||
|
||||
private long code;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user