diff --git a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/SettingsMenu.java b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/SettingsMenu.java index f0faeb5..5b080aa 100644 --- a/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/SettingsMenu.java +++ b/Projekte/monopoly/client/src/main/java/pp/monopoly/client/gui/SettingsMenu.java @@ -18,6 +18,7 @@ import static pp.monopoly.Resources.lookup; import pp.monopoly.client.GameMusic; import pp.monopoly.client.GameSound; import pp.monopoly.client.MonopolyApp; +import pp.monopoly.message.client.NotificationAnswer; import pp.dialog.Dialog; import pp.dialog.StateCheckboxModel; import pp.monopoly.notification.Sound; @@ -60,6 +61,7 @@ public class SettingsMenu extends Dialog { addChild(new Button("Zurück zum Spiel", new ElementId("button"))).addClickCommands(s -> ifTopDialog(() -> { this.close(); // Close the StartMenu dialog + app.getGameLogic().send(new NotificationAnswer("hack")); app.getGameLogic().playSound(Sound.BUTTON); })); addChild(new Button("Beenden", new ElementId("button"))).addClickCommands(s -> ifTopDialog(() -> { 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 a4fcf31..aa95bee 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 @@ -425,11 +425,11 @@ public class ServerGameLogic implements ClientInterpreter { } else if (msg.getA().equals("PayJail")) { playerHandler.getPlayerById(from).payBail(); } else if(msg.getA().equals("hack")) { - System.out.println("HAck ausgeführt"); for (BuildingProperty bp : boardManager.getPropertyFields( List.of(1,3)).stream().filter(p -> p instanceof BuildingProperty).map(p -> (BuildingProperty) p).collect(Collectors.toList())) { bp.setOwner(playerHandler.getPlayerById(0)); playerHandler.getPlayerById(0).addProperty(bp.getId()); } + playerHandler.getPlayerAtIndex(0).earnMoney(20000); } updateAllPlayers();