[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

    neromir

    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.

    Features:
    • 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:

    Code:
    #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
    exempt-players=name1,name2,name3
    use-jump-ignoring=false
    timeout-check-interval=10
    kick-message=Kicked for idling too much.
    kick-timeout=30
    kick-broadcast=kicked for idling too much.
    player-count-threshold=0
    kick-idlers=false
    ignore-vehicle-movement=false
    use-faux-sleep=false
    block-idle-items=false
    listened-events=PLAYER_MOVE,PLAYER_CHAT,INVENTORY_OPEN
    
    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:
    Code:
    - '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.

    Commands:
    Code:
    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:
    Code:
    PLAYER_MOVE
    PLAYER_CHAT
    PLAYER_COMMAND_PREPROCESS (to detect commands as well as chat)
    INVENTORY_OPEN (does not work currently due to Bukkit event issues with inventory)
    PLAYER_DROP_ITEM
    BLOCK_PLACE
    BLOCK_BREAK
    PLAYER_INTERACT
    PLAYER_ENTITY_INTERACT
    
    Changelog (open)

    Changelog:
    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

    wassilij

    Its working perfect for me with CraftBukkit Build 1185
     
  3. Offline

    Kain888

    Really useful plugin. Any chances to update to newest RB?
     
  4. Offline

    oxguy3

    Um, "bukkit" should never be part of your package identifier! In the Plugin Development forum, there is a sticky that says nothing except 'Don't include bukkit in your package identifiers.' Come on!

    Sorry to be a jerk about it. Good job on this plugin though - it has excellent code structure.
     
  5. ...it kicks people regardless of if they move or not...am i missing something here or is it just being annoying, im using 1185
     
  6. Offline

    neromir

    Unfortunately I have not had time for several months to work on this plugin, and do not foresee having time in the near future. I should have posted this sooner, but I've toyed with the idea of coming back and working on it for a while, but have just finally decided it's just not likely in the cards. With a baby on the way, I doubt I'm going to be having any more time than I have now, and my desire to play Minecraft has decreased a bit as well, over time. However, if you, or a developer you know, would like to take up the project, please feel free to fork it and continue. The code is all up-to-date on Github.

    That's not correct, as I have pointed out many times in the bukkit+ and plugin development forums (granted around May of this year). It is fine to use "bukkit" in your package as long as it is not the second-level domain name, since [org|com|net].bukkit refers to the web address owned by the bukkit team. However, [org|com|net].[otherdomain].bukkit does not refer to their domain name, and is therefore not a problem. So, org.bukkit.afkbooter would be wrong, whereas com.runicsystems.bukkit.afkbooter is fine. Please see http://forums.bukkit.org/threads/on...t-use-bukkit-in-your-plugins.3732/#post-50813 which links to a post (and the reply by dinnerbone) farther down on the same sticky thread you mentioned.

    Anyway, not to sound rude in my reply; this particular misconception is just a pet peeve of mine. :) Also, thanks for the compliment on the code structure.
     
  7. i cant delete the .jar it just says its already in use but the server is offline etc
     
  8. Offline

    oxguy3

    That's not a problem that anyone here can help you with. If you're using a server host, contact tech support. If you're hosting your server on a computer of yours, try restarting it or something.
     
  9. already solved the delete problem just forgot to say so, would have still liked to have this plugin but ah well
     
  10. Offline

    monir

    People gets kicked even when the are not Afk uppdate can somebody please take over this plugin?
     
  11. Offline

    Darkone003

    @neromir

    Plugins broken on 1538, sometimes it kicks people who aren't afk at what seems like complete random, no errors in console.
     
  12. Offline

    Don Redhorse

    will probably take this plugin over... but as a subset of a bigger plugin.. so if somebody wants to take it over also as a separate problem it would be great.
     
  13. Offline

    Don Redhorse

    @neromir I would like to take the plugin over.. looks like I need written proof to be able to create a dev.bukkit project for it... even as PART of another project...
     
  14. Offline

    neromir

    Hopefully this is sufficient: I give Don Redhorse permission to take over this plugin either to maintain it as a separate plugin or to integrate it into another project.
     
  15. Offline

    andune

    Oh, look at that. Just tonight I finally decided to tear open the source and do some performance tweaks to eliminate the PLAYER_MOVE requirement. I submitted a git pull request and came here to check on the thread and I see it's looking for an owner.

    @Don_Redhorse: sounds like you had bigger and better plans and just wanted to incorporate parts of this into some larger plugin?

    @neromir: I'd be happy to post this plugin as-is (including my performance tweak and a HeroChat-related bugfix) onto dev.bukkit.org and support it in it's current form through future Bukkit versions. I've used the plugin on my server for some time now and am quite happy with it's functionality as-is, so I'll end up supporting it anyway to keep it going on my server, I might as well share that with everyone else too. :) I'd just maintain the fork from here forward:

    https://github.com/morganm/AfkBooter
     
  16. Offline

    neromir

    @morganm That's fine with me as well. If you two want to work it out on who ends up taking it over (and in what forms), you both seem to be responsible and capable. If Don Redhorse wanted to incorporate the functionality into a larger project, it might also be nice for morganm to maintain it as a separate plugin.
     
  17. Offline

    Don Redhorse

    GO!

    I just didn't want that plugin to die, we mainly use it to signal to players that people have gone afk (we don't kick yet) and wanted to include a visisble effekt (flames or smoke or whatever) on the player, setting him invincible and disabling mob targeting.

    Would be cool if you could do that :)

    BTW: Thanks for helping me out with some issues I had ;-)
     
  18. Offline

    andune

    Alright, it's done. @neromir if you would be so kind as to update this thread to point to the dev.bukkit site to redirect people there for the file and any support questions.

    http://dev.bukkit.org/server-mods/afkbooter/

    Thanks for writing this plugin and giving it to the community to support as you move on. Best of luck in your new endeavors!

    Also @Don Redhorse I will add you as an author so feel free to dress up the dev.bukkit site or contribute new features.
     
    Don Redhorse likes this.
  19. Offline

    neromir

    @morganm Done.

    To anyone else who didn't read the first post: Do as the man says, see the dev.bukkit for any issues you have. Posting any further support issues here will be ignored by me, and likely to not be checked by morganm. If you need anything related to this plugin, go check the link he gave (top of the first post, giant red text).
     
  20. Offline

    Don Redhorse

    will do.... later... need to get my other plugins stable first (incl. the new one) and than finally setup our minecraft server... in the next 2-3 days.... yeah... xmas...
     
  21. Offline

    gabripj

    Have a way to disable the broadcast message?
    thank you!
     

Share This Page