chatchannelmanager.hpp

Go to the documentation of this file.
00001 /*
00002  *  The Mana World Server
00003  *  Copyright 2004 The Mana World Development Team
00004  *
00005  *  This file is part of The Mana World.
00006  *
00007  *  The Mana World is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  any later version.
00011  *
00012  *  The Mana World is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with The Mana World; if not, write to the Free Software
00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  *  $Id: chatchannelmanager.hpp 3153 2007-02-27 16:39:07Z crush_tmw $
00022  */
00023 
00024 #ifndef _TMWSERV_CHATCHANNELHANDLER_H_
00025 #define _TMWSERV_CHATCHANNELHANDLER_H_
00026 
00027 #include <map>
00028 
00029 #include "chat-server/chatchannel.hpp"
00030 
00031 class ChatChannelManager {
00032 
00033 public:
00034 
00038     ChatChannelManager();
00039 
00043     ~ChatChannelManager();
00044 
00051     short registerPublicChannel(const std::string& channelName,
00052                                 const std::string& channelAnnouncement,
00053                                 const std::string& channelPassword);
00054 
00061     short registerPrivateChannel(const std::string& channelName,
00062                                  const std::string& channelAnnouncement,
00063                                  const std::string& channelPassword);
00064 
00068     bool removeChannel(short channelId);
00069 
00075     std::string getPublicChannelNames(short *numChannels);
00076 
00082     short getNumberOfChannelUsers(const std::string &channelName);
00083 
00090     short getChannelId(const std::string& channelName);
00091 
00097     std::string getChannelName(short channelId);
00098 
00104     std::string getChannelAnnouncement(short channelId);
00105 
00111     bool setChannelAnnouncement(short channelId, std::string const &channelAnnouncement);
00112 
00118     bool setChannelPassword(short channelId, const std::string& channelPassword);
00119 
00125     std::string getChannelPassword(short channelId);
00126 
00132     bool getChannelPrivacy(short channelId);
00133 
00139     ChatChannel _getChannel(short channelId);
00140 
00144     bool addUserInChannel(std::string const &, short channelId);
00145 
00149     bool removeUserFromChannel(std::string const &, short channelId);
00150 
00155     void removeUserFromEveryChannels(std::string const &);
00156 
00160     std::vector< std::string > const &getUserListInChannel(short channelId);
00161 
00165     bool isChannelRegistered(short channelId);
00166 
00167 private:
00168 
00174     std::map<short, ChatChannel> mChatChannels;
00175 
00176 };
00177 
00178 extern ChatChannelManager *chatChannelManager;
00179 
00180 #endif

Generated on Fri Mar 30 15:39:16 2007 for TMW Server by  doxygen 1.3.9.1