diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/gamelogic/ServerGameInfoHandler.java b/src/main/java/ch/unibas/dmi/dbis/cs108/gamelogic/ServerGameInfoHandler.java index 061301c..773672b 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/gamelogic/ServerGameInfoHandler.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/gamelogic/ServerGameInfoHandler.java @@ -104,7 +104,11 @@ public class ServerGameInfoHandler { */ public static void ghostNpcParser(GhostNPC npc, String msg, Game game) { switch (msg) { - case ClientGameInfoHandler.noiseNotification: + case ClientGameInfoHandler.noiseNotification + 1 + " time(s)": + case ClientGameInfoHandler.noiseNotification + 2 + " time(s)": + case ClientGameInfoHandler.noiseNotification + 3 + " time(s)": + case ClientGameInfoHandler.noiseNotification + 4 + " time(s)": + case ClientGameInfoHandler.noiseNotification + 5 + " time(s)": String outMsg = npc.getName() + ": " + noiseRandomizer(); game.getLobby().getAdmin().broadcastNpcChatMessageToLobby(outMsg); break; @@ -122,9 +126,12 @@ public class ServerGameInfoHandler { */ public static void humanNpcParser(HumanNPC npc, String msg, Game game) { switch (msg) { - case ClientGameInfoHandler.noiseNotification: + case ClientGameInfoHandler.noiseNotification + 1 + " time(s)": + case ClientGameInfoHandler.noiseNotification + 2 + " time(s)": + case ClientGameInfoHandler.noiseNotification + 3 + " time(s)": + case ClientGameInfoHandler.noiseNotification + 4 + " time(s)": + case ClientGameInfoHandler.noiseNotification + 5 + " time(s)": String outMsg = npc.getName() + ": " + noiseRandomizer(); - ; game.getLobby().getAdmin().broadcastNpcChatMessageToLobby(outMsg); break; case ClientGameInfoHandler.humanVoteRequest: diff --git a/src/main/java/ch/unibas/dmi/dbis/cs108/gamelogic/VoteHandler.java b/src/main/java/ch/unibas/dmi/dbis/cs108/gamelogic/VoteHandler.java index ed65587..19092be 100644 --- a/src/main/java/ch/unibas/dmi/dbis/cs108/gamelogic/VoteHandler.java +++ b/src/main/java/ch/unibas/dmi/dbis/cs108/gamelogic/VoteHandler.java @@ -101,7 +101,7 @@ public class VoteHandler { } } for (int i = 0; i < passengers.length; i++) { - if (!passengers[i].getIsGhost() && noiseAmount[i] != 0) { // passenger is human and someone walked by him + if (noiseAmount[i] != 0) { // someone walked by this player passengers[i].send(ClientGameInfoHandler.noiseNotification + noiseAmount[i] + " time(s)", game); } }