mirror of
https://athene2.informatik.unibw-muenchen.de/progproj/gruppen-ht24/Gruppe-02.git
synced 2024-11-24 23:59:44 +01:00
Compare commits
4 Commits
bb9727d54a
...
f11f4a59f1
Author | SHA1 | Date | |
---|---|---|---|
|
f11f4a59f1 | ||
|
d631e8df1e | ||
|
af80d40700 | ||
|
3a6f8a945a |
@ -10,6 +10,8 @@ dependencies {
|
|||||||
implementation project(":monopoly:server")
|
implementation project(":monopoly:server")
|
||||||
|
|
||||||
implementation libs.jme3.desktop
|
implementation libs.jme3.desktop
|
||||||
|
implementation libs.lemur
|
||||||
|
implementation libs.lemurproto
|
||||||
|
|
||||||
runtimeOnly libs.jme3.awt.dialogs
|
runtimeOnly libs.jme3.awt.dialogs
|
||||||
runtimeOnly libs.jme3.plugins
|
runtimeOnly libs.jme3.plugins
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
package pp.monopoly.client.gui;
|
package pp.monopoly.client.gui;
|
||||||
|
|
||||||
import javax.swing.JOptionPane;
|
|
||||||
|
|
||||||
import com.jme3.material.Material;
|
import com.jme3.material.Material;
|
||||||
import com.jme3.math.Vector3f;
|
import com.jme3.math.Vector3f;
|
||||||
import com.jme3.network.Client;
|
|
||||||
import com.jme3.network.Network;
|
|
||||||
import com.jme3.scene.Geometry;
|
import com.jme3.scene.Geometry;
|
||||||
import com.jme3.scene.shape.Quad;
|
import com.jme3.scene.shape.Quad;
|
||||||
import com.jme3.texture.Texture;
|
import com.jme3.texture.Texture;
|
||||||
@ -18,7 +14,6 @@ import com.simsilica.lemur.component.SpringGridLayout;
|
|||||||
|
|
||||||
import pp.monopoly.client.MonopolyApp;
|
import pp.monopoly.client.MonopolyApp;
|
||||||
import pp.monopoly.client.StartMenu;
|
import pp.monopoly.client.StartMenu;
|
||||||
import pp.monopoly.server.MonopolyServer;
|
|
||||||
|
|
||||||
public class CreateGameMenu {
|
public class CreateGameMenu {
|
||||||
|
|
||||||
@ -68,12 +63,12 @@ public class CreateGameMenu {
|
|||||||
// "Selber hosten"-Button
|
// "Selber hosten"-Button
|
||||||
Button hostButton = buttonContainer.addChild(new Button("Selber hosten"));
|
Button hostButton = buttonContainer.addChild(new Button("Selber hosten"));
|
||||||
hostButton.setPreferredSize(new Vector3f(120, 40, 0));
|
hostButton.setPreferredSize(new Vector3f(120, 40, 0));
|
||||||
hostButton.addClickCommands(source -> startServerAndJoin());
|
// hostButton.addClickCommands(source -> startServerAndJoin());
|
||||||
|
|
||||||
// "Beitreten"-Button (vorerst funktionslos)
|
// "Beitreten"-Button (vorerst funktionslos)
|
||||||
Button joinButton = buttonContainer.addChild(new Button("Beitreten"));
|
Button joinButton = buttonContainer.addChild(new Button("Beitreten"));
|
||||||
joinButton.setPreferredSize(new Vector3f(120, 40, 0));
|
joinButton.setPreferredSize(new Vector3f(120, 40, 0));
|
||||||
joinButton.addClickCommands(source -> joinServer());
|
// joinButton.addClickCommands(source -> joinServer());
|
||||||
|
|
||||||
// Serverstatus-Label
|
// Serverstatus-Label
|
||||||
Label serverStatusLabel = menuContainer.addChild(new Label("Serverstatus: Noch nicht gestartet"));
|
Label serverStatusLabel = menuContainer.addChild(new Label("Serverstatus: Noch nicht gestartet"));
|
||||||
@ -125,35 +120,34 @@ public class CreateGameMenu {
|
|||||||
/**
|
/**
|
||||||
* Startet den Server und tritt nach 2 Sekunden der Lobby bei.
|
* Startet den Server und tritt nach 2 Sekunden der Lobby bei.
|
||||||
*/
|
*/
|
||||||
private void startServerAndJoin() {
|
//private void startServerAndJoin() {
|
||||||
new Thread(() -> {
|
// new Thread(() -> {
|
||||||
app.start();
|
// app.start();
|
||||||
MonopolyServer server = new MonopolyServer();
|
// app.startServer();
|
||||||
server.run();
|
//
|
||||||
|
// // Warte 2 Sekunden
|
||||||
// Warte 2 Sekunden
|
// try {
|
||||||
try {
|
// Thread.sleep(2000);
|
||||||
Thread.sleep(2000);
|
// } catch (InterruptedException e) {
|
||||||
} catch (InterruptedException e) {
|
// Thread.currentThread().interrupt();
|
||||||
Thread.currentThread().interrupt();
|
// }
|
||||||
}
|
//
|
||||||
|
// // Verbinde mit dem Server
|
||||||
// Verbinde mit dem Server
|
// app.enqueue(() -> joinServer());
|
||||||
app.enqueue(() -> joinServer());
|
// }).start();
|
||||||
}).start();
|
//}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tritt dem Server basierend auf den Eingaben bei.
|
* Tritt dem Server basierend auf den Eingaben bei.
|
||||||
*/
|
*/
|
||||||
private void joinServer() {
|
//private void joinServer() {
|
||||||
String serverAddress = serverAddressField.getText();
|
// String serverAddress = serverAddressField.getText();
|
||||||
int port = Integer.parseInt(portField.getText());
|
// int port = Integer.parseInt(portField.getText());
|
||||||
app.getServerConnection().connect(serverAddress, port);
|
// app.getServerConnection().connect(serverAddress, port);
|
||||||
|
|
||||||
// Öffnet die Lobby
|
// // Öffnet die Lobby
|
||||||
app.getGuiNode().detachChild(menuContainer);
|
// app.getGuiNode().detachChild(menuContainer);
|
||||||
app.getGuiNode().detachChild(background); // Entfernt das Hintergrundbild
|
// app.getGuiNode().detachChild(background); // Entfernt das Hintergrundbild
|
||||||
new LobbyMenu(app);
|
// new LobbyMenu(app);
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
@ -174,8 +174,7 @@ public class ServerGameLogic implements ClientInterpreter {
|
|||||||
Player player = playerHandler.getPlayerById(from);
|
Player player = playerHandler.getPlayerById(from);
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.setName(msg.getName());
|
player.setName(msg.getName());
|
||||||
player.setColor(msg.getColor());
|
playerHandler.setPlayerReady(player, true);
|
||||||
player.setName(msg.getName());
|
|
||||||
LOGGER.log(Level.DEBUG, "Player {0} is ready", player.getName());
|
LOGGER.log(Level.DEBUG, "Player {0} is ready", player.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ dependencyResolutionManagement {
|
|||||||
library('jme3-effects', 'org.jmonkeyengine', 'jme3-effects').versionRef('jme')
|
library('jme3-effects', 'org.jmonkeyengine', 'jme3-effects').versionRef('jme')
|
||||||
|
|
||||||
library('lemur', 'com.simsilica:lemur:1.16.0')
|
library('lemur', 'com.simsilica:lemur:1.16.0')
|
||||||
library('lemur-proto', 'com.simsilica:lemur-proto:1.13.0')
|
library('lemurproto', 'com.simsilica:lemur-proto:1.13.0')
|
||||||
|
|
||||||
library('junit4', 'junit:junit:4.13.2')
|
library('junit4', 'junit:junit:4.13.2')
|
||||||
library('gson', 'com.google.code.gson:gson:2.11.0')
|
library('gson', 'com.google.code.gson:gson:2.11.0')
|
||||||
|
Loading…
Reference in New Issue
Block a user