-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:EggLink/DanhengServer-Public
- Loading branch information
Showing
9 changed files
with
389 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
[EN](MuipAPI.md) | [简中](MuipAPI_zh-CN.md) | [繁中](MuipAPI_zh-TW.md) | [JP](MuipAPI_ja-JP.md) | ||
## 💡API Help | ||
- Since version 2.3, external APIs are supported | ||
- For example, your Dispatch is http://127.0.0.1:8080, and the request parameters and returns are in json format | ||
- (1) Authorization interface: http://127.0.0.1:8080/muip/auth_admin (support POST/GET) | ||
- -Required parameter 1: admin_key (MuipServer/AdminKey configuration in config.php) | ||
- -Required parameter 2: key_type (type, e.g. PEM or XML) | ||
- -Return example: | ||
```json | ||
{ | ||
"code": 0, | ||
//codeResponse: `code`: `0 -> Success` `1 -> Token incorrect or not enable` | ||
"message": "Authorized admin key successfully!", | ||
"data": { | ||
"rsaPublicKey": "***", | ||
"sessionId": "***", | ||
"expireTimeStamp": *** | ||
} | ||
} | ||
``` | ||
- (2)Submit command interface: http://127.0.0.1:8080/muip/exec_cmd (support POST/GET) | ||
- -Required parameter 1: SessionId (obtained after authorization API request) | ||
- -Required parameter 2: Command (the command to be executed is encrypted by RSA[pacs#1] under rsaPublicKey) | ||
- -Required parameter 3: TargetUid (UID of the player executing the command) | ||
- -Return example: | ||
```json | ||
{ | ||
"code": 0, | ||
//codeResponse: `code`: `0 -> Success` `1 -> Session expired` `2 -> session not found` `3 -> encryption error` | ||
"message": "Success", | ||
"data": { | ||
"sessionId": "***", | ||
"message": "*** //base64 | ||
} | ||
} | ||
``` | ||
- (3)Interface to get server status: http://127.0.0.1:8080/muip/server_information (only support GET) | ||
- -Required parameter 1: SessionId (obtained after authorization API request) | ||
- -Return example: | ||
```json | ||
{ | ||
"code": 0, | ||
//codeResponse: `code`: `0 -> Success` `1 -> Session expired` `2 -> session not found` | ||
"message": "Success", | ||
"data": { | ||
"onlinePlayers": [ | ||
{ | ||
"uid": 10001, | ||
"name": "KEVIN", | ||
"headIconId": 208001 | ||
}, | ||
.... | ||
], | ||
"serverTime": 1720626191, | ||
"maxMemory": 16002.227, | ||
"usedMemory": 7938.5547, | ||
"programUsedMemory": 323 | ||
} | ||
} | ||
``` | ||
- (4)Interface to get player information: http://127.0.0.1:8080/muip/player_information (only support GET) | ||
- -Required parameter 1: SessionId (obtained after authorization API request) | ||
- -Required parameter 2: Uid (player UID) | ||
- -Return example: | ||
```json | ||
{ | ||
"code": 0, | ||
//Response: `code`: `0 -> Success` `1 -> Session expired` `2 -> player not exist` `3 -> session not found` | ||
"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] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
[EN](MuipAPI.md) | [简中](MuipAPI_zh-CN.md) | [繁中](MuipAPI_zh-TW.md) | [JP](MuipAPI_ja-JP.md) | ||
|
||
##💡API支援です | ||
|
||
-バージョン2.3から、外部API呼び出しインタフェースをサポートします。 | ||
-全体のインタフェースはDispatchインタフェースに入口を加えます。例えば、Dispatchはhttp://127.0.0.1:8080、要求パラメータとリターンはjson形式です。 | ||
-(1)ライセンスインタフェース:http://127.0.0.1:8080/muip/auth_admin(支持ポスト/ get) | ||
- -必須引数1:admin_key (config.phpでのMuipServer/AdminKey構成) | ||
- -必須パラメータ2:key_type(タイプ、例えばPEM)です。 | ||
- -リターン例です: | ||
```json | ||
{ | ||
"code": 0, | ||
"message": "Authorized admin key successfully!", | ||
"data": { | ||
"rsaPublicKey": "***", | ||
"sessionId": "***", | ||
"expireTimeStamp": *** | ||
} | ||
} | ||
``` | ||
—(2)提出命令インタフェース:http://127.0.0.1:8080/muip/exec_cmd(支持ポスト/ get) | ||
- -必伝パラメータ1:SessionId(ライセンスインターフェース要求後に取得します) | ||
- -必須引数2:Command(実行するコマンドをrsaPublicKey[ライセンスインターフェース取得]でRSA[pacs#1]で暗号化します) | ||
- -必伝パラメータ3:TargetUid(コマンドを実行するプレイヤーUID)です | ||
- -リターン例です: | ||
```json | ||
{ | ||
"code": 0, | ||
"message": "Success", | ||
"data": { | ||
"sessionId": "***", | ||
"message": "*** //base64编码后 | ||
} | ||
} | ||
``` | ||
—(3)サーバーの状態をインタフェース:http://127.0.0.1:8080/muip/server_information(支持get)だけ | ||
- -必伝パラメータ1:SessionId(ライセンスインターフェース要求後に取得します) | ||
- -リターン例です: | ||
```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(支持get)だけ | ||
- -必伝パラメータ1:SessionId(ライセンスインターフェース要求後に取得します) | ||
- -必伝パラメーター2:Uid(プレイヤー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] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
[EN](MuipAPI.md) | [简中](MuipAPI_zh-CN.md) | [繁中](MuipAPI_zh-TW.md) | [JP](MuipAPI_ja-JP.md) | ||
## 💡API帮助 | ||
|
||
- 自2.3版本开始,支持外部API调用接口 | ||
- 总接口为Dispatch接口加上入口,比如你的Dispatch为 http://127.0.0.1:8080,请求参数和返回都为json格式 | ||
- (1)授权接口: http://127.0.0.1:8080/muip/auth_admin (支持POST/GET) | ||
- -必传参数1:admin_key (在config.php的MuipServer/AdminKey配置) | ||
- -必传参数2:key_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) | ||
- -必传参数1:SessionId (在授权接口请求后获得) | ||
- -必传参数2:Command (需要执行的命令经过rsaPublicKey[授权接口获取]下RSA[pacs#1]加密) | ||
- -必传参数3:TargetUid (执行命令的玩家UID) | ||
- -返回示例: | ||
```json | ||
{ | ||
"code": 0, | ||
"message": "Success", | ||
"data": { | ||
"sessionId": "***", | ||
"message": "*** //base64编码后 | ||
} | ||
} | ||
``` | ||
- (3)获取服务器状态接口: http://127.0.0.1:8080/muip/server_information (仅支持GET) | ||
- -必传参数1:SessionId (在授权接口请求后获得) | ||
- -返回示例: | ||
```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 (仅支持GET) | ||
- -必传参数1:SessionId (在授权接口请求后获得) | ||
- -必传参数2:Uid (玩家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] | ||
} | ||
} | ||
``` |
Oops, something went wrong.