if(Config.ALT_RELOG_CMD && !player.isInObserverMode())
{
if(Config.ALT_RELOG_FAKE)
{
World.removeObjectsFromPlayer(player, false);
player.sendPacket(new TeleportToLocation(player, player.getLoc()));
World.showObjectsToPlayer(player, false);
}
else
{
if (player.isInCombat() || player.isCastingNow() || player.isAttackingNow() || player.isInOlympiadMode() || player.isStunned() || player.isSleeping() || player.isParalyzed() || player.getEvent(SingleMatchEvent.class) != null || player.isInZone(ZoneType.no_restart))
return false;
GameClient client = player.getNetConnection();
player.leaveParty();
client.setState(GameClientState.AUTHED);
player.restart();
final CharacterSelectionInfo cl = new CharacterSelectionInfo(client.getLogin(), client.getSessionKey().playOkID1);
client.sendPacket(RestartResponse.OK, cl);
client.setCharSelection(cl.getCharInfo());
int slot = -1;
for(int id = 0; id <= 7; id++)
{
if(client.getObjectIdByIndex(id) == player.getObjectId())
{
slot = id;
break;
}
}
client.playerSelected(slot);
client.setState(GameClientState.IN_GAME);
}
}