Skip to content

Commit e4b72cf

Browse files
committed
docs: align README, wiki, CHANGELOG with codebase; add gameRooms config template
1 parent 3de1997 commit e4b72cf

8 files changed

Lines changed: 111 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# Changelog
22

3+
## 1.3.0-SNAPSHOT
4+
5+
Game room system with core restrictions, bossbar/text mode adaptation, and documentation alignment.
6+
7+
中文更新日志:
8+
9+
- **棋牌室系统(核心限制)**: 新增 `GameRoom` 领域模型、`GameRoomManager` 管理器、`GameRoomListener` 监听器和 YAML 持久化。当 `gameRooms.enabled=true``gameRooms.restrictNewTables=true` 时,牌桌只能在棋牌室内创建;玩家进出棋牌室有提醒消息;对局中玩家离开棋牌室后启动倒计时,超时强制结束对局。
10+
- **倒计时警告节奏**: 前段每 15 秒提醒,最后 10 秒按 10/8/6/5/4/3/2/1 逐秒倒计时。玩家返回棋牌室则取消倒计时。
11+
- **Bossbar/桌上文字模式适配**: Bossbar 和桌上中心文字根据游戏模式(RIICHI/GB/SICHUAN)显示不同内容,不再统一显示日麻特有的供托/宝牌。
12+
- **配置模板补全**: 默认配置模板新增 `gameRooms` 配置段,包含 enabled、restrictNewTables、enterExitMessages、leaveCountdownSeconds、defaultRadius、defaultHeight、file 七个配置项。
13+
- **文档矫正**: README、wiki 和 CHANGELOG 与代码实际行为对齐,包括 botmatch 命令支持 GB/SICHUAN 预设、棋牌室系统说明等。
14+
15+
English Release Notes:
16+
17+
- **Game room system (core restrictions)**: Added `GameRoom` domain model, `GameRoomManager`, `GameRoomListener`, and YAML persistence. When `gameRooms.enabled=true` and `gameRooms.restrictNewTables=true`, tables can only be created inside game rooms; enter/exit messages are shown; active players who leave a game room trigger a countdown that force-ends the match on expiry.
18+
- **Countdown warning cadence**: Early phase warns every 15 seconds; final 10 seconds count down at 10, 8, 6, 5, 4, 3, 2, 1. Returning to the room cancels the countdown.
19+
- **Bossbar/table text mode adaptation**: Bossbar and center table text now display mode-appropriate content (RIICHI/GB/SICHUAN) instead of always showing riichi-specific indicators.
20+
- **Config template completion**: Default config template now includes the `gameRooms` section with enabled, restrictNewTables, enterExitMessages, leaveCountdownSeconds, defaultRadius, defaultHeight, and file settings.
21+
- **Documentation alignment**: README, wiki, and CHANGELOG corrected to match actual code behavior, including botmatch supporting GB/SICHUAN presets and game room system documentation.
22+
323
## 1.2.0 - 2026-06-16
424

525
GB/SICHUAN opening procedure and wall management overhaul to match real Chinese Official / Sichuan Mahjong rules.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# MahjongPaper
1+
# MahjongPaper
22

33
> This project was created entirely by AI.
44
@@ -29,12 +29,13 @@ The current branch already supports playable Riichi Mahjong, GB Mahjong, and Sic
2929
- Mahjong Soul-style rank persistence and per-mode leaderboards when database-backed ranking is enabled
3030
- CraftEngine-backed seat/table interaction and CraftEngine bundle export
3131
- round history persistence through H2 by default, with optional MariaDB/MySQL
32+
- game room system: spatial containers for tables, with optional table creation restriction, enter/exit messages, and leave countdown for active matches
3233

3334
## Command Summary
3435

