Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wuhan005/asteroid_backend
Asteroid 后端
https://github.com/wuhan005/asteroid_backend
Last synced: about 10 hours ago
JSON representation
Asteroid 后端
- Host: GitHub
- URL: https://github.com/wuhan005/asteroid_backend
- Owner: wuhan005
- License: apache-2.0
- Created: 2020-05-22T15:44:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-03-15T09:24:58.000Z (over 3 years ago)
- Last Synced: 2024-05-02T02:23:02.399Z (6 months ago)
- Language: Go
- Homepage: https://cardinal.ink/asteroid/
- Size: 32.2 KB
- Stars: 30
- Watchers: 3
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Asteroid_backend
Asteroid 后端您可以使用此后端对 Asteroid 进行二次开发,使其能够在 Cardinal 以外的平台上使用。
## 开始使用
```bash
git clone https://github.com/wuhan005/Asteroid_backend
cd Asteroid_backend
go mod tidy
go build .
```在进行编译时如果提示 Timeout,原因是 Go Modules 默认使用 `proxy.golang.org`,在国内无法访问,需要设置 GOPROXY 代理。
``` bash
go env -w GOPROXY=https://goproxy.cn
```创建`team.txt`文件,队伍名一行一个。
运行:
```bash
./Asteroid
```
* `--title` 比赛名称(默认:HCTF)
* `--port` HTTP 监听端口(默认:12345)
* `--token` HTTP Authorization 请求头(默认随机字符串)## 接口
* Request Header:
```
Authorization: YOUR_TOKEN_HERE
```### `/websocket` Unity WebSocket 连接地址
### POST `/attack` 攻击特效
```json
{
"From": 1,
"To": 2
}
```
### POST `/rank` 设置排行
```json
{
"Team": [
{
"Id": 0,
"Rank": 1,
"Score": 1000
},
{
"Id": 1,
"Rank": 2,
"Score": 900
}
]
}
```
### POST `/status` 队伍状态
```json
{
"Id": 0,
"Status": "attacked"
}
```
* `attacked` 被攻击
* `down` 被 Check Down### POST `/round` 设置轮数
```json
{
"Round": 47
}
```### GET `/easterEgg` 陨石彩蛋动画
### POST `/round` 设置轮数
```json
{
"Time": 300
}
```
单位:秒(s)### POST `/clear` 清除队伍状态
```json
{
"Id": 0
}
```### POST `/clearAll` 清除所有队伍状态
## LICENSE
Apache License 2.0