Skip to content

Commit

Permalink
Merge branch 'main' of github.com:EggLink/DanhengServer-Public
Browse files Browse the repository at this point in the history
  • Loading branch information
StopWuyu committed Jul 13, 2024
2 parents 77eec39 + ad0a205 commit 7da924e
Show file tree
Hide file tree
Showing 9 changed files with 389 additions and 27 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ permissions:

on:
push:
branches: [ "master" ]
branches: [ "main" ]
paths: [ "**.cs" ]
pull_request:
branches: [ "master" ]
branches: [ "main" ]
paths: [ "**.cs" ]
workflow_dispatch:

Expand Down
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<a href="https://discord.gg/xRtZsmHBVj"><img src="https://img.shields.io/badge/Discord%20Server-000000.svg?style=for-the-badge&logo=Discord&logoColor=white" /></a>
</p>

[EN](README.md) | [簡中](docs/README_zh-CN.md) | [繁中](docs/README_zh-CN.md) | [JP](docs/README_ja-JP.md)
[EN](README.md) | [简中](docs/README_zh-CN.md) | [繁中](docs/README_zh-TW.md) | [JP](docs/README_ja-JP.md)

## 💡 Function

Expand All @@ -34,11 +34,12 @@ Some functions for the game might not support at the first time when new "Anime

### Quick Start

1. Download the executable file from [Action](https://github.com/EggLinks/DanhengServer/actions)
1. Download the executable file from [Action](https://github.com/EggLink/DanhengServer-Public/actions)
2. Open the downloaded `DanhengServer.zip` and extract it to any folder __*preferably an English path__
(Optional) Download the `certificate.p12` from the WebServer folder of the source code to enable HTTPS mode, ensuring a more secure traffic
3. Run GameServer.exe
4. Run proxy, start the game, and enjoy!
3. Download Resources[https://github.com/Dimbreath/StarRailData](https://github.com/Dimbreath/StarRailData) and unzip to the same directory `Resources`, and Turn to [https://github.com/EggLinks/DanhengServer-Resources](https://github.com/EggLinks/DanhengServer-Resources) download only `Resources/Config` folder, ExcelOutput and other should use Dimbreath's,then download Configuration from the project and unzip to the same directory`Config`
4. Run GameServer.exe
5. Run proxy, start the game, and enjoy!

### Build

Expand All @@ -52,7 +53,7 @@ DanhengServer is built using .NET Framework
##### Windows

```shell
git clone --recurse-submodules https://github.com/EggLinks/DanhengServer.git
git clone --recurse-submodules https://github.com/EggLink/DanhengServer-Public.git
cd DanhengServer
dotnet build # compile
```
Expand All @@ -69,7 +70,7 @@ sudo apt-get update && \

- Compile and run environment
```shell
git clone --recurse-submodules https://github.com/EggLinks/DanhengServer.git
git clone --recurse-submodules https://github.com/EggLink/DanhengServer-Public.git
cd DanhengServer
.\dotnet build # compile
./Gameserver
Expand All @@ -78,7 +79,10 @@ cd DanhengServer
## ❓ Help

- Support Android system
- Mission 100040119 (cannot complet automatically) (use /mission finish 100040119 to fix it)
- Mission 100040119 (cannot complet automatically) (use /mission finish 100040119 to fix it)、
-
## 🔗API Help
[EN](docs/MuipAPI.md) | [简中](docs/MuipAPI_zh-CN.md) | [繁中](docs/MuipAPI_zh-TW.md) | [JP](docs/MuipAPI_ja-JP.md)

## ❕️ Troubleshooting

Expand Down
88 changes: 88 additions & 0 deletions docs/MuipAPI.md
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]
}
}
```
86 changes: 86 additions & 0 deletions docs/MuipAPI_ja-JP.md
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]
}
}
```
85 changes: 85 additions & 0 deletions docs/MuipAPI_zh-CN.md
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]
}
}
```
Loading

0 comments on commit 7da924e

Please sign in to comment.