diff options
author | David Athay <ko2fan@gmail.com> | 2008-04-15 15:42:04 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2008-04-15 15:42:04 +0000 |
commit | e2e4ceb9fa8a72ad94853f74724676fff82b15c0 (patch) | |
tree | 5336955366e76266f92dbef4da6e632b84714cdf /src/net/chathandler.cpp | |
parent | d4cc1ded15daa0677e710013640c90b1aadd6bd0 (diff) | |
download | mana-e2e4ceb9fa8a72ad94853f74724676fff82b15c0.tar.gz mana-e2e4ceb9fa8a72ad94853f74724676fff82b15c0.tar.bz2 mana-e2e4ceb9fa8a72ad94853f74724676fff82b15c0.tar.xz mana-e2e4ceb9fa8a72ad94853f74724676fff82b15c0.zip |
Added online status of guild members
Diffstat (limited to 'src/net/chathandler.cpp')
-rw-r--r-- | src/net/chathandler.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/net/chathandler.cpp b/src/net/chathandler.cpp index 4d48865a..d8a228ea 100644 --- a/src/net/chathandler.cpp +++ b/src/net/chathandler.cpp @@ -35,6 +35,7 @@ #include "../game.h" #include "../gui/chat.h" +#include "../gui/guildwindow.h" #include "../utils/tostring.h" @@ -49,6 +50,7 @@ ChatHandler::ChatHandler() CPMSG_LIST_CHANNELS_RESPONSE, CPMSG_PUBMSG, CPMSG_QUIT_CHANNEL_RESPONSE, + CPMSG_LIST_CHANNELUSERS_RESPONSE, /* SMSG_BEING_CHAT, SMSG_PLAYER_CHAT, @@ -106,9 +108,13 @@ void ChatHandler::handleMessage(MessageIn &msg) channelName = msg.readString(); std::string announcement = msg.readString(); std::vector<std::string> userList; + std::string user; while(msg.getUnreadLength()) { - userList.push_back(msg.readString()); + user = msg.readString(); + if (user == "") + break; + userList.push_back(user); } chatWindow->addChannel(channelId, channelName); chatWindow->createNewChannelTab(channelName); @@ -125,6 +131,8 @@ void ChatHandler::handleMessage(MessageIn &msg) while(msg.getUnreadLength()) { channelName = msg.readString(); + if (channelName == "") + break; std::ostringstream numUsers; numUsers << msg.readInt16(); if(channelName != "") @@ -164,6 +172,19 @@ void ChatHandler::handleMessage(MessageIn &msg) chatWindow->removeChannel(channelId); } break; + + case CPMSG_LIST_CHANNELUSERS_RESPONSE: + channelName = msg.readString(); + while(msg.getUnreadLength()) + { + userNick = msg.readString(); + if (userNick == "") + { + break; + } + guildWindow->setOnline(channelName, userNick, true); + } + break; /* // Received speech from being case SMSG_BEING_CHAT: |