mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-24 10:09:50 +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();
|
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();
|
final long currentTime = System.currentTimeMillis();
|
||||||
user.checkMuteTimeout(currentTime);
|
dUser.checkMuteTimeout(currentTime);
|
||||||
user.updateActivity(false);
|
dUser.updateActivity(false);
|
||||||
|
|
||||||
ess.scheduleSyncDelayedTask(new Runnable()
|
ess.scheduleSyncDelayedTask(new Runnable()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
public void run()
|
public void run()
|
||||||
{
|
{
|
||||||
|
final User user = ess.getUser(player);
|
||||||
|
|
||||||
if (!user.getBase().isOnline())
|
if (!user.getBase().isOnline())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -237,7 +237,10 @@ public class User extends UserData implements Comparable<User>, IReplyTo, net.es
|
|||||||
|
|
||||||
private void _dispose()
|
private void _dispose()
|
||||||
{
|
{
|
||||||
this.base = new OfflinePlayer(base.getUniqueId(), ess.getServer());
|
if (!base.isOnline())
|
||||||
|
{
|
||||||
|
this.base = new OfflinePlayer(base.getUniqueId(), ess.getServer());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user