25#include <unordered_set>
161 bool _invisible =
false;
166 Channel(std::string
const& name,
uint32 team, std::string
const& banList =
"");
187 void UpdateChannelInDB();
189 void SetPassword(std::string
const& password) { _channelPassword = password; }
190 bool CheckPassword(std::string
const& password)
const {
return _channelPassword.empty() || (_channelPassword == password); }
199 void JoinChannel(
Player* player, std::string
const& pass =
"");
200 void LeaveChannel(
Player* player,
bool send =
true,
bool suspend =
false);
202 void KickOrBan(
Player const* player, std::string
const& badname,
bool ban);
203 void Kick(
Player const* player, std::string
const& badname) { KickOrBan(player, badname,
false); }
204 void Ban(
Player const* player, std::string
const& badname) { KickOrBan(player, badname,
true); }
206 void UnBan(
Player const* player, std::string
const& badname);
207 void Password(
Player const* player, std::string
const& pass);
208 void SetMode(
Player const* player, std::string
const& p2n,
bool mod,
bool set);
210 void SetInvisible(
Player const* player,
bool on);
212 void SetOwner(
ObjectGuid const& guid,
bool exclaim =
true);
213 void SetOwner(
Player const* player, std::string
const& name);
214 void SendWhoOwner(
Player const* player);
216 void SetModerator(
Player const* player, std::string
const& newname) { SetMode(player, newname,
true,
true); }
217 void UnsetModerator(
Player const* player, std::string
const& newname) { SetMode(player, newname,
true,
false); }
218 void SetMute(
Player const* player, std::string
const& newname) { SetMode(player, newname,
false,
true); }
219 void UnsetMute(
Player const* player, std::string
const& newname) { SetMode(player, newname,
false,
false); }
220 void SilenceAll(
Player const* player, std::string
const& name);
221 void SilenceVoice(
Player const* player, std::string
const& name);
222 void UnsilenceAll(
Player const* player, std::string
const& name);
223 void UnsilenceVoice(
Player const* player, std::string
const& name);
224 void List(
Player const* player)
const;
225 void Announce(
Player const* player);
227 void DeclineInvite(
Player const* player);
228 void Invite(
Player const* player, std::string
const& newp);
229 void JoinNotify(
ObjectGuid const& guid)
const;
230 void LeaveNotify(
ObjectGuid const& guid)
const;
232 void SendMemberCount(
Player const* player)
const;
233 void VoiceOn(
Player const* player);
234 void VoiceOff(
Player const* player);
237 template <
class Builder>
240 template <
class Builder>
241 void SendToAllButOne(Builder& builder,
ObjectGuid const& who)
const;
243 template <
class Builder>
244 void SendToOne(Builder& builder,
ObjectGuid const& who)
const;
246 bool IsOn(
ObjectGuid who)
const {
return _playersStore.find(who) != _playersStore.end(); }
251 PlayerContainer::const_iterator itr = _playersStore.find(guid);
252 return itr != _playersStore.end() ? itr->second.GetFlags() : 0;
255 void SetModerator(
ObjectGuid const& guid,
bool set);
256 void SetMute(
ObjectGuid const& guid,
bool set);
@ CHANNEL_DBC_FLAG_CITY_ONLY
@ CHANNEL_DBC_FLAG_GUILD_REQ
@ CHANNEL_DBC_FLAG_ZONE_DEP
@ CHANNEL_DBC_FLAG_GLOBAL
@ CHANNEL_DBC_FLAG_CITY_ONLY2
@ CHANNEL_DBC_FLAG_DEFENSE
@ CHANNEL_DBC_FLAG_INITIAL
@ CHAT_MODERATION_OFF_NOTICE
@ CHAT_WRONG_FACTION_NOTICE
@ CHAT_NOT_MODERATOR_NOTICE
@ CHAT_PLAYER_UNBANNED_NOTICE
@ CHAT_PLAYER_NOT_FOUND_NOTICE
@ CHAT_PLAYER_NOT_BANNED_NOTICE
@ CHAT_PLAYER_INVITED_NOTICE
@ CHAT_PLAYER_KICKED_NOTICE
@ CHAT_MODE_CHANGE_NOTICE
@ CHAT_ANNOUNCEMENTS_ON_NOTICE
@ CHAT_INVITE_WRONG_FACTION_NOTICE
@ CHAT_PLAYER_BANNED_NOTICE
@ CHAT_PLAYER_ALREADY_MEMBER_NOTICE
@ CHAT_OWNER_CHANGED_NOTICE
@ CHAT_ANNOUNCEMENTS_OFF_NOTICE
@ CHAT_NOT_IN_AREA_NOTICE
@ CHAT_NOT_MODERATED_NOTICE
@ CHAT_CHANNEL_OWNER_NOTICE
@ CHAT_WRONG_PASSWORD_NOTICE
@ CHAT_PLAYER_INVITE_BANNED_NOTICE
@ CHAT_PASSWORD_CHANGED_NOTICE
@ CHAT_INVALID_NAME_NOTICE
@ CHAT_MODERATION_ON_NOTICE
std::unordered_set< ObjectGuid > GuidUnorderedSet
BannedContainer _bannedStore
GuidUnorderedSet BannedContainer
Channel(Channel const &)=delete
bool HasFlag(uint8 flag) const
time_t _nextActivityUpdateTime
void SetMute(Player const *player, std::string const &newname)
void SetModerator(Player const *player, std::string const &newname)
void Ban(Player const *player, std::string const &badname)
void UnsetMute(Player const *player, std::string const &newname)
uint32 GetChannelId() const
bool CheckPassword(std::string const &password) const
bool IsOn(ObjectGuid who) const
void UnsetModerator(Player const *player, std::string const &newname)
void SetPassword(std::string const &password)
uint8 GetPlayerFlags(ObjectGuid const &guid) const
void Kick(Player const *player, std::string const &badname)
Channel(Channel &&)=delete
Channel & operator=(Channel &&)=delete
void SetAnnounce(bool announce)
void SetOwnership(bool ownership)
uint32 GetNumPlayers() const
bool IsBanned(ObjectGuid guid) const
AreaTableEntry const * _zoneEntry
std::string _channelPassword
std::map< ObjectGuid, PlayerInfo > PlayerContainer
PlayerContainer _playersStore
Channel & operator=(Channel const &)=delete
AreaTableEntry const * GetZoneEntry() const
static ObjectGuid const Empty
void SetModerator(bool state)
bool HasFlag(uint8 flag) const
void SetInvisible(bool on)
void SetOwner(bool state)
void SetMuted(bool state)
void RemoveFlag(uint8 flag)