Skip to content

Commit 9802d02

Browse files
author
54895y
committed
Add MatrixAuth wiki to docs site
1 parent 7d7a1e5 commit 9802d02

File tree

19 files changed

+1243
-955
lines changed

19 files changed

+1243
-955
lines changed

README.md

Lines changed: 29 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,45 @@
1-
<<<<<<< HEAD
2-
# MatrixShop 文档网站
1+
# Matrix Docs
32

4-
这是 MatrixShop 插件的官方文档网站,基于 Docusaurus 构建
3+
`D:\Matrix\Docs` 是 Matrix 系列插件的统一 Docusaurus 文档站
54

6-
## 本地开发
5+
当前已收录:
76

8-
```bash
9-
npm install
10-
npm start
11-
```
7+
- MatrixAuth
8+
- MatrixShop
129

13-
## 构建生产版本
10+
## 当前结构
1411

15-
```bash
16-
npm run build
17-
```
12+
- `docs/plugins.mdx`:插件列表
13+
- `docs/intro.md`:站点总览
14+
- `docs/matrixauth/`:MatrixAuth 文档
15+
- `docs/matrixshop/`:MatrixShop 文档
16+
- `src/pages/index.tsx`:首页
17+
- `docusaurus.config.ts`:站点配置
18+
- `sidebars.ts`:侧边导航
1819

19-
## 部署到 GitHub Pages
20+
## GitHub Pages
2021

21-
网站已配置 GitHub Actions 自动部署到 GitHub Pages。
22+
当前站点发布到:
2223

