EssentialsX

EssentialsX

2M Downloads

Feature request: Check essentials.kick.exempt permission less frequently

SlimeDog opened this issue · 3 comments

commented

Spigot 1.13 latest
Essentials version 2.15.0.29-b634 (and previous)

When player is AFK, essentials.kick.exempt permission is checked twice, approximately every 100 ticks (based on inspection of console/log). Questions:

  • Is it necessary to check the permission twice every loop?
  • This permission changes very rarely, so could easily be maintained as a player(uuid) attribute. It could be checked on plugin enable or configuration reload, or on a less-frequent schedule (say, every 5 minutes, or a configurable time frame). Is that reasonable?
[10:36:48 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:36:48 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:36:50 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:36:50 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:36:53 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:36:53 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:36:55 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:36:55 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:36:58 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:36:58 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:00 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:00 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:03 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:03 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:05 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:05 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:08 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:08 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:10 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:10 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:13 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:13 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:15 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:15 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:18 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:18 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:21 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:21 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:23 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:23 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:26 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:26 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:28 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
[10:37:28 INFO]: [LP] VB > [PLAYER NAME ELIDED] - essentials.kick.exempt - true
commented

We've discussed this further internally and have concluded that this works as intended. The check is necessary and there aren't any major performance reasons for trying to change it, as most permission plugins already cache lookups.

You might instead want to look into further filtering your verbose output.

commented

Thanks for looking into it.

commented

Looked into this a bit, and figured out where the first issue is coming from. Looks like it is as a result of

if (base.isPermissionSet(permCheck) || isDeniedToOps(node)) {
return base.hasPermission(permCheck);

where isPermissionSet and hasPermission both do a permission check, which verbose then prints twice.