Browse Source

Merge pull request #316 from shangfengh/new

feat:  add upload_deploy.yml
tags/0.1.0
shangfengh GitHub 2 years ago
parent
commit
d092004a5a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 102 additions and 7 deletions
  1. +90
    -0
      .github/workflows/upload_deploy.yml
  2. +2
    -2
      CAPI/CAPI接口(cpp).md
  3. +2
    -2
      CAPI/CAPI接口(python).md
  4. +2
    -2
      CAPI/Tool_tutorial.md
  5. +5
    -0
      Q&A.md
  6. BIN
      resource/IsRunning.png
  7. BIN
      resource/clientsmaller.png
  8. +0
    -0
      resource/image-20230416010705076.png
  9. +0
    -0
      resource/image-20230416010816392.png
  10. BIN
      resource/lib.png
  11. +1
    -1
      使用文档.md

+ 90
- 0
.github/workflows/upload_deploy.yml View File

@@ -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

+ 2
- 2
CAPI/CAPI接口(cpp).md View File

@@ -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`同理

#### 使用技能
@@ -42,7 +42,7 @@
#### 队内信息
- `std::future<bool> SendMessage(int64_t, std::string)`:给同队的队友发送消息。第一个参数指定发送的对象,第二个参数指定发送的内容,不得超过256字节。
- `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` :返回所有可视学生的信息。


+ 2
- 2
CAPI/CAPI接口(python).md View File

@@ -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<bool> SendMessage(int64_t, std::string)`:给同队的队友发送消息。第一个参数指定发送的对象,第二个参数指定发送的内容,不得超过256字节。
- `bool HaveMessage()`:是否有队友发来的尚未接收的信息。
- `std::pair<int64_t, std::string> GetMessage()`:从玩家ID为第一个参数的队友获取信息
- `std::pair<int64_t, std::string> GetMessage()`:按照消息发送顺序获取来自队友的信息,第一个参数为发送该消息的PlayerID

#### 查询可视范围内的信息



+ 2
- 2
CAPI/Tool_tutorial.md View File

@@ -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)

在命令参数一栏中加入命令行参数进行调试



+ 5
- 0
Q&A.md View File

@@ -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版本更新失败


BIN
resource/IsRunning.png View File

Before After
Width: 1920  |  Height: 134  |  Size: 17 kB

BIN
resource/clientsmaller.png View File

Before After
Width: 1160  |  Height: 929  |  Size: 903 kB

CAPI/src/image-20230416010705076.png → resource/image-20230416010705076.png View File


CAPI/src/image-20230416010816392.png → resource/image-20230416010816392.png View File


BIN
resource/lib.png View File

Before After
Width: 1208  |  Height: 149  |  Size: 11 kB

+ 1
- 1
使用文档.md View File

@@ -156,7 +156,7 @@ start cmd /k win64\Client.exe --cl --playbackFile .\video.thuaipb --playbackSpee

## WPF简易调试界面

![client](.\resource\client.png)
![client](.\resource\clientsmaller.png)

### 界面介绍



Loading…
Cancel
Save