* @param m for ServerMessage
*/
public void update(ServerMessage m) {
if (m instanceof PlayerJoinedMessage) {
PlayerJoinedMessage pjm = (PlayerJoinedMessage) m;
DefaultListModel dl = (DefaultListModel) this.playerlist.getModel();
dl.addElement(pjm.getPlayerName());
logger.info("PJM received");
if (!ownPlayerIdMessageReceived) {
players.put(pjm.getPlayerId(), pjm.getPlayerName());
this.getCore().setPlayerId(pjm.getPlayerId());
this.getCore().setPlayerName(pjm.getPlayerName());
ownPlayerIdMessageReceived = true;
} else {
players.put(pjm.getPlayerId(), pjm.getPlayerName());
}
if (managementSound != null) {
managementSound.hornbeepSound();
}
this.chatdialog.sendChatText("System", pjm.getPlayerName() + "[" + pjm.getPlayerEloScore() + "]" + " has joined!", getCore());
changeButton();
}