Core/Channels: Don't send channel kick/ban notifications if kicker is GM and Channel.SilentlyGMJoin == 1. (Aokromes' Suggestions)--;

This commit is contained in:
Machiavelli
2011-12-14 13:53:47 +01:00
parent 203d4a4952
commit 8ca9b38fee
2 changed files with 10 additions and 5 deletions
+8 -4
View File
@@ -310,18 +310,22 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
bool changeowner = (m_ownerGUID == bad->GetGUID()); bool changeowner = (m_ownerGUID == bad->GetGUID());
WorldPacket data; WorldPacket data;
bool notify = !(AccountMgr::IsGMAccount(sec) && sWorld->getBoolConfig(CONFIG_SILENTLY_GM_JOIN_TO_CHANNEL));
if (ban && !IsBanned(bad->GetGUID())) if (ban && !IsBanned(bad->GetGUID()))
{ {
banned.insert(bad->GetGUID()); banned.insert(bad->GetGUID());
MakePlayerBanned(&data, bad->GetGUID(), good);
UpdateChannelInDB(); UpdateChannelInDB();
if (notify)
MakePlayerBanned(&data, bad->GetGUID(), good);
} }
else else if (notify)
MakePlayerKicked(&data, bad->GetGUID(), good); MakePlayerKicked(&data, bad->GetGUID(), good);
SendToAll(&data); if (notify)
SendToAll(&data);
players.erase(bad->GetGUID()); players.erase(bad->GetGUID());
bad->LeftChannel(this); bad->LeftChannel(this);
+2 -1
View File
@@ -1744,7 +1744,8 @@ Channel.RestrictedLfg = 1
# #
# Channel.SilentlyGMJoin # Channel.SilentlyGMJoin
# Description: Silently join GM characters to channels # Description: Silently join GM characters to channels. If set to 1, channel kick and ban
# commands issued by a GM will not be broadcasted.
# Default: 0 - (Disabled, Join with announcement) # Default: 0 - (Disabled, Join with announcement)
# 1 - (Enabled, Join without announcement) # 1 - (Enabled, Join without announcement)