25#include <unordered_set>
157 bool _invisible =
false;
186 void UpdateChannelInDB();
188 void SetPassword(std::string
const& password) { _channelPassword = password; }
189 bool CheckPassword(std::string
const& password)
const {
return _channelPassword.empty() || (_channelPassword == password); }
198 void JoinChannel(
Player* player, std::string
const& pass =
"");
199 void LeaveChannel(
Player* player,
bool send =
true,
bool suspend =
false);
201 void KickOrBan(
Player const* player, std::string
const& badname,
bool ban);
202 void Kick(
Player const* player, std::string
const& badname) { KickOrBan(player, badname,
false); }
203 void Ban(
Player const* player, std::string
const& badname) { KickOrBan(player, badname,
true); }
205 void UnBan(
Player const* player, std::string
const& badname);
206 void Password(
Player const* player, std::string
const& pass);
207 void SetMode(
Player const* player, std::string
const& p2n,
bool mod,
bool set);
209 void SetInvisible(
Player const* player,
bool on);
211 void SetOwner(
ObjectGuid const& guid,
bool exclaim =
true);
212 void SetOwner(
Player const* player, std::string
const& name);
213 void SendWhoOwner(
Player const* player);
215 void SetModerator(
Player const* player, std::string
const& newname) { SetMode(player, newname,
true,
true); }
216 void UnsetModerator(
Player const* player, std::string
const& newname) { SetMode(player, newname,
true,
false); }
217 void SetMute(
Player const* player, std::string
const& newname) { SetMode(player, newname,
false,
true); }
218 void UnsetMute(
Player const* player, std::string
const& newname) { SetMode(player, newname,
false,
false); }
219 void SilenceAll(
Player const* player, std::string
const& name);
220 void UnsilenceAll(
Player const* player, std::string
const& name);
221 void List(
Player const* player);
222 void Announce(
Player const* player);
224 void AddonSay(
ObjectGuid const& guid, std::string
const& prefix, std::string
const& what,
bool isLogged)
const;
225 void DeclineInvite(
Player const* player);
226 void Invite(
Player const* player, std::string
const& newp);
227 void JoinNotify(
Player const* player);
228 void LeaveNotify(
Player const* player);
232 template <
class Builder>
235 template <
class Builder>
236 void SendToAllButOne(Builder& builder,
ObjectGuid const& who)
const;
238 template <
class Builder>
239 void SendToOne(Builder& builder,
ObjectGuid const& who)
const;
241 template <
class Builder>
244 bool IsOn(
ObjectGuid who)
const {
return _playersStore.find(who) != _playersStore.end(); }
249 PlayerContainer::const_iterator itr = _playersStore.find(guid);
250 return itr != _playersStore.end() ? itr->second.GetFlags() : 0;
253 void SetModerator(
ObjectGuid const& guid,
bool set);
254 void SetMute(
ObjectGuid const& guid,
bool set);
@ 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_NOT_ALLOWED_IN_CHANNEL
@ CHAT_VOICE_ON_NO_ANNOUNCE_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
ObjectGuid GetGUID() const
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)