mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 10:37:02 +00:00
[8185] Allow set visible gm level for in gm list and in who list checks.
* GM.InGMList replaced by GM.InGMList.Level with default value 3 (visible any gm levels) * GM.InWhoList replaced by GM.InWhoList.Level with default value 3 (visible any gm levels) Update mangosd.conf if used non default value for old GM.InGMList and GM.InWhoList
This commit is contained in:
parent
d98cff1e68
commit
c129b0a1bd
8 changed files with 36 additions and 32 deletions
|
|
@ -446,7 +446,7 @@ void Channel::List(Player* player)
|
||||||
size_t pos = data.wpos();
|
size_t pos = data.wpos();
|
||||||
data << uint32(0); // size of list, placeholder
|
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;
|
uint32 count = 0;
|
||||||
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
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
|
// PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
||||||
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
// 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 << uint64(i->first);
|
||||||
data << uint8(i->second.flags); // flags seems to be changed...
|
data << uint8(i->second.flags); // flags seems to be changed...
|
||||||
|
|
|
||||||
|
|
@ -157,9 +157,8 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
|
||||||
HashMapHolder<Player>::MapType::const_iterator itr = m.begin();
|
HashMapHolder<Player>::MapType::const_iterator itr = m.begin();
|
||||||
for(; itr != m.end(); ++itr)
|
for(; itr != m.end(); ++itr)
|
||||||
{
|
{
|
||||||
if (itr->second->GetSession()->GetSecurity() > SEC_PLAYER &&
|
if ((itr->second->isGameMaster() || itr->second->GetSession()->GetSecurity() <= sWorld.getConfig(CONFIG_GM_LEVEL_IN_GM_LIST)) &&
|
||||||
(itr->second->isGameMaster() || sWorld.getConfig(CONFIG_GM_IN_GM_LIST)) &&
|
(!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())))
|
||||||
(!m_session || itr->second->IsVisibleGloballyFor(m_session->GetPlayer())) )
|
|
||||||
{
|
{
|
||||||
if(first)
|
if(first)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||||
uint32 team = _player->GetTeam();
|
uint32 team = _player->GetTeam();
|
||||||
uint32 security = GetSecurity();
|
uint32 security = GetSecurity();
|
||||||
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
|
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
|
WorldPacket data( SMSG_WHO, 50 ); // guess size
|
||||||
data << clientcount; // clientcount place holder
|
data << clientcount; // clientcount place holder
|
||||||
|
|
@ -166,7 +166,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// player can see MODERATOR, GAME MASTER, ADMINISTRATOR only if CONFIG_GM_IN_WHO_LIST
|
// 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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -189,7 +189,7 @@ void SocialMgr::GetFriendInfo(Player *player, uint32 friendGUID, FriendInfo &fri
|
||||||
uint32 team = player->GetTeam();
|
uint32 team = player->GetTeam();
|
||||||
AccountTypes security = player->GetSession()->GetSecurity();
|
AccountTypes security = player->GetSession()->GetSecurity();
|
||||||
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
|
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);
|
PlayerSocialMap::iterator itr = player->GetSocial()->m_playerSocialMap.find(friendGUID);
|
||||||
if(itr != player->GetSocial()->m_playerSocialMap.end())
|
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
|
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
||||||
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
||||||
if( pFriend && pFriend->GetName() &&
|
if (pFriend && pFriend->GetName() &&
|
||||||
( security > SEC_PLAYER ||
|
(security > SEC_PLAYER ||
|
||||||
( pFriend->GetTeam() == team || allowTwoSideWhoList ) &&
|
(pFriend->GetTeam() == team || allowTwoSideWhoList) && (pFriend->GetSession()->GetSecurity() <= gmLevelInWhoList)) &&
|
||||||
( pFriend->GetSession()->GetSecurity() == SEC_PLAYER || gmInWhoList && pFriend->IsVisibleGloballyFor(player) )))
|
pFriend->IsVisibleGloballyFor(player))
|
||||||
{
|
{
|
||||||
friendInfo.Status = FRIEND_STATUS_ONLINE;
|
friendInfo.Status = FRIEND_STATUS_ONLINE;
|
||||||
if(pFriend->isAFK())
|
if(pFriend->isAFK())
|
||||||
|
|
@ -271,7 +271,7 @@ void SocialMgr::BroadcastToFriendListers(Player *player, WorldPacket *packet)
|
||||||
uint32 team = player->GetTeam();
|
uint32 team = player->GetTeam();
|
||||||
AccountTypes security = player->GetSession()->GetSecurity();
|
AccountTypes security = player->GetSession()->GetSecurity();
|
||||||
uint32 guid = player->GetGUIDLow();
|
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);
|
bool allowTwoSideWhoList = sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
|
||||||
|
|
||||||
for(SocialMap::const_iterator itr = m_socialMap.begin(); itr != m_socialMap.end(); ++itr)
|
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
|
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
||||||
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
||||||
if( pFriend && pFriend->IsInWorld() &&
|
if (pFriend && pFriend->IsInWorld() &&
|
||||||
( pFriend->GetSession()->GetSecurity() > SEC_PLAYER ||
|
(pFriend->GetSession()->GetSecurity() > SEC_PLAYER ||
|
||||||
( pFriend->GetTeam() == team || allowTwoSideWhoList ) &&
|
(pFriend->GetTeam() == team || allowTwoSideWhoList) && security <= gmLevelInWhoList) &&
|
||||||
(security == SEC_PLAYER || gmInWhoList && player->IsVisibleGloballyFor(pFriend) )))
|
player->IsVisibleGloballyFor(pFriend))
|
||||||
{
|
{
|
||||||
pFriend->GetSession()->SendPacket(packet);
|
pFriend->GetSession()->SendPacket(packet);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -797,8 +797,8 @@ void World::LoadConfigSettings(bool reload)
|
||||||
m_configs[CONFIG_GM_CHAT] = sConfig.GetIntDefault("GM.Chat", 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_WISPERING_TO] = sConfig.GetIntDefault("GM.WhisperingTo", 2);
|
||||||
|
|
||||||
m_configs[CONFIG_GM_IN_GM_LIST] = sConfig.GetBoolDefault("GM.InGMList", false);
|
m_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = sConfig.GetIntDefault("GM.InGMList.Level", SEC_ADMINISTRATOR);
|
||||||
m_configs[CONFIG_GM_IN_WHO_LIST] = sConfig.GetBoolDefault("GM.InWhoList", false);
|
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_GM_LOG_TRADE] = sConfig.GetBoolDefault("GM.LogTrade", false);
|
||||||
|
|
||||||
m_configs[CONFIG_START_GM_LEVEL] = sConfig.GetIntDefault("GM.StartLevel", 1);
|
m_configs[CONFIG_START_GM_LEVEL] = sConfig.GetIntDefault("GM.StartLevel", 1);
|
||||||
|
|
|
||||||
|
|
@ -136,8 +136,8 @@ enum WorldConfigs
|
||||||
CONFIG_GM_ACCEPT_TICKETS,
|
CONFIG_GM_ACCEPT_TICKETS,
|
||||||
CONFIG_GM_CHAT,
|
CONFIG_GM_CHAT,
|
||||||
CONFIG_GM_WISPERING_TO,
|
CONFIG_GM_WISPERING_TO,
|
||||||
CONFIG_GM_IN_GM_LIST,
|
CONFIG_GM_LEVEL_IN_GM_LIST,
|
||||||
CONFIG_GM_IN_WHO_LIST,
|
CONFIG_GM_LEVEL_IN_WHO_LIST,
|
||||||
CONFIG_GM_LOG_TRADE,
|
CONFIG_GM_LOG_TRADE,
|
||||||
CONFIG_START_GM_LEVEL,
|
CONFIG_START_GM_LEVEL,
|
||||||
CONFIG_GM_LOWER_SECURITY,
|
CONFIG_GM_LOWER_SECURITY,
|
||||||
|
|
|
||||||
|
|
@ -872,15 +872,19 @@ Channel.SilentlyGMJoin = 0
|
||||||
# 0 (disable)
|
# 0 (disable)
|
||||||
# 1 (enable)
|
# 1 (enable)
|
||||||
#
|
#
|
||||||
# GM.InGMList
|
# GM.InGMList.Level
|
||||||
# Is GM showed in GM list (if visible) in non-GM state (.gm off)
|
# Max GM level showed in GM list (if visible) in non-GM state (.gm off)
|
||||||
# Default: 0 (false)
|
# 0 (only players)
|
||||||
# 1 (true)
|
# 1 (only moderators)
|
||||||
|
# 2 (only gamemasters)
|
||||||
|
# Default: 3 (anyone)
|
||||||
#
|
#
|
||||||
# GM.InWhoList
|
# GM.InWhoList.Level
|
||||||
# Is GM showed in who list (if visible).
|
# Max GM level showed in who list (if visible).
|
||||||
# Default: 0 (false)
|
# 0 (only players)
|
||||||
# 1 (true)
|
# 1 (only moderators)
|
||||||
|
# 2 (only gamemasters)
|
||||||
|
# Default: 3 (anyone)
|
||||||
#
|
#
|
||||||
# GM.LogTrade
|
# GM.LogTrade
|
||||||
# Include GM trade and trade slot enchanting operations in GM log if it enable
|
# 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.AcceptTickets = 2
|
||||||
GM.Chat = 2
|
GM.Chat = 2
|
||||||
GM.WhisperingTo = 2
|
GM.WhisperingTo = 2
|
||||||
GM.InGMList = 0
|
GM.InGMList.Level = 3
|
||||||
GM.InWhoList = 0
|
GM.InWhoList.Level = 3
|
||||||
GM.LogTrade = 1
|
GM.LogTrade = 1
|
||||||
GM.StartLevel = 1
|
GM.StartLevel = 1
|
||||||
GM.LowerSecurity = 0
|
GM.LowerSecurity = 0
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "8184"
|
#define REVISION_NR "8185"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue