Files
DanhengServer-OpenSource/docs/MuipAPI_zh-TW.md
2024-10-07 00:25:50 +08:00

98 lines
3.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div align="center">
<table>
<td valign="center"><a href="MuipAPI.md"><img src="https://github.com/twitter/twemoji/blob/master/assets/72x72/1f1fa-1f1f8.png" width="16"/> English</td>
<td valign="center"><a href="MuipAPI_zh-CN.md"><img src="https://em-content.zobj.net/thumbs/120/twitter/351/flag-china_1f1e8-1f1f3.png" width="16"/> 简中</td>
<td valign="center"><img src="https://em-content.zobj.net/thumbs/120/twitter/351/flag-china_1f1e8-1f1f3.png" width="16"/> 繁中</td>
<td valign="center"><a href="MuipAPI_ja-JP.md"><img src="https://github.com/twitter/twemoji/blob/master/assets/72x72/1f1ef-1f1f5.png" width="16"/> 日本語</td>
</td>
</table>
</div>
## 💡API幫助
- 自2.3版本開始支持外部API調用接口
- 總接口為Dispatch接口加上入口比如你的Dispatch為 http://127.0.0.1:8080 請求參數和返回都為json格式
- (1)授權接口: http://127.0.0.1:8080/muip/auth_admin (支持POST)
- -必傳參數1admin_key (在config.php的MuipServer/AdminKey配置)
- -必傳參數2key_type (類型比如PEM)
- -返回示例:
```json
{
"code": 0,
"message": "Authorized admin key successfully!",
"data": {
"rsaPublicKey": "***",
"sessionId": "***",
"expireTimeStamp": ***
}
}
```
- (2)提交命令接口: http://127.0.0.1:8080/muip/exec_cmd (支持POST/GET)
- -必傳參數1SessionId (在授權接口請求後獲得)
- -必傳參數2Command (需要執行的命令經過rsaPublicKey[授權接口獲取]下RSA[pacs#1]加密)
- -必傳參數3TargetUid (執行命令的玩家UID)
- -返回示例:
```json
{
"code": 0,
"message": "Success",
"data": {
"sessionId": "***",
"message": "*** //base64編碼後
}
}
```
- (3)獲取服務器狀態接口: http://127.0.0.1:8080/muip/server_information (支持POST/GET)
- -必傳參數1SessionId (在授權接口請求後獲得)
- -返回示例:
```json
{
"code": 0,
"message": "Success",
"data": {
"onlinePlayers": [
{
"uid": 10001,
"name": "KEVIN",
"headIconId": 208001
},
....
],
"serverTime": 1720626191,
"maxMemory": 16002.227,
"usedMemory": 7938.5547,
"programUsedMemory": 323
}
}
```
- (4)獲取玩家信息接口: http://127.0.0.1:8080/muip/player_information (支持POST/GET)
- -必傳參數1SessionId (在授權接口請求後獲得)
- -必傳參數2Uid (玩家UID)
- - -返回示例:
```json
{
"code": 0,
"message": "Success",
"data": {
"uid": 10001,
"name": "KEVIN",
"signature": "",
"headIconId": 208001,
"curPlaneId": 10001,
"curFloorId": 10001001,
"playerStatus": "Explore",
"stamina": 182,
"recoveryStamina": 4,
"assistAvatarList": Array[0],
"displayAvatarList": Array[0],
"finishedMainMissionIdList": Array[38],
"finishedSubMissionIdList": Array[273],
"acceptedMainMissionIdList": Array[67],
"acceptedSubMissionIdList": Array[169]
}
}
```