25#include <unordered_set>
136 else flags &= ~MEMBER_FLAG_OWNER;
143 else flags &= ~MEMBER_FLAG_MODERATOR;
150 else flags &= ~MEMBER_FLAG_MUTED;
156 Channel(std::string
const& name,
uint32 team, std::string
const& banList =
"");
177 void UpdateChannelInDB();
179 void SetPassword(std::string
const& password) { _channelPassword = password; }
180 bool CheckPassword(std::string
const& password)
const {
return _channelPassword.empty() || (_channelPassword == password); }
189 void JoinChannel(
Player* player, std::string
const& pass =
"");
190 void LeaveChannel(
Player* player,
bool send =
true);
192 void KickOrBan(
Player const* player, std::string
const& badname,
bool ban);
193 void Kick(
Player const* player, std::string
const& badname) { KickOrBan(player, badname,
false); }
194 void Ban(
Player const* player, std::string
const& badname) { KickOrBan(player, badname,
true); }
196 void UnBan(
Player const* player, std::string
const& badname);
197 void Password(
Player const* player, std::string
const& pass);
198 void SetMode(
Player const* player, std::string
const& p2n,
bool mod,
bool set);
200 void SetModerator(
Player const* player, std::string
const& newname) { SetMode(player, newname,
true,
true); }
201 void UnsetModerator(
Player const* player, std::string
const& newname) { SetMode(player, newname,
true,
false); }
202 void SetMute(
Player const* player, std::string
const& newname) { SetMode(player, newname,
false,
true); }
203 void UnsetMute(
Player const* player, std::string
const& newname) { SetMode(player, newname,
false,
false); }
205 void SetInvisible(
Player const* player,
bool on);
207 void SetOwner(
ObjectGuid guid,
bool exclaim =
true);
208 void SetOwner(
Player const* player, std::string
const& name);
211 void List(
Player const* player)
const;
212 void Announce(
Player const* player);
214 void Invite(
Player const* player, std::string
const& newp);
223 template<
class Builder>
226 template<
class Builder>
227 void SendToAllButOne(Builder& builder,
ObjectGuid who)
const;
229 template<
class Builder>
230 void SendToOne(Builder& builder,
ObjectGuid who)
const;
232 bool IsOn(
ObjectGuid who)
const {
return _playersStore.find(who) != _playersStore.end(); }
237 PlayerContainer::const_iterator itr = _playersStore.find(guid);
238 return itr != _playersStore.end() ? itr->second.flags : 0;
@ 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)
void Kick(Player const *player, std::string const &badname)
Channel(Channel &&)=delete
Channel & operator=(Channel &&)=delete
void SetAnnounce(bool announce)
void SetOwnership(bool ownership)
uint8 GetPlayerFlags(ObjectGuid guid) const
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)