Afkbooter
AfkBooter - Boot players who idle too much on your server. This is the original AfkBooter by @neromir, old thread can be found here. It is being posted here as approved by @neromir and will be maintained through future Bukkit versions here.
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.
Permissions
- afkbooter.exempt: Anyone that has the exempt node will not be kicked by the plugin. (Note that the exempt node is in addition to any names listed in the exempt-players list in the settings file.)
- afkbooter.config: Anyone that has the config node will have access to all the below-listed commands
Commands
- /afkbooter kickTimeout [number] - Changes the idle time (sec) allowed before players are kicked.
- /afkbooter kickMessage [message] - Changes the message a kicked player sees.
- /afkbooter kickBroadcast [message] - Changes the message broadcast to all players when someone is kicked.
- /afkbooter listExempt - List the players on the exempt list.
- /afkbooter addExempt [playerName] - Add a player to the exempt list.
- /afkbooter removeExempt [playerName] - Remove a player from the exempt list.
- /afkbooter playercount [number] - Set the threshold below which no players will be kicked.
- /afkbooter useJumpIgnore [true|false] - Set whether or not to use experimental jump ignoring code.
- /afkbooter kickIdlers [true|false] - Set whether or not idlers should be kicked or merely announced as idling.
- /afkbooter ignoreVehicles [true|false] - Set whether or not to ignore player movement while in vehicles.
- /afkbooter useFauxSleep [true|false] - Set whether or not to use faux sleep (afk players are considered in bed).
- /afkbooter blockIdleItems [true|false] - Set whether or not item pickup should be blocked for idlers.
- /afkbooter list - List players marked as AFK.
Configuration
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_MOVE
- PLAYER_CHAT
- PLAYER_COMMAND_PREPROCESS (to detect commands as well as chat)
- PLAYER_DROP_ITEM
- BLOCK_PLACE
- BLOCK_BREAK
- PLAYER_INTERACT
- PLAYER_INTERACT_ENTITY
INVENTORY_OPEN(DO NOT USE)
Testing this on the latest bukkit dev version 2117.
Im getting kicked even if I run and jump all over the place.
You think it's a bukkit issue? Or could i be configuring it wrong?
Is it possible to turn off the broadcasting of kicked for AFK?
Beta update posted. Should syndicate as soon as Bukkit admins approve, but for now you can get it via direct link here.
I have had NO chance to test this other than that it compiles and loads, so please test it out and report any issues as tickets here. Also if there are no issues and it's working good, that would be good feedback as well so that I can promote this to a stable release.
Quick update: I got some time to work on this last night and the work is about 80% done. I've written the updates in such a way to maintain compatibility with the existing config file, even thought the Bukkit events the config file references don't actually exist anymore.
I still have a bit more work to do to finish it off, but seems likely I'll be able to get that done and tested and get a release out this week.
I've been using this plugin since it was released... Keep up the great work! I love this.
@MariuszT
It's not silent, I just responded to Ticket #5 last night.
Seriously, people, I get that you like your plugins and I'm glad that developers write plugins that people enjoy using. But this is not a paid gig. Some of us have jobs, families, school, whatever and writing plugins is something we do for fun on the side. If you've got that much spare time on your hands, pick up a good Java book and learn how to contribute back.
Otherwise, I will get to it when I can. I use this plugin too so at the moment I don't have it running either. So it will get updated, just be patient.
Silent... :( It's important plugin, I need it on 1.2.3 server.
Update to new event system?!?
And fix random kicks. Thanks!
Works good but sometimes kicks wrong people who aren't AFK
Please update soon!
Same problem, r4 and people get kicked no matter what
I am aware of the impending R5 "doom" for this plugin (Ticket #5) in that it relies heavily on the old event model, even exposing the event types directly in the config file.
It WILL need some "more than basic" refactor work in order to run on R5, so please do not upgrade to R5 and expect this to work. Bukkit has chosen to deprecate the "old event model" within a very short period of time after releasing the "new event model" and so breaking just about every plugin that didn't update in the short window provided. I'm sorry for that; it was the right choice but the timing of the deprecation window was poorly chosen.
I *will* update this plugin (or someone may do the work and push me a gitpull), so don't worry. It just may not happen immediately, it might take me a week or so to get to it. Be patient, and if you absolutely depend on AfkBooter, then don't upgrade to the latest dev releases/R5 until it's ready.
Please make sure your plugin is ready for R5 - Thank you! :)
@andune I'm blind :P I still hate dev.bukkit although it's maybe easier for devs
@nebenezer
Use pastebin to post your afkbooter.properties. All I can tell you is that it works for lots of other people and specifically that it is working for me (running RB #1846). So it's most likely you have config options setup wrong.
Installed this last night, didn't do any testing yet in search of the problem but for some reason it thought everyone was always afk. Everyone logged in got kicked every 30 seconds no matter what, hahaha. They were not pleased with me but they can get over it :P
Is there a common likely scenario that could be causing afkbooter to not register any of their movements or actions? I use a bunch of plugins.. the only one I can think of that might interfere, and I only think this because it also watches movements and actions, is NoCheat.
Love the premise. I award interest on players money for every hour they spend playing.. not surprising that I find players logged in afk pretty frequently :P
Hope I can get it working right, would love to use this plugin :)
@VADemon
I'm always amazed by the number of 'source code' requests I get on dev.bukkit.org. For your future reference, every project here has a 'repository' tab on it, which is the first place you should look. Some project authors choose not to share their source, but you'll find all of mine (and many other authors here) post a link to the github repository right there. Feel free to follow that link and clone the source. If you do make any useful additions it would be nice for you to send a gitpull request back so they can be incorporated into the plugin for everyone else to benefit from also.
Source code? :/
Could you make configurable the showing of a broadcast message to other players?
kick-broadcast didn't work. I got the standard message in the console.
When you don't do it in next time: Could I get the source code so I try to make it? Thanks