InvSeparate
InvSeparate 是一个用于 Minecraft 网络的开源路由解决方案,允许在单个代理入口点背后托管多个整合包。
它由两部分组成:
- 一个
Velocity 插件,用于决定玩家应使用的登录服务器和后端目标
- 一个客户端模组,在后端选择发生之前向 Minecraft 握手添加包标识符
这使得一个 Velocity 代理能够同时服务原版客户端、多个整合包客户端以及不同的登录流程。
功能
- 基于标识符的初始路由
- 从登录服务器到最终后端的两阶段路由
- 针对没有安装该模组或使用未知标识符的客户端提供默认回退机制
- 基于
Velocity 3.4.x 开发,兼容范围延伸至 Velocity 4.x
- 采用单体仓库布局,共享协议代码、代理插件以及多种加载器实现
工作原理
- 客户端模组读取配置的
identifier(标识符)
- 模组将
<hostname>\0<identifier> 写入握手的 host 字段
- Velocity 插件从原始握手主机名中读取标识符
- 插件选择配置的登录服务器和登录后目标
- 如果不存在标识符,则使用正常的默认路由
重要提示:Velocity 的 getVirtualHost() 方法会丢弃空字节之后的任何数据。因此代理插件必须读取原始虚拟主机值以恢复标识符。
仓库结构
common: 共享协议常量和辅助工具
velocity: Velocity 插件实现
neoforged: NeoForge 客户端模组
fabric: Fabric 客户端模组
forge: 预留 Forge 模块
bungeecord: 预留 BungeeCord 模块
示例配置
Velocity 配置文件位于 plugins/invseparate/config.yml:
default-server: "login"
default-post-login-server: "lobby"
post-login-delay-seconds: 5
identifiers:
endlessmc-hng:
login-server: "hng_login"
post-login-server: "hng"
客户端配置:
identifier = "endlessmc-hng"
构建说明
Common 和 Velocity
当前仓库默认使用 Gradle 9.x,因此这些模块可以直接构建:
./gradlew.bat :common:build :velocity:build
加载器模块
Loader 特定的模组,例如 neoforged、fabric 和 forge 位于同一仓库中,但在 settings.gradle.kts 中默认并非全部启用。
请按照构建文件中的内联注释切换所需的 Gradle 版本,并启用你想要构建的 Loader 模块。
分支策略
1.21.1 是当前主分支
- 其他 Minecraft 版本在需要时应维护在独立的分支中
1.21.8 分支已不再使用
使用场景
- 原版客户端加入默认的登录服务器
- 不同的整合包客户端加入不同的登录服务器
- 玩家经过身份验证后被转发至其目标后端服务器
- 需要比简单的登录后转发插件更强大的代理端路由层的网络
许可证
当前的源码头部信息基于 MIT 许可证组织。
InvSeparate
InvSeparate 是一个面向多整合包 Minecraft 网络的开源路由方案。
它由两部分组成:
Velocity 插件:在代理层识别客户端标识,并决定玩家应进入哪个登录服、认证后再进入哪个目标服。
- 客户端 Mod:在 Minecraft 握手阶段把整合包标识附加到握手主机名中,让代理在真正进入后端前就能完成分流。
这让同一个 Velocity 入口可以同时服务原版客户端、多个整合包客户端,以及各自不同的登录与落地流程。
特性
- 支持基于客户端标识的初始路由
- 支持“登录服 -> 目标服”的二段转发
- 未安装 Mod 或标识未知时回退到默认服务器
- 当前以
Velocity 3.4.x 为基线开发,目标兼容 Velocity 4.x
- 仓库内按模块组织公共协议、代理插件和不同加载器实现
工作原理
- 客户端 Mod 在连接服务器时读取本地配置中的
identifier
- Mod 将
<hostname>\0<identifier> 写入握手地址
- Velocity 插件从原始握手主机名中提取标识
- 插件根据
config.yml 中的规则选择登录服与登录后目标服
- 若无标识或标识未知,则按默认规则处理
注意:Velocity 的 getVirtualHost() 会丢弃 null byte 之后的数据,因此服务端必须读取原始主机名而不是处理后的虚拟主机值。
仓库结构
common:公共协议常量与工具
velocity:Velocity 插件实现
neoforged:NeoForge 客户端 Mod
fabric:Fabric 客户端 Mod
forge:预留 Forge 模块
bungeecord:预留 BungeeCord 模块
配置示例
Velocity 配置文件位于 plugins/invseparate/config.yml:
default-server: "login"
default-post-login-server: "lobby"
post-login-delay-seconds: 5
identifiers:
endlessmc-hng:
login-server: "hng_login"
post-login-server: "hng"
NeoForge/Fabric 客户端配置核心项:
identifier = "endlessmc-hng"
构建说明
公共模块与 Velocity
当前仓库默认使用 Gradle 9.x,可直接构建:
./gradlew.bat :common:build :velocity:build
Loader 模块
neoforged、fabric、forge 等加载器模块保留在同一仓库中,但当前 settings.gradle.kts 默认未启用全部模块。
按仓库内注释切换对应模块与 Gradle 版本后,可分别构建对应 Loader 产物。
分支策略
- 当前主线版本为
1.21.1
- 其他 Minecraft 版本建议使用独立分支维护
1.21.8 分支已停止使用
适用场景
- 原版客户端进入默认登录服
- 不同整合包客户端进入各自的登录服
- 登录认证完成后自动进入各自目标后端
- 需要替代或补强现有“只负责转发、不负责识别客户端”的代理路由方案
许可证
本项目当前源码头部按 MIT 许可约定组织。
InvSeparate
InvSeparate is an open-source routing solution for Minecraft networks that host multiple modpacks behind a single proxy entrypoint.
It is made of two parts:
- a
Velocity plugin that decides which login server and destination backend a player should use
- a client mod that appends a pack identifier to the Minecraft handshake before backend selection happens
This allows one Velocity proxy to serve vanilla clients, multiple modpack clients, and different login flows at the same time.
Features
- Identifier-based initial routing
- Two-stage routing from login server to final backend
- Default fallback for clients without the mod or with unknown identifiers
- Developed against
Velocity 3.4.x with a target compatibility range through Velocity 4.x
- Monorepo layout for shared protocol code, proxy plugin, and multiple loader implementations
How It Works
- The client mod reads the configured
identifier
- The mod writes
<hostname>\0<identifier> into the handshake host field
- The Velocity plugin reads the identifier from the raw handshake hostname
- The plugin selects the configured login server and post-login target
- If no identifier is present, normal default routing is used
Important: Velocity's getVirtualHost() discards any data after the null byte. The proxy plugin must therefore read the raw virtual host value to recover the identifier.
Repository Layout
common: shared protocol constants and helpers
velocity: Velocity plugin implementation
neoforged: NeoForge client mod
fabric: Fabric client mod
forge: reserved Forge module
bungeecord: reserved BungeeCord module
Example Configuration
Velocity config at plugins/invseparate/config.yml:
default-server: "login"
default-post-login-server: "lobby"
post-login-delay-seconds: 5
identifiers:
endlessmc-hng:
login-server: "hng_login"
post-login-server: "hng"
Client config:
identifier = "endlessmc-hng"
Build Notes
Common and Velocity
The repository currently defaults to Gradle 9.x, so these modules can be built directly:
./gradlew.bat :common:build :velocity:build
Loader Modules
Loader-specific modules such as neoforged, fabric, and forge live in the same repository, but they are not all enabled by default in settings.gradle.kts.
Follow the inline comments in the build files to switch the required Gradle version and enable the loader module you want to build.
Branch Strategy
1.21.1 is the current primary branch
- Other Minecraft versions should be maintained in dedicated branches when needed
- The
1.21.8 branch is no longer in use
Use Cases
- Vanilla clients join the default login server
- Different modpack clients join different login servers
- Players are forwarded to their target backend after authentication
- Networks that need a stronger proxy-side routing layer than simple post-login forwarding plugins
License
The current source headers are organized around the MIT license.
InvSeparate
InvSeparate 是一个面向多整合包 Minecraft 网络的开源路由方案。
它由两部分组成:
Velocity 插件:在代理层识别客户端标识,并决定玩家应进入哪个登录服、认证后再进入哪个目标服。
- 客户端 Mod:在 Minecraft 握手阶段把整合包标识附加到握手主机名中,让代理在真正进入后端前就能完成分流。
这让同一个 Velocity 入口可以同时服务原版客户端、多个整合包客户端,以及各自不同的登录与落地流程。
特性
- 支持基于客户端标识的初始路由
- 支持“登录服 -> 目标服”的二段转发
- 未安装 Mod 或标识未知时回退到默认服务器
- 当前以
Velocity 3.4.x 为基线开发,目标兼容 Velocity 4.x
- 仓库内按模块组织公共协议、代理插件和不同加载器实现
工作原理
- 客户端 Mod 在连接服务器时读取本地配置中的
identifier
- Mod 将
<hostname>\0<identifier> 写入握手地址
- Velocity 插件从原始握手主机名中提取标识
- 插件根据
config.yml 中的规则选择登录服与登录后目标服
- 若无标识或标识未知,则按默认规则处理
注意:Velocity 的 getVirtualHost() 会丢弃 null byte 之后的数据,因此服务端必须读取原始主机名而不是处理后的虚拟主机值。
仓库结构
common:公共协议常量与工具
velocity:Velocity 插件实现
neoforged:NeoForge 客户端 Mod
fabric:Fabric 客户端 Mod
forge:预留 Forge 模块
bungeecord:预留 BungeeCord 模块
配置示例
Velocity 配置文件位于 plugins/invseparate/config.yml:
default-server: "login"
default-post-login-server: "lobby"
post-login-delay-seconds: 5
identifiers:
endlessmc-hng:
login-server: "hng_login"
post-login-server: "hng"
NeoForge/Fabric 客户端配置核心项:
identifier = "endlessmc-hng"
构建说明
公共模块与 Velocity
当前仓库默认使用 Gradle 9.x,可直接构建:
./gradlew.bat :common:build :velocity:build
Loader 模块
neoforged、fabric、forge 等加载器模块保留在同一仓库中,但当前 settings.gradle.kts 默认未启用全部模块。
按仓库内注释切换对应模块与 Gradle 版本后,可分别构建对应 Loader 产物。
分支策略
- 当前主线版本为
1.21.1
- 其他 Minecraft 版本建议使用独立分支维护
1.21.8 分支已停止使用
适用场景
- 原版客户端进入默认登录服
- 不同整合包客户端进入各自的登录服
- 登录认证完成后自动进入各自目标后端
- 需要替代或补强现有“只负责转发、不负责识别客户端”的代理路由方案
许可证
本项目当前源码头部按 MIT 许可约定组织。
评论 0
登录后参与评分
还没有评论,来抢沙发吧