summaryrefslogtreecommitdiff
path: root/src/chat-server/chathandler.cpp
diff options
context:
space:
mode:
authorDavid Athay <ko2fan@gmail.com>2008-04-15 15:42:28 +0000
committerDavid Athay <ko2fan@gmail.com>2008-04-15 15:42:28 +0000
commit206191086403006db4472d849e9bcf3eaf7f15d0 (patch)
tree7e876ff6fdb243aefbc9a26ba9314b4afc3ef7df /src/chat-server/chathandler.cpp
parentdcca185bee0acac9dfc3f6d62a8f7252c2c69c6c (diff)
downloadmanaserv-206191086403006db4472d849e9bcf3eaf7f15d0.tar.gz
manaserv-206191086403006db4472d849e9bcf3eaf7f15d0.tar.bz2
manaserv-206191086403006db4472d849e9bcf3eaf7f15d0.tar.xz
manaserv-206191086403006db4472d849e9bcf3eaf7f15d0.zip
Fixed getting channel userlist
Diffstat (limited to 'src/chat-server/chathandler.cpp')
-rw-r--r--src/chat-server/chathandler.cpp14
1 files changed, 7 insertions, 7 deletions
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