mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-24 23:59:44 +01:00
automatically join lobby when selfhosting
This commit is contained in:
parent
6b78733a5d
commit
dcf10e0819
@ -39,10 +39,9 @@ public class CreateGameMenu extends SimpleDialog {
|
||||
private final NetworkSupport network;
|
||||
private final TextField host = new TextField(LOCALHOST);
|
||||
private final TextField port = new TextField(DEFAULT_PORT);
|
||||
// private final Button serverButton = new Button(lookup("client.server-star"));
|
||||
private final Button serverButton = new Button(lookup("client.server-start"));
|
||||
private final Button cancelButton = addChild(new Button("Abbrechen"));
|
||||
private final Button joinButton = addChild(new Button("Beitreten"));
|
||||
private final Button serverButton = new Button("Selber hosten");
|
||||
private final Button cancelButton = new Button("Abbrechen");
|
||||
private final Button joinButton = new Button("Beitreten");
|
||||
private String hostname;
|
||||
private int portNumber;
|
||||
private Future<Object> connectionFuture;
|
||||
@ -175,7 +174,6 @@ public class CreateGameMenu extends SimpleDialog {
|
||||
Thread serverThread = new Thread(() -> {
|
||||
try {
|
||||
MonopolyServer.main(null);
|
||||
connect();
|
||||
} catch (Exception e) {
|
||||
serverButton.setEnabled(true);
|
||||
LOGGER.log(Level.ERROR, "Server could not be started", e);
|
||||
@ -183,5 +181,12 @@ public class CreateGameMenu extends SimpleDialog {
|
||||
}
|
||||
});
|
||||
serverThread.start();
|
||||
try {
|
||||
Thread.sleep(2000);
|
||||
} catch (InterruptedException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
connect();
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public class MonopolyConfig extends Config {
|
||||
* The default port number for the Monopoly server.
|
||||
*/
|
||||
@Property("port")
|
||||
private int port = 4321;
|
||||
private int port = 42069;
|
||||
|
||||
/**
|
||||
* The width of the game map in terms of grid units.
|
||||
|
Loading…
Reference in New Issue
Block a user