23-
### 部署流程
24+
- [54895y/54895y.github.io](https://github.com/54895y/54895y.github.io.git)
2425

25-
1. 确保你的代码已推送到 GitHub 仓库的 `main` 分支
26-
2. 只要 `docs/``src/``static/` 或配置文件有更新,GitHub Actions 会自动触发部署
27-
3. 部署完成后,访问 https://54895y.github.io 查看网站
26+
默认配置:
2827

29-
### 手动部署
28+
- `url = https://54895y.github.io`
29+
- `baseUrl = /`
30+
- `deploymentBranch = main`
3031

31-
如果需要手动部署,可以运行:
32+
## 本地开发
3233

33-
```bash
34-
npm run build
34+
```powershell
35+
cd D:\Matrix\Docs
36+
npm install
37+
npm start
3538
```
3639

37-
构建产物会生成在 `build/` 目录中。
38-
39-
## 网站信息
40-
41-
- **网站名称**: Matrix 插件中心
42-
- **GitHub Pages URL**: https://54895y.github.io
43-
- **GitHub 仓库**: https://github.com/54895y/54895y.github.io
40+
## 构建
4441

45-
## 目录结构
46-
47-
```
48-
matrixshop-docs/
49-
├── docs/ # 文档内容
50-
├── src/ # 源代码
51-
├── static/ # 静态资源
52-
├── docusaurus.config.ts # 网站配置
53-
├── sidebars.ts # 侧边栏配置
54-
└── package.json # 项目配置
42+
```powershell
43+
cd D:\Matrix\Docs
44+
npm run build
5545
```
56-
=======
57-
# -54895y.github.io
58-
>>>>>>> 7f52a0fddbc3bc603e262a606d0b4ed07517bcbd

docs/intro.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
title: 插件 Wiki
3+
---
4+
5+
这里是 Matrix 系列插件的统一文档站。
6+
7+
当前已收录:
8+
9+
- [MatrixAuth](./matrixauth/overview.md)
10+
- [MatrixShop](./matrixshop/index.mdx)
11+
12+
当前文档约定:
13+
14+
- 每个插件放在 `docs/{plugin}/` 目录下。
15+
- 每个插件至少维护概览、部署、配置、命令和常见问题等基础页面。
16+
- 文档以当前源码和默认配置为准,不沿用旧交接文档中的过时命令或路径。
17+
- 首页只保留总入口,具体内容落到对应插件章节。
18+
19+
MatrixAuth 入口:
20+
21+
- [概览](./matrixauth/overview.md)
22+
- [部署指南](./matrixauth/installation.md)
23+
- [配置说明](./matrixauth/configuration.md)
24+
- [命令说明](./matrixauth/commands.md)
25+
- [PlaceholderAPI](./matrixauth/placeholders.md)
26+
- [EasyBot 对接](./matrixauth/easybot.md)
27+
- [开发说明](./matrixauth/development.md)
28+
- [常见问题](./matrixauth/faq.md)

docs/matrixauth/commands.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: 命令说明
3+
---
4+
5+
## 玩家命令
6+
7+
玩家可用入口:
8+
9+
- `/matrixauth`
10+
- `/account`
11+
- `/ma`
12+
- `/mauth`
13+
14+
主要子命令:
15+
16+
| 命令 | 说明 |
17+
| --- | --- |
18+
| `/matrixauth` | 查看当前账号状态 |
19+
| `/matrixauth help` | 查看帮助页 |
20+
| `/matrixauth guide` | 查看玩家向导 |
21+
| `/matrixauth premium` | 切换基础默认模式到正版 |
22+
| `/matrixauth offline` | 切换基础默认模式到离线 |
23+
| `/matrixauth bedrock` | 切换基础默认模式到基岩 |
24+
| `/matrixauth create <名称>` | 创建新档案 |
25+
| `/matrixauth delete <档案ID>` | 删除自己的档案 |
26+
| `/matrixauth profiles` | 查看自己的档案列表 |
27+
| `/matrixauth profile <档案ID>` | 查看档案详情 |
28+
| `/matrixauth link <档案ID> <类型> [名称] [UUID]` | 为档案补绑账号 |
29+
| `/matrixauth switch <档案ID> <类型>` | 切换档案当前生效账号 |
30+
31+
说明:
32+
33+
- `类型` 只能是 `premium``offline``bedrock`
34+
- 档案切换后会踢出玩家,要求重新进入。
35+
- Java 玩家在聊天栏里可以直接点击帮助页和档案列表动作。
36+
- 基岩玩家默认只收到纯指令提示。
37+
38+
## `/matrixauth link`
39+
40+
这个命令有两种使用方式。
41+
42+
绑定当前登录身份:
43+
44+
```text
45+
/matrixauth link 1 premium
46+
```
47+
48+
手动指定名称和 UUID:
49+
50+
```text
51+
/matrixauth link 1 premium Steve 8667ba71-b85a-4004-af54-457a9734eed7
52+
```
53+
54+
手动指定方式需要权限:
55+
56+
- `matrixauth.account.manual-link`
57+
58+
## 管理员命令
59+
60+
管理员统一走:
61+
62+
- `/matrixauth admin ...`
63+
64+
权限:
65+
66+
- `matrixauth.admin`
67+
- 兼容旧权限 `advancedlogin.admin`
68+
69+
管理员子命令:
70+
71+
| 命令 | 说明 |
72+
| --- | --- |
73+
| `/matrixauth admin set <玩家> <premium\|offline\|bedrock>` | 强制修改玩家基础默认模式 |
74+
| `/matrixauth admin info <玩家>` | 查看玩家基础数据 |
75+
| `/matrixauth admin profile list <玩家>` | 查看该玩家名下全部档案 |
76+
| `/matrixauth admin profile info <档案ID>` | 查看指定档案详情 |
77+
| `/matrixauth admin profile create <玩家> <档案名> <类型> <账号名> [UUID]` | 为目标玩家创建档案 |
78+
| `/matrixauth admin profile link <档案ID> <类型> <账号名> [UUID]` | 强制给档案绑定账号 |
79+
| `/matrixauth admin profile switch <档案ID> <类型>` | 强制切换档案生效账号 |
80+
| `/matrixauth admin profile delete <档案ID>` | 删除指定档案 |
81+
| `/matrixauth admin reload` | 重载配置和服务 |
82+
83+
## 旧命令说明
84+
85+
旧的 `/advancedlogin` 已经移除,不再作为有效入口。文档、帮助和管理功能都应以 `/matrixauth` 为准。

docs/matrixauth/configuration.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
title: 配置说明
3+
---
4+
5+
## `config.yml`
6+
7+
这是主配置文件,负责默认登录模式、数据库、Mojang API、兼容开关和占位符显示文本。
8+
9+
|| 默认值 | 说明 |
10+
| --- | --- | --- |
11+
| `default-mode` | `OFFLINE` | 新玩家的基础默认登录模式 |
12+
| `mojang-api.base-url` | `https://api.mojang.com` | Mojang API 地址 |
13+
| `mojang-api.session-url` | `https://sessionserver.mojang.com` | Session Server 地址 |
14+
| `mojang-api.timeout` | `5` | 请求超时,单位秒 |
15+
| `mojang-api.cache-ttl` | `600` | Mojang 查询缓存秒数 |
16+
| `mojang-api.api-fallback` | `OFFLINE` | 验证失败时的回退策略 |
17+
| `storage.type` | `SQLITE` | 存储类型,`SQLITE``MYSQL` |
18+
| `storage.sqlite.file` | `data/matrixauth.db` | SQLite 文件路径 |
19+
| `storage.mysql.*` | 见默认配置 | MySQL 连接参数 |
20+
| `storage.pool.*` | `4 / 1 / 10000` | HikariCP 连接池参数 |
21+
| `debug` | `false` | 是否输出调试日志 |
22+
| `placeholder.bedrock` | `&b基岩` | `%matrixauth_type%` 基岩显示文本 |
23+
| `placeholder.premium` | `&a正版` | `%matrixauth_type%` 正版显示文本 |
24+
| `placeholder.offline` | `&e离线` | `%matrixauth_type%` 离线显示文本 |
25+
| `account-switch.kick-message` | 内置文案 | 切换账号后踢出提示 |
26+
| `bedrock.preserve-source-identity` | `true` | 保留 Floodgate/Geyser 原始基岩身份 |
27+
| `compatibility.mcmmo.sync-profile-data` | `true` | 登录时尝试同步 mcMMO 档案数据 |
28+
29+
### `api-fallback`
30+
31+
- `OFFLINE`:Mojang API 异常时退回离线逻辑。
32+
- `KICK`:Mojang API 异常时拒绝登录。
33+
34+
## `settings/guide.yml`
35+
36+
这个文件控制玩家向导和入服提醒。
37+
38+
|| 默认值 | 说明 |
39+
| --- | --- | --- |
40+
| `enabled` | `true` | 向导系统总开关 |
41+
| `reminder-enabled` | `true` | 是否发送入服提醒 |
42+
| `auto-send-on-join` | `true` | 玩家加入后是否自动发送 |
43+
| `clickable-actions` | `true` | Java 版是否启用聊天点击动作 |
44+
| `join-delay-ticks` | `40` | 入服后延迟多少 tick 再提醒 |
45+
| `remind-when-profiles-empty` | `true` | 没有档案时是否提醒 |
46+
| `remind-when-profiles-exist` | `true` | 已有档案时是否提醒 |
47+
48+
行为规则:
49+
50+
- Java 玩家会收到可点击的 `/account guide``/matrixauth` 相关提示。
51+
- 基岩玩家只收到纯文本指令提示。
52+
- 关闭 `clickable-actions` 后,Java 玩家也会退回纯文本提示。
53+
54+
## `settings/easybot.yml`
55+
56+
这个文件控制插件侧 EasyBot HTTP 兼容接口。
57+
58+
|| 默认值 | 说明 |
59+
| --- | --- | --- |
60+
| `enabled` | `false` | 是否启用 HTTP 查询接口 |
61+
| `host` | `127.0.0.1` | 监听地址 |
62+
| `port` | `26992` | 监听端口 |
63+
| `token` | `matrixauth-easybot-token` | EasyBot 查询令牌 |
64+
65+
如果 EasyBot 不和 Minecraft 在同一台机器上,`host` 不能继续使用 `127.0.0.1`
66+
67+
## `messages.yml`
68+
69+
这个文件负责:
70+
71+
- 玩家提示
72+
- 向导文案
73+
- 帮助页
74+
- 命令反馈
75+
- 点击提示文本
76+
77+
如果你需要改玩家看到的所有文案,优先从 `messages.yml` 下手。

docs/matrixauth/development.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: 开发说明
3+
---
4+
5+
## 仓库结构
6+
7+
当前代码和文档拆分为两部分:
8+
9+
- 主插件工程:`MatrixAuth/Code`
10+
- 文档站点:`Docs`
11+
12+
GitHub 侧的 MatrixAuth 仓库当前约定:
13+
14+
- `main`:只保留主插件 `Code/`
15+
- `codex/easybot-assets`:保存 EasyBot 扩展和图片模板
16+
17+
## 主插件关键文件
18+
19+
- `src/main/kotlin/com/y54895/matrixauth/MatrixAuth.kt`:插件生命周期、服务初始化、命令注册
20+
- `src/main/kotlin/com/y54895/matrixauth/data/DataManager.kt`:数据库读写与档案管理
21+
- `src/main/kotlin/com/y54895/matrixauth/listener/LoginListener.kt`:登录预处理主链路
22+
- `src/main/kotlin/com/y54895/matrixauth/command/AccountCommand.kt`:玩家命令
23+
- `src/main/kotlin/com/y54895/matrixauth/command/MatrixAuthAdminSupport.kt`:管理员命令
24+
- `src/main/kotlin/com/y54895/matrixauth/hook/MatrixAuthPlaceholderExpansion.kt`:PlaceholderAPI 变量扩展
25+
- `src/main/kotlin/com/y54895/matrixauth/util/RuntimeLibraryBootstrap.kt`:精简版运行时依赖入口
26+
- `src/main/kotlin/com/y54895/matrixauth/service/EasyBotCompatHttpService.kt`:EasyBot HTTP 查询接口
27+
- `src/main/kotlin/com/y54895/matrixauth/util/SchedulerBridge.kt`:Folia 调度兼容
28+
29+
## 精简版实现
30+
31+
当前主 jar 已改成精简发行:
32+
33+
- `build.gradle.kts` 不再把 Gson、HikariCP、SQLite 驱动、MySQL 驱动直接打进包。
34+
- 运行时依赖由 TabooLib 注解自动下载。
35+
- SQLite 和 MySQL 驱动按实际存储类型分别触发加载。
36+
37+
这意味着构建产物体积会很小,但首次启动需要联网。
38+
39+
## 数据库表
40+
41+
当前核心表:
42+
43+
| 表名 | 用途 |
44+
| --- | --- |
45+
| `matrixauth_players` | 玩家基础记录,保存默认模式、历史 UUID、owner_id |
46+
| `matrixauth_profiles` | 档案主体,保存档案名、当前激活账号类型、时间戳 |
47+
| `matrixauth_profile_accounts` | 档案绑定账号,保存各类型账号名和 UUID |
48+
49+
## Docusaurus 站点
50+
51+
文档站点工程位于 `Docs`
52+
53+
关键文件:
54+
55+
- `docusaurus.config.ts`
56+
- `sidebars.ts`
57+
- `src/pages/index.tsx`
58+
59+
当前站点按 GitHub Pages 用户站点配置:
60+
61+
- 仓库:[54895y/54895y.github.io](https://github.com/54895y/54895y.github.io.git)
62+
- `url = https://54895y.github.io`
63+
- `baseUrl = /`
64+
65+
## 本地构建
66+
67+
主插件:
68+
69+
```powershell
70+
cd D:\Matrix\MatrixAuth\Code
71+
.\gradlew.bat build
72+
```
73+
74+
文档站点:
75+
76+
```powershell
77+
cd D:\Matrix\Docs
78+
npm run build
79+
```

0 commit comments

Comments
 (0)