|
|
@@ -129,12 +129,14 @@ npm run build
|
|
|
|
|
|
### 上传游戏 bundle
|
|
|
|
|
|
+`x-game-name`、`x-game-description`、`x-game-controls` 含非 ASCII 字符时必须 URL encode,否则服务端会乱码。
|
|
|
+
|
|
|
```bash
|
|
|
curl -X POST https://loganz2.cn/api/games/bundle \
|
|
|
-H "x-game-id: my-game" \
|
|
|
- -H "x-game-name: 我的游戏" \
|
|
|
- -H "x-game-description: 游戏描述" \
|
|
|
- -H "x-game-controls: 方向键移动" \
|
|
|
+ -H "x-game-name: $(python3 -c "import urllib.parse; print(urllib.parse.quote('我的游戏'))")" \
|
|
|
+ -H "x-game-description: $(python3 -c "import urllib.parse; print(urllib.parse.quote('游戏描述'))")" \
|
|
|
+ -H "x-game-controls: $(python3 -c "import urllib.parse; print(urllib.parse.quote('方向键移动'))")" \
|
|
|
-H "content-type: application/javascript" \
|
|
|
--data-binary "@bundle.js"
|
|
|
```
|
|
|
@@ -142,9 +144,9 @@ curl -X POST https://loganz2.cn/api/games/bundle \
|
|
|
| Header | 说明 |
|
|
|
|---|---|
|
|
|
| `x-game-id` | 游戏唯一 id,只允许字母、数字、`_`、`-` |
|
|
|
-| `x-game-name` | 显示名称(需 URL encode) |
|
|
|
-| `x-game-description` | 简短描述(可选,需 URL encode) |
|
|
|
-| `x-game-controls` | 操作说明(可选,需 URL encode) |
|
|
|
+| `x-game-name` | 显示名称,需 URL encode |
|
|
|
+| `x-game-description` | 简短描述(可选),需 URL encode |
|
|
|
+| `x-game-controls` | 操作说明(可选),需 URL encode |
|
|
|
|
|
|
上传成功后游戏立即可用,访问 `https://loganz2.cn/games/<id>` 即可游玩。
|
|
|
|