Don't run calls against bucket api in async login thread

This commit is contained in:
snowleo 2013-01-30 00:26:50 +01:00
parent 12786a260e
commit cef8cf7b75

View file

@ -175,13 +175,18 @@ public class EssentialsPlayerListener implements Listener
updateCompass(user); updateCompass(user);
user.setLastLogin(System.currentTimeMillis()); user.setLastLogin(System.currentTimeMillis());
user.updateActivity(false); user.updateActivity(false);
ess.scheduleSyncDelayedTask(new Runnable()
{
@Override
public void run()
{
if (!ess.getVanishedPlayers().isEmpty() && !user.isAuthorized("essentials.vanish.see")) if (!ess.getVanishedPlayers().isEmpty() && !user.isAuthorized("essentials.vanish.see"))
{ {
for (String p : ess.getVanishedPlayers()) for (String p : ess.getVanishedPlayers())
{ {
Player toVanish = ess.getUser(p).getBase(); Player toVanish = ess.getServer().getPlayerExact(p);
if (toVanish.isOnline()) if (toVanish != null && toVanish.isOnline())
{ {
user.hidePlayer(toVanish); user.hidePlayer(toVanish);
} }
@ -189,16 +194,9 @@ public class EssentialsPlayerListener implements Listener
} }
if (user.isAuthorized("essentials.sleepingignored")) if (user.isAuthorized("essentials.sleepingignored"))
{
ess.scheduleSyncDelayedTask(new Runnable()
{
@Override
public void run()
{ {
user.setSleepingIgnored(true); user.setSleepingIgnored(true);
} }
});
}
if (!ess.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd")) if (!ess.getSettings().isCommandDisabled("motd") && user.isAuthorized("essentials.motd"))
{ {
@ -257,6 +255,8 @@ public class EssentialsPlayerListener implements Listener
} }
} }
} }
});
}
// Makes the compass item ingame always point to the first essentials home. #EasterEgg // Makes the compass item ingame always point to the first essentials home. #EasterEgg
private void updateCompass(final User user) private void updateCompass(final User user)