Velocity 白名单插件
一个用于 Velocity 代理服务器的简单远程白名单插件。
功能说明
此插件从远程 URL 获取白名单,并控制哪些玩家可以加入你的 Velocity 代理服务器。白名单存储在你托管的 JSON 文件中(例如 CDN 或 Web 服务器),因此你无需重启服务器即可更新白名单。
特性
- 从远程 URL 获取白名单
- 基于用户名的白名单机制
- 支持多个列表(管理员、VIP、成员等)
- 特殊模式:允许所有人或拒绝所有人
- 每隔几秒自动从 URL 重新加载
- 当玩家被移出白名单时将其踢出
- 可自定义提示信息
安装步骤
- 下载 JAR 文件
- 将其放入 Velocity 的
plugins/ 文件夹中
- 启动服务器(它将创建示例配置文件)
- 停止服务器
- 编辑
plugins/velocity-whitelist-worker/config.json 并设置你的 URL
- 在该 URL 处创建你的白名单 JSON 文件
- 再次启动服务器
配置说明
本地配置文件:config.json
{
"url": "https://your-domain.com/whitelist.json",
"reloadIntervalSeconds": 10
}
url - 获取白名单的来源地址(必填)
reloadIntervalSeconds - 检查更新的频率(默认值:10)
远程白名单文件
这是位于你配置的 URL 处的 JSON 文件:
{
"customLists": ["admin", "vip"],
"admin": [
"Player1",
"Player2"
],
"vip": [
"Player3",
"Player4"
]
}
customLists - 使用哪些列表(如果为空或缺失,则允许所有人加入)
- 添加你自己的列表名称以及对应的玩家用户名
特殊模式
将 customLists 设置为特殊值:
["all"] - 允许所有人加入
["none"] - 拒绝所有人加入(维护模式)
[] 或缺失 - 允许所有人加入(默认)
消息文件:messages.json
自定义玩家看到的提示信息:
{
"deniedMessage": "Sorry, You don't fit the Vibe(SMP)...",
"kickedMessage": "You no longer fit the Vibe(SMP)...",
"maintenanceMessage": "Don't worry, we'll be right back, just some maintenance"
}
工作原理
- 插件加载并读取你的本地配置
- 从你的 URL 获取白名单
- 检查当前激活的模式/列表
- 根据白名单允许或拒绝玩家加入
- 每 X 秒自动重新加载
- 如果玩家被移出白名单,则将其踢出
示例
仅允许管理员:
{
"customLists": ["admin"],
"admin": ["Admin1", "Admin2"]
}
允许多个群组:
{
"customLists": ["admin", "member"],
"admin": ["Admin1"],
"member": ["Player1", "Player2", "Player3"]
}
维护模式:
{
"customLists": ["none"]
}
允许所有人:
{
"customLists": ["all"]
}
或者直接留空:
{}
运行要求
- Velocity 3.4.0 或更高版本
- Java 21 或更高版本
- 一个用于托管白名单 JSON 文件的 Web 服务器
Velocity Whitelist Worker
A simple remote whitelist plugin for Velocity proxy servers.
What it does
This plugin fetches a whitelist from a remote URL and controls which players can join your Velocity proxy. The whitelist is stored in a JSON file that you host somewhere (like a CDN or web server), so you can update it without restarting the server.
Features
- Fetches whitelist from a remote URL
- Username-based whitelisting
- Multiple list support (admin, vip, members, etc.)
- Special modes: allow everyone or deny everyone
- Auto-reload from URL every few seconds
- Kicks players when removed from whitelist
- Customizable messages
Installation
- Download the JAR file
- Place it in your Velocity
plugins/ folder
- Start the server (it will create example config files)
- Stop the server
- Edit
plugins/velocity-whitelist-worker/config.json and set your URL
- Create your whitelist JSON file at that URL
- Start the server again
Configuration
Local config file: config.json
{
"url": "https://your-domain.com/whitelist.json",
"reloadIntervalSeconds": 10
}
url - Where to fetch the whitelist from (required)
reloadIntervalSeconds - How often to check for updates (default: 10)
Remote whitelist file
This is the JSON file at your configured URL:
{
"customLists": ["admin", "vip"],
"admin": [
"Player1",
"Player2"
],
"vip": [
"Player3",
"Player4"
]
}
customLists - Which lists to use (if empty or missing, everyone is allowed)
- Add your own list names with player usernames
Special modes
Set customLists to special values:
["all"] - Allow everyone
["none"] - Deny everyone (maintenance mode)
[] or missing - Allow everyone (default)
Messages file: messages.json
Customize the messages players see:
{
"deniedMessage": "Sorry, You don't fit the Vibe(SMP)...",
"kickedMessage": "You no longer fit the Vibe(SMP)...",
"maintenanceMessage": "Don't worry, we'll be right back, just some maintenance"
}
How it works
- Plugin loads and reads your local config
- Fetches the whitelist from your URL
- Checks which mode/lists are active
- Allows or denies players based on the whitelist
- Automatically reloads every X seconds
- Kicks players if they're removed from the whitelist
Examples
Allow only admins:
{
"customLists": ["admin"],
"admin": ["Admin1", "Admin2"]
}
Allow multiple groups:
{
"customLists": ["admin", "member"],
"admin": ["Admin1"],
"member": ["Player1", "Player2", "Player3"]
}
Maintenance mode:
{
"customLists": ["none"]
}
Allow everyone:
{
"customLists": ["all"]
}
Or just leave it empty:
{}
Requirements
- Velocity 3.4.0 or higher
- Java 21 or higher
- A web server to host your whitelist JSON file
评论 0
登录后参与评分
还没有评论,来抢沙发吧