Core/Player: Always allow accounts with RBAC_PERM_COMMAND_GM to enter instances on login
Always allow accounts with RBAC_PERM_COMMAND_GM to enter instances on login even if player had .gm off . Send an ingame message to notify the user about the avoided kick.
This commit is contained in:
1 parent
6e296ddaa2
commit
5f917e2286
2 files changed
+22
-3
No files matched your search
@@ -2561,6 +2561,11 @@ void Player::SetGameMaster(bool on)
|
||||
UpdateObjectVisibility();
|
||||
}
|
||||
|
||||
bool Player::CanBeGameMaster() const
|
||||
{
|
||||
return m_session && m_session->HasPermission(rbac::RBAC_PERM_COMMAND_GM);
|
||||
}
|
||||
|
||||
void Player::SetGMVisible(bool on)
|
||||
{
|
||||
if (on)
|
||||
@@ -18674,17 +18679,28 @@ bool Player::CheckInstanceLoginValid(Map* map)
|
||||
{
|
||||
// cannot be in raid instance without a group
|
||||
if (!GetGroup())
|
||||
return false;
|
||||
return IsInstanceLoginGameMasterException();
|
||||
}
|
||||
else
|
||||
{
|
||||
// cannot be in normal instance without a group and more players than 1 in instance
|
||||
if (!GetGroup() && map->GetPlayersCountExceptGMs() > 1)
|
||||
return false;
|
||||
return IsInstanceLoginGameMasterException();
|
||||
}
|
||||
|
||||
// do checks for satisfy accessreqs, instance full, encounter in progress (raid), perm bind group != perm bind player
|
||||
return sMapMgr->CanPlayerEnter(map->GetId(), this, true);
|
||||
return sMapMgr->CanPlayerEnter(map->GetId(), this, true) || IsInstanceLoginGameMasterException();
|
||||
}
|
||||
|
||||
bool Player::IsInstanceLoginGameMasterException() const
|
||||
{
|
||||
if (CanBeGameMaster())
|
||||
{
|
||||
ChatHandler(GetSession()).PSendSysMessage("You didn't get kicked out of the instance even if Player::CheckInstanceLoginValid() returned false and without .gm on flag");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Player::CheckInstanceCount(uint32 instanceId) const
|
||||
|
||||
@@ -1072,6 +1072,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool isAcceptWhispers() const { return (m_ExtraFlags & PLAYER_EXTRA_ACCEPT_WHISPERS) != 0; }
|
||||
void SetAcceptWhispers(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_ACCEPT_WHISPERS; else m_ExtraFlags &= ~PLAYER_EXTRA_ACCEPT_WHISPERS; }
|
||||
bool IsGameMaster() const { return (m_ExtraFlags & PLAYER_EXTRA_GM_ON) != 0; }
|
||||
bool CanBeGameMaster() const;
|
||||
void SetGameMaster(bool on);
|
||||
bool isGMChat() const { return (m_ExtraFlags & PLAYER_EXTRA_GM_CHAT) != 0; }
|
||||
void SetGMChat(bool on) { if (on) m_ExtraFlags |= PLAYER_EXTRA_GM_CHAT; else m_ExtraFlags &= ~PLAYER_EXTRA_GM_CHAT; }
|
||||
@@ -2500,6 +2501,8 @@ class Player : public Unit, public GridObject<Player>
|
||||
bool IsHasDelayedTeleport() const { return m_bHasDelayedTeleport; }
|
||||
void SetDelayedTeleportFlag(bool setting) { m_bHasDelayedTeleport = setting; }
|
||||
void ScheduleDelayedOperation(uint32 operation) { if (operation < DELAYED_END) m_DelayedOperations |= operation; }
|
||||
|
||||
bool IsInstanceLoginGameMasterException() const;
|
||||
|
||||
MapReference m_mapRef;
|
||||
|
||||
|
||||
Reference in new issue
Block a user