Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
Channel Class Reference

#include <Channel.h>

Classes

struct  PlayerInfo

Public Member Functions

void Announce (Player const *player)
void Ban (Player const *player, std::string const &badname)
 Channel (std::string const &name, uint32 channel_id, uint32 TeamTeam=0)
void DeVoice (uint64 guid1, uint64 guid2)
uint32 GetChannelId () const
uint8 GetFlags () const
std::string const & GetName () const
uint32 GetNumPlayers () const
std::string const & GetPassword () const
bool HasFlag (uint8 flag) const
void Invite (Player const *player, std::string const &newp)
bool IsAnnounce () const
bool IsConstant () const
bool IsLFG () const
void JoinChannel (Player *player, std::string const &pass)
void JoinNotify (ObjectGuid UserGUID, uint32 ChannelID, uint8 ChannelFlagsChannelFlags, uint8 UserFlags, std::string const &ChannelName)
void Kick (Player const *player, std::string const &badname)
void KickOrBan (Player const *player, std::string const &badname, bool ban)
void LeaveChannel (Player *player, bool send=true)
void LeaveNotify (ObjectGuid UserGUID, uint32 ChannelID, uint8 ChannelFlagsChannelFlags, std::string const &ChannelName)
void List (Player const *player)
void Password (Player const *player, std::string const &pass)
void Say (uint64 guid, std::string const &what, Language lang)
void SendWhoOwner (uint64 guid)
void SetAnnounce (bool nannounce)
void SetMode (Player const *player, std::string const &p2n, bool mod, bool set)
void SetModerator (Player const *player, std::string const &newname)
void SetMute (Player const *player, std::string const &newname)
void SetOwner (Player const *player, std::string const &name)
void SetOwner (uint64 guid, bool exclaim=true)
void SetOwnership (bool ownership)
void SetPassword (std::string const &npassword)
void UnBan (Player const *player, std::string const &badname)
void UnsetModerator (Player const *player, std::string const &newname)
void UnsetMute (Player const *player, std::string const &newname)
void Voice (uint64 guid1, uint64 guid2)

Static Public Member Functions

static void CleanOldChannelsInDB ()

Private Types

typedef std::set< uint64BannedContainer
typedef std::map< uint64, PlayerInfoPlayerContainer

Private Member Functions

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

Private Attributes

bool _announce
uint32 _channelId
uint8 _flags
bool _IsSaved
std::string _name
uint64 _ownerGUID
bool _ownership
std::string _password
uint32 _Team
BannedContainer bannedStore
PlayerContainer playersStore

Detailed Description

Definition at line 106 of file Channel.h.

Member Typedef Documentation

◆ BannedContainer

typedef std::set<uint64> Channel::BannedContainer
private

Definition at line 258 of file Channel.h.

◆ PlayerContainer

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

Definition at line 257 of file Channel.h.

Constructor & Destructor Documentation

◆ Channel()

Channel::Channel ( std::string const & name,
uint32 channel_id,
uint32 Team = 0 )

Member Function Documentation

◆ Announce()

◆ Ban()

void Channel::Ban ( Player const * player,
std::string const & badname )
inline

Definition at line 154 of file Channel.h.

References KickOrBan().

◆ CleanOldChannelsInDB()

void Channel::CleanOldChannelsInDB ( )
static

◆ DeVoice()

void Channel::DeVoice ( uint64 guid1,
uint64 guid2 )

Definition at line 739 of file Channel.cpp.

◆ GetChannelId()

uint32 Channel::GetChannelId ( ) const
inline

Definition at line 139 of file Channel.h.

References _channelId.

Referenced by JoinChannel(), LeaveChannel(), MakeYouJoined(), MakeYouLeft(), and HookMgr::OnChat().

◆ GetFlags()

uint8 Channel::GetFlags ( ) const
inline

Definition at line 147 of file Channel.h.

References _flags.

Referenced by IsLFG(), JoinChannel(), LeaveChannel(), List(), and MakeYouJoined().

◆ GetName()

std::string const & Channel::GetName ( ) const
inline

◆ GetNumPlayers()

uint32 Channel::GetNumPlayers ( ) const
inline

