diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2006-01-24 22:10:29 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2006-01-24 22:10:29 +0000 |
commit | 47858bb48f2735d0a44e8c461951559fa94062d8 (patch) | |
tree | f63baae9ff9959f7c7795b44aa79be179b54a6ae /src/connectionhandler.cpp | |
parent | 5293e989f8ad43a1b02562be2bcba071803f24c3 (diff) | |
download | manaserv-47858bb48f2735d0a44e8c461951559fa94062d8.tar.gz manaserv-47858bb48f2735d0a44e8c461951559fa94062d8.tar.bz2 manaserv-47858bb48f2735d0a44e8c461951559fa94062d8.tar.xz manaserv-47858bb48f2735d0a44e8c461951559fa94062d8.zip |
Chat Channeling Commit part 4. Renamed the slang filter into StringFilter and moved some code to it. Added the missing protocol values, and implemented registering/registering of channels; More to come about it.
Diffstat (limited to 'src/connectionhandler.cpp')
-rw-r--r-- | src/connectionhandler.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/connectionhandler.cpp b/src/connectionhandler.cpp index 38233a6a..c7a3d49b 100644 --- a/src/connectionhandler.cpp +++ b/src/connectionhandler.cpp @@ -317,3 +317,24 @@ unsigned int ConnectionHandler::getClientNumber() { return clients.size(); } + +void ConnectionHandler::makeUsersLeaveChannel(const short channelId) +{ + MessageOut result; + result.writeShort(SMSG_QUIT_CHANNEL_RESPONSE); + result.writeByte(CHATCNL_OUT_OK); + for (NetComputers::iterator i = clients.begin(); i != clients.end();i++) + { + const std::vector<tmwserv::BeingPtr> beingList = + chatChannelManager->getUserListInChannel(channelId); + // If the being is in the channel, send it the 'leave now' packet + for (std::vector<tmwserv::BeingPtr>::const_iterator j = beingList.begin(); + j != beingList.end(); j++) + { + if ((*i)->getCharacter().get() == (*j).get() ) + { + (*i)->send(result.getPacket()); + } + } + } +} |