3536
- `/mahjong help`: show in-game command help
3637
- `/mahjong create`: create a new empty table at your location
37-
- `/mahjong botmatch [hanchan|tonpuu]`: create a 4-bot test match and spectate it
38+
- `/mahjong botmatch [MAJSOUL_HANCHAN|MAJSOUL_TONPUU|GB|SICHUAN]`: create a 4-bot test match and spectate it
3839
- `/mahjong mode <MAJSOUL_TONPUU|MAJSOUL_HANCHAN|GB|SICHUAN>`: apply a preset before the next start
3940
- `/mahjong join <tableId>`: join a table as a player
4041
- `/mahjong leave`: leave immediately before the hand starts, or queue a leave after the current hand
@@ -196,6 +197,7 @@ The current human-friendly layout is:
196197
- `database.h2`: local embedded H2 settings
197198
- `database.pool`: connection pool sizing
198199
- `tables.persistence`: persistent table restore file
200+
- `gameRooms`: game room system — spatial containers for tables, creation restriction, enter/exit messages, and leave countdown
199201
- `ranking`: Mahjong Soul-style room presets and rank persistence
200202
- `integrations.craftengine`: CraftEngine export and interaction preferences
201203
- `debug`: debug logging switches

README.zh-CN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@
2727
- 观战、私有手牌显示、HUD 覆盖层和本地化提示
2828
- 基于 CraftEngine 的座位 / 牌桌交互与 bundle 导出
2929
- 默认使用 H2 持久化对局历史和段位,可选 MariaDB/MySQL
30+
- 棋牌室系统:牌桌的空间容器,支持牌桌创建限制、进出提醒和对局中离开倒计时
3031

3132
## 指令概览
3233

3334
- `/mahjong help`:显示游戏内帮助
3435
- `/mahjong create`:在当前位置创建一个空牌桌
35-
- `/mahjong botmatch [hanchan|tonpuu]`:创建一桌 4 Bot 测试对局并进入观战
36+
- `/mahjong botmatch [MAJSOUL_HANCHAN|MAJSOUL_TONPUU|GB|SICHUAN]`:创建一桌 4 Bot 测试对局并进入观战
3637
- `/mahjong mode <MAJSOUL_TONPUU|MAJSOUL_HANCHAN|GB|SICHUAN>`:桌主/管理员在下一局开始前应用预设规则;默认玩法以 `MAJSOUL_HANCHAN` 为主
3738
- `/mahjong join <tableId>`:加入牌桌
3839
- `/mahjong leave`:开局前直接离开;开局后标记为本局结束后离开
@@ -191,6 +192,7 @@
191192
- `database.h2`:本地 H2 配置
192193
- `database.pool`:连接池参数
193194
- `tables.persistence`:持久牌桌文件配置
195+
- `gameRooms`:棋牌室系统——牌桌的空间容器,支持创建限制、进出提醒和离开倒计时
194196
- `integrations.craftengine`:CraftEngine 导出与交互偏好
195197
- `debug`:调试日志
196198

docs/wiki.zh-CN.md

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,7 @@
247247
| `tables.startupRebuildBatchSize` | 启动时分批恢复牌桌展示的批量大小 |
248248
| `tables.allowFreeMoveDuringRound` | 是否允许牌局中自由移动 |
249249
| `tables.persistence` | 牌桌持久化文件开关和文件名 |
250+
| `gameRooms` | 棋牌室系统——牌桌的空间容器,创建限制、进出提醒、离开倒计时 |
250251
| `ranking` | 雀魂风格段位系统开关和房间档位 |
251252
| `integrations.craftengine` | CraftEngine bundle 导出、物品、家具和兼容性设置 |
252253
| `debug` | 调试日志分类 |
@@ -314,7 +315,7 @@ MahjongPaper 使用 CraftEngine 处理以下内容:
314315
| `/mahjong addbot` | 桌主/管理员 | 开局前添加 Bot |
315316
| `/mahjong removebot` | 桌主/管理员 | 开局前移除 Bot |
316317
| `/mahjong create` | 管理员 | 创建牌桌 |
317-
| `/mahjong botmatch [hanchan|tonpuu]` | 管理员 | 创建 4 Bot 测试桌 |
318+
| `/mahjong botmatch [MAJSOUL_HANCHAN|MAJSOUL_TONPUU|GB|SICHUAN]` | 管理员 | 创建 4 Bot 测试桌 |
318319
| `/mahjong list` | 管理员 | 列出活动牌桌 |
319320
| `/mahjong render` | 管理员 | 强制刷新牌桌展示 |
320321
| `/mahjong inspect` | 管理员 | 渲染诊断 |
@@ -323,11 +324,42 @@ MahjongPaper 使用 CraftEngine 处理以下内容:
323324
| `/mahjong deletetable [table_id]` | 管理员 | 删除牌桌 |
324325
| `/mahjong reload` | 管理员 | 重载配置 |
325326

