Zrips / CMI

114 stars 97 forks source link

no afk kick with inventory open #8543

Open Leahcimkrob opened 6 months ago

Leahcimkrob commented 6 months ago

Description of Issue

Hello, I noticed that you can avoid the AFK kick or going AFK if you keep a chest, oven or other inventory open. Can you take a look and fix it?

Version Information

[16:47:53 INFO]: --------------------------------------------------
[16:47:53 INFO]: CMI Plugin Version: 9.6.10.9 BungeeCord CMIB  MySQL
[16:47:53 INFO]: CMILib: 1.4.5.2
[16:47:53 INFO]: Server: Paper(450) 1.20.4-R0.1-SNAPSHOT-
[16:47:53 INFO]: CMI economy: Enabled Vault: 1.7.3-CMI CMI Chat: Disabled
[16:47:53 INFO]: Modules -> 56 enabled 3 disabled: tablist, armorstand, votifier
[16:47:53 INFO]: --------------------------------------------------

Errors

no error

Relevant Config Sections

Afk:
  # Enable or disable auto afk system entirely
  Enabled: true
  # When enabled shows title message informing that player is in afk mode
  TitleMessage: true
  # When enabled shows random subtitle message
  SubTitleMessage: true
  # Prevents jumping in one place to avoid afk status
  PreventJumping: true
  # Prevents damage while afk
  PreventDamage: true
  # Defines how often in seconds plugin will check for afk players state
  CheckInterval: 10
  # When set to true, players playtime counter stops
  # As of nature how this system works you can see +-1second jumping up and down while checking players playtime
  StopPlayTime: false
  # Defines how long to wait after player stops moving to set him as afk
  # Player needs to have cmi.command.afk.auto permission node
  # Set to 0 if you want to disable it
  AutoAfkIn: 600
  # Defines commands to be performed when player enters afk mode automatically while addling
  # Supports specialized commands
  AutoAfkCmds:
  - cmi broadcast !&7[&6&lFS&7] &b%vault_prefix%%cmi_user_name% &7›› &eist nun abwesend!
  # Defines commands to be performed when player enters /cmi afk
  # Supports specialized commands
  ManualAfkCmds:
  - cmi broadcast !&7[&6&lFS&7] &b%vault_prefix%%cmi_user_name% &7›› &eist nun abwesend!
  # Defines commands to be performed when player leaves afk mode
  AfkLeaveCmds:
  - cmi broadcast !&7[&6&lFS&7] &b%vault_prefix%%cmi_user_name% &7›› &eist wieder
    anwesend!
  # Defines how long to wait after player stops moving to kick player
  # This is additional timer to AutoAfkIn and in case player entered afk mode manually he will get kicked after AutoAfkIn+AutoKickIn seconds
  # This can be used not only to kick but to perform repeating action every x seconds if needed
  # Keep it at -1 to disable auto kick
  # Can be bypassed with cmi.command.afk.kickbypass permission node
  # Additionally players kick time can be changed with cmi.command.afk.kickOutIn.[seconds] permission node where bigger value takes priority
  AutoKickIn: 600
  # This will define how long to wait before performing kick commands again
  RepeatingAutoKickInterval: 300
  # When set to true, kick command will be repeated each RepeatingAutoKickInterval seconds
  RepeatKickCommand: false
  # Defines commands to be performed when player can be kicked
  # If player is not kicked then commands will be repeated every RepeatingAutoKickInterval seconds
  AutoKickCmds:
  - cmi:kick [playerName] AFK-Kick (Lobby)
  # Defines worlds where players will not be placed into afk mode after they idled for defined time
  DisabledWorlds:
  - oneTestWorld
  - secondTestWorld
  # Disables afk on interaction
  DisableOnInteract: true
  # Prevents player from going bypassing afk mode while continuously holding one button with particular items or on particular blocks
  SmartInteractCheck: true
  # Prevents from players abusing afk by constantly moving in afk machine
  AntiAfkMachines: true
  # Prevents players from being  pooled around while player is in afk mode
  PreventHook: true
  # EXPERIMENTAL! Prevents players from being pushed around while player is in afk mode
  # Keep in mind that player can still be moved around the same block he is in
  PreventPushing: false
  # Disables afk on inventory click
  DisableOnInventoryClick: true
  # Disables afk on item drop
  DisableOnitemDrop: true
  # Disables afk on command usage
  DisableOnCommand: true
  # Disables afk on public chat message
  DisableOnPublicChat: true
  # Disables afk on private chat message
  DisableOnPrivateChat: true
  # Disables afk on move
  DisableOnMove: true
  # Disables afk on camera movement
  DisableOnLookAround: false
  # Disables afk on fishing when you catch fish
  DisableOnFishing: false
  # Disables item pickup while afk
  DisableItemPickup: false
  PreventMobSpawning:
    # When enabled we can prevent mob spawning near players who are afk
    Enabled: false
    # Prevents natural mob spawning
    # This can be more on heavy side of the server as it will try constantly to spawn in monsters near afk players
    Natural: false
    # Prevent mob spawning from spawners
    Spawners: true
    # Usually responsible for spawning in iron golems
    VillageDefence: true
  # Disables exp pickup while afk
  # Attention! Because of weird minecraft handling of exp orbs, best way is to set orb to 0exp and allow it to be obsorbed
  # So by enabling this exp obsorbed by afk players will have no effect
  DisableExpPickup: false

Relevant Plugins

n/a

Agreements

Zrips commented 6 months ago

Can't reproduce at this moment. By any chance you have some plugins regulating chest inventories? Try testing it without any other plugin and CMI only, you can just lower afk and kick timers to like 3 seconds for quicker tests. But it in general when player has open inventory no events being fired which would put player into afk mode as it should, in normal situations. So you might have something else going on preventing player from entering afk mode when chest is opened

Leahcimkrob commented 6 months ago

The player is standing at a furnace or a chest and has opened it. He then doesn't go into AFK, therefore no AFK kick. We don't have a plugin that modifies furnaces, chests or inventories in this way. But I'll just test it with CMI.

Zrips commented 6 months ago

We are checking few events which gets fired when player does something, in normal situations no events are being fired when you have chest open and you are not doing anything in there, so player should be put into afk mode. And just in case, test it with clean client and not modded one, just in case that one does something wonky too

Leahcimkrob commented 6 months ago

Hello, I tried it again. I have no problems with either a Bedrock account or a Java account, so he goes into the afk with the chest open. Both with 1.20.1 and 1.20.4. If this isn't the case for some players, unfortunately I can't say anything for sure yet I once requested the client, version and mods from a player, but I can't say anything about it yet.