Improve PlayerState stability.

This commit is contained in:
Olof Larsson 2016-01-09 17:12:44 +01:00
parent 246d9c1a44
commit 83f1d3c903

View File

@ -81,6 +81,16 @@ public class EngineMassiveCorePlayerState extends EngineAbstract
this.idToState.put(id, PlayerState.LOGASYNC); 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 // LOGSYNC
// -------------------------------------------- // // -------------------------------------------- //
@ -95,6 +105,18 @@ public class EngineMassiveCorePlayerState extends EngineAbstract
this.idToState.put(id, PlayerState.LOGSYNC); 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 // JOINING
// -------------------------------------------- // // -------------------------------------------- //