Fix timeUntilKickOfflinePlayer; resolves #826

This commit is contained in:
Daniel Saukel 2020-10-24 17:41:45 +02:00
parent a4616b07ac
commit 9167face12
2 changed files with 4 additions and 0 deletions

View File

@ -788,6 +788,8 @@ public class DungeonsXL extends DREPlugin implements DungeonsAPI {
}
dPlayer.setPlayer(player);
playerCache.remove(dPlayer);
playerCache.add(player, dPlayer);
dPlayer.setOfflineTimeMillis(0);
return true;
}

View File

@ -449,9 +449,11 @@ public class DPlayerListener implements Listener {
} else if (timeUntilKickOfflinePlayer > 0) {
dGroup.sendMessage(DMessage.PLAYER_OFFLINE.getMessage(dPlayer.getName(), String.valueOf(timeUntilKickOfflinePlayer)), player);
((GamePlayer) dPlayer).setOfflineTimeMillis(System.currentTimeMillis() + timeUntilKickOfflinePlayer * 1000);
return;
} else {
dGroup.sendMessage(DMessage.PLAYER_OFFLINE_NEVER.getMessage(dPlayer.getName()), player);
return;
}
} else if (dPlayer instanceof InstancePlayer) {