327+
## 棋牌室系统
328+
329+
棋牌室是牌桌的空间容器,用于限制牌桌的创建位置、提供进出提醒和对局中离开倒计时。
330+
331+
### 核心功能
332+
333+
| 功能 | 说明 |
334+
| --- | --- |
335+
| 牌桌创建限制 | `gameRooms.restrictNewTables: true` 时,新牌桌只能在棋牌室内创建;棋牌室外的已有牌桌仍可正常使用 |
336+
| 进出提醒 | `gameRooms.enterExitMessages: true` 时,玩家进出棋牌室会收到提示消息 |
337+
| 离开倒计时 | 对局中的玩家离开棋牌室后开始倒计时(默认 60 秒),超时则强制结束对局;玩家返回棋牌室则取消倒计时 |
338+
339+
### 倒计时警告节奏
340+
341+
- 前段:每 15 秒提醒一次(如 60s、45s、30s、15s)
342+
- 最后 10 秒:10、8、6、5、4、3、2、1 逐秒倒计时
343+
344+
### 配置项
345+
346+
| 配置项 | 默认值 | 说明 |
347+
| --- | --- | --- |
348+
| `gameRooms.enabled` | `true` | 启用棋牌室系统 |
349+
| `gameRooms.restrictNewTables` | `true` | 限制新牌桌只能在棋牌室内创建 |
350+
| `gameRooms.enterExitMessages` | `true` | 进出棋牌室时显示提示 |
351+
| `gameRooms.leaveCountdownSeconds` | `60` | 离开倒计时秒数(最小 5) |
352+
| `gameRooms.defaultRadius` | `10` | 中心点创建棋牌室的默认半径 |
353+
| `gameRooms.defaultHeight` | `8` | 中心点创建棋牌室的默认高度 |
354+
| `gameRooms.file` | `game-rooms.yml` | 棋牌室持久化文件 |
355+
356+
棋牌室数据保存在 `plugins/MahjongPaper/game-rooms.yml` 中。
357+
326358
## 常见问题
327359

328360
### 为什么我不能创建牌桌?
329361

330-
`/mahjong create` 需要 `mahjongpaper.admin`。普通玩家只能加入、观战和进行牌局操作。
362+
`/mahjong create` 需要 `mahjongpaper.admin`。普通玩家只能加入、观战和进行牌局操作。此外,如果棋牌室系统已启用且 `gameRooms.restrictNewTables``true`,则牌桌只能在棋牌室内创建,在棋牌室外尝试创建会提示"必须在棋牌室内"。
331363

332364
### 为什么国标胡不了?
333365

src/main/config-template/config.template.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,29 @@ tables:
5353
enabled: true
5454
file: tables.yml
5555

56+
# {{gameroom.summary}}
57+
gameRooms:
58+
# {{gameroom.enabled}}
59+
enabled: true
60+
61+
# {{gameroom.restrict}}
62+
restrictNewTables: true
63+
64+
# {{gameroom.messages}}
65+
enterExitMessages: true
66+
67+
# {{gameroom.countdown}}
68+
leaveCountdownSeconds: 60
69+
70+
# {{gameroom.radius}}
71+
defaultRadius: 10
72+
73+
# {{gameroom.height}}
74+
defaultHeight: 8
75+
76+
# {{gameroom.file}}
77+
file: game-rooms.yml
78+
5679
ranking:
5780
# {{ranking.summary}}
5881
enabled: true

