mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-11-06 02:51:32 +01:00
Only dispose users who are offline at point of disposal.
This should cater for quick reconnects on lagged servers.
This commit is contained in:
parent
f09180659d
commit
b00c31730f
@ -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;
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user