TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ChannelMgr.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 #ifndef __TRINITY_CHANNELMGR_H
19 #define __TRINITY_CHANNELMGR_H
20 
21 #include "Common.h"
22 #include "Channel.h"
23 
24 #define MAX_CHANNEL_NAME_STR 0x31
25 #define MAX_CHANNEL_PASS_STR 31
26 
28 {
29  typedef std::map<std::wstring, Channel*> ChannelMap;
30 
31  protected:
32  ChannelMgr() : _team(0) { }
33  ~ChannelMgr();
34 
35  public:
36  static ChannelMgr* ForTeam(uint32 team);
37  void SetTeam(uint32 newTeam) { _team = newTeam; }
38 
39  Channel* GetJoinChannel(std::string const& name, uint32 channelId);
40  Channel* GetChannel(std::string const& name, Player* player, bool notify = true);
41  void LeftChannel(std::string const& name);
42 
43  private:
44  ChannelMap _channels;
46 
47  static void SendNotOnChannelNotify(Player const* player, std::string const& name);
48 };
49 
50 #endif
uint32 _team
Definition: ChannelMgr.h:45
std::map< std::wstring, Channel * > ChannelMap
Definition: ChannelMgr.h:29
ChannelMgr()
Definition: ChannelMgr.h:32
Definition: Channel.h:126
void SetTeam(uint32 newTeam)
Definition: ChannelMgr.h:37
uint32_t uint32
Definition: Define.h:150
Definition: ChannelMgr.h:27
#define TC_GAME_API
Definition: Define.h:134
ChannelMap _channels
Definition: ChannelMgr.h:44