src/main/config-template/config_comments_en.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ tables.batch=How many persistent tables are rebuilt per tick after startup.
1515
tables.free_move=Allow players to move freely during a round without being treated as leaving.
1616
tables.persistence=Persistent tables are restored from this file on startup.
1717

18+
gameroom.summary=Game rooms are spatial containers for mahjong tables. When enabled, tables can only be created inside a game room.
19+
gameroom.enabled=Enable the game room system. When disabled, tables can be created anywhere.
20+
gameroom.restrict=When true, new tables can only be created inside a game room. Existing tables outside rooms remain functional.
21+
gameroom.messages=Show enter/exit messages when players cross game room boundaries.
22+
gameroom.countdown=Seconds before a match is force-ended when an active player leaves the game room. Minimum 5 seconds.
23+
gameroom.radius=Default radius (blocks) when creating a game room from a center point.
24+
gameroom.height=Default height (blocks) when creating a game room from a center point.
25+
gameroom.file=File name for game room persistence, relative to the plugin data folder.
26+
1827
ranking.summary=Mahjong Soul-style rank points and persistence (requires database.enabled=true).
1928
ranking.rooms=Supported room presets: BRONZE, SILVER, GOLD, JADE, THRONE
2029

src/main/config-template/config_comments_zh_CN.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ tables.batch=服务器启动后,每 tick 重建的持久化牌桌数量。
1515
tables.free_move=允许玩家在对局中自由移动且不被视为离桌。
1616
tables.persistence=启动时从该文件恢复持久化牌桌。
1717

18+
gameroom.summary=棋牌室是牌桌的空间容器。启用后,牌桌只能在棋牌室内创建。
19+
gameroom.enabled=启用棋牌室系统。禁用后,牌桌可以在任意位置创建。
20+
gameroom.restrict=为 true 时,新牌桌只能在棋牌室内创建。棋牌室外的已有牌桌仍可正常使用。
21+
gameroom.messages=玩家进出棋牌室时显示提示消息。
22+
gameroom.countdown=对局中玩家离开棋牌室后,强制结束对局的倒计时秒数。最小 5 秒。
23+
gameroom.radius=以中心点创建棋牌室时的默认半径(方块数)。
24+
gameroom.height=以中心点创建棋牌室时的默认高度(方块数)。
25+
gameroom.file=棋牌室持久化文件名,相对于插件数据目录。
26+
1827
ranking.summary=雀魂风格段位分与持久化(需要 database.enabled=true)。
1928
ranking.rooms=支持房间预设: BRONZE, SILVER, GOLD, JADE, THRONE
2029

src/main/config-template/config_comments_zh_TW.properties

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ tables.batch=伺服器啟動後,每 tick 重建的持久化牌桌數量。
1515
tables.free_move=允許玩家在對局中自由移動且不視為離桌。
1616
tables.persistence=啟動時從此檔案還原持久化牌桌。
1717

18+
gameroom.summary=棋牌室是牌桌的空間容器。啟用後,牌桌只能在棋牌室內建立。
19+
gameroom.enabled=啟用棋牌室系統。停用後,牌桌可以在任意位置建立。
20+
gameroom.restrict=為 true 時,新牌桌只能在棋牌室內建立。棋牌室外的已有牌桌仍可正常使用。
21+
gameroom.messages=玩家進出棋牌室時顯示提示訊息。
22+
gameroom.countdown=對局中玩家離開棋牌室後,強制結束對局的倒數計時秒數。最小 5 秒。
23+
gameroom.radius=以中心點建立棋牌室時的預設半徑(方塊數)。
24+
gameroom.height=以中心點建立棋牌室時的預設高度(方塊數)。
25+
gameroom.file=棋牌室持久化檔案名稱,相對於外掛資料夾。
26+
1827
ranking.summary=雀魂風格段位分與持久化(需 database.enabled=true)。
1928
ranking.rooms=支援房間預設: BRONZE, SILVER, GOLD, JADE, THRONE
2029

0 commit comments

Comments
 (0)