From 1f5c8ba4a66bccbe84f91bad32989e741cd7a327 Mon Sep 17 00:00:00 2001 From: Simon Wilkening Date: Fri, 18 Oct 2024 17:09:50 +0200 Subject: [PATCH] fixed bug of chrashing servers when shell hits a target --- .../src/main/java/pp/battleship/client/BattleshipApp.java | 1 - .../src/main/java/pp/battleship/server/BattleshipServer.java | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Projekte/battleship/client/src/main/java/pp/battleship/client/BattleshipApp.java b/Projekte/battleship/client/src/main/java/pp/battleship/client/BattleshipApp.java index 8a6a91e..2e4130d 100644 --- a/Projekte/battleship/client/src/main/java/pp/battleship/client/BattleshipApp.java +++ b/Projekte/battleship/client/src/main/java/pp/battleship/client/BattleshipApp.java @@ -23,7 +23,6 @@ import com.simsilica.lemur.style.BaseStyles; import pp.battleship.client.gui.BattleAppState; import pp.battleship.client.gui.EditorAppState; import pp.battleship.client.gui.SeaAppState; -import pp.battleship.client.GameMusic; import pp.battleship.game.client.BattleshipClient; import pp.battleship.game.client.ClientGameLogic; import pp.battleship.game.client.ServerConnection; diff --git a/Projekte/battleship/server/src/main/java/pp/battleship/server/BattleshipServer.java b/Projekte/battleship/server/src/main/java/pp/battleship/server/BattleshipServer.java index 1ad0a2e..d10a5d9 100644 --- a/Projekte/battleship/server/src/main/java/pp/battleship/server/BattleshipServer.java +++ b/Projekte/battleship/server/src/main/java/pp/battleship/server/BattleshipServer.java @@ -18,6 +18,7 @@ import pp.battleship.BattleshipConfig; import pp.battleship.game.server.Player; import pp.battleship.game.server.ServerGameLogic; import pp.battleship.game.server.ServerSender; +import pp.battleship.message.client.AnimationFinishedMessage; import pp.battleship.message.client.ClientMessage; import pp.battleship.message.client.MapMessage; import pp.battleship.message.client.ShootMessage; @@ -115,6 +116,7 @@ public class BattleshipServer implements MessageListener, Conn Serializer.registerClass(MapMessage.class); Serializer.registerClass(ShootMessage.class); Serializer.registerClass(EffectMessage.class); + Serializer.registerClass(AnimationFinishedMessage.class); Serializer.registerClass(Battleship.class); Serializer.registerClass(IntPoint.class); Serializer.registerClass(Shot.class); @@ -123,6 +125,7 @@ public class BattleshipServer implements MessageListener, Conn private void registerListeners() { myServer.addMessageListener(this, MapMessage.class); myServer.addMessageListener(this, ShootMessage.class); + myServer.addMessageListener(this, AnimationFinishedMessage.class); myServer.addConnectionListener(this); }