TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Channel Class Reference

#include <Channel.h>

Classes

struct  PlayerInfo
 

Public Member Functions

 Channel (std::string const &name, uint32 channel_id, uint32 Team=0)
 
std::string constGetName () const
 
uint32 GetChannelId () const
 
bool IsConstant () const
 
bool IsAnnounce () const
 
bool IsLFG () const
 
std::string constGetPassword () const
 
void SetPassword (std::string const &npassword)
 
void SetAnnounce (bool nannounce)
 
uint32 GetNumPlayers () const
 
uint8 GetFlags () const
 
bool HasFlag (uint8 flag) const
 
void JoinChannel (Player *player, std::string const &pass)
 
void LeaveChannel (Player *player, bool send=true)
 
void KickOrBan (Player const *player, std::string const &badname, bool ban)
 
void Kick (Player const *player, std::string const &badname)
 
void Ban (Player const *player, std::string const &badname)
 
void UnBan (Player const *player, std::string const &badname)
 
void Password (Player const *player, std::string const &pass)
 
void SetMode (Player const *player, std::string const &p2n, bool mod, bool set)
 
void SetOwner (ObjectGuid const &guid, bool exclaim=true)
 
void SetOwner (Player const *player, std::string const &name)
 
void SendWhoOwner (Player const *player)
 
void SetModerator (Player const *player, std::string const &newname)
 
void UnsetModerator (Player const *player, std::string const &newname)
 
void SetMute (Player const *player, std::string const &newname)
 
void UnsetMute (Player const *player, std::string const &newname)
 
void SilenceAll (Player const *player, std::string const &name)
 
void SilenceVoice (Player const *player, std::string const &name)
 
void UnsilenceAll (Player const *player, std::string const &name)
 
void UnsilenceVoice (Player const *player, std::string const &name)
 
void List (Player const *player)
 
void Announce (Player const *player)
 
void Say (ObjectGuid const &guid, std::string const &what, uint32 lang)
 
void DeclineInvite (Player const *player)
 
void Invite (Player const *player, std::string const &newp)
 
void Voice (Player const *player)
 
void DeVoice (Player const *player)
 
void JoinNotify (Player const *player)
 
void LeaveNotify (Player const *player)
 
void SetOwnership (bool ownership)
 

Static Public Member Functions

static void CleanOldChannelsInDB ()
 

Private Types

typedef std::map< ObjectGuid,
PlayerInfo
PlayerContainer
 
typedef GuidSet BannedContainer
 

Private Member Functions

