Skip to content
Browse files

added a max distance and logging to console again

  • Loading branch information...
1 parent eca92a5 commit 7e6c06e5635bd67d3133ca47c309d82d655ba4eb smcgregor committed May 29, 2012
Showing with 5 additions and 7 deletions.
  1. +5 −7 src/com/c45y/NoLog/NoLogListener.java
View
12 src/com/c45y/NoLog/NoLogListener.java
@@ -93,14 +93,12 @@ public void onPlayerQuit(PlayerQuitEvent event) {
}
if (plugin.PlayerLog.containsKey(player)) {
// Check if the attacker is dead, we don't care if you log after killing someone
- if ((!plugin.PlayerLog.get(player).getAttacker().isDead()) && (plugin.PlayerLog.get(player).getTimestamp() > System.currentTimeMillis() - 10000)) {
- for (Player playeri : plugin.getServer().getOnlinePlayers()) {
- if (playeri.hasPermission("NoLog.view")) {
- playeri.sendMessage(ChatColor.BLUE + "NL: " + genNoLogMessage(player));
- }
- }
- plugin.PlayerLog.remove(player);
+ NoLogObject nlo = plugin.PlayerLog.get(player);
+ if ((!nlo.getAttacker().isDead()) && (nlo.getTimestamp() > System.currentTimeMillis() - 10000) && (nlo.getDistance(nlo.getAttacker()) < 50)) {
+ plugin.messageMods(ChatColor.BLUE + "NL: " + genNoLogMessage(player));
+ plugin.log.info("NoLog: " + genNoLogMessage(player));
}
+ plugin.PlayerLog.remove(player);
}
}

0 comments on commit 7e6c06e

Please sign in to comment.
Something went wrong with that request. Please try again.