Definition at line 146 of file Channel.h.

References playersStore.

Referenced by ChannelMgr::LeftChannel().

◆ GetPassword()

std::string const & Channel::GetPassword ( ) const
inline

Definition at line 143 of file Channel.h.

References _password.

◆ GetPlayerFlags()

uint8 Channel::GetPlayerFlags ( uint64 guid) const
inlineprivate

Definition at line 225 of file Channel.h.

References playersStore.

Referenced by JoinChannel(), MakeModeChange(), SetModerator(), SetMute(), and SetOwner().

◆ HasFlag()

bool Channel::HasFlag ( uint8 flag) const
inline

Definition at line 148 of file Channel.h.

References _flags.

Referenced by JoinChannel(), and ChatLogScript::OnChat().

◆ Invite()

◆ IsAnnounce()

bool Channel::IsAnnounce ( ) const
inline

Definition at line 141 of file Channel.h.

References _announce.

◆ IsBanned()

bool Channel::IsBanned ( uint64 guid) const
inlineprivate

Definition at line 220 of file Channel.h.

References bannedStore.

Referenced by Invite(), JoinChannel(), KickOrBan(), and UnBan().

◆ IsConstant()

bool Channel::IsConstant ( ) const
inline

◆ IsLFG()

bool Channel::IsLFG ( ) const
inline

Definition at line 142 of file Channel.h.

References CHANNEL_FLAG_LFG, and GetFlags().

◆ IsOn()

bool Channel::IsOn ( uint64 who) const
inlineprivate

◆ JoinChannel()

◆ JoinNotify()

void Channel::JoinNotify ( ObjectGuid UserGUID,
uint32 ChannelID,
uint8 ChannelFlags,
uint8 UserFlags,
std::string const & ChannelName )

◆ Kick()

void Channel::Kick ( Player const * player,
std::string const & badname )
inline

Definition at line 153 of file Channel.h.

References KickOrBan().

◆ KickOrBan()

◆ LeaveChannel()

◆ LeaveNotify()

void Channel::LeaveNotify ( ObjectGuid UserGUID,
uint32 ChannelID,
uint8 ChannelFlags,
std::string const & ChannelName )

◆ List()

◆ MakeAnnouncementsOff()

void Channel::MakeAnnouncementsOff ( WorldPacket * data,
uint64 guid )
private

Definition at line 838 of file Channel.cpp.

References CHAT_ANNOUNCEMENTS_OFF_NOTICE, and MakeNotifyPacket().

Referenced by Announce().

◆ MakeAnnouncementsOn()

void Channel::MakeAnnouncementsOn ( WorldPacket * data,
uint64 guid )
private

Definition at line 832 of file Channel.cpp.

References CHAT_ANNOUNCEMENTS_ON_NOTICE, and MakeNotifyPacket().

Referenced by Announce().

◆ MakeBanned()

void Channel::MakeBanned ( WorldPacket * data)
private

Definition at line 856 of file Channel.cpp.

References CHAT_BANNED_NOTICE, and MakeNotifyPacket().

Referenced by JoinChannel().

◆ MakeChannelOwner()

void Channel::MakeChannelOwner ( WorldPacket * data)
private

Definition at line 813 of file Channel.cpp.

References _ownerGUID, CHAT_CHANNEL_OWNER_NOTICE, IsConstant(), MakeNotifyPacket(), and sObjectMgr.

Referenced by SendWhoOwner().

◆ MakeInvalidName()

void Channel::MakeInvalidName ( WorldPacket * data)
private

Definition at line 903 of file Channel.cpp.

References CHAT_INVALID_NAME_NOTICE, and MakeNotifyPacket().

◆ MakeInvite()

void Channel::MakeInvite ( WorldPacket * data,
uint64 guid )
private

Definition at line 887 of file Channel.cpp.

References CHAT_INVITE_NOTICE, and MakeNotifyPacket().

Referenced by Invite().

◆ MakeInviteWrongFaction()

void Channel::MakeInviteWrongFaction ( WorldPacket * data)
private

Definition at line 893 of file Channel.cpp.

