Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export default defineConfig({
"manual/zh/config/safe",
"manual/zh/config/merge-am",
"manual/zh/config/merge-ml",
"manual/zh/config/nanolimbo-settings",
],
},
"manual/zh/命令列表",
Expand Down
16 changes: 13 additions & 3 deletions src/content/docs/manual/zh/config/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ modules {
profile-skin=true
# 数据迁移
data-merge=false
# 内置 NanoLimbo 后端;仅在 vServer.mode 为 outpre 时用于拉起本地认证等待服
backend-nanolimbo=true
}
# 等待区服务器
v-server {
# 登录服实现模式:backend 或 outpre。推荐 outpre 模式,若有问题请使用backend模式。
mode=outpre
# ❇️认证完成后默认进入的服务器
post-auth-default-server=play
# 记住认证时收到的服务器跳转请求
remember-requested-server-during-auth=true
backend {
Expand All @@ -130,7 +130,7 @@ v-server {
enable-profile-compensation=true
# 在线热改 name(风险较低,默认开启)
enable-name-hot-change=true
# 在线热改 UUID(高风险,默认关闭)
# ⚠️在线热改 UUID(高风险,默认关闭)
enable-uuid-hot-change=false
}
outpre {
Expand All @@ -146,8 +146,18 @@ v-server {
presented-port=-1
# 转接给认证服时,在连接握手中对后端暴露的玩家源 IP;留空时使用玩家真实 IP
presented-player-ip=""
# 对在线模式玩家(Velocity 已完成 Mojang 验证)启用直通(struck)模式:
# 玩家连入时阻塞等待认证完成,通过后直接进入游戏,跳过等待区。
struck-online-mode=true
}
}
# 认证行为配置
auth {
# ⚠️禁止通过以下渠道进行新档案注册(建档)的凭证渠道 ID 列表。
# 填入渠道 ID(如 offline、yggdrasil、floodgate)后,该渠道的凭证将无法用于创建新玩家档案。
# 已有档案的登录不受影响。
disable-registration=[]
}
# 消息
messages {
# 默认语言;当未启用客户端语言检测,或客户端语言没有对应语言文件时使用
Expand Down
163 changes: 163 additions & 0 deletions src/content/docs/manual/zh/config/nanolimbo-settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
title: 内置 NanoLimbo 配置文件
---

此文件内容与[NanoLimbo](https://github.com/Nan1t/NanoLimbo)的配置文件一致。

```yaml
# 内置服务器的地址和端口。将ip设为空即可使用任意公开地址。
bind:
ip: "localhost"
port: 30066

# 服务器可接受的最大玩家数量。
# 要移除玩家上限,将本项设为-1。
maxPlayers: 100

# 服务器列表中的信息。
ping:
description: "<gradient:blue:white>NanoLimbo"
version: "<gradient:blue:white>NanoLimbo"
# 指定客户端Ping服务端时返回的协议版本号。
# 默认为-1,此时返回客户端所对应的协议版本。
# 详见https://zh.minecraft.wiki/w/%E5%8D%8F%E8%AE%AE%E7%89%88%E6%9C%AC#%E5%8D%8F%E8%AE%AE%E7%89%88%E6%9C%AC%E5%88%97%E8%A1%A8
protocol: -1

# 可用维度:OVERWORLD(主世界), THE_NETHER(下界), THE_END(末地)
dimension: THE_END

# 是否在玩家列表中显示玩家名。
# 对于1.16.5的客户端,为防止崩溃,即便此处禁用也会发送玩家列表。
playerList:
enable: true
username: "NanoLimbo"

# 是否在玩家列表显示页眉和页脚。
# 仅适用于1.8+客户端
headerAndFooter:
enable: true
header: "<white>Welcome!"
footer: "<gradient:blue:white>NanoLimbo"

# 设置玩家的游戏模式。
# 0 - 生存
# 1 - 创造(隐藏生命值和饥饿值)
# 2 - 冒险
# 3 - 旁观(隐藏所有底部UI)
# 旁观者模式仅适用于1.8+客户端
gameMode: 3

# 移除“不安全聊天信息”的弹窗。
# 仅适用于1.20.5+客户端
secureProfile: false

# F3调试界面显示的服务端名称。
# 仅适用于1.13+客户端
brandName:
enable: true
content: "<gradient:blue:white>NanoLimbo"

# 玩家加入服务器时发送的消息。
joinMessage:
enable: true
text: "<white>Welcome to the <gradient:blue:white>NanoLimbo<white>!"

# 玩家加入服务器时显示的BOSS栏。
# 仅适用于1.9+客户端
bossBar:
enable: true
text: "<white>Welcome to the <gradient:blue:white>NanoLimbo<white>!"
health: 1.0
# 可用颜色:PINK, BLUE, RED, GREEN, YELLOW, PURPLE, WHITE
color: BLUE
# 可用样式:SOLID, DASHES_6, DASHES_10, DASHES_12, DASHES_20
division: SOLID

# 玩家加入服务器时显示的标题和副标题。
# 仅适用于1.8+客户端
title:
enable: true
# 若仅需副标题,请将此项留空
title: "<white><b>Welcome!"
# 若仅需标题,请将此项留空
subtitle: "<gradient:blue:white>NanoLimbo"
# 淡入时长,以游戏刻为单位(1秒=20游戏刻)
fadeIn: 10
# 持续显示时长,以游戏刻为单位
stay: 100
# 淡出时长,以游戏刻为单位
fadeOut: 10

# ❇️玩家信息转发协议支持。
# 可用类型:
# - NONE
# - LEGACY
# - MODERN
# - BUNGEE_GUARD
# 如果你不使用MODERN类型,不要设置`secret`。
#
# `secret`和`tokens`都接受'@'前缀。 prefix to load the value from an
# 该前缀允许你从外部文件读取数值(路径是和当前目录的相对路径)。
# 如果你需要避免将密钥写入本文件,可使用此前缀:如Docker密钥或SOPS。
# 例如:
# secret: '@secret.txt'
# tokens: '@tokens.txt' # 一行一个token,允许'#'前缀注释
# tokens:
# - 'inline-token'
# - '@extra-tokens.txt' # 可以同时直接写入密钥和通过文件读取密钥
infoForwarding:
type: NONE
secret: "<YOUR_SECRET_HERE>"
tokens:
- "<BUNGEE_GUARD_TOKEN>"

# 连接超时时长,单位为毫秒
readTimeout: 30000

# 在连接时记录玩家的IP地址。
# 如需保护隐私或遵循GDPR规范,将此项设为false即可从日志隐藏IP地址(以"<redacted>"显示)
logPlayersIp: true

# 定义日志级别。生产环境建议使用级别2。
# 日志级别说明:
# 0 - 只显示错误
# 1 - 显示错误和警告
# 2 - 显示错误、警告、和普通日志
# 3 - 显示错误、警告、普通日志、和调试信息
debugLevel: 2

# ⚠️警告!如果你不清楚自己在干什么,不要动这一部分的配置!
netty:
# Available transport type:
# - EPOLL
# - IO_URING
# - KQUEUE
# - NIO
transportType: EPOLL
# EventLoopGroup threads count
threads:
bossGroup: 1
workerGroup: 4

# 检查入站流量并踢出可疑连接的设置。
# 要注意玩家也可以发送很多小数据包,比如单纯地移动鼠标。
traffic:
# If true, then additional handler will be added to the channel pipeline
enable: true
# Max packet size in bytes
# Unlimited if -1
maxPacketSize: 8192
# The interval to measure packets over
# Lowering this value will limit peak packets from players which would target people with bad connections
# Raising this value will allow higher peak packet rates, which will help with people who have poor connections
# Ignored if -1.0
interval: 7.0
# The maximum packets per second for players
# It is measured over the configured interval
# Ignored if -1.0
maxPacketRate: 500.0
# The maximum packet bytes per second for players
# It is measured over the configured interval as an average bytes/sec
# Ignored if -1.0
maxPacketBytesRate: 2048.0
```
2 changes: 0 additions & 2 deletions src/content/docs/manual/zh/config/profile-skin.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ title: "profile-skin.conf"
玩家皮肤缓存模块配置。在模块`profile-skin`激活时有效。

```hocon
# 启用本模块
enabled=true
# 优先缓存并已携带签名的材质
prefer-upstream-signed-textures=true
# 不修复的入口ID
Expand Down
9 changes: 7 additions & 2 deletions src/content/docs/manual/zh/config/safe.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ slug: "manual/zh/config/safe"
基础安全模块(`safe`)的配置。

```hocon
# 启用防护
enable=true
# 全局连接频率限制
global-rate-limit {
max-attempts=80
Expand All @@ -18,6 +16,13 @@ ip-rate-limit {
max-attempts=8
window-seconds=10
}
# 同 IP 连接玩家数量限制
ip-limit {
# 是否开启?
enable=true
# 玩家数量上限
max=3
}
# 同 IP 超阈值后的临时冷却
ip-cooldown {
# 同 IP 临时冷却
Expand Down
2 changes: 2 additions & 0 deletions src/content/docs/manual/zh/config/配置列表.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import { FileTree } from "@astrojs/starlight/components";
- littleskin.conf Littleskin外置登录支持
- mojang.conf ⚠️正版登录支持
- [验证条目配置格式](/manual/zh/config/yggd-entry)
- backend-nanolimbo/
- [settings.yml](/manual/zh/config/nanolimbo-settings) 内置NanoLimbo配置
- data/ 数据库目录
- libs/ 代码库目录
- messages/ 语言文件目录。每个目录下都会包含英文(en_us.conf)、俄文(ru_ru.conf)、中文(zh_cn.conf)三个语言的配置文件。根目录下为核心插件的语言文件。
Expand Down
2 changes: 2 additions & 0 deletions src/content/docs/manual/zh/命令列表.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ title: 命令列表

## 核心插件

提示:在认证后端中的玩家执行核心插件的命令不需要加`hzl`前缀。

| 命令 | 说明 | 所需身份 |
| --- | --- | --- |
| `/hzl re` | 重新触发认证流程 | 玩家 |
Expand Down
13 changes: 8 additions & 5 deletions src/content/docs/manual/zh/基础安装.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ HyperZoneLogin 目前主要以单文件 JAR 包分发,运作时使用内置的

HyperZoneLogin 需要:

* 一个真实的后端服务器作为认证等待区;
* 一个游戏后端作为认证成功后跳转的服务器;
* 将整个群组服网络配置为使用`modern`转发模式。
* 将整个群组服网络配置为使用`modern`转发模式;
* *[可选] 一个真实的后端服务器作为认证等待区。*

在安装 HyperZoneLogin 之前,请务必按照前述章节的指引完成 Velocity 与游戏后端服的基础配置。

Expand All @@ -27,15 +27,18 @@ HyperZoneLogin 需要:
5. 在[`start.conf`](/manual/zh/config/start)中设置好语言,并设置`ready=true`;
6. 重启 Velocity;
7. 按照[`配置索引`](/manual/zh/config/配置列表)中的说明正确配置[`core.conf`](/manual/zh/config/core)中的`module`、`v-server`、和`database`字段;
8. 再次重启 Velocity,让插件配置生效。
8. 如果你使用了自己的服务器作为认证等待区,请正确配置`v-server`的认证服名称和端口,以及认证服的 Velocity Modern 转发配置;如果你直接使用内置的 NanoLimbo 作为认证等待区,请:
1. 确保`core.conf`中的`v-server.outpre.auth-host`设为`127.0.0.1`,`v-server.outpre.auth-port`与[`backend-nanolimbo/settings.yml`](/manual/zh/config/nanolimbo-settings)中的`bind.port`设置为同一端口;
2. 将 Velocity 中`forward.secret`的密钥填入`backend-nanolimbo/settings.yml`中的`infoForwarding.secret`一项,并将`infoForwarding.type`改为`MODERN`。
9. 再次重启 Velocity,让插件配置生效。

## 安装后检验

如果你激活了你所需的模块,并且正确调整了所需配置,即可尝试加入服务器。如无异常,应当观察到以下现象:

1. 玩家不能直接连接后端服务器,只能从 Velocity 反代理端连接;
2. 玩家先进入等待区,此时玩家名称为`HZLxxxxxx`(后接随机数字);
3. 正版玩家、外置登录玩家或基岩版玩家应自动完成认证过程,离线玩家会被提示需要使用`/register`或`/login`命令进行注册或登录;
2. 正版玩家、外置登录玩家或基岩版玩家应自动完成认证过程;
3. 离线玩家会进入等待区,此时玩家名称为`HZLxxxxxx`(后接随机数字),并被提示需要使用`/register`或`/login`命令进行注册或登录;
4. 认证通过后,玩家应当自动跳转到正式游戏服务器,并恢复原有名称;
5. 整个过程中 Velocity 控制台没有输出明显的错误。

Expand Down
10 changes: 7 additions & 3 deletions src/content/docs/manual/zh/常见问题.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ title: "常见问题"
- 让玩家完全退出游戏和启动器后,重新启动游戏并尝试重新加入服务器。
- 确认是否只有某一类启动器会出现该问题,然后参照[`问题反馈`](问题反馈.md)中的说明提交反馈,反馈时需补充具体启动器名称、下载链接、登录方式与复现步骤,以及相关服务器日志。

## 加入游戏后提示“您与`等待后端名称`的连接出现问题。”,服务端日志出现`java.lang.NoSuchFieldError`
## 离线玩家登录完成后,因“Internal Exception: io.netty.handler.codec.DecoderException: Received unknown packet id 119”被踢

检查`velocity.toml`中`online-mode`是否为`true`。如果是,改为`false`,并将所有后端中 Velocity 代理支持配置中的`online-mode`也改为`false`。

## 加入游戏后因“您与outpre-auth的连接出现问题。”被踢,服务端日志出现`java.lang.NoSuchFieldError`

日志中的报错应与下方类似:

Expand Down Expand Up @@ -66,6 +70,6 @@ HyperZoneLogin 在玩家等待验证时,会临时把玩家名字改成类似 `
- **`outpre` 模式(推荐)**:只修改发送给登录服的玩家信息,Velocity 和其他封禁插件看到的还是玩家的真实名字,封禁能正常生效。
- **`backend` 模式(备用)**:直接在 Velocity 上改名字,因此登陆期间 Velocity 和其他插件(比如封禁插件)看到的都是临时名 `HZLxxxxxx`。如果此时封禁插件检测到违规,或者会记忆玩家首次登陆时的信息,它封的会是这个临时名,而不是真正的玩家。再加上每次临时名都不一样,**玩家只需要再次进服就能绕过封禁。**

:::caution[由于改名逻辑的不同,`backend`模式还可能会和其他 Velocity 插件出现不兼容的现象。]
**任何情况下都请优先使用 `outpre` 模式**,只在遇到严重兼容性问题时再考虑切到 `backend` 模式。这样既能保证其他插件正确识别玩家,又不会影响登录流程的安全性。
:::caution[警告]
**由于改名逻辑的不同,`backend`模式还可能会和其他 Velocity 插件出现不兼容的现象。任何情况下都请优先使用 `outpre` 模式**,只在遇到严重兼容性问题时再考虑切到 `backend` 模式。这样既能保证其他插件正确识别玩家,又不会影响登录流程的安全性。
:::
28 changes: 4 additions & 24 deletions src/content/docs/manual/zh/快速上手.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ title: "快速上手"

如果你现在的目标是:**先把 HyperZoneLogin 跑起来,再逐步细化配置**,请先按本章完成一套最小可用部署。

本文档展示了一个完整示例思路:**Velocity 代理 + Outpre等待后端 + 真实游戏后端**。这也是当前更稳妥、排障成本更低的入门方式。
本文档展示了一个完整示例思路:**Velocity 代理 + 内置Outpre等待后端 + 真实游戏后端**。这也是当前更稳妥、排障成本更低的入门方式。

## 前置条件

开始前请先确认:

- [ ] 你已经准备好一台 Velocity 代理;
- [ ] 你至少准备了两个后端服:一个等待后端、一个正式游戏后端;
- [ ] 你至少准备好了一个正式游戏后端;
- [ ] 你打算让玩家通过代理地址进入,而不是直连后端;
- [ ] 你已经看过 [`服务器基础配置`](/manual/zh/服务器基础配置/),或者熟悉 Velocity 的`modern`转发配置方法。
Expand All @@ -34,35 +33,16 @@ format=hocon
ready=true
```

6. 再次重启Velocity,让插件生成完整配置。
7. 按照下方说明修改 [`core.conf`](/manual/zh/config/core) 配置:

```hocon title=core.conf
v-server {
# 认证完成后默认进入的服务器。将其改为你在velocity.toml中设置的游戏后端服ID。
post-auth-default-server=play
...
outpre {
...
# 认证服的直连 Host。将其设置为等待后端的地址。
auth-host="127.0.0.1"
# 认证服的直连 Port。将其设置为等待后端的端口。
auth-port=30066
...
}
}
```

8. 最后再次重启Velocity,并确保游戏后端服也已经运行。
6. 再次重启Velocity,让插件生成完整配置,并确保游戏后端服也已经运行。

## 检验方式

当你完成上述所有配置后,即可通过代理地址加入服务器检验链路是否正常。

如果链路正常,应该会观察到以下现象:

1. 玩家先进入Outpre等待区;
2. 在Outpre等待区里看到的玩家名表现为 `HZLxxxxxx`(`xxxxxx` 为一串随机数字);
1. 如果你是正版账号,应该在等待片刻后直接加入正式游戏后端。
2. 如果你是离线账号,你会进入Outpre等待区,并看到自己的玩家名表现为 `HZLxxxxxx`(`xxxxxx` 为一串随机数字);
3. 认证完成并进入正式游戏后端后,玩家名恢复为正常玩家名称。

如果没有出现上述现象,优先回查以下内容:
Expand Down
Loading
Loading