| @@ -0,0 +1,90 @@ | |||||
| 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 | |||||
| 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 shell | |||||
| run: | | |||||
| cp -r ./CAPI/cmd/* ./THUAI6/win/ | |||||
| cp -r ./CAPI/shell/* ./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 | |||||
| @@ -5,7 +5,7 @@ | |||||
| ### 主动指令 | ### 主动指令 | ||||
| #### 移动 | #### 移动 | ||||
| - `std::future<bool> Move(int64_t timeInMilliseconds, double angleInRadian)`:移动,`timeInMilliseconds` 为移动时间,单位毫秒;`angleInRadian` 表示移动方向,单位弧度,使用极坐标,**竖直向下方向为x轴,水平向右方向为y轴** | |||||
| - `std::future<bool> Move(int64_t timeInMilliseconds, double angleInRadian)`:移动,`timeInMilliseconds` 为移动时间,单位毫秒;`angleInRadian` 表示移动方向,单位弧度,使用极坐标,**竖直向下方向为x轴,水平向右方向为y轴**。因为移动过程中你会受到多种干扰使得移动结果不符合你的预期;因此建议小步移动,边移动边考虑之后的行为。 | |||||
| - `std::future<bool> MoveRight(uint32_t timeInMilliseconds)`即向右移动,`MoveLeft`、`MoveDown`、`MoveUp`同理 | - `std::future<bool> MoveRight(uint32_t timeInMilliseconds)`即向右移动,`MoveLeft`、`MoveDown`、`MoveUp`同理 | ||||
| #### 使用技能 | #### 使用技能 | ||||
| @@ -42,7 +42,7 @@ | |||||
| #### 队内信息 | #### 队内信息 | ||||
| - `std::future<bool> SendMessage(int64_t, std::string)`:给同队的队友发送消息。第一个参数指定发送的对象,第二个参数指定发送的内容,不得超过256字节。 | - `std::future<bool> SendMessage(int64_t, std::string)`:给同队的队友发送消息。第一个参数指定发送的对象,第二个参数指定发送的内容,不得超过256字节。 | ||||
| - `bool HaveMessage()`:是否有队友发来的尚未接收的信息。 | - `bool HaveMessage()`:是否有队友发来的尚未接收的信息。 | ||||
| - `std::pair<int64_t, std::string> GetMessage()`:从玩家ID为第一个参数的队友获取信息。 | |||||
| - `std::pair<int64_t, std::string> GetMessage()`:按照消息发送顺序获取来自队友的信息,第一个参数为发送该消息的PlayerID。 | |||||
| #### 查询可视范围内的信息 | #### 查询可视范围内的信息 | ||||
| - `std::vector<std::shared_ptr<const THUAI6::Student>> GetStudents() const` :返回所有可视学生的信息。 | - `std::vector<std::shared_ptr<const THUAI6::Student>> GetStudents() const` :返回所有可视学生的信息。 | ||||
| @@ -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`同理 | - `def MoveRight(self, timeInMilliseconds: int) -> Future[bool]`即向右移动,`MoveLeft`、`MoveDown`、`MoveUp`同理 | ||||
| #### 使用技能 | #### 使用技能 | ||||
| @@ -53,7 +53,7 @@ | |||||
| - `std::future<bool> SendMessage(int64_t, std::string)`:给同队的队友发送消息。第一个参数指定发送的对象,第二个参数指定发送的内容,不得超过256字节。 | - `std::future<bool> SendMessage(int64_t, std::string)`:给同队的队友发送消息。第一个参数指定发送的对象,第二个参数指定发送的内容,不得超过256字节。 | ||||
| - `bool HaveMessage()`:是否有队友发来的尚未接收的信息。 | - `bool HaveMessage()`:是否有队友发来的尚未接收的信息。 | ||||
| - `std::pair<int64_t, std::string> GetMessage()`:从玩家ID为第一个参数的队友获取信息。 | |||||
| - `std::pair<int64_t, std::string> GetMessage()`:按照消息发送顺序获取来自队友的信息,第一个参数为发送该消息的PlayerID。 | |||||
| #### 查询可视范围内的信息 | #### 查询可视范围内的信息 | ||||
| @@ -10,7 +10,7 @@ | |||||
| 菜单栏下方一行 | 菜单栏下方一行 | ||||
|  | |||||
|  | |||||
| 可以更改生成模式为`Debug`或`Release` | 可以更改生成模式为`Debug`或`Release` | ||||
| @@ -18,7 +18,7 @@ | |||||
| 左上方菜单栏 `调试->调试属性` | 左上方菜单栏 `调试->调试属性` | ||||
|  | |||||
|  | |||||
| 在命令参数一栏中加入命令行参数进行调试 | 在命令参数一栏中加入命令行参数进行调试 | ||||
| @@ -52,6 +52,11 @@ A: | |||||
|  |  | ||||
| 确保上图项目属性中平台工具集在 v143,C++17 标准 | 确保上图项目属性中平台工具集在 v143,C++17 标准 | ||||
| Q:CAPI编译不通过 | |||||
|  | |||||
| A:查看`.\win\CAPI\cpp\`文件夹下是否有`lib`文件夹,没有则https://cloud.tsinghua.edu.cn/d/6972138f641d4e81a446/ 下载并复制粘贴 | |||||
| ## Python | ## Python | ||||
| ### grpc版本更新失败 | ### grpc版本更新失败 | ||||
| @@ -156,7 +156,7 @@ start cmd /k win64\Client.exe --cl --playbackFile .\video.thuaipb --playbackSpee | |||||
| ## WPF简易调试界面 | ## WPF简易调试界面 | ||||
|  | |||||
|  | |||||
| ### 界面介绍 | ### 界面介绍 | ||||