From 47858bb48f2735d0a44e8c461951559fa94062d8 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Tue, 24 Jan 2006 22:10:29 +0000 Subject: 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. --- src/connectionhandler.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/connectionhandler.cpp') diff --git a/src/connectionhandler.cpp b/src/connectionhandler.cpp index 38233a6..c7a3d49 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 beingList = + chatChannelManager->getUserListInChannel(channelId); + // If the being is in the channel, send it the 'leave now' packet + for (std::vector::const_iterator j = beingList.begin(); + j != beingList.end(); j++) + { + if ((*i)->getCharacter().get() == (*j).get() ) + { + (*i)->send(result.getPacket()); + } + } + } +} -- cgit