diff --git a/src/game/Channel.cpp b/src/game/Channel.cpp index 64bc508f4..e0fca88c6 100644 --- a/src/game/Channel.cpp +++ b/src/game/Channel.cpp @@ -446,7 +446,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) @@ -455,7 +455,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 24eeed581..2f64c5001 100644 --- a/src/game/Level0.cpp +++ b/src/game/Level0.cpp @@ -157,9 +157,8 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/) HashMapHolder::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 4fd91ee27..427f5d65c 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -149,7 +149,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 @@ -166,7 +166,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 01dbfeb85..65dc730c7 100644 --- a/src/game/SocialMgr.cpp +++ b/src/game/SocialMgr.cpp @@ -189,7 +189,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()) @@ -197,10 +197,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()) @@ -271,7 +271,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) @@ -283,10 +283,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 bf20ccf08..865356d41 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -797,8 +797,8 @@ void World::LoadConfigSettings(bool reload) 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); diff --git a/src/game/World.h b/src/game/World.h index 8c2f2df14..1382eb348 100644 --- a/src/game/World.h +++ b/src/game/World.h @@ -136,8 +136,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_GM_LOWER_SECURITY, diff --git a/src/mangosd/mangosd.conf.dist.in b/src/mangosd/mangosd.conf.dist.in index de5dbe22d..2ec285160 100644 --- a/src/mangosd/mangosd.conf.dist.in +++ b/src/mangosd/mangosd.conf.dist.in @@ -872,15 +872,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.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 -# Is GM showed in who list (if visible). -# Default: 0 (false) -# 1 (true) +# 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 @@ -908,8 +912,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 = 1 GM.LowerSecurity = 0 diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 0d694d764..cb36eb4db 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8184" + #define REVISION_NR "8185" #endif // __REVISION_NR_H__