chat packets sent to server and then sent back to all clients. #story[1246]

This commit is contained in:
Peter Galloway
2017-08-30 20:42:11 +12:00
parent 353dd48829
commit 4ebf7d6104
8 changed files with 68 additions and 108 deletions
@@ -57,6 +57,8 @@ import seng302.visualiser.fxObjects.BoatObject;
*/
public class RaceViewController extends Thread implements ImportantAnnotationDelegate {
private final int CHAT_LIMIT = 128;
@FXML
private Pane basePane;
@FXML
@@ -113,10 +115,14 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
raceSparkLine.visibleProperty().setValue(false);
raceSparkLine.getYAxis().setAutoRanging(false);
sparklineYAxis.setTickMarkVisible(false);
positionVbox.getStylesheets().add(getClass().getResource("/css/master.css").toString());
selectAnnotationBtn.setOnAction(event -> loadSelectAnnotationView());
chatInput.lengthProperty().addListener((obs, oldLen, newLen) -> {
if (newLen.intValue() > CHAT_LIMIT) {
chatInput.setText(chatInput.getText().substring(0, CHAT_LIMIT));
}
});
}
public void loadRace (
@@ -650,9 +656,8 @@ public class RaceViewController extends Thread implements ImportantAnnotationDel
return chat;
}
// @FXML
// public void onSendAction() {
//
// chatHistory.setText(chatHistory.getText() + chatInput.getText() + '\n');
// }
public void updateChatHistory(Paint playerColour, String newMessage) {
chatHistory.setText(chatHistory.getText() + newMessage + '\n');
}
}