diff --git a/.github/workflows/upload_deploy.yml b/.github/workflows/upload_deploy.yml new file mode 100644 index 0000000..b69cb34 --- /dev/null +++ b/.github/workflows/upload_deploy.yml @@ -0,0 +1,86 @@ +name: "upload_deploy" + +############################################################################### +# This ci is skipped in THUAI6 for THUAI6 use cloud disk to distribute. +# To use automatically distribution, comment out `if: false` in the following +# two jobs. +############################################################################### + +on: + push: + branches: [ master] + +jobs: + build_upload: + runs-on: windows-latest + if: false # Skip this job + steps: + - uses: actions/checkout@v3 + + - name: Setup dotnet Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.0.x + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.9.2' + architecture: 'x64' + + - name: Pip Install paramiko + run: pip install paramiko + + - name: Publish + run: | + New-Item -Path . -Name "THUAI6" -ItemType "directory" + mkdir -p THUAI6/win/win64 + mkdir -p THUAI6/linux/linux64 + mkdir -p THUAI6/win/win64/Debug + mkdir -p THUAI6/linux/linux64/Debug + dotnet publish "./logic/Server/Server.csproj" -c Release -r linux-x64 -o ./THUAI6/win/win64 --self-contained true + dotnet publish "./logic/Server/Server.csproj" -c Release -r win-x64 -o ./THUAI6/linux/linux64 --self-contained true + dotnet publish "./logic/Server/Server.csproj" -c Debug -r win-x64 -o ./THUAI6/win/win64/Debug --self-contained true + dotnet publish "./logic/Server/Server.csproj" -c Debug -r linux-x64 -o ./THUAI6/linux/linux64/Debug --self-contained true + dotnet publish "./logic/Client/Client.csproj" -c Release -r win-x64 -o ./THUAI6/win/win64 --self-contained true + + - name: Copy CAPI + run: | + mkdir -p THUAI6/win/CAPI/proto + cp ./dependency/proto/Message2Clients.proto ./THUAI6/win/CAPI/proto/ + cp ./dependency/proto/Message2Server.proto ./THUAI6/win/CAPI/proto/ + cp ./dependency/proto/Services.proto ./THUAI6/win/CAPI/proto/ + cp ./dependency/proto/MessageType.proto ./THUAI6/win/CAPI/proto/ + cp -r ./CAPI/cpp ./THUAI6/win/CAPI/ + cp -r ./CAPI/python ./THUAI6/win/CAPI/ + cp -r ./THUAI6/win/CAPI ./THUAI6/linux/ + + - name: Copy Markdown + run: | + New-Item -Path . -Name "Md" -ItemType "directory" + cp ./CAPI/CAPI接口(cpp).md ./Md/ + cp ./CAPI/CAPI接口(python).md ./Md/ + cp ./CAPI/Tool_tutorial.md ./Md/ + cp Q&A.md ./Md/ + cp 使用文档.md ./Md/ + cp GameRules.md ./Md/ + + - name: Markdown to PDF and HTML + uses: BaileyJM02/markdown-to-pdf@v1.2.0 + with: + input_dir: ./Md + output_dir: ./THUAI6/ + images_dir: ./resource + image_import: ./images + build_html: false + + - name: Tencent Cloud COS Action + uses: TencentCloud/cos-action@v1 + with: + secret_id: ${{ secrets.TENCENT_CLOUD_SECRET_ID }} + secret_key: ${{ secrets.TENCENT_CLOUD_SECRET_KEY }} + cos_bucket: ${{ secrets.COS_BUCKET }} + cos_region: ${{ secrets.COS_REGION }} + local_path: ./THUAI6 + remote_path: THUAI6 + clean: true diff --git a/CAPI/CAPI接口(cpp).md b/CAPI/CAPI接口(cpp).md index ec0ca6c..a02d382 100644 --- a/CAPI/CAPI接口(cpp).md +++ b/CAPI/CAPI接口(cpp).md @@ -5,7 +5,7 @@ ### 主动指令 #### 移动 -- `std::future Move(int64_t timeInMilliseconds, double angleInRadian)`:移动,`timeInMilliseconds` 为移动时间,单位毫秒;`angleInRadian` 表示移动方向,单位弧度,使用极坐标,**竖直向下方向为x轴,水平向右方向为y轴** +- `std::future Move(int64_t timeInMilliseconds, double angleInRadian)`:移动,`timeInMilliseconds` 为移动时间,单位毫秒;`angleInRadian` 表示移动方向,单位弧度,使用极坐标,**竖直向下方向为x轴,水平向右方向为y轴**。因为移动过程中你会受到多种干扰使得移动结果不符合你的预期;因此建议小步移动,边移动边考虑之后的行为。 - `std::future MoveRight(uint32_t timeInMilliseconds)`即向右移动,`MoveLeft`、`MoveDown`、`MoveUp`同理 #### 使用技能 @@ -42,7 +42,7 @@ #### 队内信息 - `std::future SendMessage(int64_t, std::string)`:给同队的队友发送消息。第一个参数指定发送的对象,第二个参数指定发送的内容,不得超过256字节。 - `bool HaveMessage()`:是否有队友发来的尚未接收的信息。 - - `std::pair GetMessage()`:从玩家ID为第一个参数的队友获取信息。 + - `std::pair GetMessage()`:按照消息发送顺序获取来自队友的信息,第一个参数为发送该消息的PlayerID。 #### 查询可视范围内的信息 - `std::vector> GetStudents() const` :返回所有可视学生的信息。 diff --git a/CAPI/CAPI接口(python).md b/CAPI/CAPI接口(python).md index 71302c2..030dee2 100644 --- a/CAPI/CAPI接口(python).md +++ b/CAPI/CAPI接口(python).md @@ -8,7 +8,7 @@ #### 移动 -- `def Move(self, timeInMilliseconds: int, angle: float) -> Future[bool]`:移动,`timeInMilliseconds` 为移动时间,单位毫秒;`angleInRadian` 表示移动方向,单位弧度,使用极坐标,**竖直向下方向为x轴,水平向右方向为y轴** +- `def Move(self, timeInMilliseconds: int, angle: float) -> Future[bool]`:移动,`timeInMilliseconds` 为移动时间,单位毫秒;`angleInRadian` 表示移动方向,单位弧度,使用极坐标,**竖直向下方向为x轴,水平向右方向为y轴**因为移动过程中你会受到多种干扰使得移动结果不符合你的预期;因此建议小步移动,边移动边考虑之后的行为。 - `def MoveRight(self, timeInMilliseconds: int) -> Future[bool]`即向右移动,`MoveLeft`、`MoveDown`、`MoveUp`同理 #### 使用技能 @@ -53,7 +53,7 @@ - `std::future SendMessage(int64_t, std::string)`:给同队的队友发送消息。第一个参数指定发送的对象,第二个参数指定发送的内容,不得超过256字节。 - `bool HaveMessage()`:是否有队友发来的尚未接收的信息。 - - `std::pair GetMessage()`:从玩家ID为第一个参数的队友获取信息。 + - `std::pair GetMessage()`:按照消息发送顺序获取来自队友的信息,第一个参数为发送该消息的PlayerID。 #### 查询可视范围内的信息 diff --git a/CAPI/Tool_tutorial.md b/CAPI/Tool_tutorial.md index 5209b2a..33b059e 100644 --- a/CAPI/Tool_tutorial.md +++ b/CAPI/Tool_tutorial.md @@ -10,7 +10,7 @@ 菜单栏下方一行 -![image-20230416010705076](src/image-20230416010705076.png) +![image-20230416010705076](../resource/image-20230416010705076.png) 可以更改生成模式为`Debug`或`Release` @@ -18,7 +18,7 @@ 左上方菜单栏 `调试->调试属性` -![image-20230416010816392](src/image-20230416010816392.png) +![image-20230416010816392](../resource/image-20230416010816392.png) 在命令参数一栏中加入命令行参数进行调试 diff --git a/Q&A.md b/Q&A.md index 1898ca1..c9a6340 100644 --- a/Q&A.md +++ b/Q&A.md @@ -52,6 +52,11 @@ A: ![项目属性](.\resource\项目属性.png) 确保上图项目属性中平台工具集在 v143,C++17 标准 +Q:CAPI编译不通过 +![lib](.\resource\lib.png) + +A:查看`.\win\CAPI\cpp\`文件夹下是否有`lib`文件夹,没有则https://cloud.tsinghua.edu.cn/d/6972138f641d4e81a446/ 下载并复制粘贴 + ## Python ### grpc版本更新失败 diff --git a/resource/IsRunning.png b/resource/IsRunning.png new file mode 100644 index 0000000..1cbaac5 Binary files /dev/null and b/resource/IsRunning.png differ diff --git a/resource/clientsmaller.png b/resource/clientsmaller.png new file mode 100644 index 0000000..7ed36ab Binary files /dev/null and b/resource/clientsmaller.png differ diff --git a/CAPI/src/image-20230416010705076.png b/resource/image-20230416010705076.png similarity index 100% rename from CAPI/src/image-20230416010705076.png rename to resource/image-20230416010705076.png diff --git a/CAPI/src/image-20230416010816392.png b/resource/image-20230416010816392.png similarity index 100% rename from CAPI/src/image-20230416010816392.png rename to resource/image-20230416010816392.png diff --git a/resource/lib.png b/resource/lib.png new file mode 100644 index 0000000..5bed8ce Binary files /dev/null and b/resource/lib.png differ diff --git a/使用文档.md b/使用文档.md index 33ee1d1..f7a4e2f 100644 --- a/使用文档.md +++ b/使用文档.md @@ -156,7 +156,7 @@ start cmd /k win64\Client.exe --cl --playbackFile .\video.thuaipb --playbackSpee ## WPF简易调试界面 -![client](.\resource\client.png) +![client](.\resource\clientsmaller.png) ### 界面介绍