OpGuard
OpGuard 保护指定玩家在你的 Paper 服务器上不会失去操作员(op)权限。
受保护的操作员无法通过命令被意外取消 op,任何试图移除其操作员状态的行为都会被自动检测并撤销。
功能
命令保护
当有人尝试运行:
/deop <player>
OpGuard 会在命令执行前拦截它。
这适用于由玩家、服务器控制台和 RCON 发出的命令。
如果目标是受保护的操作员,该命令将被取消,因此玩家永远不会失去操作员状态,哪怕只是一瞬间。
后台检查
并非所有移除操作员状态的方式都经过 /deop。
其他插件可能通过 API 修改操作员状态,或者有人可能手动编辑 ops.json。
OpGuard 会定期检查当前操作员列表与受保护列表。如果受保护的玩家不再是操作员,其操作员状态将立即恢复。
检查间隔可配置,默认约为每秒一次。
恢复机制
当 OpGuard 需要恢复操作员状态时,它使用服务器控制台命令:
op <player>
这与管理员手动使用的方法相同,并使恢复过程与服务器的常规操作员系统保持兼容。
OP 等级
OpGuard 不会硬编码操作员等级(如 level 4)。
操作员权限等级由以下配置控制:
op-permission-level
在 server.properties 中。
/op 命令始终授予由服务器配置的权限等级。默认情况下,这通常是 level 4。
配置
config.yml:
protected-ops:
- PlayerName
protected-uuids:
- uuid-here
settings:
check-interval-ticks: 20
log-to-console: true
选项
protected-ops
应始终保持为操作员的玩家名称。
protected-uuids
可选的基于 UUID 的保护。
settings.check-interval-ticks
后台检查运行的频率。20 tick 大约为 1 秒。
settings.log-to-console
控制是否将 OpGuard 的保护和恢复操作记录到控制台。
命令
/opguard reload
重新加载配置。
/opguard check
立即运行操作员保护检查。
别名: /og
兼容性
OpGuard 专为标准的 Paper/Bukkit 操作员系统设计,可保护免受 /deop 命令以及发生在命令系统之外的操作员移除行为的影响。
受保护的玩家将始终保持操作员状态。
OpGuard
OpGuard protects selected players from losing operator privileges on your Paper server.
Protected operators cannot be accidentally deopped through commands, and any other attempt to remove their operator status is automatically detected and reversed.
Features
Command Protection
When someone tries to run:
/deop <player>
OpGuard intercepts the command before it is executed.
This works for commands issued by players, the server console, and RCON.
If the target is a protected operator, the command is cancelled, so the player never loses operator status, even for a moment.
Background Check
Not every way of removing operator status goes through /deop.
Another plugin could modify operator status through the API, or someone could manually edit ops.json.
OpGuard periodically checks the current operator list against the protected list. If a protected player is no longer an operator, their operator status is immediately restored.
The interval is configurable and defaults to approximately once per second.
Restoration
When OpGuard needs to restore operator status, it uses the server console command:
op <player>
This is the same method an administrator would use manually and keeps the restoration process compatible with the server's normal operator system.
OP Level
OpGuard does not hardcode an operator level such as level 4.
The operator permission level is controlled by:
op-permission-level
in server.properties.
The /op command always grants the permission level configured by the server. By default, this is normally level 4.
Configuration
config.yml:
protected-ops:
- PlayerName
protected-uuids:
- uuid-here
settings:
check-interval-ticks: 20
log-to-console: true
Options
protected-ops
Player names that should always remain operators.
protected-uuids
Optional UUID-based protection.
settings.check-interval-ticks
How often the background check runs. 20 ticks is approximately 1 second.
settings.log-to-console
Controls whether OpGuard logs protection and restoration actions to the console.
Commands
/opguard reload
Reloads the configuration.
/opguard check
Immediately runs an operator protection check.
Alias: /og
Compatibility
OpGuard is designed for the standard Paper/Bukkit operator system and protects against both /deop commands and operator removal that happens outside the command system.
Protected players stay operators.
评论 0
登录后参与评分
还没有评论,来抢沙发吧