zPermissions — 适用于 Bukkit 的 Superperms 插件
zPermissions 主要是一个基于 SQL 数据库的 Superperms(即 Bukkit 权限)实现。它还支持扁平文件存储。 notable features 包括:多世界支持、具有多条轨道/梯队的等级、任意深度的组继承(在合理范围内),以及使用 WorldGuard 区域、Residence 领地、Factions 领土或 Factoid 土地的区域特定权限。
没有内置的建筑保护功能(我依赖其他插件来实现这一点)。zPermissions 专注于权限,仅此而已。
我的目标是让 zPermissions 成为一个简单但功能丰富的 Superperms 提供者。
从 1.3beta1 版本开始,zPermissions 支持 UUID!有关详细信息,请参阅该版本的说明。
[ 快速入门文档 | 面向服务器管理员 | 常见问题解答 | 更多文档如下! ]
有问题?遇到问题?
如果您的问题仍未得到解答,请在论坛上发帖。
最后,对于任何错误/问题,请创建dev.bukkit.org 工单。
除非我已经认识你,否则私信将被忽略。
特性
-
多种存储选项,从 SQL 到扁平文件。 使用 Bukkit 数据库存储权限(即 bukkit.yml 中的设置)。应与 Avaje Ebean 支持的大多数数据库一起工作——我已专门测试了 PostgreSQL、MySQL 和 H2。默认的 Bukkit 数据库 SQLite 不受支持。如果使用它,zPermissions 将自动回退到扁平文件存储。
-
组继承。 组可以从多个父组继承权限。
-
玩家可能属于多个组。 应用组权限的顺序是明确定义的,并基于组权重(当然,这是可配置的)。
-
多世界支持。 授予玩家和组的权限可以与特定世界关联。
-
可选的区域支持。 权限也可以与 WorldGuard 区域或 Residence 住所关联。
-
多条晋升路径! 使用权限,您还可以限制谁可以晋升/降级他人以及他们可以使用哪些路径。此外,每个玩家都可以沿多条路径进行晋升/降级。
-
短期临时权限。 给玩家一个持续时间为几秒到几分钟的权限节点。
-
临时组分配。 将组分配给玩家,使其成员资格在1天……几个月……或一年后过期!无论您想要什么持续时间。
-
可以为玩家和组分配聊天前缀和后缀。 仍然需要一个与 Vault 兼容的聊天格式插件,例如 Herochat、zChat 等。
-
API。 zPermissions 提供了一个全面的 只读 API,其他插件可以使用它。(尽管我建议使用 Vault 进行编码。)
-
元数据支持。 玩家和组可以具有与之关联的任意元数据。元数据值可以是字符串、整数、实数(浮点数)和布尔值。可以通过原生 API 或 Vault Chat API 查询元数据。
-
自动组权限。 随着 Superperms/Bukkit 权限的出现,测试组成员资格的推荐方法是使用权限。zPermissions 可以根据每个组的名称自动设置一个权限。默认情况下,此可配置权限为
group.<groupname>(与 WorldEdit 和 WorldGuard 开箱即用兼容!)。 -
可重新分配的默认组。 默认组(未明确分配到任何组的玩家被分配的组)名为
default。这可以更改。
概念
-
组是“通用的”——跨所有世界。没有计划引入特定于世界的组。
-
然而,玩家和群组可能拥有特定世界和/或特定区域的权限。这些权限仅在玩家处于该特定世界和/或区域时生效。
-
权限共有 4 个“层级”:通用、世界专属、区域专属,以及最终的区域与世界专属。最通用的权限会优先应用,且所有组权限会先于玩家权限应用:
- 通用组权限
- 世界专属组权限
- 区域专属组权限
- 区域与世界专属组权限
- 通用玩家权限
- 世界专属玩家权限
- 区域专属玩家权限
- 区域与世界专属玩家权限
-
玩家可以属于多个组。可以为组分配权重 — 权重越高,该组的优先级越靠后,从而覆盖之前的组。权重相同的组按字母顺序应用。
-
组可以继承自一个或多个父组。组的父组以逆序应用,以便组的第一个父组能够覆盖所有后续父组。
安装与用法
将 zPermissions.jar 放入服务器的 plugins 目录中。启动服务器。这将在服务器的 plugins/zPermissions 目录下创建 config.yml 文件。你可能需要编辑此文件以设置默认组和默认轨道。你也可以创建自己的轨道。
输入 /permissions 开始使用。(如果可用别名,/perm 或 /p 也可以工作。)
get、set 和 unset 子命令中的权限节点可以指定为:
- <permission> — 未限定的权限节点适用于所有世界和所有区域。
- <world>:<permission> — 要使权限成为世界专属的,请在其前加上世界名称并跟随冒号。
- <region>/<permission> — 要使权限成为区域专属的,请在其前加上区域名称并跟随斜杠。
- <region>/<world>:<permission> — 你还可以通过组合两个限定符使权限同时具备区域和世界专属特性。目前,区域限定符必须始终放在前面。
等级命令为 /promote、/demote、/setrank 和 /unsetrank,通常会将更改广播给所有管理员。等级命令有一个选项 -q 用于静默操作,例如在被自动化进程调用时。但是,出于安全审计目的,它们仍会将操作记录到服务器日志中。与 -q 相反,它们也接受 -Q,这会导致等级命令将更改广播给所有用户。
更多文档
- Permissions
- Detailed Command Usage
- Temporary Permissions & Groups
- Customizing Table Names
- Vault Support
- For Plugin Developers
- Schema Updates
许可证与源码
zPermissions 根据 Apache License, Version 2.0 发布。
源代码可在 GitHub 上找到:
本项目的开发版本可以从提供的持续集成服务器获取。这些版本未经 BukkitDev 工作人员批准。请自行承担使用风险。
- zPermissions (需要 ToHPluginUtils.jar)
- zPermissions-standlone (包含 ToHPluginUtils,类似于在 dev.bukkit.org 上分发的版本)
待办事项
- 更全面的单元测试,特别是针对服务接口。
- 更好的组织文档。
zPermissions — A Superperms plugin for Bukkit
zPermissions is primarily an SQL database-backed Superperms (aka Bukkit permissions) implementation. It also supports flat-file storage. Notable features are: multi-world support, ranks with multiple tracks/ladders, group inheritance of arbitrary depth (within reason), and optional region-specific permissions using WorldGuard regions, Residence residences, Factions territories, or Factoid lands.
There is no built-in build protection (I rely on other plugins for that). zPermissions focuses on permissions and only permissions.
I aim to keep zPermissions a simple, yet feature-rich, Superperms provider.
zPermissions supports UUIDs as of the 1.3beta1 release! See the notes for that release for details.
[ Quick start documentation | For Server Admins | FAQ | More documentation below! ]
Questions? Problems?
First, please check the known issues as well as the FAQ.
If your question is still unanswered, please post on the forum.
Finally, for any bugs/issues, please create a dev.bukkit.org ticket.
Unless I already know you, PMs will be ignored.
Features
-
A variety of storage options, from SQL to flat-file. Uses Bukkit database to store permissions (i.e. settings in bukkit.yml). Should work with most databases supported by Avaje Ebean — I've specifically tested with PostgreSQL, MySQL, and H2. The default Bukkit database, SQLite, is not supported. zPermissions will automatically fall back to flat-file storage if it is used.
-
Group inheritance. Groups may inherit permissions from a multiple parent groups.
-
Players may be members of more than one group. The order of which group permissions are applied is well defined and based on group weight (which is configurable, of course).
-
Multi-world support. Permissions granted to players and groups may be associated with a specific world.
-
Optional region support. Permissions may also be associated with WorldGuard regions or Residence residences.
-
Multiple promotion tracks! Using permissions, you can also limit who can promote/demote others and which tracks they may use. In addition, each player may be promoted/demoted along multiple tracks.
-
Short-term temporary permissions. Give a player a permission node that lasts anywhere from a few seconds to a few minutes.
-
Temporary group assignments. Assign a group to a player and have their membership expire after 1 day... a few months... or a year! Whatever duration you want.
-
Players and groups can be assigned chat prefixes and suffixes. A Vault-compatible chat-formatting plugin is still required, like Herochat, zChat, etc.
-
API. zPermissions offers a comprehensive read-only API that other plugins can use. (Though I would recommend coding against Vault instead.)
-
Metadata support. Players and groups may have arbitrary metadata associated with them. Metadata values may be strings, integers, reals (floating point), and booleans. Metadata may be queried via the native API or Vault Chat API.
-
Automatic group permissions. With the advent of Superperms/Bukkit permissions, the recommended way of testing group membership is by using permissions. zPermissions can automatically set a permission based on the group's name for each group. By default, this configurable permission is
group.<groupname>(compatible out-of-the-box with WorldEdit and WorldGuard!). -
Re-assignable default group. The default group (the group assigned to players who have not been explicitly placed into any groups) is named
default. This may be changed.
Concepts
-
Groups are "universal" — across all worlds. There are no plans to introduce world-specific groups.
-
However, players and groups may have world-specific and/or region-specific permissions. These permissions are only in effect when the player is in that particular world and/or region.
-
There are 4 "levels" of permissions: universal, world-specific, region-specific, and finally region- and world-specific. The most general permissions are applied first, with all group permissions applied first finally followed by player permissions:
- Universal group permissions
- World-specific group permissions
- Region-specific group permissions
- Region- and world-specific group permissions
- Universal player permissions
- World-specific player permissions
- Region-specific player permissions
- Region- and world-specific player permissions
-
Players may be members of multiple groups. Groups may be assigned a weight — a higher weight means the group is applied later so it overrides earlier groups. Groups with the same weight are applied alphabetically.
-
Groups may inherit from one or more parent groups. A group's parents are applied in reverse order so that a group's first parent overrides all subsequent parents.
Installation & Usage
Put zPermissions.jar in your server's plugins directory. Start up your server. This will create the file config.yml in your server's plugins/zPermissions directory. You may want to edit this file to set your default group and default track. You may also want to create your tracks.
Type /permissions to get started. (/perm or /p may also work, if those aliases are available.)
The permission nodes in the get, set, and unset sub-commands may be specified as:
- <permission> — An unqualified permission node applies to all worlds and all regions.
- <world>:<permission> — To make a permission world-specific, prefix it with the world name followed by a colon.
- <region>/<permission> — To make a permission region-specific, prefix it with the region name followed by a slash.
- <region>/<world>:<permission> — You may also make a permission both region- and world-specific by combining the two qualifiers. For now, the region qualifier must always come first.
The rank commands are /promote, /demote, /setrank, and /unsetrank and will normally broadcast changes to all admins. The rank commands have an option -q to operate silently, e.g. when being called by automated processes. They will, however, still log their actions to the server log for security audit purposes. Opposite of -q, they will also take -Q which causes the rank commands to broadcast changes to all users.
More Documentation
- Permissions
- Detailed Command Usage
- Temporary Permissions & Groups
- Customizing Table Names
- Vault Support
- For Plugin Developers
- Schema Updates
License & Source
zPermissions is released under the Apache License, Version 2.0.
Sources may be found on GitHub:
Development builds of this project can be acquired at the provided continuous integration server. These builds have not been approved by the BukkitDev staff. Use them at your own risk.
- zPermissions (Requires ToHPluginUtils.jar)
- zPermissions-standlone (includes ToHPluginUtils, like the version distributed on dev.bukkit.org)
To Do
- More extensive unit tests, especially on the service interface.
- Better organized docs.
下载 zPermissions
下载 zPermissions
下载 zPermissions
下载 zPermissions
下载 zPermissions
下载 zPermissions
下载 zPermissions
下载 zPermissions
下载 zPermissions
下载 zPermissions
1.3
UUID 更新。
基于 Bukkit 1.7.8+ 开发。可能兼容 1.7.5,但不推荐。
迁移流程
您的数据将自动进行迁移。不过,建议在运行新版本之前执行以下操作。
(建议先在测试服务器和测试数据库上尝试此流程,使用从生产环境复制的 zPermission 表。)
- (可选但强烈推荐)备份您的 zPermissions 数据库或 zPermissions data.yml,具体取决于您使用的存储选项。请参阅您的数据库服务器文档以获取详细信息。
- 当你的服务器运行在旧版本的 zPermissions(1.1.1、1.2)上时,执行命令:
/perm export <filename>
<filename>可以是任意名称,例如uuid-backup.txt或其他。
完成后,关闭服务器,切换到新版本的 zPermissions,然后重新启动。zPermissions 将自动迁移所有现有玩家的数据。在此过程中请留意服务器日志 —— 如果查询 Mojang 服务器后仍无法确定某玩家的 UUID,该玩家数据 将被删除。
如果发生严重错误(例如在查询 Mojang 服务器时出现网络问题),请从数据库备份(或 data.yml 备份)恢复,然后重试。
或者,切换到 zPermissions 的旧版本,运行 /perm purge,再切换回新版本,然后尝试导入你之前创建的备份导出文件 /perm import。
迁移日志示例
[zPermissions] 150 entities to migrate
[zPermissions] 499 memberships to migrate
[zPermissions] Looking up 449 UUIDs...
[zPermissions] Migrating entities...
[zPermissions] Unable to migrate 'xxx' -- failed to lookup UUID
[zPermissions] Migrating memberships...
[zPermissions] Unable to migrate 'yyy' (member of 'resident') -- failed to lookup UUID
[zPermissions] Unable to migrate 'zzz' (member of 'resident') -- failed to lookup UUID
[zPermissions] Deleting entities that failed to migrate...
[zPermissions] Deleting memberships that failed to migrate...
[zPermissions] Migration done
UUID 说明
-
entities表中的name列现在将保存玩家 UUID 的 16 字节十六进制表示形式。display_name列将继续保存玩家的名称,但仅用于显示目的,以避免进行反向 UUID 查找。 -
memberships表新增了一个display_name列,其作用与上述相同。 -
memberships表中的member列现在将存储玩家的十六进制 UUID。当玩家登录时,如果名称发生变化,这两个表中的
display_name列都会更新为当前名称。 -
所有接受玩家名称的命令现在也支持四种形式的 UUID:
ef046b514ef44e15bb1a3d21f9da0ebcef046b51-4ef4-4e15-bb1a-3d21f9da0ebcef046b514ef44e15bb1a3d21f9da0ebc/ZerothAngelef046b51-4ef4-4e15-bb1a-3d21f9da0ebc/ZerothAngel
后两种形式用于(临时)设置显示名称。(请记住,玩家每次登录时其显示名称都会更新,因此这里只是提供便利。)如果你未设置显示名称且该玩家不在线,系统将默认将其设置为与 UUID 相同的值。
-
/perm export命令现在将始终使用 UUID 导出命令。 -
所有接受玩家名称的命令将执行以下操作:
- 如果输入已经是 UUID(上述四种形式之一),则直接使用它
- 如果指定名称的玩家在线,则获取其 UUID
- 否则,执行(可能远程的)查询。由于这可能导致主线程阻塞,查询将在后台进行。这意味着如果触发了查询,命令会立即返回,但你可能需要过一段时间才能看到结果。
-
显示玩家列表的命令 ——
/perm list、/perm search、/perm group ... members—— 新增了一个选项:-U 或 --uuid。启用此选项后,玩家将以“UUID/最后已知名称”的形式显示。 -
原生 zPermissions API (ZPermissionsService) 新增了针对涉及玩家的操作的方法,这些方法接收和返回 UUID。旧的与玩家相关的方法已被弃用,它们仅通过使用 Bukkit.getOfflinePlayer(String) 将用户名映射到 UUID。请注意,在 Bukkit 1.7.8 及以上版本中,该方法可能会产生阻塞。
-
随 zPermissions 提供的 Vault API 实现通过使用 Bukkit.getOfflinePlayer(String) 将用户名映射到 UUID,这在 Bukkit 1.7.8+ 中是一个可能阻塞的方法。这只是直到 Vault 添加直接 UUID 支持之前的权宜之计。
破坏性变更
player..rename命令因显而易见的原因已被移除。player..clone命令保留。- 对于
/perm diff命令:<player>和<other-player>参数不再接受“限定式”玩家名称(例如按世界限定的名称)。相反,该命令现在通过显式的-w或-W选项来分别指定<player>和/或<other-player>的世界。
影响 1.3beta1 的已知问题:
- 完全不支持离线模式。请注意,通过 BungeeCord/Spigot 可用的 UUID 欺骗功能在 BungeeCord 服务器在线时应可正常工作。
- 玩家登录时,其名称与 UUID 的映射会被缓存(默认 5 分钟)。这其实没什么用,因为通常情况下你在发出命令时他们仍然在线。Dev build #526+ 通过将缓存时机改为玩家登出后来解决此问题。
- 当配置为只读模式时,每当有人登录都会显示堆栈跟踪。虽然这是一个 bug,但无害。该问题已在 dev build #528+ 中修复。
- 使用平面文件时,在迁移过程中,如果任何具有临时会员资格的玩家的查找失败,zPermissions 将无法加载已迁移的 data.yml。你可以从备份恢复并使用 dev build #532+,或者按照此评论中的说明来挽救你的 data.yml。
关于这个资源的讨论、问题反馈与使用心得
还没有讨论,来发第一帖吧
你是这个资源的作者?登录后可认领此资源。
相似资源
插件
PacketEvents 是一款专为 Minecraft Java 版打造的协议库,旨在简化数据包的处理与传输。
插件
ExyliaPlugins 的库。
插件
重新定义服务器上的生物运输方式。使用高度可定制的口袋道具,安全地捕获、存储和释放任何实体。
插件
为基于 Spigot/Paper/Folia 的服务器添加对 Vivecraft 的支持
插件
一个强大的 API,用于为你的 Minecraft 服务器创建自定义进度。
插件
SkyBlock、OneBlock、Boxed、SkyGrid、AcidIsland、CaveBlock、Poseidon、StrangerRealms——以及更多!这些只是由 BentoBox 支持的基于岛屿的游戏模式之一。来自原版 ASkyBlock 的作者。
评论 0
登录后参与评分
还没有评论,来抢沙发吧