mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 10:30:27 +00:00
feat(Core): implement world availability option (#8755)
This commit is contained in:
@@ -665,17 +665,23 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData)
|
||||
|
||||
void WorldSession::HandlePlayerLoginOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (PlayerLoading() || GetPlayer() != nullptr)
|
||||
{
|
||||
LOG_ERROR("network", "Player tries to login again, AccountId = %d", GetAccountId());
|
||||
KickPlayer("WorldSession::HandlePlayerLoginOpcode Another client logging in");
|
||||
return;
|
||||
}
|
||||
|
||||
m_playerLoading = true;
|
||||
ObjectGuid playerGuid;
|
||||
recvData >> playerGuid;
|
||||
|
||||
if (PlayerLoading() || GetPlayer() != nullptr || !playerGuid.IsPlayer())
|
||||
{
|
||||
// limit player interaction with the world
|
||||
if (!sWorld->getBoolConfig(CONFIG_REALM_LOGIN_ENABLED))
|
||||
{
|
||||
WorldPacket data(SMSG_CHARACTER_LOGIN_FAILED, 1);
|
||||
// see LoginFailureReason enum for more reasons
|
||||
data << uint8(LoginFailureReason::NoWorld);
|
||||
SendPacket(&data);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!playerGuid.IsPlayer() || !IsLegitCharacterForAccount(playerGuid))
|
||||
{
|
||||
LOG_ERROR("network", "Account (%u) can't login with that character (%s).", GetAccountId(), playerGuid.ToString().c_str());
|
||||
|
||||
Reference in New Issue
Block a user