Page 1 of 1

Client crash on login if your character's position changed

Posted: Mon Oct 09, 2017 7:52 am
by ShinichiYao
For example if you logout in an instance, and after the instance finished you would login at the exitpoint of the instance. In this case Client crashes.

Image

Re: Client crash on login if your character's position changed

Posted: Mon Oct 09, 2017 9:28 am
by FinalDestination
yes happens me too

Re: Client crash on login if your character's position changed

Posted: Tue Oct 10, 2017 11:11 am
by ShinichiYao
Also happened in NoRestartZone. If player.teleToLocation execute too fast after spawnMe in EnterWorld could cause this issue.

Code: Select all

	@Override
	public void onPlayerLoginInside(L2PcInstance player)
	{
		if (!_enabled)
		{
			return;
		}
		
		if (((System.currentTimeMillis() - player.getLastAccess()) > getRestartTime()) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > getRestartAllowedTime()))
		{
			player.teleToLocation(TeleportWhereType.TOWN);
		}
	}

Re: Client crash on login if your character's position changed

Posted: Sun Dec 02, 2018 9:19 am
by FinalDestination

Code: Select all

// we need to add delay here in case of critical error on player login.
			ThreadPoolManager.getInstance().scheduleGeneral(() -> player.teleToLocation(TeleportWhereType.TOWN), 1000);

Re: Client crash on login if your character's position changed

Posted: Tue Dec 04, 2018 6:18 pm
by Sacrifice
FinalDestination wrote: Sun Dec 02, 2018 9:19 am

Code: Select all

// we need to add delay here in case of critical error on player login.
			ThreadPoolManager.getInstance().scheduleGeneral(() -> player.teleToLocation(TeleportWhereType.TOWN), 1000);
Always ThreadPool general must to do all jobs... :lol:

Re: Client crash on login if your character's position changed

Posted: Tue Dec 04, 2018 6:19 pm
by Sacrifice
ShinichiYao wrote: Tue Oct 10, 2017 11:11 am Also happened in NoRestartZone. If player.teleToLocation execute too fast after spawnMe in EnterWorld could cause this issue.

Code: Select all

	@Override
	public void onPlayerLoginInside(L2PcInstance player)
	{
		if (!_enabled)
		{
			return;
		}
		
		if (((System.currentTimeMillis() - player.getLastAccess()) > getRestartTime()) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > getRestartAllowedTime()))
		{
			player.teleToLocation(TeleportWhereType.TOWN);
		}
	}
That's "better solution"... don't know if is correctly expelled, but as concept... Can be useful