Fixed multiple client logout and exit game.
This commit is contained in:
parent
760cc8fdf3
commit
07cb5d7dae
@ -36,7 +36,13 @@ public class MoveBackwardToLocation extends ClientBasePacket
|
|||||||
final int originX = readD();
|
final int originX = readD();
|
||||||
final int originY = readD();
|
final int originY = readD();
|
||||||
final int originZ = readD();
|
final int originZ = readD();
|
||||||
|
|
||||||
final PlayerInstance activeChar = client.getActiveChar();
|
final PlayerInstance activeChar = client.getActiveChar();
|
||||||
|
if (activeChar == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (activeChar.getCurrentState() == CreatureState.CASTING)
|
if (activeChar.getCurrentState() == CreatureState.CASTING)
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(new ActionFailed());
|
activeChar.sendPacket(new ActionFailed());
|
||||||
|
@ -47,11 +47,11 @@ public class RequestRestart extends ClientBasePacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.deleteMe();
|
|
||||||
player.sendPacket(new RestartResponse());
|
player.sendPacket(new RestartResponse());
|
||||||
client.saveCharToDisk(client.getActiveChar());
|
client.saveCharToDisk(player);
|
||||||
client.setActiveChar(null);
|
|
||||||
player.sendPacket(new CharSelectInfo(client.getLoginName(), client.getSessionId()));
|
player.sendPacket(new CharSelectInfo(client.getLoginName(), client.getSessionId()));
|
||||||
|
player.deleteMe();
|
||||||
|
client.setActiveChar(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@ public class LeaveWorld extends ServerBasePacket
|
|||||||
@Override
|
@Override
|
||||||
public byte[] getContent()
|
public byte[] getContent()
|
||||||
{
|
{
|
||||||
_bao.write(150);
|
writeC(0x96);
|
||||||
return _bao.toByteArray();
|
return getBytes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -28,6 +28,7 @@ import java.util.List;
|
|||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.gameserver.network.serverpackets.LeaveWorld;
|
||||||
import org.l2jmobius.loginserver.LoginController;
|
import org.l2jmobius.loginserver.LoginController;
|
||||||
import org.l2jmobius.loginserver.data.AccountData;
|
import org.l2jmobius.loginserver.data.AccountData;
|
||||||
import org.l2jmobius.loginserver.network.clientpackets.RequestAuthLogin;
|
import org.l2jmobius.loginserver.network.clientpackets.RequestAuthLogin;
|
||||||
@ -140,13 +141,14 @@ public class ClientThread extends Thread
|
|||||||
}
|
}
|
||||||
if (lc.isAccountInLoginServer(account))
|
if (lc.isAccountInLoginServer(account))
|
||||||
{
|
{
|
||||||
_log.warning("Account is in use on Login server (kicking off):" + account);
|
// _log.warning("Account is in use on Login server (kicking off):" + account);
|
||||||
lc.getLoginServerConnection(account).close();
|
lc.getLoginServerConnection(account).close();
|
||||||
lc.removeLoginServerLogin(account);
|
lc.removeLoginServerLogin(account);
|
||||||
}
|
}
|
||||||
if (lc.isAccountInGameServer(account))
|
if (lc.isAccountInGameServer(account))
|
||||||
{
|
{
|
||||||
_log.warning("Account is in use on Game server (kicking off):" + account);
|
// _log.warning("Account is in use on Game server (kicking off):" + account);
|
||||||
|
lc.getClientConnection(account).sendPacket(new LeaveWorld());
|
||||||
lc.getClientConnection(account).close();
|
lc.getClientConnection(account).close();
|
||||||
lc.removeGameServerLogin(account);
|
lc.removeGameServerLogin(account);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user