References CHAT_INVITE_WRONG_FACTION_NOTICE, and MakeNotifyPacket().

Referenced by Invite().

◆ MakeJoined()

void Channel::MakeJoined ( WorldPacket * data,
uint64 guid )
private

Definition at line 748 of file Channel.cpp.

References CHAT_JOINED_NOTICE, and MakeNotifyPacket().

Referenced by JoinChannel().

◆ MakeLeft()

void Channel::MakeLeft ( WorldPacket * data,
uint64 guid )
private

Definition at line 754 of file Channel.cpp.

References CHAT_LEFT_NOTICE, and MakeNotifyPacket().

Referenced by LeaveChannel().

◆ MakeModeChange()

void Channel::MakeModeChange ( WorldPacket * data,
uint64 guid,
uint8 oldflags )
private

Definition at line 824 of file Channel.cpp.

References CHAT_MODE_CHANGE_NOTICE, GetPlayerFlags(), and MakeNotifyPacket().

Referenced by SetModerator(), SetMute(), and SetOwner().

◆ MakeMuted()

void Channel::MakeMuted ( WorldPacket * data)
private

Definition at line 844 of file Channel.cpp.

References CHAT_MUTED_NOTICE, and MakeNotifyPacket().

Referenced by Say().

◆ MakeNotifyPacket()

◆ MakeNotInArea()

void Channel::MakeNotInArea ( WorldPacket * data)
private

Definition at line 930 of file Channel.cpp.

References CHAT_NOT_IN_AREA_NOTICE, and MakeNotifyPacket().

◆ MakeNotInLfg()

void Channel::MakeNotInLfg ( WorldPacket * data)
private

Definition at line 935 of file Channel.cpp.

References CHAT_NOT_IN_LFG_NOTICE, and MakeNotifyPacket().

Referenced by JoinChannel().

◆ MakeNotMember()

void Channel::MakeNotMember ( WorldPacket * data)
private

◆ MakeNotModerated()

void Channel::MakeNotModerated ( WorldPacket * data)
private

Definition at line 908 of file Channel.cpp.

References CHAT_NOT_MODERATED_NOTICE, and MakeNotifyPacket().

◆ MakeNotModerator()

void Channel::MakeNotModerator ( WorldPacket * data)
private

Definition at line 785 of file Channel.cpp.

References CHAT_NOT_MODERATOR_NOTICE, and MakeNotifyPacket().

Referenced by Announce(), KickOrBan(), Password(), SetMode(), and UnBan().

◆ MakeNotOwner()

void Channel::MakeNotOwner ( WorldPacket * data)
private

Definition at line 808 of file Channel.cpp.

References CHAT_NOT_OWNER_NOTICE, and MakeNotifyPacket().

Referenced by KickOrBan(), SetMode(), and SetOwner().

◆ MakeOwnerChanged()

void Channel::MakeOwnerChanged ( WorldPacket * data,
uint64 guid )
private

Definition at line 796 of file Channel.cpp.

References CHAT_OWNER_CHANGED_NOTICE, and MakeNotifyPacket().

Referenced by SetOwner().

◆ MakePasswordChanged()

void Channel::MakePasswordChanged ( WorldPacket * data,
uint64 guid )
private

Definition at line 790 of file Channel.cpp.

References CHAT_PASSWORD_CHANGED_NOTICE, and MakeNotifyPacket().

Referenced by Password().

◆ MakePlayerAlreadyMember()

void Channel::MakePlayerAlreadyMember ( WorldPacket * data,
uint64 guid )
private

Definition at line 881 of file Channel.cpp.

References CHAT_PLAYER_ALREADY_MEMBER_NOTICE, and MakeNotifyPacket().

Referenced by Invite(), and JoinChannel().

◆ MakePlayerBanned()

void Channel::MakePlayerBanned ( WorldPacket * data,
uint64 bad,
uint64 good )
private

Definition at line 861 of file Channel.cpp.

References CHAT_PLAYER_BANNED_NOTICE, and MakeNotifyPacket().

Referenced by KickOrBan().

◆ MakePlayerInviteBanned()

void Channel::MakePlayerInviteBanned ( WorldPacket * data,
std::string const & name )
private

