diff options
author | David Athay <ko2fan@gmail.com> | 2008-04-15 15:42:28 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2008-04-15 15:42:28 +0000 |
commit | 206191086403006db4472d849e9bcf3eaf7f15d0 (patch) | |
tree | 7e876ff6fdb243aefbc9a26ba9314b4afc3ef7df | |
parent | dcca185bee0acac9dfc3f6d62a8f7252c2c69c6c (diff) | |
download | manaserv-206191086403006db4472d849e9bcf3eaf7f15d0.tar.gz manaserv-206191086403006db4472d849e9bcf3eaf7f15d0.tar.bz2 manaserv-206191086403006db4472d849e9bcf3eaf7f15d0.tar.xz manaserv-206191086403006db4472d849e9bcf3eaf7f15d0.zip |
Fixed getting channel userlist
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | src/chat-server/chathandler.cpp | 14 |
2 files changed, 11 insertions, 7 deletions
@@ -1,3 +1,7 @@ +2008-04-15 David Athay <ko2fan@gmail.com> + + * src/chat-server/chathandler.cpp: Fixed getting channel userlist. + 2008-04-03 David Athay <kofan@gmail.com> * src/chat-server/chathandler.cpp: Restricted who can be invited to diff --git a/src/chat-server/chathandler.cpp b/src/chat-server/chathandler.cpp index dd56a383..e0171578 100644 --- a/src/chat-server/chathandler.cpp +++ b/src/chat-server/chathandler.cpp @@ -453,7 +453,7 @@ void ChatHandler::handleEnterChannelMessage(ChatClient &client, MessageIn &msg) channel->getPassword() != givenPassword) { // Incorrect password (should probably have its own return value) - reply.writeByte(ERRMSG_INVALID_ARGUMENT); + reply.writeByte(ERRMSG_INSUFFICIENT_RIGHTS); } else if (!channel->canJoin()) { @@ -549,13 +549,13 @@ ChatHandler::handleListChannelUsersMessage(ChatClient &client, MessageIn &msg) { MessageOut reply(CPMSG_LIST_CHANNELUSERS_RESPONSE); - int channelId = msg.readLong(); - ChatChannel *channel = chatChannelManager->getChannel(channelId); - - reply.writeLong(channelId); + std::string channelName = msg.readString(); + ChatChannel *channel = chatChannelManager->getChannel(channelName); if (channel) { + reply.writeString(channel->getName()); + const ChatChannel::ChannelUsers &users = channel->getUserList(); for (ChatChannel::ChannelUsers::const_iterator @@ -563,9 +563,9 @@ ChatHandler::handleListChannelUsersMessage(ChatClient &client, MessageIn &msg) { reply.writeString((*i)->characterName); } - } - client.send(reply); + client.send(reply); + } } void |