mirror of
https://github.com/jie65535/gc-opencommand-plugin.git
synced 2025-06-02 17:49:12 +08:00
A plugin that open the GC command execution interface for third-party clients
|
||
---|---|---|
gradle/wrapper | ||
src/main | ||
.gitignore | ||
build.gradle | ||
gradlew | ||
gradlew.bat | ||
LICENSE | ||
README.md | ||
settings.gradle |
gc-opencommand-plugin
一个为第三方客户端开放GC命令执行接口的插件
服务端安装
- 在 Release 下载
jar
- 放入
plugins
文件夹即可
构建说明
- 克隆仓库
- 在目录下新建
lib
目录 - 将
grasscutter-1.1.x-dev.jar
放入lib
目录 gradle build
玩家使用流程
- 在客户端中填写服务地址,确认是否支持
- 填写UID,发送验证码
- 将游戏内收到的4位整数验证码填入客户端校验
- 享受便利!
客户端请求流程
ping
确认是否支持opencommand
插件sendCode
向指定玩家发送验证码(1分钟内不允许重发),保存返回的token
- 使用
token
和4位整数验证码发送verify
校验 - 如果验证通过,可以使用该
token
执行command
动作
API /opencommand/api
示例
https://127.0.0.1/opencommand/api
Request 请求
public final class JsonRequest {
public String token = "";
public String action = "";
public Object data = null;
}
Response 响应
public final class JsonResponse {
public int retcode = 200;
public String message = "success";
public Object data;
}
Actions 动作
ping
data = null
sendCode
Request
data = uid (int)
Response
data = token (string)
verify
要求 token
Request
data = code (int)
Response
Success:
code = 200
Verification failed:
code = 400
command
要求 token
Request
data = command (string)
Response
data = message (string)