Ensured that noise notifications can only come from non kickedOff passenegers
This commit is contained in:
parent
c9f0654eef
commit
68d84b9493
@ -122,9 +122,12 @@ public class ServerGameInfoHandler {
|
||||
case ClientGameInfoHandler.noiseNotification + 5 + " time(s)":
|
||||
String outMsg = npc.getName() + ": " + noiseRandomizer();
|
||||
//TODO: add likelyhood
|
||||
game.getLobby().getAdmin().broadcastNpcChatMessageToLobby(outMsg);
|
||||
game.getLobby().getAdmin().sendMsgToClientsInLobby(Protocol.printToGUI + "$" + GuiParameters.noiseHeardAtPosition
|
||||
+ "$" + npc.getPosition());
|
||||
if(!npc.getKickedOff()) {
|
||||
game.getLobby().getAdmin().broadcastNpcChatMessageToLobby(outMsg);
|
||||
game.getLobby().getAdmin().sendMsgToClientsInLobby(
|
||||
Protocol.printToGUI + "$" + GuiParameters.noiseHeardAtPosition
|
||||
+ "$" + npc.getPosition());
|
||||
}
|
||||
break;
|
||||
case ClientGameInfoHandler.ghostVoteRequest:
|
||||
npc.vote(game);
|
||||
@ -146,9 +149,12 @@ public class ServerGameInfoHandler {
|
||||
case ClientGameInfoHandler.noiseNotification + 4 + " time(s)":
|
||||
case ClientGameInfoHandler.noiseNotification + 5 + " time(s)":
|
||||
String outMsg = npc.getName() + ": " + noiseRandomizer();
|
||||
game.getLobby().getAdmin().broadcastNpcChatMessageToLobby(outMsg);
|
||||
game.getLobby().getAdmin().sendMsgToClientsInLobby(Protocol.printToGUI + "$" + GuiParameters.noiseHeardAtPosition
|
||||
+ "$" + npc.getPosition());
|
||||
if(!npc.getKickedOff()) {
|
||||
game.getLobby().getAdmin().broadcastNpcChatMessageToLobby(outMsg);
|
||||
game.getLobby().getAdmin().sendMsgToClientsInLobby(
|
||||
Protocol.printToGUI + "$" + GuiParameters.noiseHeardAtPosition
|
||||
+ "$" + npc.getPosition());
|
||||
}
|
||||
break;
|
||||
case ClientGameInfoHandler.humanVoteRequest:
|
||||
npc.vote(game);
|
||||
|
||||
@ -199,7 +199,7 @@ public class GameController implements Initializable {
|
||||
*/
|
||||
public void addMessageToNotificationText(String msg) {
|
||||
LOGGER.trace("addMessage " + msg);
|
||||
Text notification = new Text("\\R" + msg);
|
||||
Text notification = new Text(System.lineSeparator() + msg);
|
||||
notification.setFill(Color.BLACK);
|
||||
notification.setStyle("-fx-font: 50 arial;");
|
||||
Platform.runLater(new Runnable() {
|
||||
@ -352,7 +352,9 @@ public class GameController implements Initializable {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
noiseImage0.setImage(loadBellImage());
|
||||
if(!gameStateModel.getKickedOff()[0]) {
|
||||
noiseImage0.setImage(loadBellImage());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.debug(e.getMessage());
|
||||
}
|
||||
@ -370,7 +372,9 @@ public class GameController implements Initializable {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
noiseImage1.setImage(loadBellImage());
|
||||
if(!gameStateModel.getKickedOff()[1]) {
|
||||
noiseImage1.setImage(loadBellImage());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.debug(e.getMessage());
|
||||
}
|
||||
@ -387,7 +391,9 @@ public class GameController implements Initializable {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
noiseImage2.setImage(loadBellImage());
|
||||
if(!gameStateModel.getKickedOff()[2]) {
|
||||
noiseImage2.setImage(loadBellImage());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.debug(e.getMessage());
|
||||
;
|
||||
@ -405,8 +411,9 @@ public class GameController implements Initializable {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
LOGGER.debug("hello");
|
||||
noiseImage3.setImage(loadBellImage());
|
||||
if(!gameStateModel.getKickedOff()[3]) {
|
||||
noiseImage3.setImage(loadBellImage());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.debug(e.getMessage());
|
||||
}
|
||||
@ -423,8 +430,9 @@ public class GameController implements Initializable {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
LOGGER.debug("hello");
|
||||
noiseImage4.setImage(loadBellImage());
|
||||
if(!gameStateModel.getKickedOff()[4]) {
|
||||
noiseImage4.setImage(loadBellImage());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.debug(e.getMessage());
|
||||
}
|
||||
@ -441,7 +449,9 @@ public class GameController implements Initializable {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
noiseImage5.setImage(loadBellImage());
|
||||
if(!gameStateModel.getKickedOff()[5]) {
|
||||
noiseImage5.setImage(loadBellImage());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LOGGER.debug(e.getMessage());
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@
|
||||
<bottom>
|
||||
<AnchorPane fx:id="ChatArea" BorderPane.alignment="CENTER">
|
||||
<children>
|
||||
<SplitPane fx:id="chatSplitPane" dividerPositions="0.5" minHeight="50.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<SplitPane fx:id="chatSplitPane" dividerPositions="0.8555729984301413" minHeight="50.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
|
||||
<items>
|
||||
<AnchorPane fx:id="chatAnchorPane" minHeight="0.0" minWidth="0.0" />
|
||||
<AnchorPane fx:id="otherNotificationAnchorPane" minHeight="0.0" minWidth="0.0">
|
||||
|
||||
Reference in New Issue
Block a user