Definition at line 919 of file Channel.cpp.

References CHAT_PLAYER_INVITE_BANNED_NOTICE, and MakeNotifyPacket().

Referenced by Invite().

◆ MakePlayerInvited()

void Channel::MakePlayerInvited ( WorldPacket * data,
std::string const & name )
private

Definition at line 913 of file Channel.cpp.

References CHAT_PLAYER_INVITED_NOTICE, and MakeNotifyPacket().

Referenced by Invite().

◆ MakePlayerKicked()

void Channel::MakePlayerKicked ( WorldPacket * data,
uint64 bad,
uint64 good )
private

Definition at line 849 of file Channel.cpp.

References CHAT_PLAYER_KICKED_NOTICE, and MakeNotifyPacket().

Referenced by KickOrBan().

◆ MakePlayerNotBanned()

void Channel::MakePlayerNotBanned ( WorldPacket * data,
std::string const & name )
private

Definition at line 875 of file Channel.cpp.

References CHAT_PLAYER_NOT_BANNED_NOTICE, and MakeNotifyPacket().

◆ MakePlayerNotFound()

void Channel::MakePlayerNotFound ( WorldPacket * data,
std::string const & name )
private

Definition at line 802 of file Channel.cpp.

References CHAT_PLAYER_NOT_FOUND_NOTICE, and MakeNotifyPacket().

Referenced by Invite(), KickOrBan(), SetMode(), SetOwner(), and UnBan().

◆ MakePlayerUnbanned()

void Channel::MakePlayerUnbanned ( WorldPacket * data,
uint64 bad,
uint64 good )
private

Definition at line 868 of file Channel.cpp.

References CHAT_PLAYER_UNBANNED_NOTICE, and MakeNotifyPacket().

Referenced by UnBan().

◆ MakeThrottled()

void Channel::MakeThrottled ( WorldPacket * data)
private

Definition at line 925 of file Channel.cpp.

References CHAT_THROTTLED_NOTICE, and MakeNotifyPacket().

◆ MakeVoiceOff()

void Channel::MakeVoiceOff ( WorldPacket * data,
uint64 guid )
private

Definition at line 946 of file Channel.cpp.

References CHAT_VOICE_OFF_NOTICE, and MakeNotifyPacket().

◆ MakeVoiceOn()

void Channel::MakeVoiceOn ( WorldPacket * data,
uint64 guid )
private

Definition at line 940 of file Channel.cpp.

References CHAT_VOICE_ON_NOTICE, and MakeNotifyPacket().

◆ MakeWrongFaction()

void Channel::MakeWrongFaction ( WorldPacket * data)
private

Definition at line 898 of file Channel.cpp.

References CHAT_WRONG_FACTION_NOTICE, and MakeNotifyPacket().

◆ MakeWrongPassword()

void Channel::MakeWrongPassword ( WorldPacket * data)
private

Definition at line 775 of file Channel.cpp.

References CHAT_WRONG_PASSWORD_NOTICE, and MakeNotifyPacket().

Referenced by JoinChannel().

◆ MakeYouJoined()

void Channel::MakeYouJoined ( WorldPacket * data)
private

Definition at line 760 of file Channel.cpp.

References CHAT_YOU_JOINED_NOTICE, GetChannelId(), GetFlags(), and MakeNotifyPacket().

Referenced by JoinChannel().

◆ MakeYouLeft()

void Channel::MakeYouLeft ( WorldPacket * data)
private

Definition at line 768 of file Channel.cpp.

References CHAT_YOU_LEFT_NOTICE, GetChannelId(), IsConstant(), and MakeNotifyPacket().

Referenced by LeaveChannel().

◆ Password()

◆ Say()

◆ SendToAll()

void Channel::SendToAll ( WorldPacket * data,
uint64 guid = 0 )
private

◆ SendToAllButOne()

void Channel::SendToAllButOne ( WorldPacket * data,
uint64 who )
private

Definition at line 723 of file Channel.cpp.

References ObjectAccessor::FindPlayer(), and playersStore.

Referenced by JoinNotify(), and LeaveNotify().

