mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/Misc: Don't logout players instantly when client automatically requests a logout by idling too long
This commit is contained in:
@@ -237,13 +237,15 @@ void WorldSession::HandleWhoOpcode(WorldPackets::Who::WhoRequestPkt& whoRequest)
|
||||
SendPacket(response.Write());
|
||||
}
|
||||
|
||||
void WorldSession::HandleLogoutRequestOpcode(WorldPackets::Character::LogoutRequest& /*logoutRequest*/)
|
||||
void WorldSession::HandleLogoutRequestOpcode(WorldPackets::Character::LogoutRequest& logoutRequest)
|
||||
{
|
||||
if (!GetPlayer()->GetLootGUID().IsEmpty())
|
||||
GetPlayer()->SendLootReleaseAll();
|
||||
|
||||
bool instantLogout = (GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat()) ||
|
||||
GetPlayer()->IsInFlight() || HasPermission(rbac::RBAC_PERM_INSTANT_LOGOUT);
|
||||
bool instantLogout = GetPlayer()->IsInFlight();
|
||||
if (!logoutRequest.IdleLogout)
|
||||
instantLogout |= (GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_RESTING) && !GetPlayer()->IsInCombat())
|
||||
|| HasPermission(rbac::RBAC_PERM_INSTANT_LOGOUT);
|
||||
|
||||
/// TODO: Possibly add RBAC permission to log out in combat
|
||||
bool canLogoutInCombat = GetPlayer()->HasPlayerFlag(PLAYER_FLAGS_RESTING);
|
||||
|
||||
Reference in New Issue
Block a user