void MakeNotifyPacket (WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
 
void MakeJoined (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
 
void MakeLeft (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
 
void MakeYouJoined (WorldPackets::Channel::ChannelNotify &data)
 
void MakeYouLeft (WorldPackets::Channel::ChannelNotify &data)
 
void MakeWrongPassword (WorldPackets::Channel::ChannelNotify &data)
 
void MakeNotMember (WorldPackets::Channel::ChannelNotify &data)
 
void MakeNotModerator (WorldPackets::Channel::ChannelNotify &data)
 
void MakePasswordChanged (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
 
void MakeOwnerChanged (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
 
void MakePlayerNotFound (WorldPackets::Channel::ChannelNotify &data, std::string const &name)
 
void MakeNotOwner (WorldPackets::Channel::ChannelNotify &data)
 
void MakeChannelOwner (WorldPackets::Channel::ChannelNotify &data)
 
void MakeModeChange (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid, uint8 oldFlags, uint8 newFlags)
 
void MakeAnnouncementsOn (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
 
void MakeAnnouncementsOff (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
 
void MakeMuted (WorldPackets::Channel::ChannelNotify &data)
 
void MakePlayerKicked (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &bad, ObjectGuid const &good)
 
void MakeBanned (WorldPackets::Channel::ChannelNotify &data)
 
void MakePlayerBanned (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &bad, ObjectGuid const &good)
 
void MakePlayerUnbanned (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &bad, ObjectGuid const &good)
 
void MakePlayerNotBanned (WorldPackets::Channel::ChannelNotify &data, std::string const &name)
 
void MakePlayerAlreadyMember (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
 
void MakeInvite (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
 
void MakeInviteWrongFaction (WorldPackets::Channel::ChannelNotify &data)
 
void MakeWrongFaction (WorldPackets::Channel::ChannelNotify &data)
 
void MakeInvalidName (WorldPackets::Channel::ChannelNotify &data)
 
void MakeNotModerated (WorldPackets::Channel::ChannelNotify &data)
 
void MakePlayerInvited (WorldPackets::Channel::ChannelNotify &data, std::string const &name)
 
void MakePlayerInviteBanned (WorldPackets::Channel::ChannelNotify &data, std::string const &name)
 
void MakeThrottled (WorldPackets::Channel::ChannelNotify &data)
 
void MakeNotInArea (WorldPackets::Channel::ChannelNotify &data)
 
void MakeNotInLfg (WorldPackets::Channel::ChannelNotify &data)
 
void MakeVoiceOn (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
 
void MakeVoiceOff (WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
 
void SendToAll (WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
 
void SendToAllButOne (WorldPacket const *data, ObjectGuid const &who)
 
void SendToOne (WorldPacket const *data, ObjectGuid const &who)
 
bool IsOn (ObjectGuid const &who) const
 
bool IsBanned (ObjectGuid const &guid) const
 
void UpdateChannelInDB () const
 
void UpdateChannelUseageInDB () const
 
uint8 GetPlayerFlags (ObjectGuid const &guid) const
 
void SetModerator (ObjectGuid const &guid, bool set)
 
void SetMute (ObjectGuid const &guid, bool set)
 

Private Attributes

bool _announce
 
bool _ownership
 
bool _IsSaved
 
uint8 _flags
 
uint32 _channelId
 
uint32 _team
 
ObjectGuid _ownerGUID
 
std::string _name
 
std::string _password
 
PlayerContainer _playersStore
 
BannedContainer _bannedStore
 

Member Typedef Documentation

typedef std::map<ObjectGuid, PlayerInfo> Channel::PlayerContainer
private

Constructor & Destructor Documentation

Channel::Channel ( std::string const name,
uint32  channel_id,
uint32  Team = 0 
)
29  :
30  _announce(true),
31  _ownership(true),
32  _IsSaved(false),
33  _flags(0),
34  _channelId(channelId),
35  _team(team),
36  _name(name)
37 {
38  // set special flags if built-in channel
39  if (ChatChannelsEntry const* ch = sChatChannelsStore.LookupEntry(channelId)) // check whether it's a built-in channel
40  {
41  _announce = false; // no join/leave announces
42  _ownership = false; // no ownership handout
43 
44  _flags |= CHANNEL_FLAG_GENERAL; // for all built-in channels
45 
46  if (ch->Flags & CHANNEL_DBC_FLAG_TRADE) // for trade channel
48 
49  if (ch->Flags & CHANNEL_DBC_FLAG_CITY_ONLY2) // for city only channels
51 
52  if (ch->Flags & CHANNEL_DBC_FLAG_LFG) // for LFG channel
54  else // for all other channels
56  }
57  else // it's custom channel
58  {
60 
61  // If storing custom channels in the db is enabled either load or save the channel
62  if (sWorld->getBoolConfig(CONFIG_PRESERVE_CUSTOM_CHANNELS))
63  {
65  stmt->setString(0, _name);
66  stmt->setUInt32(1, _team);
68 
69  if (result) // load
70  {
71  Field* fields = result->Fetch();
72  _announce = fields[0].GetBool();
73  _ownership = fields[1].GetBool();
74  _password = fields[2].GetString();
75  std::string bannedList = fields[3].GetString();
76 
77  if (!bannedList.empty())
78  {
79  Tokenizer tokens(bannedList, ' ');
80  for (Tokenizer::const_iterator i = tokens.begin(); i != tokens.end(); ++i)
81  {
82  std::string bannedGuidStr(*i);
83  ObjectGuid bannedGuid;
84  bannedGuid.SetRawValue(uint64(strtoull(bannedGuidStr.substr(0, 16).c_str(), nullptr, 16)), uint64(strtoull(bannedGuidStr.substr(16).c_str(), nullptr, 16)));
85  if (!bannedGuid.IsEmpty())
86  {
87  TC_LOG_DEBUG("chat.system", "Channel (%s) loaded bannedStore %s", _name.c_str(), bannedGuid.ToString().c_str());
88  _bannedStore.insert(bannedGuid);
89  }
90  }
91  }
92  }
93  else // save
94  {
96  stmt->setString(0, _name);
97  stmt->setUInt32(1, _team);
99  TC_LOG_DEBUG("chat.system", "Channel (%s) saved in database", _name.c_str());
100  }
101 
102  _IsSaved = true;
103  }
104  }
105 }
BannedContainer _bannedStore
Definition: Channel.h:285
Definition: Channel.h:106
void Execute(const char *sql)
Definition: DatabaseWorkerPool.h:87
Definition: Channel.h:109
std::shared_ptr< PreparedResultSet > PreparedQueryResult
Definition: QueryResult.h:107
Definition: Util.h:45
std::string _name
Definition: Channel.h:282
Class used to access individual fields of database query result.
Definition: Field.h:56
Definition: CharacterDatabase.h:209
void setString(const uint8 index, const std::string &value)
Definition: PreparedStatement.cpp:187
uint8 _flags
Definition: Channel.h:278
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
uint64_t uint64
Definition: g3dmath.h:170
#define sWorld
Definition: World.h:887
Definition: PreparedStatement.h:74
Definition: Channel.h:89
Definition: World.h:160
bool _ownership
Definition: Channel.h:276
StorageType::const_iterator const_iterator
Definition: Util.h:52
void SetRawValue(std::vector< uint8 > const &guid)
Definition: ObjectGuid.cpp:134
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
Definition: Channel.h:83
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
Definition: Channel.h:104
Definition: Channel.h:88
Definition: Channel.h:85
std::string _password
Definition: Channel.h:283
bool _announce
Definition: Channel.h:275
QueryResult Query(const char *sql, T *connection=nullptr)
Definition: DatabaseWorkerPool.cpp:113
uint32 _channelId
Definition: Channel.h:279
Definition: Channel.h:87
Definition: CharacterDatabase.h:210
Definition: DBCStructure.h:172
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
Definition: ObjectGuid.h:189
bool GetBool() const
Definition: Field.h:65
DBCStorage< ChatChannelsEntry > sChatChannelsStore(ChatChannelsfmt)
std::string GetString() const
Definition: Field.h:276
Definition: Channel.h:86
std::string ToString() const
Definition: ObjectGuid.cpp:99
bool IsEmpty() const
Definition: ObjectGuid.h:242
bool _IsSaved
Definition: Channel.h:277
uint32 _team
Definition: Channel.h:280

+ Here is the call graph for this function:

Member Function Documentation

void Channel::Announce ( Player const player)
571 {
572  ObjectGuid const& guid = player->GetGUID();
573 
574  if (!IsOn(guid))
575  {
577  MakeNotMember(notify);
578  player->SendDirectMessage(notify.Write());
579  return;
580  }
581 
582  if (!_playersStore[guid].IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
583  {
585  MakeNotModerator(notify);
586  player->SendDirectMessage(notify.Write());
587  return;
588  }
589 
590  _announce = !_announce;
591 
593  if (_announce)
594  MakeAnnouncementsOn(notify, guid);
595  else
596  MakeAnnouncementsOff(notify, guid);
597  SendToAll(notify.Write());
598 
600 }
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
void UpdateChannelInDB() const
Definition: Channel.cpp:107
Definition: ChannelPackets.h:52
void MakeNotModerator(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:823
void MakeAnnouncementsOn(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
Definition: Channel.cpp:870
void MakeNotMember(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:818
void MakeAnnouncementsOff(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
Definition: Channel.cpp:876
bool _announce
Definition: Channel.h:275
PlayerContainer _playersStore
Definition: Channel.h:284
Definition: ObjectGuid.h:189
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257

+ Here is the call graph for this function:

void Channel::Ban ( Player const player,
std::string const badname 
)
inline
187 { KickOrBan(player, badname, true); }
void KickOrBan(Player const *player, std::string const &badname, bool ban)
Definition: Channel.cpp:294
void Channel::CleanOldChannelsInDB ( )
static
137 {
138  if (sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) > 0)
139  {
141  stmt->setUInt32(0, sWorld->getIntConfig(CONFIG_PRESERVE_CUSTOM_CHANNEL_DURATION) * DAY);
143 
144  TC_LOG_DEBUG("chat.system", "Cleaned out unused custom chat channels.");
145  }
146 }
void Execute(const char *sql)
Definition: DatabaseWorkerPool.h:87
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
#define sWorld
Definition: World.h:887
Definition: PreparedStatement.h:74
Definition: CharacterDatabase.h:214
Definition: Common.h:99
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::DeclineInvite ( Player const player)
747 {
748 }
void Channel::DeVoice ( Player const player)
755 {
756 }
uint32 Channel::GetChannelId ( ) const
inline
172 { return _channelId; }
uint32 _channelId
Definition: Channel.h:279

+ Here is the caller graph for this function:

uint8 Channel::GetFlags ( ) const
inline
180 { return _flags; }
uint8 _flags
Definition: Channel.h:278

+ Here is the caller graph for this function:

std::string const& Channel::GetName ( ) const
inline
171 { return _name; }
std::string _name
Definition: Channel.h:282

+ Here is the caller graph for this function:

uint32 Channel::GetNumPlayers ( ) const
inline
179 { return uint32(_playersStore.size()); }
PlayerContainer _playersStore
Definition: Channel.h:284
uint32_t uint32
Definition: g3dmath.h:168

+ Here is the caller graph for this function:

std::string const& Channel::GetPassword ( ) const
inline
176 { return _password; }
std::string _password
Definition: Channel.h:283
uint8 Channel::GetPlayerFlags ( ObjectGuid const guid) const
inlineprivate
264  {
265  PlayerContainer::const_iterator itr = _playersStore.find(guid);
266  return itr != _playersStore.end() ? itr->second.GetFlags() : 0;
267  }
PlayerContainer _playersStore
Definition: Channel.h:284

+ Here is the caller graph for this function:

bool Channel::HasFlag ( uint8  flag) const
inline
181 { return (_flags & flag) != 0; }
uint8 _flags
Definition: Channel.h:278

+ Here is the caller graph for this function:

void Channel::Invite ( Player const player,
std::string const newp 
)
641 {
642  ObjectGuid const& guid = player->GetGUID();
643 
644  if (!IsOn(guid))
645  {
647  MakeNotMember(notify);
648  player->SendDirectMessage(notify.Write());
649  return;
650  }
651 
653  if (!newp || !newp->isGMVisible())
654  {
656  MakePlayerNotFound(notify, newname);
657  player->SendDirectMessage(notify.Write());
658  return;
659  }
660 
661  if (IsBanned(newp->GetGUID()))
662  {
664  MakePlayerInviteBanned(notify, newname);
665  player->SendDirectMessage(notify.Write());
666  return;
667  }
668 
669  if (newp->GetTeam() != player->GetTeam() &&
670  (!player->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) ||
671  !newp->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL)))
672  {
674  MakeInviteWrongFaction(notify);
675  player->SendDirectMessage(notify.Write());
676  return;
677  }
678 
679  if (IsOn(newp->GetGUID()))
680  {
682  MakePlayerAlreadyMember(notify, newp->GetGUID());
683  player->SendDirectMessage(notify.Write());
684  return;
685  }
686 
687  if (!newp->GetSocial()->HasIgnore(guid))
688  {
690  MakeInvite(notify, guid);
691  newp->SendDirectMessage(notify.Write());
692  }
693 
695  MakePlayerInvited(notify, newp->GetName());
696  player->SendDirectMessage(notify.Write());
697 }
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
void MakePlayerAlreadyMember(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
Definition: Channel.cpp:919
TC_GAME_API Player * FindConnectedPlayerByName(std::string const &name)
Definition: ObjectAccessor.cpp:240
Definition: ChannelPackets.h:52
bool IsBanned(ObjectGuid const &guid) const
Definition: Channel.h:258
void MakePlayerInvited(WorldPackets::Channel::ChannelNotify &data, std::string const &name)
Definition: Channel.cpp:951
void MakeNotMember(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:818
void MakePlayerNotFound(WorldPackets::Channel::ChannelNotify &data, std::string const &name)
Definition: Channel.cpp:840
void MakeInvite(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
Definition: Channel.cpp:925
void MakePlayerInviteBanned(WorldPackets::Channel::ChannelNotify &data, std::string const &name)
Definition: Channel.cpp:957
Definition: ObjectGuid.h:189
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257
void MakeInviteWrongFaction(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:931

+ Here is the call graph for this function:

bool Channel::IsAnnounce ( ) const
inline
174 { return _announce; }
bool _announce
Definition: Channel.h:275
bool Channel::IsBanned ( ObjectGuid const guid) const
inlineprivate
258 { return _bannedStore.find(guid) != _bannedStore.end(); }
BannedContainer _bannedStore
Definition: Channel.h:285

+ Here is the caller graph for this function:

bool Channel::IsConstant ( ) const
inline
173 { return _channelId != 0; }
uint32 _channelId
Definition: Channel.h:279

+ Here is the caller graph for this function:

bool Channel::IsLFG ( ) const
inline
175 { return (GetFlags() & CHANNEL_FLAG_LFG) != 0; }
Definition: Channel.h:89
uint8 GetFlags() const
Definition: Channel.h:180
bool Channel::IsOn ( ObjectGuid const who) const
inlineprivate
257 { return _playersStore.find(who) != _playersStore.end(); }
PlayerContainer _playersStore
Definition: Channel.h:284

+ Here is the caller graph for this function:

void Channel::JoinChannel ( Player player,
std::string const pass 
)
149 {
150  ObjectGuid const& guid = player->GetGUID();
151  if (IsOn(guid))
152  {
153  // Do not send error message for built-in channels
154  if (!IsConstant())
155  {
157  MakePlayerAlreadyMember(notify, guid);
158  player->SendDirectMessage(notify.Write());
159  }
160  return;
161  }
162 
163  if (IsBanned(guid))
164  {
166  MakeBanned(notify);
167  player->SendDirectMessage(notify.Write());
168  return;
169  }
170 
171  if (!_password.empty() && pass != _password)
172  {
174  MakeWrongPassword(notify);
175  player->SendDirectMessage(notify.Write());
176  return;
177  }
178 
179  if (HasFlag(CHANNEL_FLAG_LFG) &&
180  sWorld->getBoolConfig(CONFIG_RESTRICTED_LFG_CHANNEL) &&
181  AccountMgr::IsPlayerAccount(player->GetSession()->GetSecurity()) && //FIXME: Move to RBAC
182  player->GetGroup())
183  {
185  MakeNotInLfg(notify);
186  player->SendDirectMessage(notify.Write());
187  return;
188  }
189 
190  player->JoinedChannel(this);
191 
192  if (_announce && !player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL))
193  {
195  MakeJoined(notify, guid);
196  SendToAll(notify.Write());
197  }
198 
199  PlayerInfo playerInfo;
200  playerInfo.PlayerGuid = guid;
201  _playersStore[guid] = playerInfo;
202 
203  /*
204  WorldPackets::Channel::ChannelNotify notify;
205  MakeYouJoined(notify);
206  player->SendDirectMessage(notify.Write());
207  */
208 
210  //notify.ChannelWelcomeMsg = "";
211  notify.ChatChannelID = _channelId;
212  //notify.InstanceID = 0;
213  notify._ChannelFlags = _flags;
214  notify._Channel = _name;
215  player->SendDirectMessage(notify.Write());
216 
217  JoinNotify(player);
218 
219  // Custom channel handling
220  if (!IsConstant())
221  {
222  // Update last_used timestamp in db
223  if (!_playersStore.empty())
225 
226  // If the channel has no owner yet and ownership is allowed, set the new owner.
227  if (_ownerGUID.IsEmpty() && _ownership)
228  {
229  SetOwner(guid, _playersStore.size() > 1);
230  _playersStore[guid].SetModerator(true);
231  }
232  }
233 }
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:63
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
void MakePlayerAlreadyMember(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
Definition: Channel.cpp:919
std::string _name
Definition: Channel.h:282
void MakeBanned(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:894
Definition: ChannelPackets.h:52
bool IsBanned(ObjectGuid const &guid) const
Definition: Channel.h:258
Definition: Player.h:396
uint8 _flags
Definition: Channel.h:278
void MakeWrongPassword(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:813
#define sWorld
Definition: World.h:887
void SetOwner(ObjectGuid const &guid, bool exclaim=true)
Definition: Channel.cpp:699
Definition: Channel.h:89
bool _ownership
Definition: Channel.h:276
std::string _Channel
Channel Name.
Definition: ChannelPackets.h:83
bool HasFlag(uint8 flag) const
Definition: Channel.h:181
Definition: ChannelPackets.h:72
bool IsConstant() const
Definition: Channel.h:173
void MakeNotInLfg(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:973
void MakeJoined(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
Definition: Channel.cpp:786
int32 ChatChannelID
Definition: ChannelPackets.h:80
Definition: World.h:125
void JoinNotify(Player const *player)
Definition: Channel.cpp:990
static bool IsPlayerAccount(uint32 gmlevel)
Definition: AccountMgr.cpp:390
std::string _password
Definition: Channel.h:283
bool _announce
Definition: Channel.h:275
uint32 _channelId
Definition: Channel.h:279
void UpdateChannelUseageInDB() const
Definition: Channel.cpp:128
PlayerContainer _playersStore
Definition: Channel.h:284
uint32 _ChannelFlags
Definition: ChannelPackets.h:82
Definition: ObjectGuid.h:189
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
ObjectGuid _ownerGUID
Definition: Channel.h:281
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

void Channel::JoinNotify ( Player const player)
991 {
992  ObjectGuid const& guid = player->GetGUID();
993 
994  if (IsConstant())
995  {
997  userlistAdd.AddedUserGUID = guid;
998  userlistAdd._ChannelFlags = GetFlags();
999  userlistAdd.UserFlags = GetPlayerFlags(guid);
1000  userlistAdd.ChannelID = GetChannelId();
1001  userlistAdd.ChannelName = GetName();
1002  SendToAllButOne(userlistAdd.Write(), guid);
1003  }
1004  else
1005  {
1007  userlistUpdate.UpdatedUserGUID = guid;
1008  userlistUpdate._ChannelFlags = GetFlags();
1009  userlistUpdate.UserFlags = GetPlayerFlags(guid);
1010  userlistUpdate.ChannelID = GetChannelId();
1011  userlistUpdate.ChannelName = GetName();
1012  SendToAll(userlistUpdate.Write());
1013  }
1014 }
uint32 GetChannelId() const
Definition: Channel.h:172
uint8 GetPlayerFlags(ObjectGuid const &guid) const
Definition: Channel.h:263
Definition: ChannelPackets.h:125
Definition: ChannelPackets.h:98
std::string ChannelName
Definition: ChannelPackets.h:136
ObjectGuid AddedUserGUID
Definition: ChannelPackets.h:105
std::string ChannelName
Definition: ChannelPackets.h:109
uint8 UserFlags
Definition: ChannelPackets.h:107
uint32 _ChannelFlags
Definition: ChannelPackets.h:106
bool IsConstant() const
Definition: Channel.h:173
uint32 _ChannelFlags
Definition: ChannelPackets.h:133
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:86
int32 ChannelID
Definition: ChannelPackets.h:135
std::string const & GetName() const
Definition: Channel.h:171
Definition: ObjectGuid.h:189
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:109
uint8 UserFlags
Definition: ChannelPackets.h:134
void SendToAllButOne(WorldPacket const *data, ObjectGuid const &who)
Definition: Channel.cpp:766
uint8 GetFlags() const
Definition: Channel.h:180
int32 ChannelID
Definition: ChannelPackets.h:108
ObjectGuid UpdatedUserGUID
Definition: ChannelPackets.h:132

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::Kick ( Player const player,
std::string const badname 
)
inline
186 { KickOrBan(player, badname, false); }
void KickOrBan(Player const *player, std::string const &badname, bool ban)
Definition: Channel.cpp:294
void Channel::KickOrBan ( Player const player,
std::string const badname,
bool  ban 
)
295 {
296  ObjectGuid const& good = player->GetGUID();
297 
298  if (!IsOn(good))
299  {
301  MakeNotMember(notify);
302  player->SendDirectMessage(notify.Write());
303  return;
304  }
305 
306  if (!_playersStore[good].IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
307  {
309  MakeNotModerator(notify);
310  player->SendDirectMessage(notify.Write());
311  return;
312  }
313 
315  ObjectGuid victim = bad ? bad->GetGUID() : ObjectGuid::Empty;
316  if (!victim || !IsOn(victim))
317  {
319  MakePlayerNotFound(notify, badname);
320  player->SendDirectMessage(notify.Write());
321  return;
322  }
323 
324  bool changeowner = _ownerGUID == victim;
325 
326  if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR) && changeowner && good != _ownerGUID)
327  {
329  MakeNotOwner(notify);
330  player->SendDirectMessage(notify.Write());
331  return;
332  }
333 
334  if (ban && !IsBanned(victim))
335  {
336  _bannedStore.insert(victim);
338 
339  if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL))
340  {
342  MakePlayerBanned(notify, victim, good);
343  SendToAll(notify.Write());
344  }
345  }
346  else if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL))
347  {
349  MakePlayerKicked(notify, victim, good);
350  SendToAll(notify.Write());
351  }
352 
353  _playersStore.erase(victim);
354  bad->LeftChannel(this);
355 
356  if (changeowner && _ownership && !_playersStore.empty())
357  {
358  _playersStore[good].SetModerator(true);
359  SetOwner(good);
360  }
361 }
BannedContainer _bannedStore
Definition: Channel.h:285
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
void UpdateChannelInDB() const
Definition: Channel.cpp:107
TC_GAME_API Player * FindConnectedPlayerByName(std::string const &name)
Definition: ObjectAccessor.cpp:240
Definition: ChannelPackets.h:52
bool IsBanned(ObjectGuid const &guid) const
Definition: Channel.h:258
void MakeNotModerator(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:823
void SetOwner(ObjectGuid const &guid, bool exclaim=true)
Definition: Channel.cpp:699
void MakeNotMember(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:818
bool _ownership
Definition: Channel.h:276
void MakePlayerKicked(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &bad, ObjectGuid const &good)
Definition: Channel.cpp:887
void MakePlayerNotFound(WorldPackets::Channel::ChannelNotify &data, std::string const &name)
Definition: Channel.cpp:840
void MakeNotOwner(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:846
void MakePlayerBanned(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &bad, ObjectGuid const &good)
Definition: Channel.cpp:899
PlayerContainer _playersStore
Definition: Channel.h:284
Definition: ObjectGuid.h:189
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
ObjectGuid _ownerGUID
Definition: Channel.h:281
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257

+ Here is the call graph for this function:

void Channel::LeaveChannel ( Player player,
bool  send = true 
)
236 {
237  ObjectGuid const& guid = player->GetGUID();
238  if (!IsOn(guid))
239  {
240  if (send)
241  {
243  MakeNotMember(notify);
244  player->SendDirectMessage(notify.Write());
245  }
246  return;
247  }
248 
249  player->LeftChannel(this);
250 
251  if (send)
252  {
253  /*
254  WorldPackets::Channel::ChannelNotify notify;
255  MakeYouLeft(notify);
256  player->SendDirectMessage(notify.Write());
257  */
258 
260  notify.Channel = _name;
261  notify.ChatChannelID = 0;
262  //notify.Suspended = false;
263  player->SendDirectMessage(notify.Write());
264  }
265 
266  bool changeowner = _playersStore[guid].IsOwner();
267 
268  _playersStore.erase(guid);
269 
270  if (_announce && !player->GetSession()->HasPermission(rbac::RBAC_PERM_SILENTLY_JOIN_CHANNEL))
271  {
273  MakeLeft(notify, guid);
274  SendToAll(notify.Write());
275  }
276 
277  LeaveNotify(player);
278 
279  if (!IsConstant())
280  {
281  // Update last_used timestamp in db
283 
284  // If the channel owner left and there are still playersStore inside, pick a new owner
285  if (changeowner && _ownership && !_playersStore.empty())
286  {
287  ObjectGuid const& newowner = _playersStore.begin()->second.PlayerGuid;
288  _playersStore[newowner].SetModerator(true);
289  SetOwner(newowner);
290  }
291  }
292 }
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
std::string Channel
Channel Name.
Definition: ChannelPackets.h:93
std::string _name
Definition: Channel.h:282
Definition: ChannelPackets.h:52
int32 ChatChannelID
Definition: ChannelPackets.h:94
void LeaveNotify(Player const *player)
Definition: Channel.cpp:1016
void SetOwner(ObjectGuid const &guid, bool exclaim=true)
Definition: Channel.cpp:699
void MakeLeft(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
Definition: Channel.cpp:792
void MakeNotMember(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:818
bool _ownership
Definition: Channel.h:276
bool IsConstant() const
Definition: Channel.h:173
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:76
bool _announce
Definition: Channel.h:275
void UpdateChannelUseageInDB() const
Definition: Channel.cpp:128
PlayerContainer _playersStore
Definition: Channel.h:284
Definition: ObjectGuid.h:189
Definition: ChannelPackets.h:86
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257

+ Here is the call graph for this function:

void Channel::LeaveNotify ( Player const player)
1017 {
1018  ObjectGuid const& guid = player->GetGUID();
1020  userlistRemove.RemovedUserGUID = guid;
1021  userlistRemove._ChannelFlags = GetFlags();
1022  userlistRemove.ChannelID = GetChannelId();
1023  userlistRemove.ChannelName = GetName();
1024 
1025  if (IsConstant())
1026  SendToAllButOne(userlistRemove.Write(), guid);
1027  else
1028  SendToAll(userlistRemove.Write());
1029 }
uint32 GetChannelId() const
Definition: Channel.h:172
std::string ChannelName
Definition: ChannelPackets.h:122
uint32 ChannelID
Definition: ChannelPackets.h:121
ObjectGuid RemovedUserGUID
Definition: ChannelPackets.h:119
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:98
Definition: ChannelPackets.h:112
bool IsConstant() const
Definition: Channel.h:173
uint32 _ChannelFlags
Definition: ChannelPackets.h:120
std::string const & GetName() const
Definition: Channel.h:171
Definition: ObjectGuid.h:189
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
void SendToAllButOne(WorldPacket const *data, ObjectGuid const &who)
Definition: Channel.cpp:766
uint8 GetFlags() const
Definition: Channel.h:180

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::List ( Player const player)

always true?

532 {
533  if (!IsOn(player->GetGUID()))
534  {
536  MakeNotMember(notify);
537  player->SendDirectMessage(notify.Write());
538  return;
539  }
540 
541  TC_LOG_DEBUG("chat.system", "SMSG_CHANNEL_LIST %s Channel: %s",
542  player->GetSession()->GetPlayerInfo().c_str(), GetName().c_str());
543 
545  list._Display = true;
546  list._Channel = GetName();
547  list._ChannelFlags = GetFlags();
548 
549  uint32 gmLevelInWhoList = sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
550 
551  list._Members.reserve(_playersStore.size());
552  for (PlayerContainer::value_type const& i : _playersStore)
553  {
554  Player* member = ObjectAccessor::FindConnectedPlayer(i.first);
555 
556  // PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
557  // MODERATOR, GAME MASTER, ADMINISTRATOR can see all
558  if (member &&
559  (player->GetSession()->HasPermission(rbac::RBAC_PERM_WHO_SEE_ALL_SEC_LEVELS) ||
560  member->GetSession()->GetSecurity() <= AccountTypes(gmLevelInWhoList)) &&
561  member->IsVisibleGloballyFor(player))
562  {
563  list._Members.emplace_back(i.second.PlayerGuid, GetVirtualRealmAddress(), i.second.GetFlags());
564  }
565  }
566 
567  player->SendDirectMessage(list.Write());
568 }
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
Definition: ChannelPackets.h:52
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
#define sWorld
Definition: World.h:887
void MakeNotMember(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:818
Definition: ChannelPackets.h:29
uint32_t uint32
Definition: Define.h:150
AccountTypes
Definition: Common.h:106
bool _Display
Definition: ChannelPackets.h:49
Definition: World.h:264
PlayerContainer _playersStore
Definition: Channel.h:284
uint32 GetVirtualRealmAddress()
Definition: World.cpp:3487
std::string const & GetName() const
Definition: Channel.h:171
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:215
uint8 GetFlags() const
Definition: Channel.h:180

+ Here is the call graph for this function:

void Channel::MakeAnnouncementsOff ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const guid 
)
private
877 {
879  data.SenderGuid = guid;
880 }
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
Definition: Channel.h:54
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeAnnouncementsOn ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const guid 
)
private
871 {
873  data.SenderGuid = guid;
874 }
Definition: Channel.h:53
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeBanned ( WorldPackets::Channel::ChannelNotify data)
private
895 {
897 }
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
Definition: Channel.h:59

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeChannelOwner ( WorldPackets::Channel::ChannelNotify data)
private
852 {
853  std::string name;
854 
855  if (!ObjectMgr::GetPlayerNameByGUID(_ownerGUID, name) || name.empty())
856  name = "PLAYER_NOT_FOUND";
857 
859  data.Sender = ((IsConstant() || !_ownerGUID) ? "Nobody" : name);
860 }
std::string Sender
Definition: ChannelPackets.h:59
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
bool IsConstant() const
Definition: Channel.h:173
static bool GetPlayerNameByGUID(ObjectGuid const &guid, std::string &name)
Definition: ObjectMgr.cpp:2258
Definition: Channel.h:51
ObjectGuid _ownerGUID
Definition: Channel.h:281

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeInvalidName ( WorldPackets::Channel::ChannelNotify data)
private
942 {
944 }
Definition: Channel.h:67
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

void Channel::MakeInvite ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const guid 
)
private
926 {
928  data.SenderGuid = guid;
929 }
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
Definition: Channel.h:64
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeInviteWrongFaction ( WorldPackets::Channel::ChannelNotify data)
private
932 {
934 }
Definition: Channel.h:65
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeJoined ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const guid 
)
private
787 {
789  data.SenderGuid = guid;
790 }
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
Definition: Channel.h:38
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeLeft ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const guid 
)
private
793 {
795  data.SenderGuid = guid;
796 }
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
Definition: Channel.h:39

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeModeChange ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const guid,
uint8  oldFlags,
uint8  newFlags 
)
private
863 {
865  data.SenderGuid = guid;
866  data.OldFlags = oldFlags;
867  data.NewFlags = newFlags;
868 }
Definition: Channel.h:52
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
uint8 NewFlags
Definition: ChannelPackets.h:64
uint8 OldFlags
Definition: ChannelPackets.h:63

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeMuted ( WorldPackets::Channel::ChannelNotify data)
private
883 {
885 }
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
Definition: Channel.h:57

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeNotifyPacket ( WorldPackets::Channel::ChannelNotify data,
uint8  notifyType 
)
private
781 {
782  data.Type = notifyType;
783  data._Channel = _name;
784 }
std::string _name
Definition: Channel.h:282
std::string _Channel
Channel Name.
Definition: ChannelPackets.h:65
uint8 Type
Definition: ChannelPackets.h:62

+ Here is the caller graph for this function:

void Channel::MakeNotInArea ( WorldPackets::Channel::ChannelNotify data)
private
969 {
971 }
Definition: Channel.h:72
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

void Channel::MakeNotInLfg ( WorldPackets::Channel::ChannelNotify data)
private
974 {
976 }
Definition: Channel.h:73
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeNotMember ( WorldPackets::Channel::ChannelNotify data)
private
819 {
821 }
Definition: Channel.h:45
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeNotModerated ( WorldPackets::Channel::ChannelNotify data)
private
947 {
949 }
Definition: Channel.h:68
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

void Channel::MakeNotModerator ( WorldPackets::Channel::ChannelNotify data)
private
824 {
826 }
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
Definition: Channel.h:46

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeNotOwner ( WorldPackets::Channel::ChannelNotify data)
private
847 {
849 }
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
Definition: Channel.h:50

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeOwnerChanged ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const guid 
)
private
835 {
837  data.SenderGuid = guid;
838 }
Definition: Channel.h:48
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakePasswordChanged ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const guid 
)
private
829 {
831  data.SenderGuid = guid;
832 }
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
Definition: Channel.h:47

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakePlayerAlreadyMember ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const guid 
)
private
920 {
922  data.SenderGuid = guid;
923 }
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
Definition: Channel.h:63

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakePlayerBanned ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const bad,
ObjectGuid const good 
)
private
900 {
902  data.SenderGuid = good;
903  data.TargetGuid = bad;
904 }
Definition: Channel.h:60
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
ObjectGuid TargetGuid
Definition: ChannelPackets.h:67

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakePlayerInviteBanned ( WorldPackets::Channel::ChannelNotify data,
std::string const name 
)
private
958 {
960  data.Sender = name;
961 }
Definition: Channel.h:70
std::string Sender
Definition: ChannelPackets.h:59
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakePlayerInvited ( WorldPackets::Channel::ChannelNotify data,
std::string const name 
)
private
952 {
954  data.Sender = name;
955 }
std::string Sender
Definition: ChannelPackets.h:59
Definition: Channel.h:69
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakePlayerKicked ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const bad,
ObjectGuid const good 
)
private
888 {
890  data.SenderGuid = good;
891  data.TargetGuid = bad;
892 }
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
Definition: Channel.h:58
ObjectGuid TargetGuid
Definition: ChannelPackets.h:67

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakePlayerNotBanned ( WorldPackets::Channel::ChannelNotify data,
std::string const name 
)
private
914 {
916  data.Sender = name;
917 }
Definition: Channel.h:62
std::string Sender
Definition: ChannelPackets.h:59
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

void Channel::MakePlayerNotFound ( WorldPackets::Channel::ChannelNotify data,
std::string const name 
)
private
841 {
843  data.Sender = name;
844 }
std::string Sender
Definition: ChannelPackets.h:59
Definition: Channel.h:49
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakePlayerUnbanned ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const bad,
ObjectGuid const good 
)
private
907 {
909  data.SenderGuid = good;
910  data.TargetGuid = bad;
911 }
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
ObjectGuid TargetGuid
Definition: ChannelPackets.h:67
Definition: Channel.h:61

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeThrottled ( WorldPackets::Channel::ChannelNotify data)
private
964 {
966 }
Definition: Channel.h:71
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

void Channel::MakeVoiceOff ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const guid 
)
private
985 {
987  data.SenderGuid = guid;
988 }
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
Definition: Channel.h:75
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

void Channel::MakeVoiceOn ( WorldPackets::Channel::ChannelNotify data,
ObjectGuid const guid 
)
private
979 {
981  data.SenderGuid = guid;
982 }
Definition: Channel.h:74
ObjectGuid SenderGuid
Definition: ChannelPackets.h:60
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

void Channel::MakeWrongFaction ( WorldPackets::Channel::ChannelNotify data)
private
937 {
939 }
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
Definition: Channel.h:66

+ Here is the call graph for this function:

void Channel::MakeWrongPassword ( WorldPackets::Channel::ChannelNotify data)
private
814 {
816 }
Definition: Channel.h:44
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::MakeYouJoined ( WorldPackets::Channel::ChannelNotify data)
private
799 {
801  //*data << uint8(GetFlags());
802  data.ChatChannelID = GetChannelId();
803  //*data << uint32(0);
804 }
uint32 GetChannelId() const
Definition: Channel.h:172
Definition: Channel.h:41
int32 ChatChannelID
Definition: ChannelPackets.h:69
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780

+ Here is the call graph for this function:

void Channel::MakeYouLeft ( WorldPackets::Channel::ChannelNotify data)
private
807 {
809  data.ChatChannelID = GetChannelId();
810  //*data << uint8(IsConstant());
811 }
uint32 GetChannelId() const
Definition: Channel.h:172
int32 ChatChannelID
Definition: ChannelPackets.h:69
void MakeNotifyPacket(WorldPackets::Channel::ChannelNotify &data, uint8 notifyType)
Definition: Channel.cpp:780
Definition: Channel.h:43

+ Here is the call graph for this function:

void Channel::Password ( Player const player,
std::string const pass 
)
404 {
405  ObjectGuid const& guid = player->GetGUID();
406 
407  if (!IsOn(guid))
408  {
410  MakeNotMember(notify);
411  player->SendDirectMessage(notify.Write());
412  return;
413  }
414 
415  if (!_playersStore[guid].IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
416  {
418  MakeNotModerator(notify);
419  player->SendDirectMessage(notify.Write());
420  return;
421  }
422 
423  _password = pass;
424 
426  MakePasswordChanged(notify, guid);
427  SendToAll(notify.Write());
428 
430 }
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
void MakePasswordChanged(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
Definition: Channel.cpp:828
void UpdateChannelInDB() const
Definition: Channel.cpp:107
Definition: ChannelPackets.h:52
void MakeNotModerator(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:823
void MakeNotMember(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:818
std::string _password
Definition: Channel.h:283
PlayerContainer _playersStore
Definition: Channel.h:284
Definition: ObjectGuid.h:189
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257

+ Here is the call graph for this function:

void Channel::Say ( ObjectGuid const guid,
std::string const what,
uint32  lang 
)
603 {
604  if (what.empty())
605  return;
606 
607  // TODO: Add proper RBAC check
609  lang = LANG_UNIVERSAL;
610 
611  if (!IsOn(guid))
612  {
614  MakeNotMember(notify);
615  SendToOne(notify.Write(), guid);
616  return;
617  }
618 
619  if (_playersStore[guid].IsMuted())
620  {
622  MakeMuted(notify);
623  SendToOne(notify.Write(), guid);
624  return;
625  }
626 
628  if (Player* player = ObjectAccessor::FindConnectedPlayer(guid))
629  packet.Initialize(CHAT_MSG_CHANNEL, Language(lang), player, player, what, 0, _name);
630  else
631  {
632  packet.Initialize(CHAT_MSG_CHANNEL, Language(lang), nullptr, nullptr, what, 0, _name);
633  packet.SenderGUID = guid;
634  packet.TargetGUID = guid;
635  }
636 
637  SendToAll(packet.Write(), !_playersStore[guid].IsModerator() ? guid : ObjectGuid::Empty);
638 }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
Definition: SharedDefines.h:961
void MakeMuted(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:882
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
std::string _name
Definition: Channel.h:282
void SendToOne(WorldPacket const *data, ObjectGuid const &who)
Definition: Channel.cpp:774
Definition: ChannelPackets.h:52
Definition: ChatPackets.h:150
Definition: SharedDefines.h:4248
#define sWorld
Definition: World.h:887
void MakeNotMember(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:818
WorldPacket const * Write() override
Definition: ChatPackets.cpp:162
ObjectGuid SenderGUID
Definition: ChatPackets.h:164
Language
Definition: SharedDefines.h:959
void Initialize(ChatMsg chatType, Language language, WorldObject const *sender, WorldObject const *receiver, std::string message, uint32 achievementId=0, std::string channelName="", LocaleConstant locale=DEFAULT_LOCALE, std::string addonPrefix="")
Definition: ChatPackets.cpp:104
ObjectGuid TargetGUID
Definition: ChatPackets.h:167
PlayerContainer _playersStore
Definition: Channel.h:284
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:215

+ Here is the call graph for this function:

void Channel::SendToAll ( WorldPacket const data,
ObjectGuid const guid = ObjectGuid::Empty 
)
private
759 {
760  for (PlayerContainer::value_type const& i : _playersStore)
761  if (Player* player = ObjectAccessor::FindConnectedPlayer(i.first))
762  if (guid.IsEmpty() || !player->GetSocial()->HasIgnore(guid))
763  player->SendDirectMessage(data);
764 }
PlayerContainer _playersStore
Definition: Channel.h:284
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:215

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::SendToAllButOne ( WorldPacket const data,
ObjectGuid const who 
)
private
767 {
768  for (PlayerContainer::value_type const& i : _playersStore)
769  if (i.first != who)
770  if (Player* player = ObjectAccessor::FindConnectedPlayer(i.first))
771  player->SendDirectMessage(data);
772 }
PlayerContainer _playersStore
Definition: Channel.h:284
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:215

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::SendToOne ( WorldPacket const data,
ObjectGuid const who 
)
private
775 {
776  if (Player* player = ObjectAccessor::FindConnectedPlayer(who))
777  player->SendDirectMessage(data);
778 }
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:215

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::SendWhoOwner ( Player const player)
522 {
524  if (IsOn(player->GetGUID()))
525  MakeChannelOwner(notify);
526  else
527  MakeNotMember(notify);
528  player->SendDirectMessage(notify.Write());
529 }
void MakeChannelOwner(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:851
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
Definition: ChannelPackets.h:52
void MakeNotMember(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:818
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257

+ Here is the call graph for this function:

void Channel::SetAnnounce ( bool  nannounce)
inline
178 { _announce = nannounce; }
bool _announce
Definition: Channel.h:275
void Channel::SetMode ( Player const player,
std::string const p2n,
bool  mod,
bool  set 
)
433 {
434  ObjectGuid const& guid = player->GetGUID();
435 
436  if (!IsOn(guid))
437  {
439  MakeNotMember(notify);
440  player->SendDirectMessage(notify.Write());
441  return;
442  }
443 
444  if (!_playersStore[guid].IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
445  {
447  MakeNotModerator(notify);
448  player->SendDirectMessage(notify.Write());
449  return;
450  }
451 
452  if (guid == _ownerGUID && p2n == player->GetName() && mod)
453  return;
454 
456  ObjectGuid victim = newp ? newp->GetGUID() : ObjectGuid::Empty;
457 
458  if (victim.IsEmpty() || !IsOn(victim) ||
459  (player->GetTeam() != newp->GetTeam() &&
460  (!player->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) ||
461  !newp->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL))))
462  {
464  MakePlayerNotFound(notify, p2n);
465  player->SendDirectMessage(notify.Write());
466  return;
467  }
468 
469  if (_ownerGUID == victim && _ownerGUID != guid)
470  {
472  MakeNotOwner(notify);
473  player->SendDirectMessage(notify.Write());
474  return;
475  }
476 
477  if (mod)
478  SetModerator(newp->GetGUID(), set);
479  else
480  SetMute(newp->GetGUID(), set);
481 }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
TC_GAME_API Player * FindConnectedPlayerByName(std::string const &name)
Definition: ObjectAccessor.cpp:240
Definition: ChannelPackets.h:52
void MakeNotModerator(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:823
void MakeNotMember(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:818
void SetMute(Player const *player, std::string const &newname)
Definition: Channel.h:196
void SetModerator(Player const *player, std::string const &newname)
Definition: Channel.h:194
void MakePlayerNotFound(WorldPackets::Channel::ChannelNotify &data, std::string const &name)
Definition: Channel.cpp:840
void MakeNotOwner(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:846
PlayerContainer _playersStore
Definition: Channel.h:284
Definition: ObjectGuid.h:189
ObjectGuid _ownerGUID
Definition: Channel.h:281
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

void Channel::SetModerator ( Player const player,
std::string const newname 
)
inline
194 { SetMode(player, newname, true, true); }
void SetMode(Player const *player, std::string const &p2n, bool mod, bool set)
Definition: Channel.cpp:432

+ Here is the caller graph for this function:

void Channel::SetModerator ( ObjectGuid const guid,
bool  set 
)
private
1032 {
1033  if (_playersStore[guid].IsModerator() != set)
1034  {
1035  uint8 oldFlag = _playersStore[guid].GetFlags();
1036  _playersStore[guid].SetModerator(set);
1037 
1039  MakeModeChange(data, guid, oldFlag, _playersStore[guid].GetFlags());
1040  SendToAll(data.Write());
1041  }
1042 }
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
Definition: ChannelPackets.h:52
PlayerContainer _playersStore
Definition: Channel.h:284
uint8_t uint8
Definition: Define.h:152
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
uint8 GetFlags() const
Definition: Channel.h:180
void MakeModeChange(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid, uint8 oldFlags, uint8 newFlags)
Definition: Channel.cpp:862

+ Here is the call graph for this function:

void Channel::SetMute ( Player const player,
std::string const newname 
)
inline
196 { SetMode(player, newname, false, true); }
void SetMode(Player const *player, std::string const &p2n, bool mod, bool set)
Definition: Channel.cpp:432

+ Here is the caller graph for this function:

void Channel::SetMute ( ObjectGuid const guid,
bool  set 
)
private
1045 {
1046  if (_playersStore[guid].IsMuted() != set)
1047  {
1048  uint8 oldFlag = _playersStore[guid].GetFlags();
1049  _playersStore[guid].SetMuted(set);
1050 
1052  MakeModeChange(data, guid, oldFlag, _playersStore[guid].GetFlags());
1053  SendToAll(data.Write());
1054  }
1055 }
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
Definition: ChannelPackets.h:52
PlayerContainer _playersStore
Definition: Channel.h:284
uint8_t uint8
Definition: Define.h:152
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
uint8 GetFlags() const
Definition: Channel.h:180
void MakeModeChange(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid, uint8 oldFlags, uint8 newFlags)
Definition: Channel.cpp:862

+ Here is the call graph for this function:

void Channel::SetOwner ( ObjectGuid const guid,
bool  exclaim = true 
)
700 {
701  if (!_ownerGUID.IsEmpty())
702  {
703  // [] will re-add player after it possible removed
704  PlayerContainer::iterator itr = _playersStore.find(_ownerGUID);
705  if (itr != _playersStore.end())
706  itr->second.SetOwner(false);
707  }
708 
709  _ownerGUID = guid;
710  if (!_ownerGUID.IsEmpty())
711  {
712  uint8 oldFlag = _playersStore[_ownerGUID].GetFlags();
713  _playersStore[_ownerGUID].SetModerator(true);
714  _playersStore[_ownerGUID].SetOwner(true);
715 
718  SendToAll(notify.Write());
719 
720  if (exclaim)
721  {
722  MakeOwnerChanged(notify, _ownerGUID);
723  SendToAll(notify.Write());
724  }
725 
727  }
728 }
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
void UpdateChannelInDB() const
Definition: Channel.cpp:107
Definition: ChannelPackets.h:52
PlayerContainer _playersStore
Definition: Channel.h:284
uint8_t uint8
Definition: Define.h:152
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
ObjectGuid _ownerGUID
Definition: Channel.h:281
uint8 GetFlags() const
Definition: Channel.h:180
void MakeOwnerChanged(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid)
Definition: Channel.cpp:834
bool IsEmpty() const
Definition: ObjectGuid.h:242
void MakeModeChange(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &guid, uint8 oldFlags, uint8 newFlags)
Definition: Channel.cpp:862

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::SetOwner ( Player const player,
std::string const name 
)
484 {
485  ObjectGuid const& guid = player->GetGUID();
486 
487  if (!IsOn(guid))
488  {
490  MakeNotMember(notify);
491  player->SendDirectMessage(notify.Write());
492  return;
493  }
494 
495  if (!player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR) && guid != _ownerGUID)
496  {
498  MakeNotOwner(notify);
499  player->SendDirectMessage(notify.Write());
500  return;
501  }
502 
504  ObjectGuid victim = newp ? newp->GetGUID() : ObjectGuid::Empty;
505 
506  if (!victim || !IsOn(victim) ||
507  (player->GetTeam() != newp->GetTeam() &&
508  (!player->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL) ||
509  !newp->GetSession()->HasPermission(rbac::RBAC_PERM_TWO_SIDE_INTERACTION_CHANNEL))))
510  {
512  MakePlayerNotFound(notify, newname);
513  player->SendDirectMessage(notify.Write());
514  return;
515  }
516 
517  _playersStore[victim].SetModerator(true);
518  SetOwner(victim);
519 }
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
TC_GAME_API Player * FindConnectedPlayerByName(std::string const &name)
Definition: ObjectAccessor.cpp:240
Definition: ChannelPackets.h:52
void SetOwner(ObjectGuid const &guid, bool exclaim=true)
Definition: Channel.cpp:699
void MakeNotMember(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:818
void MakePlayerNotFound(WorldPackets::Channel::ChannelNotify &data, std::string const &name)
Definition: Channel.cpp:840
void MakeNotOwner(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:846
PlayerContainer _playersStore
Definition: Channel.h:284
Definition: ObjectGuid.h:189
ObjectGuid _ownerGUID
Definition: Channel.h:281
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257

+ Here is the call graph for this function:

void Channel::SetOwnership ( bool  ownership)
inline
211 { _ownership = ownership; }
bool _ownership
Definition: Channel.h:276

+ Here is the caller graph for this function:

void Channel::SetPassword ( std::string const npassword)
inline
177 { _password = npassword; }
std::string _password
Definition: Channel.h:283
void Channel::SilenceAll ( Player const player,
std::string const name 
)
731 {
732 }
void Channel::SilenceVoice ( Player const player,
std::string const name 
)
735 {
736 }
void Channel::UnBan ( Player const player,
std::string const badname 
)
364 {
365  ObjectGuid const& good = player->GetGUID();
366 
367  if (!IsOn(good))
368  {
370  MakeNotMember(notify);
371  player->SendDirectMessage(notify.Write());
372  return;
373  }
374 
375  if (!_playersStore[good].IsModerator() && !player->GetSession()->HasPermission(rbac::RBAC_PERM_CHANGE_CHANNEL_NOT_MODERATOR))
376  {
378  MakeNotModerator(notify);
379  player->SendDirectMessage(notify.Write());
380  return;
381  }
382 
384  ObjectGuid victim = bad ? bad->GetGUID() : ObjectGuid::Empty;
385 
386  if (victim.IsEmpty() || !IsBanned(victim))
387  {
389  MakePlayerNotFound(notify, badname);
390  player->SendDirectMessage(notify.Write());
391  return;
392  }
393 
394  _bannedStore.erase(victim);
395 
397  MakePlayerUnbanned(notify, victim, good);
398  SendToAll(notify.Write());
399 
401 }
BannedContainer _bannedStore
Definition: Channel.h:285
static ObjectGuid const Empty
Definition: ObjectGuid.h:196
WorldPacket const * Write() override
Definition: ChannelPackets.cpp:38
void UpdateChannelInDB() const
Definition: Channel.cpp:107
TC_GAME_API Player * FindConnectedPlayerByName(std::string const &name)
Definition: ObjectAccessor.cpp:240
Definition: ChannelPackets.h:52
bool IsBanned(ObjectGuid const &guid) const
Definition: Channel.h:258
void MakeNotModerator(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:823
void MakeNotMember(WorldPackets::Channel::ChannelNotify &data)
Definition: Channel.cpp:818
void MakePlayerUnbanned(WorldPackets::Channel::ChannelNotify &data, ObjectGuid const &bad, ObjectGuid const &good)
Definition: Channel.cpp:906
void MakePlayerNotFound(WorldPackets::Channel::ChannelNotify &data, std::string const &name)
Definition: Channel.cpp:840
PlayerContainer _playersStore
Definition: Channel.h:284
Definition: ObjectGuid.h:189
void SendToAll(WorldPacket const *data, ObjectGuid const &guid=ObjectGuid::Empty)
Definition: Channel.cpp:758
bool IsOn(ObjectGuid const &who) const
Definition: Channel.h:257
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

void Channel::UnsetModerator ( Player const player,
std::string const newname 
)
inline
195 { SetMode(player, newname, true, false); }
void SetMode(Player const *player, std::string const &p2n, bool mod, bool set)
Definition: Channel.cpp:432
void Channel::UnsetMute ( Player const player,
std::string const newname 
)
inline
197 { SetMode(player, newname, false, false); }
void SetMode(Player const *player, std::string const &p2n, bool mod, bool set)
Definition: Channel.cpp:432
void Channel::UnsilenceAll ( Player const player,
std::string const name 
)
739 {
740 }
void Channel::UnsilenceVoice ( Player const player,
std::string const name 
)
743 {
744 }
void Channel::UpdateChannelInDB ( ) const
private
108 {
109  if (_IsSaved)
110  {
111  std::ostringstream banlist;
112  for (ObjectGuid const& guid : _bannedStore)
113  banlist << guid << ' ';
114 
116  stmt->setBool(0, _announce);
117  stmt->setBool(1, _ownership);
118  stmt->setString(2, _password);
119  stmt->setString(3, banlist.str());
120  stmt->setString(4, _name);
121  stmt->setUInt32(5, _team);
123 
124  TC_LOG_DEBUG("chat.system", "Channel (%s) updated in database", _name.c_str());
125  }
126 }
BannedContainer _bannedStore
Definition: Channel.h:285
void Execute(const char *sql)
Definition: DatabaseWorkerPool.h:87
std::string _name
Definition: Channel.h:282
void setString(const uint8 index, const std::string &value)
Definition: PreparedStatement.cpp:187
#define TC_LOG_DEBUG(filterType__,...)
Definition: Log.h:198
Definition: PreparedStatement.h:74
void setBool(const uint8 index, const bool value)
Definition: PreparedStatement.cpp:88
bool _ownership
Definition: Channel.h:276
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
std::string _password
Definition: Channel.h:283
bool _announce
Definition: Channel.h:275
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
Definition: ObjectGuid.h:189
Definition: CharacterDatabase.h:211
bool _IsSaved
Definition: Channel.h:277
uint32 _team
Definition: Channel.h:280

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::UpdateChannelUseageInDB ( ) const
private
129 {
131  stmt->setString(0, _name);
132  stmt->setUInt32(1, _team);
134 }
void Execute(const char *sql)
Definition: DatabaseWorkerPool.h:87
std::string _name
Definition: Channel.h:282
void setString(const uint8 index, const std::string &value)
Definition: PreparedStatement.cpp:187
Definition: PreparedStatement.h:74
Definition: CharacterDatabase.h:212
PreparedStatement * GetPreparedStatement(PreparedStatementIndex index)
Definition: DatabaseWorkerPool.h:263
void setUInt32(const uint8 index, const uint32 value)
Definition: PreparedStatement.cpp:115
CharacterDatabaseWorkerPool CharacterDatabase
Accessor to the character database.
Definition: DatabaseEnv.cpp:21
uint32 _team
Definition: Channel.h:280

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void Channel::Voice ( Player const player)
751 {
752 }

Member Data Documentation

bool Channel::_announce
private
BannedContainer Channel::_bannedStore
private
uint32 Channel::_channelId
private
uint8 Channel::_flags
private
bool Channel::_IsSaved
private
std::string Channel::_name
private
ObjectGuid Channel::_ownerGUID
private
bool Channel::_ownership
private
std::string Channel::_password
private
PlayerContainer Channel::_playersStore
private
uint32 Channel::_team
private

The documentation for this class was generated from the following files: