Improve PlayerState stability.
This commit is contained in:
parent
246d9c1a44
commit
83f1d3c903
@ -81,6 +81,16 @@ public class EngineMassiveCorePlayerState extends EngineAbstract
|
||||
this.idToState.put(id, PlayerState.LOGASYNC);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void logasyncMonitor(AsyncPlayerPreLoginEvent event)
|
||||
{
|
||||
if (event.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) return;
|
||||
|
||||
final UUID id = event.getUniqueId();
|
||||
|
||||
this.idToState.remove(id);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// LOGSYNC
|
||||
// -------------------------------------------- //
|
||||
@ -95,6 +105,18 @@ public class EngineMassiveCorePlayerState extends EngineAbstract
|
||||
this.idToState.put(id, PlayerState.LOGSYNC);
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void logsyncMonitor(PlayerLoginEvent event)
|
||||
{
|
||||
if (event.getResult() != PlayerLoginEvent.Result.ALLOWED) return;
|
||||
|
||||
final Player player = event.getPlayer();
|
||||
if (MUtil.isntPlayer(player)) return;
|
||||
final UUID id = player.getUniqueId();
|
||||
|
||||
this.idToState.remove(id);
|
||||
}
|
||||
|
||||
// -------------------------------------------- //
|
||||
// JOINING
|
||||
// -------------------------------------------- //
|
||||
|
Loading…
Reference in New Issue
Block a user