AfkBooter - 踢出在服务器上闲置过久的玩家。这是由 @neromir 开发的原始 AfkBooter,旧版讨论帖可在此 查看。经 @neromir 授权,现发布于此处,并将随后续 Bukkit 版本在此持续维护。
功能特性
- 防止玩家在服务器上的闲置时间超过设定的上限。
- 允许你设置一个免受闲置踢出的玩家名单。
- 允许你设置一个玩家数量阈值,当在线人数低于该阈值时,不会踢出任何玩家。
- 允许你为被踢出的玩家设置自定义的踢出提示消息,同时设置一条在被踢出时向全服广播的消息。
- 允许你决定是仅仅公告玩家的闲置状态,还是直接将闲置玩家踢出。如果设置为 true,当玩家不再处于闲置状态时会进行公告。踢出广播消息用于确定玩家进入闲置状态时所公告消息的文本内容。
- 适用于任意数量的在线玩家(即使服务器上只有一个人也不会失效)。
- 允许你设置检查闲置的频率。它不会为你随意设定踢出检查间隔,而是让你根据服务器的最佳需求自行决定。
- 允许你指定从给定事件集中监听哪些事件,以用于活动性检查。
- 允许你指定玩家在载具中移动时是否应被视为活跃状态。
- 允许你设置闲置玩家是否应被计为“在床上”,以便检查所有玩家是否都在床上以将服务器时间推进到白天。
- 允许你设置是否阻止闲置玩家拾取物品。
- 与 Permissions 3.1.6 集成。在 Permissions 2.7.3 上也能正常运行。
安装方法
- 只需将 jar 文件放入 CraftBukkit 的 plugins 目录即可。
- 首次运行时,它会在 "plugins/AfkBooter" 目录下创建一个名为 "afkbooter.properties" 的文件,并填充默认设置。
- 然后你应该停止服务器,修改设置以符合你的需求,再重新启动服务器。
权限节点
- afkbooter.exempt:拥有此豁免节点的玩家不会被插件踢出。(注意,此豁免节点是在设置文件中 exempt-players 列出的名单之外的额外豁免。)
- afkbooter.config:拥有此配置节点的玩家将可以访问以下列出的所有命令。
命令
- /afkbooter kickTimeout [number] - 更改在被踢出前允许的闲置时间(秒)。
- /afkbooter kickMessage [message] - 更改被踢出玩家看到的消息。
- /afkbooter kickBroadcast [message] - 更改有人被踢出时向所有玩家广播的消息。
- /afkbooter listExempt - 列出豁免列表中的玩家。
- /afkbooter addExempt [playerName] - 将一名玩家添加到豁免列表。
- /afkbooter removeExempt [playerName] - 从豁免列表中移除一名玩家。
- /afkbooter playercount [number] - 设置低于此阈值时将不会踢出任何玩家的临界值。
- /afkbooter useJumpIgnore [true|false] - 设置是否使用实验性的跳跃忽略代码。
- /afkbooter kickIdlers [true|false] - 设置是否应踢出闲置玩家,还是仅公告其闲置状态。
- /afkbooter ignoreVehicles [true|false] - 设置是否在玩家位于载具中时忽略其移动。
- /afkbooter useFauxSleep [true|false] - 设置是否使用模拟睡眠(闲置玩家被视为在床上)。
- /afkbooter blockIdleItems [true|false] - 设置是否应阻止闲置玩家拾取物品。
- /afkbooter list - 列出标记为 AFK 的玩家。
配置说明
当插件检测到以下任一事件时(具体取决于你的设置),玩家可以被视为活跃状态:
- 加入服务器 (Join)
- 移动(看向超过一定角度阈值的方向,我相信是 30 度,也算作移动)
- 聊天/命令
- 打开物品栏(仅仅是保持物品栏打开不会触发此项——只有实际执行打开物品栏的动作才会触发)
- 放置方块
- 破坏方块
- 掉落物品
- 玩家与方块交互
- 玩家与实体交互
可在 listened-events 属性中列出的事件名称:
- PLAYER_MOVE
- PLAYER_CHAT
- PLAYER_COMMAND_PREPROCESS(用于同时检测命令和聊天)
- PLAYER_DROP_ITEM
- BLOCK_PLACE
- BLOCK_BREAK
- PLAYER_INTERACT
- PLAYER_INTERACT_ENTITY
INVENTORY_OPEN(请勿使用)
更新日志
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)
Changelog
评论 0
登录后参与评分
还没有评论,来抢沙发吧