aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/game/Channel.cpp5
-rw-r--r--src/game/Level0.cpp5
-rw-r--r--src/game/MiscHandler.cpp4
-rw-r--r--src/game/SocialMgr.cpp20
-rw-r--r--src/game/World.cpp5
-rw-r--r--src/game/World.h4
-rw-r--r--src/trinitycore/trinitycore.conf.dist26
7 files changed, 37 insertions, 32 deletions
diff --git a/src/game/Channel.cpp b/src/game/Channel.cpp
index a247abe19ee..16b084f8127 100644
--- a/src/game/Channel.cpp
+++ b/src/game/Channel.cpp
@@ -539,7 +539,7 @@ void Channel::List(Player* player)
size_t pos = data.wpos();
data << uint32(0); // size of list, placeholder
- bool gmInWhoList = sWorld.getConfig(CONFIG_GM_IN_WHO_LIST) || player->GetSession()->GetSecurity() > SEC_PLAYER;
+ uint32 gmLevelInWhoList = sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
uint32 count = 0;
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
@@ -548,7 +548,8 @@ void Channel::List(Player* player)
// PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
- if (plr && ( plr->GetSession()->GetSecurity() == SEC_PLAYER || (gmInWhoList && plr->IsVisibleGloballyFor(player))))
+ if (plr && (player->GetSession()->GetSecurity() > SEC_PLAYER || plr->GetSession()->GetSecurity() <= gmLevelInWhoList) &&
+ plr->IsVisibleGloballyFor(player))
{
data << uint64(i->first);
data << uint8(i->second.flags); // flags seems to be changed...
diff --git a/src/game/Level0.cpp b/src/game/Level0.cpp
index f5fd5ec2626..ec3198b4213 100644
--- a/src/game/Level0.cpp
+++ b/src/game/Level0.cpp
@@ -163,9 +163,8 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
HashMapHolder<Player>::MapType::const_iterator itr = m.begin();
for(; itr != m.end(); ++itr)
{
- if (itr->second->GetSession()->GetSecurity() > SEC_PLAYER &&
- (itr->second->isGameMaster() || sWorld.getConfig(CONFIG_GM_IN_GM_LIST)) &&
- (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())) )
+ if ((itr->second->isGameMaster() || itr->second->GetSession()->GetSecurity() <= sWorld.getConfig(CONFIG_GM_LEVEL_IN_GM_LIST)) &&
+ (!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())))
{
if(first)
{
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp
index cb9b3adf7bb..aeec27ced32 100644
--- a/src/game/MiscHandler.cpp
+++ b/src/game/MiscHandler.cpp
@@ -231,7 +231,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
uint32 team = _player->GetTeam();
uint32 security = GetSecurity();
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
- bool gmInWhoList = sWorld.getConfig(CONFIG_GM_IN_WHO_LIST);
+ uint32 gmLevelInWhoList = sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
WorldPacket data( SMSG_WHO, 50 ); // guess size
data << clientcount; // clientcount place holder
@@ -248,7 +248,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
continue;
// player can see MODERATOR, GAME MASTER, ADMINISTRATOR only if CONFIG_GM_IN_WHO_LIST
- if ((itr->second->GetSession()->GetSecurity() > SEC_PLAYER && !gmInWhoList))
+ if ((itr->second->GetSession()->GetSecurity() > gmLevelInWhoList))
continue;
}
diff --git a/src/game/SocialMgr.cpp b/src/game/SocialMgr.cpp
index fb0e1574d08..d94cd422f11 100644
--- a/src/game/SocialMgr.cpp
+++ b/src/game/SocialMgr.cpp
@@ -198,7 +198,7 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
uint32 team = player->GetTeam();
AccountTypes security = player->GetSession()->GetSecurity();
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
- bool gmInWhoList = sWorld.getConfig(CONFIG_GM_IN_WHO_LIST) || security > SEC_PLAYER;
+ AccountTypes gmLevelInWhoList = AccountTypes (sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
PlayerSocialMap::iterator itr = player->GetSocial()->m_playerSocialMap.find(friendGUID);
if(itr != player->GetSocial()->m_playerSocialMap.end())
@@ -206,10 +206,10 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
- if( pFriend && pFriend->GetName() &&
- ( security > SEC_PLAYER ||
- ( pFriend->GetTeam() == team || allowTwoSideWhoList ) &&
- ( pFriend->GetSession()->GetSecurity() == SEC_PLAYER || gmInWhoList && pFriend->IsVisibleGloballyFor(player) )))
+ if (pFriend && pFriend->GetName() &&
+ (security > SEC_PLAYER ||
+ (pFriend->GetTeam() == team || allowTwoSideWhoList) && (pFriend->GetSession()->GetSecurity() <= gmLevelInWhoList)) &&
+ pFriend->IsVisibleGloballyFor(player))
{
friendInfo.Status = FRIEND_STATUS_ONLINE;
if(pFriend->isAFK())
@@ -273,7 +273,7 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
uint32 team = player->GetTeam();
AccountTypes security = player->GetSession()->GetSecurity();
uint32 guid = player->GetGUIDLow();
- bool gmInWhoList = sWorld.getConfig(CONFIG_GM_IN_WHO_LIST);
+ AccountTypes gmLevelInWhoList = AccountTypes(sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
for(SocialMap::const_iterator itr = m_socialMap.begin(); itr != m_socialMap.end(); ++itr)
@@ -285,10 +285,10 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
- if( pFriend && pFriend->IsInWorld() &&
- ( pFriend->GetSession()->GetSecurity() > SEC_PLAYER ||
- ( pFriend->GetTeam() == team || allowTwoSideWhoList ) &&
- (security == SEC_PLAYER || gmInWhoList && player->IsVisibleGloballyFor(pFriend) )))
+ if (pFriend && pFriend->IsInWorld() &&
+ (pFriend->GetSession()->GetSecurity() > SEC_PLAYER ||
+ (pFriend->GetTeam() == team || allowTwoSideWhoList) && security <= gmLevelInWhoList) &&
+ player->IsVisibleGloballyFor(pFriend))
{
pFriend->GetSession()->SendPacket(packet);
}
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 8dbc68520fa..9ad5156801d 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -813,8 +813,9 @@ void World::LoadConfigSettings(bool reload)
//m_configs[CONFIG_GM_ACCEPT_TICKETS] = sConfig.GetIntDefault("GM.AcceptTickets", 2);
m_configs[CONFIG_GM_CHAT] = sConfig.GetIntDefault("GM.Chat", 2);
m_configs[CONFIG_GM_WISPERING_TO] = sConfig.GetIntDefault("GM.WhisperingTo", 2);
- m_configs[CONFIG_GM_IN_GM_LIST] = sConfig.GetBoolDefault("GM.InGMList", false);
- m_configs[CONFIG_GM_IN_WHO_LIST] = sConfig.GetBoolDefault("GM.InWhoList", false);
+
+ m_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = sConfig.GetIntDefault("GM.InGMList.Level", SEC_ADMINISTRATOR);
+ m_configs[CONFIG_GM_LEVEL_IN_WHO_LIST] = sConfig.GetIntDefault("GM.InWhoList.Level", SEC_ADMINISTRATOR);
m_configs[CONFIG_GM_LOG_TRADE] = sConfig.GetBoolDefault("GM.LogTrade", false);
m_configs[CONFIG_START_GM_LEVEL] = sConfig.GetIntDefault("GM.StartLevel", 1);
m_configs[CONFIG_ALLOW_GM_GROUP] = sConfig.GetBoolDefault("GM.AllowInvite", false);
diff --git a/src/game/World.h b/src/game/World.h
index e1985aa55a4..4864977b029 100644
--- a/src/game/World.h
+++ b/src/game/World.h
@@ -141,8 +141,8 @@ enum WorldConfigs
CONFIG_GM_ACCEPT_TICKETS,
CONFIG_GM_CHAT,
CONFIG_GM_WISPERING_TO,
- CONFIG_GM_IN_GM_LIST,
- CONFIG_GM_IN_WHO_LIST,
+ CONFIG_GM_LEVEL_IN_GM_LIST,
+ CONFIG_GM_LEVEL_IN_WHO_LIST,
CONFIG_GM_LOG_TRADE,
CONFIG_START_GM_LEVEL,
CONFIG_ALLOW_GM_GROUP,
diff --git a/src/trinitycore/trinitycore.conf.dist b/src/trinitycore/trinitycore.conf.dist
index e59206367da..9a33a2daf6e 100644
--- a/src/trinitycore/trinitycore.conf.dist
+++ b/src/trinitycore/trinitycore.conf.dist
@@ -1029,15 +1029,19 @@ Channel.SilentlyGMJoin = 0
# 0 (disable)
# 1 (enable)
#
-# GM.InGMList
-# Is GM showed in GM list (if visible) in non-GM state (.gm off)
-# Default: 0 (false)
-# 1 (true)
-#
-# GM.InWhoList
-# Is GM showed in who list (if visible).
-# Default: 0 (false)
-# 1 (true)
+# GM.InGMList.Level
+# Max GM level showed in GM list (if visible) in non-GM state (.gm off)
+# 0 (only players)
+# 1 (only moderators)
+# 2 (only gamemasters)
+# Default: 3 (anyone)
+#
+# GM.InWhoList.Level
+# Max GM level showed in who list (if visible).
+# 0 (only players)
+# 1 (only moderators)
+# 2 (only gamemasters)
+# Default: 3 (anyone)
#
# GM.LogTrade
# Include GM trade and trade slot enchanting operations in GM log if it enable
@@ -1075,8 +1079,8 @@ GM.Visible = 2
GM.AcceptTickets = 2
GM.Chat = 2
GM.WhisperingTo = 2
-GM.InGMList = 0
-GM.InWhoList = 0
+GM.InGMList.Level = 3
+GM.InWhoList.Level = 3
GM.LogTrade = 1
GM.StartLevel = 80
GM.AllowInvite = 0