◆ SendToOne()

void Channel::SendToOne ( WorldPacket * data,
uint64 who )
private

◆ SendWhoOwner()

void Channel::SendWhoOwner ( uint64 guid)

Definition at line 495 of file Channel.cpp.

References IsOn(), MakeChannelOwner(), MakeNotMember(), and SendToOne().

◆ SetAnnounce()

void Channel::SetAnnounce ( bool nannounce)
inline

Definition at line 145 of file Channel.h.

References _announce.

◆ SetMode()

◆ SetModerator() [1/2]

void Channel::SetModerator ( Player const * player,
std::string const & newname )
inline

Definition at line 161 of file Channel.h.

References SetMode().

Referenced by SetMode().

◆ SetModerator() [2/2]

void Channel::SetModerator ( uint64 guid,
bool set )
inlineprivate

Definition at line 231 of file Channel.h.

References GetPlayerFlags(), MakeModeChange(), playersStore, and SendToAll().

◆ SetMute() [1/2]

void Channel::SetMute ( Player const * player,
std::string const & newname )
inline

Definition at line 163 of file Channel.h.

References SetMode().

Referenced by SetMode().

◆ SetMute() [2/2]

void Channel::SetMute ( uint64 guid,
bool set )
inlineprivate

Definition at line 244 of file Channel.h.

References GetPlayerFlags(), MakeModeChange(), playersStore, and SendToAll().

◆ SetOwner() [1/2]

◆ SetOwner() [2/2]

void Channel::SetOwner ( uint64 guid,
bool exclaim = true )

◆ SetOwnership()

void Channel::SetOwnership ( bool ownership)
inline

Definition at line 173 of file Channel.h.

References _ownership.

Referenced by message_commandscript::HandleChannelSetOwnership().

◆ SetPassword()

void Channel::SetPassword ( std::string const & npassword)
inline

Definition at line 144 of file Channel.h.

References _password.

◆ UnBan()

◆ UnsetModerator()

void Channel::UnsetModerator ( Player const * player,
std::string const & newname )
inline

Definition at line 162 of file Channel.h.

References SetMode().

◆ UnsetMute()

void Channel::UnsetMute ( Player const * player,
std::string const & newname )
inline

Definition at line 164 of file Channel.h.

References SetMode().

◆ UpdateChannelInDB()

◆ UpdateChannelUseageInDB()

void Channel::UpdateChannelUseageInDB ( ) const
private

◆ Voice()

void Channel::Voice ( uint64 guid1,
uint64 guid2 )

Definition at line 737 of file Channel.cpp.

Member Data Documentation

◆ _announce

bool Channel::_announce
private

◆ _channelId

uint32 Channel::_channelId
private

Definition at line 264 of file Channel.h.

Referenced by Channel(), GetChannelId(), and IsConstant().

◆ _flags

uint8 Channel::_flags
private

Definition at line 263 of file Channel.h.

Referenced by Channel(), GetFlags(), and HasFlag().

◆ _IsSaved

bool Channel::_IsSaved
private

Definition at line 262 of file Channel.h.

Referenced by Channel(), and UpdateChannelInDB().

◆ _name

std::string Channel::_name
private

◆ _ownerGUID

uint64 Channel::_ownerGUID
private

Definition at line 266 of file Channel.h.

Referenced by Channel(), JoinChannel(), KickOrBan(), MakeChannelOwner(), SetMode(), SetOwner(), and SetOwner().

◆ _ownership

bool Channel::_ownership
private

◆ _password

std::string Channel::_password
private

Definition at line 268 of file Channel.h.

Referenced by Channel(), GetPassword(), JoinChannel(), Password(), SetPassword(), and UpdateChannelInDB().

◆ _Team

uint32 Channel::_Team
private

Definition at line 265 of file Channel.h.

Referenced by Channel(), UpdateChannelInDB(), and UpdateChannelUseageInDB().

◆ bannedStore

BannedContainer Channel::bannedStore
private

Definition at line 270 of file Channel.h.

Referenced by IsBanned(), KickOrBan(), UnBan(), and UpdateChannelInDB().

◆ playersStore


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