Only dispose users who are offline at point of disposal.

This should cater for quick reconnects on lagged servers.
This commit is contained in:
KHobbits 2014-05-10 15:36:58 +01:00
parent f09180659d
commit b00c31730f
2 changed files with 64 additions and 59 deletions

View File

@ -208,23 +208,25 @@ public class EssentialsPlayerListener implements Listener
}
ess.getBackup().onPlayerJoin();
final User user = ess.getUser(player);
final User dUser = ess.getUser(player);
if (user.isNPC())
if (dUser.isNPC())
{
user.setNPC(false);
dUser.setNPC(false);
}
final long currentTime = System.currentTimeMillis();
user.checkMuteTimeout(currentTime);
user.updateActivity(false);
dUser.checkMuteTimeout(currentTime);
dUser.updateActivity(false);
ess.scheduleSyncDelayedTask(new Runnable()
{
@Override
public void run()
{
final User user = ess.getUser(player);
if (!user.getBase().isOnline())
{
return;

View File

@ -236,9 +236,12 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
}
private void _dispose()
{
if (!base.isOnline())
{
this.base = new OfflinePlayer(base.getUniqueId(), ess.getServer());
}
}
@Override
public Boolean canSpawnItem(final int itemId)