Chat displays whether someone is an admin or moderator in the list of users.

This commit is contained in:
marcins78
2013-08-21 14:15:50 +00:00
parent 6c98a112a8
commit b07b08a9b9
2 changed files with 13 additions and 3 deletions

View File

@@ -164,8 +164,20 @@ public class ChatRequestHandler extends LotroServerRequestHandler implements Uri
for (String userInRoom : usersInRoom) {
Element user = doc.createElement("user");
user.appendChild(doc.createTextNode(userInRoom));
user.appendChild(doc.createTextNode(formatPlayerNameForChatList(userInRoom)));
chatElem.appendChild(user);
}
}
private String formatPlayerNameForChatList(String userInRoom) {
final Player player = _playerDao.getPlayer(userInRoom);
if (player != null) {
final String playerType = player.getType();
if (playerType.contains("a"))
return "*"+userInRoom;
else if (playerType.contains("l"))
return "+"+userInRoom;
}
return userInRoom;
}
}

View File

@@ -212,11 +212,9 @@ var ChatBoxUI = Class.extend({
if (this.chatListDiv != null) {
this.chatListDiv.html("");
var players = new Array();
for (var i = 0; i < users.length; i++) {
var user = users[i];
var userName = user.childNodes[0].nodeValue;
players.push(userName);
this.chatListDiv.append("<div class='chatUser'>" + userName + "</div>");
}
}