From 06417910e2424f66ea8f1606fad32c51d06d5983 Mon Sep 17 00:00:00 2001 From: Ali Moghnieh Date: Sat, 2 Jan 2016 10:16:34 +0000 Subject: [PATCH] Add 10 seconds of graceful time before doing first check to prevent misinterpretation of lack of activity. --- Essentials/src/com/earth2me/essentials/User.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/User.java b/Essentials/src/com/earth2me/essentials/User.java index 9b7a88edf..1535a0fbe 100644 --- a/Essentials/src/com/earth2me/essentials/User.java +++ b/Essentials/src/com/earth2me/essentials/User.java @@ -494,6 +494,11 @@ public class User extends UserData implements Comparable, IMessageRecipien } public void checkActivity() { + // Graceful time before the first afk check call. + if (System.currentTimeMillis() - lastActivity <= 10000) { + return; + } + final long autoafkkick = ess.getSettings().getAutoAfkKick(); if (autoafkkick > 0 && lastActivity > 0 && (lastActivity + (autoafkkick * 1000)) < System.currentTimeMillis() && !isHidden() && !isAuthorized("essentials.kick.exempt") && !isAuthorized("essentials.afk.kickexempt")) { final String kickReason = tl("autoAfkKickReason", autoafkkick / 60.0);