From f11f4a59f1165d768126d00e389e1f1080b203d1 Mon Sep 17 00:00:00 2001 From: Johannes Schmelz Date: Wed, 20 Nov 2024 00:55:33 +0100 Subject: [PATCH 1/3] fixed lemurproto dependecy --- Projekte/monopoly/client/build.gradle | 2 ++ Projekte/settings.gradle | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Projekte/monopoly/client/build.gradle b/Projekte/monopoly/client/build.gradle index 66985e3..1c22a37 100644 --- a/Projekte/monopoly/client/build.gradle +++ b/Projekte/monopoly/client/build.gradle @@ -10,6 +10,8 @@ dependencies { implementation project(":monopoly:server") implementation libs.jme3.desktop + implementation libs.lemur + implementation libs.lemurproto runtimeOnly libs.jme3.awt.dialogs runtimeOnly libs.jme3.plugins diff --git a/Projekte/settings.gradle b/Projekte/settings.gradle index 92a7ec5..fa64d6f 100644 --- a/Projekte/settings.gradle +++ b/Projekte/settings.gradle @@ -25,7 +25,7 @@ dependencyResolutionManagement { library('jme3-effects', 'org.jmonkeyengine', 'jme3-effects').versionRef('jme') 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('gson', 'com.google.code.gson:gson:2.11.0') From cdce478d7770e5905e69effaa723e09350612152 Mon Sep 17 00:00:00 2001 From: Johannes Schmelz Date: Wed, 20 Nov 2024 01:45:34 +0100 Subject: [PATCH 2/3] send GameStart message with a list of all Players --- .../pp/monopoly/game/server/PlayerHandler.java | 8 ++++++++ .../pp/monopoly/game/server/ServerGameLogic.java | 7 +++++++ .../java/pp/monopoly/message/server/GameStart.java | 14 ++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java index d7bbe10..3cbe272 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/PlayerHandler.java @@ -50,6 +50,14 @@ public class PlayerHandler { return players.size(); } + /** + * Retuns all players + * @return List of all players + */ + public List getPlayers() { + return players; + } + /** * Chechs if all players are ready to start the game * @return {@code true} if all players are ready, otherwise {@code false} diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java index 62cdd72..9ce732d 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/game/server/ServerGameLogic.java @@ -2,6 +2,7 @@ package pp.monopoly.game.server; import pp.monopoly.MonopolyConfig; import pp.monopoly.message.client.*; +import pp.monopoly.message.server.GameStart; import pp.monopoly.message.server.ServerMessage; import pp.monopoly.message.server.TradeReply; import pp.monopoly.message.server.TradeRequest; @@ -177,6 +178,12 @@ public class ServerGameLogic implements ClientInterpreter { playerHandler.setPlayerReady(player, true); LOGGER.log(Level.DEBUG, "Player {0} is ready", player.getName()); } + + if(playerHandler.allPlayersReady()) { + for (Player p : playerHandler.getPlayers()) { + send(p, new GameStart(playerHandler.getPlayers())); + } + } } /** diff --git a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameStart.java b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameStart.java index bf39031..cfdfe54 100644 --- a/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameStart.java +++ b/Projekte/monopoly/model/src/main/java/pp/monopoly/message/server/GameStart.java @@ -1,7 +1,21 @@ package pp.monopoly.message.server; +import java.util.List; + +import pp.monopoly.game.server.Player; + public class GameStart extends ServerMessage{ + private final List players; + + public GameStart(List players) { + this.players = players; + } + + public List getPlayers() { + return players; + } + @Override public void accept(ServerInterpreter interpreter) { interpreter.received(this); From aa47dd579fe17900094343b481a1b6432be9c1e6 Mon Sep 17 00:00:00 2001 From: Johannes Schmelz Date: Wed, 20 Nov 2024 02:21:23 +0100 Subject: [PATCH 3/3] added selenium dependecy for drop down menu --- Projekte/monopoly/client/build.gradle | 2 ++ Projekte/settings.gradle | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Projekte/monopoly/client/build.gradle b/Projekte/monopoly/client/build.gradle index 1c22a37..683def3 100644 --- a/Projekte/monopoly/client/build.gradle +++ b/Projekte/monopoly/client/build.gradle @@ -13,6 +13,8 @@ dependencies { implementation libs.lemur implementation libs.lemurproto + implementation libs.selenium + runtimeOnly libs.jme3.awt.dialogs runtimeOnly libs.jme3.plugins runtimeOnly libs.jme3.jogg diff --git a/Projekte/settings.gradle b/Projekte/settings.gradle index fa64d6f..928fed6 100644 --- a/Projekte/settings.gradle +++ b/Projekte/settings.gradle @@ -27,6 +27,8 @@ dependencyResolutionManagement { library('lemur', 'com.simsilica:lemur:1.16.0') library('lemurproto', 'com.simsilica:lemur-proto:1.13.0') + library('selenium', 'org.seleniumhq.selenium:selenium-java:4.11.0') + library('junit4', 'junit:junit:4.13.2') library('gson', 'com.google.code.gson:gson:2.11.0') library('jackson-databind', 'com.fasterxml.jackson.core:jackson-databind:2.17.2')