From a10261331304ae1b2f6431c6b8b5bcb5b95bd2ec Mon Sep 17 00:00:00 2001 From: mingjun97 Date: Sun, 1 May 2022 23:17:18 -0700 Subject: [PATCH] Utils for gacha history record subsystem * Auto generate mapping files with command `java -jar grasscutter.jar -gachamap` * Static file provider * For gacha record webpage * All static files should be stored at `GRASSCUTTER_RESOURCE/gcstatic/` * Can benefit other subsystem in future when webpages involved --- README.md | 2 + README_zh-CN.md | 2 + data/gacha_records.html | 16 +++- .../java/emu/grasscutter/Grasscutter.java | 3 + .../server/dispatch/DispatchServer.java | 5 + .../http/gcstatic/StaticFileHandler.java | 31 +++++++ .../java/emu/grasscutter/tools/Tools.java | 93 +++++++++++++++++++ 7 files changed, 148 insertions(+), 4 deletions(-) create mode 100644 src/main/java/emu/grasscutter/server/http/gcstatic/StaticFileHandler.java diff --git a/README.md b/README.md index dc87ff1d8..51d360628 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,8 @@ You can find the output jar in the root of the project folder. You might want to use this command (`java -jar grasscutter.jar -handbook`) in a cmd that is in the grasscutter folder. It will create a handbook file (GM Handbook.txt) where you can find the item IDs for stuff you want +You may want to use this command (`java -jar grasscutter.jar -gachamap`) to generate a mapping file for the gacha record subsystem. The file will be generated to `GRASSCUTTER_RESOURCE/gcstatic` folder. Otherwise you may only see number IDs in the gacha record page. + There is a dummy user named "Server" in every player's friends list that you can message to use commands. Commands also work in other chat rooms, such as private/team chats. to run commands ingame, you need to add prefix `/` or `!` such as `/pos` | Commands | Usage | Permission node | Availability | description | Alias | diff --git a/README_zh-CN.md b/README_zh-CN.md index 9a58b9565..4ad7e6ff1 100644 --- a/README_zh-CN.md +++ b/README_zh-CN.md @@ -102,6 +102,8 @@ chmod +x gradlew 你可能需要在终端中运行 `java -jar grasscutter.jar -handbook` 它将会创建一个 `GM Handbook.txt` 以方便您查阅物品ID等 +你可能需要在终端中运行 `java -jar grasscutter.jar -gachamap` 来使得祈愿历史记录系统正常显示物品信息。 这个命令生成一个配置文件到如下文件夹:`GRASSCUTTER_RESOURCE/gcstatic`。 不执行此命令,您的祈愿历史记录中将只会显示数字ID而非物品名称。(目前仅支持自动生成英文记录信息) + 在每个玩家的朋友列表中都有一个名为“Server”的虚拟用户,你可以通过发送消息来使用命令。命令也适用于其他聊天室,例如私人/团队聊天。 要在游戏中使用命令,需要添加 `/` 或 `!` 前缀,如 `/pos` diff --git a/data/gacha_records.html b/data/gacha_records.html index 21270a046..55240e77d 100644 --- a/data/gacha_records.html +++ b/data/gacha_records.html @@ -1,5 +1,7 @@ + + + + + + +