[ADMN] AfkBooter v1.0.3 - Boot players that idle too much [1000]

Discussion in 'Inactive/Unsupported Plugins' started by neromir, Feb 16, 2011.

  1. Offline


    AfkBooter - Boot players who idle too much on your server:
    Version: v1.0.3

    This plugin is no longer being maintained by neromir. It has been taken on by morganm. Please see the BukkitDev site http://dev.bukkit.org/server-mods/afkbooter/ for the latest version, support, and questions.

    Download AfkBooter v1.0.3: jar
    Source Code: https://github.com/neromir/AfkBooter

    Important Note: If you are upgrading from pre-1.0, take special note of the listened-events property! You must set it or the plugin will not work!

    This plugin monitors the last activity time a player has on your server and will boot them if that time longer than a settable idle-allowance.

    Current version was tested against CB 1000, 935 and 953. Previous versions will work with CB 860, 818, 803, 798, 766, 740, 733, 677, 670, 617, 556, 531, and 493. Version 0.7.1 and above require 612+ due to interface changes. Version 0.4 requires at least CB 432+ due to the changes with the plugin constructor.

    • Prevent players from idling on your server beyond a given time limit.
    • Allows you to set a list of player names who are immune to idle-kicking.
    • Allows you to set a player count threshold below which nobody will be kicked.
    • Allows you to set a custom kick message for both the kicked player to see and one that is broadcast to all players on the server when the player is kicked.
    • Allows you to determine if player idling status should be merely announced rather than having idlers kicked. If set to true, it will be announced when players are no longer idling. The kick broadcast message is used to determine the text of the message announced when a player goes idle.
    • Works with any number of people on the server (does not fail when there's only a single person on).
    • Allows you to set a kick-check frequency. Rather than arbitrarily set a kick-check interval for you, it allows you to determine what is best for your server.
    • Allows you to specify which events, out of a given set, should be listened to for purposes of activity checking.
    • Allows you to specify if players should be counted as active while moving in a vehicle.
    • Allows you to set whether idlers should be counted as "in bed" for checking if all players are in bed to move the server time forward to day.
    • Allows you to set whether idlers should be blocked from picking up items.
    • Integrated with Permissions 3.1.6. Should also work fine with Permissions 2.7.3.

    To install
    Simply put the jar file in your plugins directory for CraftBukkit. On first run it will create a file called "afkbooter.properties" in the directory "plugins/AfkBooter" and populate it with the default settings. You should then stop your server, change the settings to match what you want, and re-run it.

    To upgrade

    Important Note: If you are upgrading from pre-1.0, take special note of the listened-events property! You must set it or the plugin will not work!

    Put the new jar in your plugins directory for CraftBukkit and start the server. Use one of the below-listed commands which changes a value, such as kickTimeout, from inside the server console. You can just reset it to the already-configured value. This will update your settings file to contain all the latest settings. Stop the server, change any of the new settings. Restart and you're good.

    The properties file looks like this:

    #Default auto-created config file. Version 1.0.2. Please change.
    #kick-timeout is amount of time (sec) players can be idle, kick-message is the message the
    #kicked player sees, kick-broadcast is the message all players see when a player is kicked (name + message), 
    #timeout-check-interval is the frequency (sec) to check for players to boot, and exempt-players is the list
    #of players not to kick at all. player-count-threshold is the number of players that must be present before
    #players start getting kicked for idling.  Set to 0 for always. Set use-jump-ignoring to use the experimental
    #code which ignores vertical movement for activity purposes. Set kick-idlers to determine whether or not idlers
    #should actually be kicked or merely announced. ignore-vehicle-movement if set to true will not consider a player's 
    #movement if they are in a vehicle. use-faux-sleep will count AFK players as "sleeping" for the purposes of beds
    #moving the clock forward; only works if kick-idlers is false.
    #Sun May 8 19:09:36 MST 2011
    kick-message=Kicked for idling too much.
    kick-broadcast=kicked for idling too much.
    Note that the server broadcast for kick-broadcast will show up as "<kickedPlayerName> <kick-broadcast>". So in this case, it'd be "neromir kicked for idling too much."

    Permissions nodes:
    - 'afkbooter.exempt'
    - 'afkbooter.config'
    Anyone that has the exempt node will not be kicked by the plugin. Anyone that has the config node will have access to all the below-listed commands. Note that the exempt node is in addition to any names listed in the exempt-players list in the settings file. Also note that ops have access to all commands as well, regardless of whether or not they have the config permission.

    Example: /afkbooter kickTimeout [number] - Changes the idle time (sec) allowed before players are kicked.
    Example: /afkbooter kickMessage [message] - Changes the message a kicked player sees.
    Example: /afkbooter kickBroadcast [message] - Changes the message broadcast to all players when someone is kicked.
    Example: /afkbooter listExempt - List the players on the exempt list.
    Example: /afkbooter addExempt [playerName] - Add a player to the exempt list.
    Example: /afkbooter removeExempt [playerName] - Remove a player from the exempt list.
    Example: /afkbooter playercount [number] - Set the threshold below which no players will be kicked.
    Example: /afkbooter useJumpIgnore [true|false] - Set whether or not to use experimental jump ignoring code.
    Example: /afkbooter kickIdlers [true|false] - Set whether or not idlers should be kicked or merely announced as idling.
    Example: /afkbooter ignoreVehicles [true|false] - Set whether or not to ignore player movement while in vehicles.
    Example: /afkbooter useFauxSleep [true|false] - Set whether or not to use faux sleep (afk players are considered in bed).
    Example: /afkbooter blockIdleItems [true|false] - Set whether or not item pickup should be blocked for idlers.
    Example: /afkbooter list - List players marked as AFK.
    Also note that a player newly added to the exempt list may get kicked for idling if they are in the server when they are added. They should be exempt from tracking once they rejoin the server, however.

    A player can be considered active when the plugin catches one of the following events (depending on how you set it):
    • Join
    • Movement (looking around past a certain threshold, I believe 30 degrees, does count as movement).
    • Chat/command
    • Opening the inventory (simply holding the inventory open does not trigger this-- only the actual open inventory action does).
    • Block placement.
    • Block break.
    • Dropped item.
    • Player interacting with a block.
    • Player interacting with an entity.

    Event names which can be listed in the listened-events property:
    PLAYER_COMMAND_PREPROCESS (to detect commands as well as chat)
    INVENTORY_OPEN (does not work currently due to Bukkit event issues with inventory)
    Changelog (open)

    Version 1.0.3
    • Fixed an exception that was thrown if the "/afkbooter list" command was used while nobody was AFK.
    Version 1.0.2
    • Added ability to listen to PLAYER_INTERACT and PLAYER_ENTITY_INTERACT events.
    • Added /afkbooter list command which will list idle players if kickIdlers=false
    Version 1.0.1
    • Added a bad formatting check, should catch exceptions when you screw up the listened-events property.
    Version 1.0
    • Fixed bug which required a restart of the AfkBooter when you changed the kickTimeout. It will now properly detect it when changed while the server is running.
    • Added ability to block pick up of items for players which are idling. Note that this only functions when kickIdlers is false.
    • Added ability to listen to players' commands in addition to their chat for determining activity status.
    • Completely revamped the way that events are listened to for determining activity status in order to allow for easier adding of additional events. You now must list the event names in the listened-events property. Events should be comma separated. For events that can be listened to, please see the list above.
    Version 0.9
    • Added option to ignore player movement while in a vehicle. Set the ignore-vehicle-movement property to true for this.
    • Added ability to set AFK players as "asleep" according to the new Bukkit feature in CB 677. This only works if you have kick-idlers set to false. If use-faux-sleep is set to true, then players who are AFK will be marked as "in bed" for checking if all players are in bed to move the server clock to day.
    Version 0.8.1
    • Fixed possible NPE through the Permissions plugin. Looks like he's not checking if the Player object passed in to his PermissionHandler.has() method is null or not.
    Version 0.8
    • Added ability to simply make an announcement of idling status. This is controlled through the kick-idlers property of the properties file to false. Defaults to kick idlers (true).
    • Added a check for player online-ness before trying to kick them. Should hopefully help prevent some of the NPEs, since the previous check for player presence was apparently insufficient.
    • Changed kick announcement color to yellow.
    Version 0.7.1
    • Simple changes to method signatures to match the changes in CB 612? (Not sure exactly which version they were introduced). Makes plugin fully compatible with CB 617.
    Version 0.7
    • Added the ability to determine whether certain events should be listened to. The events which can be listened to currently are:
      Player move
      Open inventory
      Player chat
      Block place
      Block break
      Player drop item.

      These are modified by setting one of the "listen-*" settings in the properties file.
    Version 0.6.1
    • Corrected a NullPointerException that was occurring if you were not running the Permissions plugin.
    Version 0.6
    • Added support for Permissions plugin.
    • Added synchronization for the playersToKick list. Seemed like we were getting some log messages that indicated there was some concurrent access happening. This should prevent it while simultaneously not slowing bukkit down much.
    • Added some nicer cleanup in onDisable() so it wipes some stuff out for potential subsequent startup better.
    • Added a setting for the experimental jump ignoring code so I no longer have to maintain multiple versions of the plugin. It's "use-jump-ignoring" in the properties file. Also added the command "useJumpIgnore [true|false]" to the plugin's command description and commands it is capable of handling.
    Version 0.5.1
    • Added some experimental jump-ignoring code.
    Version 0.5
    • Added a player count threshold making it so if the number of players on the server is below this threshold then nobody will be kicked. Set to 0 to always kick idlers.
    • Made the system a bit more robust so if there's a problem with the players to be kicked task not happening we're not totally hosed until server restart. You should get a log message after 60 seconds saying that kicking players failed and then the system should be ready to go.
    Version 0.4
    • Fixed the TSLPC error.
    • Corrected a problem in which the player command event was being listened for but not caught instead of listening for the player chat event which was attempted to be caught.
    Version 0.3
    • Added commands that allow you to hot-swap config values while the server is running.
    • Added config-file saving which happens every time you change a value with a command. See commands above.
    Version 0.2
    • Removed setting re-saving on shutdown until settings hot-swapping is enabled while the server is running.
    Version 0.1
    • Releasing the AfkBooter.

    Features for the future:
    • Look into allowing multi-line kick messages. (low priority, haven't been able to figure it out yet).

    Old Versions:
    v1.0.2: jar
    v1.0.1: jar
    v1.0: jar
    v0.9: jar
    v0.8.1: jar
    v0.8: jar
    v0.7.1: jar
    v0.7: jar
    v0.6.1: jar
    v0.6: jar
    v0.5.1 (experimental, see change log): jar
    v0.5: jar
    v0.4: jar
    v0.3: jar
    v0.2: jar
    v0.1: jar
    morganm and ssechaud like this.
  2. Offline


    I tried using this, but it keeps resetting the config file to default no matter what so i cant configure it at all. :\
  3. Offline


    Are you changing the settings while the server is running? The plugin will re-write its current settings when it shuts down (this is for the future feature that will allow you to change settings while it's running.)

    Make sure you stop the server before you try to change settings. I'll try to get a new version up that doesn't overwrite your settings on shutdown until I get the hot-swapping running.

    Edit: Ok, I got a new version uploaded that doesn't save over settings on shutdown.
  4. Offline



    I love your plugin.

    It is the first AFK player remover I have hit that does seem to work.

    I am using your plugin on a medium size server that runs 24/7. Average about 12-18 people all the time.

    My players have told me that they are getting kicked even while chatting.

    This is no way in the fault of you or your coding. I am blaming this on the other two chat effecting plugins we have running.

    I thought I would just post for you what is happening and what plugins "I suspect" are the issues.

    I mean don't get me wrong as a fix would be very cool.

    In the mean time I am just going to tell my users to suck it up and make sure they move every once in a while.

    Plugins we use and that I think are the problem:

    Keep up the great work!
  5. Offline


    That's a little odd, but would make sense if either of those other two plugins are cancelling the chat event before it gets to my plugin, as I'm only using the monitor priority to look at events. I'll take a look at them and see if I can find out exactly what's going on.
  6. Offline


    Maybe I'm wrong, but doesn't minecraft do this automatically? I've been booted several times on my server for idling too long.
  7. Offline


    Minecraft does not do this automatically. It'll boot you if there's a communication error, but previous to this plugin I have idled on my own server for several hours without consequence.
  8. Offline


    I really appreciate your hard work towards what is an invaluable plugin.
  9. Offline


    Put up a new version of the plugin which allows hot-swapping of config values. Haven't had a chance yet to look into those other plugins which are probably overriding the chat event-- getting ready to move this week, so my available time has been short.
  10. Offline


    Cool.. I do look forward to it. In the mean time.. I told my players just to move once in a while.

    CB# 350+

    On server start up.

    06:36:16 [SEVERE] Could not load plugins/AfkBooterv0.3.jar in plugins: null
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:80)
    at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.java:129)
    at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager.java:94)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:59)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.NoSuchMethodException: com.runicsystems.bukkit.AfkBooter.AfkBooter.<init>()
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.getConstructor(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.java:75)
    ... 8 more

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 9, 2016
  11. Offline


    My console is telling me your plugin has a 'stupidly long constructor' and tells me to bother you about it.
  12. Offline


    Posted a fix for TSLPC problem.

    Also it turns out the plugin was not properly listening for the chat event, so I've corrected that. You shouldn't have issues with players getting kicked while chatting anymore.
  13. Offline


    Using build 447 when a player get kicked I see this error message in the console:

    04:48:50 [SEVERE] java.lang.IllegalStateException: Failed to remove player. net.
    minecraft.server.EntityPlayer@2ea isn't in chunk -10, 16
    04:48:50 [SEVERE] at net.minecraft.server.PlayerInstance.b(PlayerInstance.
    04:48:50 [SEVERE] at net.minecraft.server.PlayerManager.b(PlayerManager.ja
    04:48:50 [SEVERE] at net.minecraft.server.ServerConfigurationManager.c(Ser
    04:48:50 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHand
    04:48:50 [SEVERE] at net.minecraft.server.NetworkManager.a(SourceFile:234)

    04:48:50 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHand
    04:48:50 [SEVERE] at net.minecraft.server.NetworkListenThread.a(SourceFile
    04:48:50 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServe
    04:48:50 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftSer
    04:48:50 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(Sour
  14. Offline


    Cool, thanks for this plugin!

    A little Request:
    - option so set "ony kick, if more than xx Users are online"

  15. Offline


    @ssechaud: That's a result of the player not getting removed from the chunk properly by bukkit. I would think it's probable that player had teleported sometime before he was kicked between your server start up and then. I'm not sure there's anything I can do about that error, but will look into it.

    @Jobsti: I can add that, yes.
  16. Offline


    Is there any chance you could make this compatible with permissions? I love the plugin, but I'd love to be able to, instead of writing out the player who are exempt from afk kicking, be able to define groups. This way I don't have to keep editing the file every time someone needs to be added or removed.

    I don't mean to be annoying, but I just think it would help the usability of the plugin.
  17. Offline


    Can you add ability to ignore jumping?

    Some players put something on their space key, causing them to jump forever and not get kicked while being AFK.
  18. Offline


    Added version 0.5 and 0.5.1. The only difference between the two is that 0.5.1 contains some new experimental jump-ignoring code. Note that I haven't figured out a clean way to determine if a player is jumping versus just on a ladder (although if you're on a ladder the whole time for most kick windows you've got problems...). The only way I've been able to come up with so far is just to store a whole bunch of state info about the player's last multiple movements, and that's something I'd rather avoid doing. So right now the experimental code simply ignores your movement for activity tracking purposes if there's a vertical component to it.

    Again, if you'd rather not deal with that aspect (especially since it may be buggy), just download 0.5.

    Ran out of time to look into permissions today-- hopefully tomorrow.
  19. Offline


    Don't include the version number in your .jar or the folder which contains the configuration. It's unprofessional, and it's hard to upgrade to the newest version, since you have to delete the old files and reconfigure everything. Just a tip.
  20. Offline


    Well i think that up/down protection is suitable. Even if someone would climb ladders up and down for 10 minutes, he should be kicked.

    I will check it out tomorrow. Thanks.
  21. Offline


    Firstly, I disagree about it being unprofessional. It helps server admins know what version they are running (with regards to the configuration file). Secondly, the folder name doesn't have the version number in it. The version number is written into the configuration file's comments. You won't have to reconfigure anything. It's merely to help server admins know what version they're running. The version number gets overwritten with the current version if you use any of the plugin's commands.

    As to the jar name having the version number in it, that's done to allow me to track download counts on GitHub and allow users to download older versions of the plugin. I trust server admins to be able to use a simple rename command.
  22. Offline


    Goooooood Job !!!!
  23. can i suggest you make it so block-breaks/places reset the players activity timer?
  24. Offline



    Please support the auto-updating plugin CraftBukkitUpToDate. To do so please provide a permanent direct link to the author of CraftBukkitUpToDate.

    The below is information they provide
    Show Spoiler

    My Plugin didn't supported, how i get it to work with CButD?
    Give me a permanent link to your Plugin, i will add it. That's all no changes at your SourceCode or something else, all I need is a permanent link to the newest version of your Plugin. A good place for this is http://www.dropbox.com/ or for OpenSource https://github.com/.

    I really enjoy using your plugin and would like to see it work well with the above listed 'updater' plugin.
  25. just saw a decent sized problem. When i attempted to restart my server, it spammed the console with this, and didn't let my server restart:
    [INFO] [AfkBooter] Attempting to re-check for players to kick too soon. Please set interval higher.
    The interval is at 10 seconds. I'm not sure what exactly would cause this to happen when shutting down... but it caused my server to go down while restarting
  26. Offline


    How did you shut your server down? Did you use the stop command or some other way? At what point in the restart process did this happen? i.e. when stopping, during start but after loading, etc. This error is produced when the plugin has found idle players that need to be kicked but has not actually been able to kick them yet. It'll give you this error once every time your interval timer goes off until either a) it kicks the players and clears out that list, or b) it hits 60 seconds and determines it's unable to kick the players and will just clear the list out anyway and spit out an error mesage telling you that kicking failed.

    I would be extremely surprised if this is what caused your server to fail. I would rather suspect this is another symptom of whatever actually caused it to fail.

    As to block placing/breaking, I could add that to tracking but it would increase lag to a certain extent. It might be negligible, but my reasoning for not including it in the first place was that if you were placing blocks in more than about a 5x5 square around yourself then you would have to be moving anyway.

  27. Ok. now its just showing that error and 'soft-crashing' the server. (by soft-crash i mean no commands go in/out, but the server is still 'online'...everything simply times out)
    Just to make sure you got the correct message::
    [INFO] [AfkBooter] Attempting to re-check for players to kick too soon. Please set interval higher.
    I have the interval at 30 seconds. And afk kicking is set to kick after 5 minutes. There was NO command to restart/shut down the server, and there were no other error consoles. Noone was kicked at that point (although it might have been trying to kick someone). I have no other plugins that are in use that would interfere with this. (main ones are worldguard/edit stargates, and administration plugins that modify permissions/chat)
  28. Offline


    What other plugins are you using? What version of this plugin are you using? What version of CraftBukkit are you running?

    Have you tried disabling this plugin (remove it from the plugins directory) and the problem goes away? What if you run the AfkBooter by itself with no other plugins present?

    I honestly don't know what to tell you right now. With the information you've given me, I can determine no way that this is possible. I can't reproduce this on my server, so I won't be able to help without some more information.

    I'm confused about this part: is this a separate incident than the first one?
  29. Yeah... sepparate incident...its happening about 3-4 times a day... and getting quite annoying.

    What causes the plugin to output that to console? perhaps its when it tries to kick someone, but cannot...
    Maybe during a world save? (game freezes for about 10-15 seconds during save). Thats the only possible thing i can think of (plugin tries to kick someone, but it doesn't work, and it tries again, which is against the set interval..etc etc)

    As to removing the plugin, yes... when its gone, the error doesn't come up... (The error is coming from your plugin, whcih is why console is outputting "AfkBooter" with the message...)
    As to trying it with ONLY this plugin, it is slightly absurd to do that. Running a server with 35-50 people online at all hours, would be slightly insane to simply disable all other plugins, and run the server for who knows how long just to see if it comes back (even thought i know this would provide a quick answer, its just not feasible)
  30. Offline


    Yes I realize the error is coming from my plugin-- I wrote the error message. I know exactly where in the code the error is being generated, and what the plugin thinks is wrong. What I don't know is why it's wrong-- it does not make any sense and does not make sense that world saving would have anything to do with a plugin that checks for the presence of players-- it doesn't do anything with the map.

    As to what causes the plugin to output this message-- I already told you, 2 posts ago. I'm a bit irritated that you didn't seem to read it.

    You do not have a test server instance you try new plugins on? As to the absurdity, to be honest, if you want to solve this problem, tough. It doesn't matter if you find it absurd to disable all other plugins to try to track it down. I have told you that I am not able to reproduce this problem on my own servers, test or production, and if I am not able to reproduce the problem I cannot fix it. Therefore, if you want me to be able to resolve this problem, you must provide me with as much information as possible.

    From my point of view now, I am forced to assume that one of your other plugins is interfering with the operation of my plugin. You have still failed to provide basic information that I have asked for in order to try to track this down, such as which plugins you are using and what versions of them and CraftBukkit you are running. Until you are able to provide that information, do not ask for further support.

Share This Page