Skip to content

Commit

Permalink
Add 10 seconds of graceful time before doing first check to prevent m…
Browse files Browse the repository at this point in the history
…isinterpretation of lack of activity.
  • Loading branch information
SupaHam committed Jan 2, 2016
1 parent c56dd6e commit 0641791
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Essentials/src/com/earth2me/essentials/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,11 @@ public void updateActivity(final boolean broadcast) {
}

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);
Expand Down

1 comment on commit 0641791

@SupaHam
Copy link
Member Author

@SupaHam SupaHam commented on 0641791 Jan 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to @RoyCurtis in #340.

Please # to comment.