diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/CreateGameMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/CreateGameMenu.java index 3d73a08..cd10d18 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/CreateGameMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/CreateGameMenu.java @@ -1,11 +1,7 @@ package pp.monopoly.client.gui; -import javax.swing.JOptionPane; - import com.jme3.material.Material; import com.jme3.math.Vector3f; -import com.jme3.network.Client; -import com.jme3.network.Network; import com.jme3.scene.Geometry; import com.jme3.scene.shape.Quad; import com.jme3.texture.Texture; @@ -18,7 +14,6 @@ import com.simsilica.lemur.component.SpringGridLayout; import pp.monopoly.client.MonopolyApp; import pp.monopoly.client.StartMenu; -import pp.monopoly.server.MonopolyServer; public class CreateGameMenu { @@ -68,12 +63,12 @@ public class CreateGameMenu { // "Selber hosten"-Button Button hostButton = buttonContainer.addChild(new Button("Selber hosten")); hostButton.setPreferredSize(new Vector3f(120, 40, 0)); - hostButton.addClickCommands(source -> startServerAndJoin()); + // hostButton.addClickCommands(source -> startServerAndJoin()); // "Beitreten"-Button (vorerst funktionslos) Button joinButton = buttonContainer.addChild(new Button("Beitreten")); joinButton.setPreferredSize(new Vector3f(120, 40, 0)); - joinButton.addClickCommands(source -> joinServer()); + // joinButton.addClickCommands(source -> joinServer()); // Serverstatus-Label Label serverStatusLabel = menuContainer.addChild(new Label("Serverstatus: Noch nicht gestartet")); @@ -125,34 +120,34 @@ public class CreateGameMenu { /** * Startet den Server und tritt nach 2 Sekunden der Lobby bei. */ - private void startServerAndJoin() { - new Thread(() -> { - app.start(); - app.startServer(); - - // Warte 2 Sekunden - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - } - - // Verbinde mit dem Server - app.enqueue(() -> joinServer()); - }).start(); - } + //private void startServerAndJoin() { + // new Thread(() -> { + // app.start(); + // app.startServer(); +// + // // Warte 2 Sekunden + // try { + // Thread.sleep(2000); + // } catch (InterruptedException e) { + // Thread.currentThread().interrupt(); + // } +// + // // Verbinde mit dem Server + // app.enqueue(() -> joinServer()); + // }).start(); + //} /** * Tritt dem Server basierend auf den Eingaben bei. */ - private void joinServer() { - String serverAddress = serverAddressField.getText(); - int port = Integer.parseInt(portField.getText()); - app.getServerConnection().connect(serverAddress, port); + //private void joinServer() { + // String serverAddress = serverAddressField.getText(); + // int port = Integer.parseInt(portField.getText()); + // app.getServerConnection().connect(serverAddress, port); - // Öffnet die Lobby - app.getGuiNode().detachChild(menuContainer); - app.getGuiNode().detachChild(background); // Entfernt das Hintergrundbild - new LobbyMenu(app); - } + // // Öffnet die Lobby + // app.getGuiNode().detachChild(menuContainer); + // app.getGuiNode().detachChild(background); // Entfernt das Hintergrundbild + // new LobbyMenu(app); + //} }