Fixed some inconsistencies with the LD flag

This commit is contained in:
Ziggy
2015-05-07 17:46:17 +02:00
parent b7e31ae748
commit 4be4470c1e
+4 -2
View File
@@ -79,8 +79,10 @@ public class ConnectionService extends Service {
public void run() {
Player p = disappearPlayers.poll();
synchronized (zonedInPlayers) {
if (p != null && zonedInPlayers.contains(p))
if (p != null && zonedInPlayers.contains(p)) {
disappear(p);
p.getPlayerObject().clearFlagBitmask(PlayerFlags.LD); // Remove the LD flag here
}
}
}
};
@@ -162,8 +164,8 @@ public class ConnectionService extends Service {
private void logOut(Player p) {
if (p.getPlayerState() != PlayerState.LOGGED_OUT)
System.out.println("[" + p.getUsername() +"] Logged out " + p.getCharacterName());
p.setPlayerState(PlayerState.LOGGED_OUT);
p.getPlayerObject().setFlagBitmask(PlayerFlags.LD);
p.setPlayerState(PlayerState.LOGGED_OUT);
disappearPlayers.add(p);
updateService.schedule(disappearRunnable, (long) DISAPPEAR_THRESHOLD, TimeUnit.MILLISECONDS);
}