mirror of
https://github.com/jie65535/gc-opencommand-plugin.git
synced 2025-12-15 19:31:35 +08:00
Compare commits
16 Commits
v1.5.0
...
v1.5.2-for
| Author | SHA1 | Date | |
|---|---|---|---|
| d64238a9e9 | |||
| c3667a8206 | |||
| c62d777037 | |||
| 5019b6548a | |||
| 1c8d448a7b | |||
| 99f914b952 | |||
| 82477321d1 | |||
| f19c4b8e77 | |||
| 3f1ecfe8a6 | |||
|
|
79564ff41c | ||
| ded44804d4 | |||
| 4b8eb490f5 | |||
| 70261df520 | |||
| 5c2be0e776 | |||
| 72948121d6 | |||
| 42c748ad2e |
4
.github/workflows/build.yml
vendored
4
.github/workflows/build.yml
vendored
@@ -5,7 +5,7 @@ on:
|
|||||||
paths:
|
paths:
|
||||||
- "**.java"
|
- "**.java"
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "for-unstable"
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "**.java"
|
- "**.java"
|
||||||
@@ -35,7 +35,7 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradle-
|
${{ runner.os }}-gradle-
|
||||||
- name: Download latest grasscutter jar
|
- name: Download latest grasscutter jar
|
||||||
run: wget https://nightly.link/Grasscutters/Grasscutter/workflows/build/development/Grasscutter.zip && mkdir lib && unzip Grasscutter.zip -d lib
|
run: wget https://nightly.link/Grasscutters/Grasscutter/workflows/build/unstable/Grasscutter.zip && mkdir lib && unzip Grasscutter.zip -d lib
|
||||||
|
|
||||||
- name: Change permission
|
- name: Change permission
|
||||||
run: chmod +x gradlew
|
run: chmod +x gradlew
|
||||||
|
|||||||
16
README.md
16
README.md
@@ -4,6 +4,16 @@
|
|||||||
|
|
||||||
一个为第三方客户端开放GC命令执行接口的插件
|
一个为第三方客户端开放GC命令执行接口的插件
|
||||||
|
|
||||||
|
## 分支说明
|
||||||
|
|
||||||
|
本分支目的在于兼容 GC 的 `unstable` 分支
|
||||||
|
|
||||||
|
## 使用本插件的应用
|
||||||
|
- [GrasscutterTools](https://github.com/jie65535/GrasscutterCommandGenerator) —— Windows 客户端工具
|
||||||
|
- [JGrasscutterCommand](https://github.com/jie65535/JGrasscutterCommand) —— [Mirai](https://github.com/mamoe/mirai) 插件,在QQ里执行命令
|
||||||
|
- [Yunzai-GrasscutterCommand](https://github.com/Zyy-boop/Yunzai-GrasscutterCommand) —— Yunzai-bot插件,在QQ里执行命令
|
||||||
|
- 待补充
|
||||||
|
|
||||||
## 服务端安装
|
## 服务端安装
|
||||||
|
|
||||||
1. 在 [Release](https://github.com/jie65535/gc-opencommand-plugin/releases) 下载 `jar`
|
1. 在 [Release](https://github.com/jie65535/gc-opencommand-plugin/releases) 下载 `jar`
|
||||||
@@ -64,7 +74,7 @@
|
|||||||
|
|
||||||
## `config.json`
|
## `config.json`
|
||||||
|
|
||||||
```json
|
```json5
|
||||||
{
|
{
|
||||||
// 控制台连接令牌
|
// 控制台连接令牌
|
||||||
"consoleToken": "",
|
"consoleToken": "",
|
||||||
@@ -253,7 +263,7 @@ public final class JsonResponse {
|
|||||||
| message | `Success` | `String` |
|
| message | `Success` | `String` |
|
||||||
| data | `{}` | `JsonObject` |
|
| data | `{}` | `JsonObject` |
|
||||||
|
|
||||||
```json
|
```json5
|
||||||
{
|
{
|
||||||
"retcode": 200,
|
"retcode": 200,
|
||||||
"message": "success",
|
"message": "success",
|
||||||
@@ -286,4 +296,4 @@ public final class JsonResponse {
|
|||||||
|---------|------------------|----------|
|
|---------|------------------|----------|
|
||||||
| retcode | `200` | `Int` |
|
| retcode | `200` | `Int` |
|
||||||
| message | `Success` | `String` |
|
| message | `Success` | `String` |
|
||||||
| data | `Command return` | `String` |
|
| data | `Command return` | `String` |
|
||||||
|
|||||||
@@ -4,6 +4,15 @@
|
|||||||
|
|
||||||
A plugin that opens the GC command execution interface for third-party clients
|
A plugin that opens the GC command execution interface for third-party clients
|
||||||
|
|
||||||
|
## Branch Description
|
||||||
|
|
||||||
|
The purpose of this branch is to be compatible with the 'unstable' branch of GC
|
||||||
|
|
||||||
|
## Applications using this plug-in
|
||||||
|
- [GrasscutterTools](https://github.com/jie65535/GrasscutterCommandGenerator) —— Windows Client Tools
|
||||||
|
- [JGrasscutterCommand](https://github.com/jie65535/JGrasscutterCommand) —— [Mirai](https://github.com/mamoe/mirai) Plugin, run commands in QQ
|
||||||
|
- TODO
|
||||||
|
|
||||||
## Server installation
|
## Server installation
|
||||||
|
|
||||||
1. Download the `jar` in [Release](https://github.com/jie65535/gc-opencommand-plugin/releases)
|
1. Download the `jar` in [Release](https://github.com/jie65535/gc-opencommand-plugin/releases)
|
||||||
@@ -239,7 +248,7 @@ Success
|
|||||||
| message | `Success` | `String` |
|
| message | `Success` | `String` |
|
||||||
| data | `{}` | `JsonObject` |
|
| data | `{}` | `JsonObject` |
|
||||||
|
|
||||||
```json
|
```json5
|
||||||
{
|
{
|
||||||
"retcode": 200,
|
"retcode": 200,
|
||||||
"message": "success",
|
"message": "success",
|
||||||
@@ -272,4 +281,4 @@ Success
|
|||||||
|---------|------------------|----------|
|
|---------|------------------|----------|
|
||||||
| retcode | `200` | `Int` |
|
| retcode | `200` | `Int` |
|
||||||
| message | `Success` | `String` |
|
| message | `Success` | `String` |
|
||||||
| data | `Command return` | `String` |
|
| data | `Command return` | `String` |
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group 'com.github.jie65535.opencommand'
|
group 'com.github.jie65535.opencommand'
|
||||||
version 'dev-1.5.0'
|
version '1.5.2'
|
||||||
|
|
||||||
sourceCompatibility = 17
|
sourceCompatibility = 17
|
||||||
targetCompatibility = 17
|
targetCompatibility = 17
|
||||||
@@ -18,7 +18,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
jar.baseName = 'opencommand'
|
jar.baseName = 'opencommand-for-unstable'
|
||||||
|
|
||||||
destinationDir = file(".")
|
destinationDir = file(".")
|
||||||
}
|
}
|
||||||
@@ -24,21 +24,54 @@ import emu.grasscutter.game.player.Player;
|
|||||||
import emu.grasscutter.server.event.game.ReceiveCommandFeedbackEvent;
|
import emu.grasscutter.server.event.game.ReceiveCommandFeedbackEvent;
|
||||||
import emu.grasscutter.server.event.player.PlayerJoinEvent;
|
import emu.grasscutter.server.event.player.PlayerJoinEvent;
|
||||||
import emu.grasscutter.server.event.player.PlayerQuitEvent;
|
import emu.grasscutter.server.event.player.PlayerQuitEvent;
|
||||||
import emu.grasscutter.utils.MessageHandler;
|
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
|
||||||
|
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public final class EventListeners {
|
public final class EventListeners {
|
||||||
|
|
||||||
private static MessageHandler consoleMessageHandler;
|
private static StringBuilder consoleMessageHandler;
|
||||||
|
private static final Int2ObjectMap<StringBuilder> playerMessageHandlers = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
public static void setConsoleMessageHandler(MessageHandler handler) {
|
public static void setConsoleMessageHandler(StringBuilder handler) {
|
||||||
consoleMessageHandler = handler;
|
consoleMessageHandler = handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取新的玩家消息处理类
|
||||||
|
* 获取时将创建或清空消息处理器并返回实例,**在执行命令前获取!**
|
||||||
|
* @param uid 玩家uid
|
||||||
|
* @return 新的玩家消息处理类
|
||||||
|
*/
|
||||||
|
public static StringBuilder getPlayerNewMessageHandler(int uid) {
|
||||||
|
var handler = playerMessageHandlers.get(uid);
|
||||||
|
if (handler == null) {
|
||||||
|
handler = new StringBuilder();
|
||||||
|
playerMessageHandlers.put(uid, handler);
|
||||||
|
} else {
|
||||||
|
handler.setLength(0);
|
||||||
|
}
|
||||||
|
return handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 命令执行反馈事件处理
|
||||||
|
*/
|
||||||
public static void onCommandResponse(ReceiveCommandFeedbackEvent event) {
|
public static void onCommandResponse(ReceiveCommandFeedbackEvent event) {
|
||||||
if (consoleMessageHandler != null && event.getPlayer() == null) {
|
StringBuilder handler;
|
||||||
consoleMessageHandler.setMessage(event.getMessage());
|
if (event.getPlayer() == null) {
|
||||||
|
handler = consoleMessageHandler;
|
||||||
|
} else {
|
||||||
|
handler = playerMessageHandlers.get(event.getPlayer().getUid());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (handler != null) {
|
||||||
|
if (!handler.isEmpty()) {
|
||||||
|
// New line
|
||||||
|
handler.append(System.lineSeparator());
|
||||||
|
}
|
||||||
|
handler.append(event.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,6 +90,10 @@ public final class EventListeners {
|
|||||||
SocketClient.sendPacket(playerList);
|
SocketClient.sendPacket(playerList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 仅游戏模式下玩家离开事件处理方法
|
||||||
|
* 用于更新玩家列表
|
||||||
|
*/
|
||||||
public static void onPlayerQuit(PlayerQuitEvent playerQuitEvent) {
|
public static void onPlayerQuit(PlayerQuitEvent playerQuitEvent) {
|
||||||
PlayerList playerList = new PlayerList();
|
PlayerList playerList = new PlayerList();
|
||||||
playerList.player = Grasscutter.getGameServer().getPlayers().size();
|
playerList.player = Grasscutter.getGameServer().getPlayers().size();
|
||||||
@@ -70,4 +107,15 @@ public final class EventListeners {
|
|||||||
playerList.playerList = playerNames;
|
playerList.playerList = playerNames;
|
||||||
SocketClient.sendPacket(playerList);
|
SocketClient.sendPacket(playerList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 玩家离开事件处理 2
|
||||||
|
* 用于清理内存
|
||||||
|
*/
|
||||||
|
public static void onPlayerQuit2(PlayerQuitEvent playerQuitEvent) {
|
||||||
|
var uid = playerQuitEvent.getPlayer().getUid();
|
||||||
|
if (playerMessageHandlers.containsKey(uid)) {
|
||||||
|
playerMessageHandlers.remove(uid);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import com.github.jie65535.opencommand.socket.SocketData;
|
|||||||
import emu.grasscutter.command.CommandMap;
|
import emu.grasscutter.command.CommandMap;
|
||||||
import emu.grasscutter.server.http.Router;
|
import emu.grasscutter.server.http.Router;
|
||||||
import emu.grasscutter.utils.Crypto;
|
import emu.grasscutter.utils.Crypto;
|
||||||
import emu.grasscutter.utils.MessageHandler;
|
|
||||||
import emu.grasscutter.utils.Utils;
|
import emu.grasscutter.utils.Utils;
|
||||||
import io.javalin.Javalin;
|
import io.javalin.Javalin;
|
||||||
import io.javalin.http.Context;
|
import io.javalin.http.Context;
|
||||||
@@ -46,130 +45,132 @@ public final class OpenCommandHandler implements Router {
|
|||||||
private static final Map<String, Integer> codes = new HashMap<>();
|
private static final Map<String, Integer> codes = new HashMap<>();
|
||||||
private static final Int2ObjectMap<Date> codeExpireTime = new Int2ObjectOpenHashMap<>();
|
private static final Int2ObjectMap<Date> codeExpireTime = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
|
|
||||||
public static void handle(Context context) {
|
public static void handle(Context context) {
|
||||||
var plugin = OpenCommandPlugin.getInstance();
|
var plugin = OpenCommandPlugin.getInstance();
|
||||||
var config = plugin.getConfig();
|
try {
|
||||||
var data = plugin.getData();
|
var config = plugin.getConfig();
|
||||||
var now = new Date();
|
var data = plugin.getData();
|
||||||
// Trigger cleanup action
|
var now = new Date();
|
||||||
cleanupExpiredCodes();
|
// Trigger cleanup action
|
||||||
data.removeExpiredClients();
|
cleanupExpiredCodes();
|
||||||
|
data.removeExpiredClients();
|
||||||
|
|
||||||
var req = context.bodyAsClass(JsonRequest.class);
|
var req = context.bodyAsClass(JsonRequest.class);
|
||||||
if (req.action.equals("sendCode")) {
|
if (req.action.equals("sendCode")) {
|
||||||
int playerId = (int) req.data;
|
int playerId = (int) req.data;
|
||||||
var player = plugin.getServer().getPlayerByUid(playerId);
|
var player = plugin.getServer().getPlayerByUid(playerId);
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
context.json(new JsonResponse(404, "Player Not Found."));
|
context.json(new JsonResponse(404, "Player Not Found."));
|
||||||
} else {
|
} else {
|
||||||
if (codeExpireTime.containsKey(playerId)) {
|
if (codeExpireTime.containsKey(playerId)) {
|
||||||
var expireTime = codeExpireTime.get(playerId);
|
var expireTime = codeExpireTime.get(playerId);
|
||||||
if (now.before(expireTime)) {
|
if (now.before(expireTime)) {
|
||||||
context.json(new JsonResponse(403, "Requests are too frequent"));
|
context.json(new JsonResponse(403, "Requests are too frequent"));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String token = req.token;
|
||||||
|
if (token == null || token.isEmpty())
|
||||||
|
token = Utils.bytesToHex(Crypto.createSessionKey(32));
|
||||||
|
int code = Utils.randomRange(1000, 9999);
|
||||||
|
codeExpireTime.put(playerId, new Date(now.getTime() + config.codeExpirationTime_S * 1000L));
|
||||||
|
codes.put(token, code);
|
||||||
|
data.addClient(new Client(token, playerId, new Date(now.getTime() + config.tempTokenExpirationTime_S * 1000L)));
|
||||||
|
player.dropMessage("[Open Command] Verification code: " + code);
|
||||||
|
context.json(new JsonResponse(token));
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
String token = req.token;
|
} else if (req.action.equals("ping")) {
|
||||||
if (token == null || token.isEmpty())
|
|
||||||
token = Utils.bytesToHex(Crypto.createSessionKey(32));
|
|
||||||
int code = Utils.randomRange(1000, 9999);
|
|
||||||
codeExpireTime.put(playerId, new Date(now.getTime() + config.codeExpirationTime_S * 1000L));
|
|
||||||
codes.put(token, code);
|
|
||||||
data.addClient(new Client(token, playerId, new Date(now.getTime() + config.tempTokenExpirationTime_S * 1000L)));
|
|
||||||
player.dropMessage("[Open Command] Verification code: " + code);
|
|
||||||
context.json(new JsonResponse(token));
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
} else if (req.action.equals("ping")) {
|
|
||||||
context.json(new JsonResponse());
|
|
||||||
return;
|
|
||||||
} else if (req.action.equals("online")) {
|
|
||||||
var p = new ArrayList<String>();
|
|
||||||
plugin.getServer().getPlayers().forEach((uid, player) -> p.add(player.getNickname()));
|
|
||||||
context.json(new JsonResponse(200, "Success", new SocketData.OnlinePlayer(p)));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// token is required
|
|
||||||
if (req.token == null || req.token.isEmpty()) {
|
|
||||||
context.json(new JsonResponse(401, "Unauthorized"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var isConsole = req.token.equals(config.consoleToken);
|
|
||||||
var client = data.getClientByToken(req.token);
|
|
||||||
if (!isConsole && client == null) {
|
|
||||||
context.json(new JsonResponse(401, "Unauthorized"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isConsole) {
|
|
||||||
if (req.action.equals("verify")) {
|
|
||||||
context.json(new JsonResponse());
|
context.json(new JsonResponse());
|
||||||
return;
|
return;
|
||||||
} else if (req.action.equals("command")) {
|
} else if (req.action.equals("online")) {
|
||||||
//noinspection SynchronizationOnLocalVariableOrMethodParameter
|
var p = new ArrayList<String>();
|
||||||
synchronized (plugin) {
|
plugin.getServer().getPlayers().forEach((uid, player) -> p.add(player.getNickname()));
|
||||||
try {
|
context.json(new JsonResponse(200, "Success", new SocketData.OnlinePlayer(p)));
|
||||||
plugin.getLogger().info(String.format("IP: %s run command in console > %s", context.ip(), req.data));
|
|
||||||
var resultCollector = new MessageHandler();
|
|
||||||
EventListeners.setConsoleMessageHandler(resultCollector);
|
|
||||||
CommandMap.getInstance().invoke(null, null, req.data.toString());
|
|
||||||
context.json(new JsonResponse(resultCollector.getMessage()));
|
|
||||||
} catch (Exception e) {
|
|
||||||
plugin.getLogger().warn("Run command failed.", e);
|
|
||||||
EventListeners.setConsoleMessageHandler(null);
|
|
||||||
context.json(new JsonResponse(500, "error", e.getLocalizedMessage()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
} else if (req.action.equals("runmode")) {
|
|
||||||
context.json(new JsonResponse(200, "Success", 0));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (codes.containsKey(req.token)) {
|
|
||||||
if (req.action.equals("verify")) {
|
// token is required
|
||||||
if (codes.get(req.token).equals(req.data)) {
|
if (req.token == null || req.token.isEmpty()) {
|
||||||
codes.remove(req.token);
|
context.json(new JsonResponse(401, "Unauthorized"));
|
||||||
// update token expire time
|
return;
|
||||||
client.tokenExpireTime = new Date(now.getTime() + config.tokenLastUseExpirationTime_H * 60L * 60L * 1000L);
|
}
|
||||||
|
var isConsole = req.token.equals(config.consoleToken);
|
||||||
|
var client = data.getClientByToken(req.token);
|
||||||
|
if (!isConsole && client == null) {
|
||||||
|
context.json(new JsonResponse(401, "Unauthorized"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isConsole) {
|
||||||
|
if (req.action.equals("verify")) {
|
||||||
context.json(new JsonResponse());
|
context.json(new JsonResponse());
|
||||||
plugin.getLogger().info(String.format("Player %d has passed the verification, ip: %s", client.playerId, context.ip()));
|
return;
|
||||||
plugin.saveData();
|
} else if (req.action.equals("command")) {
|
||||||
} else {
|
//noinspection SynchronizationOnLocalVariableOrMethodParameter
|
||||||
context.json(new JsonResponse(400, "Verification failed"));
|
synchronized (plugin) {
|
||||||
}
|
try {
|
||||||
return;
|
plugin.getLogger().info(String.format("IP: %s run command in console > %s", context.ip(), req.data));
|
||||||
}
|
var resultCollector = new StringBuilder();
|
||||||
} else {
|
EventListeners.setConsoleMessageHandler(resultCollector);
|
||||||
if (req.action.equals("command")) {
|
CommandMap.getInstance().invoke(null, null, req.data.toString());
|
||||||
// update token expire time
|
context.json(new JsonResponse(resultCollector.toString()));
|
||||||
client.tokenExpireTime = new Date(now.getTime() + config.tokenLastUseExpirationTime_H * 60L * 60L * 1000L);
|
} catch (Exception e) {
|
||||||
var player = plugin.getServer().getPlayerByUid(client.playerId);
|
plugin.getLogger().warn("Run command failed.", e);
|
||||||
var command = req.data.toString();
|
EventListeners.setConsoleMessageHandler(null);
|
||||||
if (player == null) {
|
context.json(new JsonResponse(500, "error", e.getLocalizedMessage()));
|
||||||
context.json(new JsonResponse(404, "Player not found"));
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
} else if (req.action.equals("runmode")) {
|
||||||
|
context.json(new JsonResponse(200, "Success", 0));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Player MessageHandler do not support concurrency
|
} else if (codes.containsKey(req.token)) {
|
||||||
//noinspection SynchronizationOnLocalVariableOrMethodParameter
|
if (req.action.equals("verify")) {
|
||||||
synchronized (player) {
|
if (codes.get(req.token).equals(req.data)) {
|
||||||
try {
|
codes.remove(req.token);
|
||||||
var resultCollector = new MessageHandler();
|
// update token expire time
|
||||||
player.setMessageHandler(resultCollector);
|
client.tokenExpireTime = new Date(now.getTime() + config.tokenLastUseExpirationTime_H * 60L * 60L * 1000L);
|
||||||
CommandMap.getInstance().invoke(player, player, command);
|
context.json(new JsonResponse());
|
||||||
context.json(new JsonResponse(resultCollector.getMessage()));
|
plugin.getLogger().info(String.format("Player %d has passed the verification, ip: %s", client.playerId, context.ip()));
|
||||||
} catch (Exception e) {
|
plugin.saveData();
|
||||||
plugin.getLogger().warn("Run command failed.", e);
|
} else {
|
||||||
context.json(new JsonResponse(500, "error", e.getLocalizedMessage()));
|
context.json(new JsonResponse(400, "Verification failed"));
|
||||||
} finally {
|
|
||||||
player.setMessageHandler(null);
|
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (req.action.equals("command")) {
|
||||||
|
// update token expire time
|
||||||
|
client.tokenExpireTime = new Date(now.getTime() + config.tokenLastUseExpirationTime_H * 60L * 60L * 1000L);
|
||||||
|
var player = plugin.getServer().getPlayerByUid(client.playerId);
|
||||||
|
var command = req.data.toString();
|
||||||
|
if (player == null) {
|
||||||
|
context.json(new JsonResponse(404, "Player not found"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
//noinspection SynchronizationOnLocalVariableOrMethodParameter
|
||||||
|
synchronized (player) {
|
||||||
|
// Player MessageHandler do not support concurrency
|
||||||
|
var handler = EventListeners.getPlayerNewMessageHandler(player.getUid());
|
||||||
|
try {
|
||||||
|
CommandMap.getInstance().invoke(player, player, command);
|
||||||
|
context.json(new JsonResponse(handler.toString()));
|
||||||
|
} catch (Exception e) {
|
||||||
|
plugin.getLogger().warn("Run command failed.", e);
|
||||||
|
context.json(new JsonResponse(500, "error", e.getLocalizedMessage()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
context.json(new JsonResponse(403, "forbidden"));
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
plugin.getLogger().error("[OpenCommand] handler error.", ex);
|
||||||
}
|
}
|
||||||
context.json(new JsonResponse(403, "forbidden"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void cleanupExpiredCodes() {
|
private static void cleanupExpiredCodes() {
|
||||||
|
|||||||
@@ -51,155 +51,159 @@ public final class OpenCommandOnlyHttpHandler implements Router {
|
|||||||
|
|
||||||
public static void handle(Context context) {
|
public static void handle(Context context) {
|
||||||
var plugin = OpenCommandPlugin.getInstance();
|
var plugin = OpenCommandPlugin.getInstance();
|
||||||
var config = plugin.getConfig();
|
try {
|
||||||
var data = plugin.getData();
|
var config = plugin.getConfig();
|
||||||
var now = new Date();
|
var data = plugin.getData();
|
||||||
// Trigger cleanup action
|
var now = new Date();
|
||||||
cleanupExpiredCodes();
|
// Trigger cleanup action
|
||||||
data.removeExpiredClients();
|
cleanupExpiredCodes();
|
||||||
|
data.removeExpiredClients();
|
||||||
|
|
||||||
var req = context.bodyAsClass(JsonRequest.class);
|
var req = context.bodyAsClass(JsonRequest.class);
|
||||||
if (req.action.equals("sendCode")) {
|
if (req.action.equals("sendCode")) {
|
||||||
int playerId = (int) req.data;
|
int playerId = (int) req.data;
|
||||||
var player = SocketData.getPlayer(playerId);
|
var player = SocketData.getPlayer(playerId);
|
||||||
if (player == null) {
|
if (player == null) {
|
||||||
context.json(new JsonResponse(404, "Player Not Found."));
|
context.json(new JsonResponse(404, "Player Not Found."));
|
||||||
} else {
|
} else {
|
||||||
if (codeExpireTime.containsKey(playerId)) {
|
if (codeExpireTime.containsKey(playerId)) {
|
||||||
var expireTime = codeExpireTime.get(playerId);
|
var expireTime = codeExpireTime.get(playerId);
|
||||||
if (now.before(expireTime)) {
|
if (now.before(expireTime)) {
|
||||||
context.json(new JsonResponse(403, "Requests are too frequent"));
|
context.json(new JsonResponse(403, "Requests are too frequent"));
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String token = req.token;
|
||||||
|
if (token == null || token.isEmpty())
|
||||||
|
token = Utils.bytesToHex(Crypto.createSessionKey(32));
|
||||||
|
int code = Utils.randomRange(1000, 9999);
|
||||||
|
codeExpireTime.put(playerId, new Date(now.getTime() + config.codeExpirationTime_S * 1000L));
|
||||||
|
codes.put(token, code);
|
||||||
|
data.addClient(new Client(token, playerId, new Date(now.getTime() + config.tempTokenExpirationTime_S * 1000L)));
|
||||||
|
Player.dropMessage(playerId, "[Open Command] Verification code: " + code);
|
||||||
|
context.json(new JsonResponse(token));
|
||||||
}
|
}
|
||||||
|
return;
|
||||||
String token = req.token;
|
} else if (req.action.equals("ping")) {
|
||||||
if (token == null || token.isEmpty())
|
|
||||||
token = Utils.bytesToHex(Crypto.createSessionKey(32));
|
|
||||||
int code = Utils.randomRange(1000, 9999);
|
|
||||||
codeExpireTime.put(playerId, new Date(now.getTime() + config.codeExpirationTime_S * 1000L));
|
|
||||||
codes.put(token, code);
|
|
||||||
data.addClient(new Client(token, playerId, new Date(now.getTime() + config.tempTokenExpirationTime_S * 1000L)));
|
|
||||||
Player.dropMessage(playerId, "[Open Command] Verification code: " + code);
|
|
||||||
context.json(new JsonResponse(token));
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
} else if (req.action.equals("ping")) {
|
|
||||||
context.json(new JsonResponse());
|
|
||||||
return;
|
|
||||||
} else if (req.action.equals("online")) {
|
|
||||||
context.json(new JsonResponse(200, "Success", SocketData.getOnlinePlayer()));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// token is required
|
|
||||||
if (req.token == null || req.token.isEmpty()) {
|
|
||||||
context.json(new JsonResponse(401, "Unauthorized"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
var isConsole = req.token.equals(config.consoleToken);
|
|
||||||
var client = data.getClientByToken(req.token);
|
|
||||||
if (!isConsole && client == null) {
|
|
||||||
context.json(new JsonResponse(401, "Unauthorized"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isConsole) {
|
|
||||||
if (req.action.equals("verify")) {
|
|
||||||
context.json(new JsonResponse());
|
context.json(new JsonResponse());
|
||||||
return;
|
return;
|
||||||
} else if (req.action.equals("command")) {
|
} else if (req.action.equals("online")) {
|
||||||
var server = SocketServer.getClientInfoByUuid(req.server);
|
context.json(new JsonResponse(200, "Success", SocketData.getOnlinePlayer()));
|
||||||
if (server == null) {
|
|
||||||
context.json(new JsonResponse(404, "Server Not Found."));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
plugin.getLogger().info(String.format("IP: %s run command in console > %s", context.ip(), req.data));
|
|
||||||
var wait = new SocketDataWait<HttpPacket>(2000L) {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpPacket initData(HttpPacket data) {
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void timeout() {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
SocketServer.sendPacketAndWait(server.ip, new RunConsoleCommand(req.data.toString()), wait);
|
|
||||||
var packet = wait.getData();
|
|
||||||
if (packet == null) {
|
|
||||||
context.json(new JsonResponse(408, "Timeout"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
context.json(new JsonResponse(packet.code, packet.message, packet.data));
|
|
||||||
return;
|
|
||||||
} else if (req.action.equals("server")) {
|
|
||||||
context.json(new JsonResponse(200, "Success", SocketServer.getOnlineClient()));
|
|
||||||
return;
|
|
||||||
} else if (req.action.equals("runmode")) {
|
|
||||||
context.json(new JsonResponse(200, "Success", 1));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else if (codes.containsKey(req.token)) {
|
|
||||||
if (req.action.equals("verify")) {
|
// token is required
|
||||||
if (codes.get(req.token).equals(req.data)) {
|
if (req.token == null || req.token.isEmpty()) {
|
||||||
codes.remove(req.token);
|
context.json(new JsonResponse(401, "Unauthorized"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var isConsole = req.token.equals(config.consoleToken);
|
||||||
|
var client = data.getClientByToken(req.token);
|
||||||
|
if (!isConsole && client == null) {
|
||||||
|
context.json(new JsonResponse(401, "Unauthorized"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isConsole) {
|
||||||
|
if (req.action.equals("verify")) {
|
||||||
|
context.json(new JsonResponse());
|
||||||
|
return;
|
||||||
|
} else if (req.action.equals("command")) {
|
||||||
|
var server = SocketServer.getClientInfoByUuid(req.server);
|
||||||
|
if (server == null) {
|
||||||
|
context.json(new JsonResponse(404, "Server Not Found."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
plugin.getLogger().info(String.format("IP: %s run command in console > %s", context.ip(), req.data));
|
||||||
|
var wait = new SocketDataWait<HttpPacket>(2000L) {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpPacket initData(HttpPacket data) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void timeout() {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
SocketServer.sendPacketAndWait(server.ip, new RunConsoleCommand(req.data.toString()), wait);
|
||||||
|
var packet = wait.getData();
|
||||||
|
if (packet == null) {
|
||||||
|
context.json(new JsonResponse(408, "Timeout"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
context.json(new JsonResponse(packet.code, packet.message, packet.data));
|
||||||
|
return;
|
||||||
|
} else if (req.action.equals("server")) {
|
||||||
|
context.json(new JsonResponse(200, "Success", SocketServer.getOnlineClient()));
|
||||||
|
return;
|
||||||
|
} else if (req.action.equals("runmode")) {
|
||||||
|
context.json(new JsonResponse(200, "Success", 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else if (codes.containsKey(req.token)) {
|
||||||
|
if (req.action.equals("verify")) {
|
||||||
|
if (codes.get(req.token).equals(req.data)) {
|
||||||
|
codes.remove(req.token);
|
||||||
|
// update token expire time
|
||||||
|
client.tokenExpireTime = new Date(now.getTime() + config.tokenLastUseExpirationTime_H * 60L * 60L * 1000L);
|
||||||
|
context.json(new JsonResponse());
|
||||||
|
plugin.getLogger().info(String.format("Player %d has passed the verification, ip: %s", client.playerId, context.ip()));
|
||||||
|
plugin.saveData();
|
||||||
|
} else {
|
||||||
|
context.json(new JsonResponse(400, "Verification failed"));
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (req.action.equals("command")) {
|
||||||
|
SocketDataWait<HttpPacket> socketDataWait = new SocketDataWait<>(1000L * 10L) {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpPacket initData(HttpPacket data) {
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void timeout() {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
// update token expire time
|
// update token expire time
|
||||||
client.tokenExpireTime = new Date(now.getTime() + config.tokenLastUseExpirationTime_H * 60L * 60L * 1000L);
|
client.tokenExpireTime = new Date(now.getTime() + config.tokenLastUseExpirationTime_H * 60L * 60L * 1000L);
|
||||||
context.json(new JsonResponse());
|
var command = req.data.toString();
|
||||||
plugin.getLogger().info(String.format("Player %d has passed the verification, ip: %s", client.playerId, context.ip()));
|
var player = new Player();
|
||||||
plugin.saveData();
|
player.uid = client.playerId;
|
||||||
} else {
|
player.type = PlayerEnum.RunCommand;
|
||||||
context.json(new JsonResponse(400, "Verification failed"));
|
player.data = command;
|
||||||
}
|
|
||||||
return;
|
if (!SocketServer.sendUidPacketAndWait(client.playerId, player, socketDataWait)) {
|
||||||
}
|
context.json(new JsonResponse(404, "Player Not Found."));
|
||||||
} else {
|
return;
|
||||||
if (req.action.equals("command")) {
|
|
||||||
SocketDataWait<HttpPacket> socketDataWait = new SocketDataWait<>(1000L * 10L) {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public HttpPacket initData(HttpPacket data) {
|
HttpPacket httpPacket = socketDataWait.getData();
|
||||||
return data;
|
if (httpPacket == null) {
|
||||||
|
context.json(new JsonResponse(500, "error", "Wait timeout"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
context.json(new JsonResponse(httpPacket.code, httpPacket.message));
|
||||||
@Override
|
|
||||||
public void timeout() {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
// update token expire time
|
|
||||||
client.tokenExpireTime = new Date(now.getTime() + config.tokenLastUseExpirationTime_H * 60L * 60L * 1000L);
|
|
||||||
var command = req.data.toString();
|
|
||||||
var player = new Player();
|
|
||||||
player.uid = client.playerId;
|
|
||||||
player.type = PlayerEnum.RunCommand;
|
|
||||||
player.data = command;
|
|
||||||
|
|
||||||
if (!SocketServer.sendUidPacketAndWait(client.playerId, player, socketDataWait)) {
|
|
||||||
context.json(new JsonResponse(404, "Player Not Found."));
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HttpPacket httpPacket = socketDataWait.getData();
|
|
||||||
if (httpPacket == null) {
|
|
||||||
context.json(new JsonResponse(500, "error", "Wait timeout"));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
context.json(new JsonResponse(httpPacket.code, httpPacket.message));
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
context.json(new JsonResponse(403, "forbidden"));
|
||||||
|
} catch (Exception ex) {
|
||||||
|
plugin.getLogger().error("[OpenCommand] handler error.", ex);
|
||||||
}
|
}
|
||||||
context.json(new JsonResponse(403, "forbidden"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void cleanupExpiredCodes() {
|
private static void cleanupExpiredCodes() {
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ import emu.grasscutter.server.event.player.PlayerQuitEvent;
|
|||||||
import emu.grasscutter.utils.JsonUtils;
|
import emu.grasscutter.utils.JsonUtils;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.nio.file.Files;
|
||||||
|
|
||||||
public final class OpenCommandPlugin extends Plugin {
|
public final class OpenCommandPlugin extends Plugin {
|
||||||
|
|
||||||
@@ -57,10 +59,16 @@ public final class OpenCommandPlugin extends Plugin {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable() {
|
public void onEnable() {
|
||||||
|
// 监听命令执行反馈
|
||||||
new EventHandler<>(ReceiveCommandFeedbackEvent.class)
|
new EventHandler<>(ReceiveCommandFeedbackEvent.class)
|
||||||
.priority(HandlerPriority.HIGH)
|
.priority(HandlerPriority.HIGH)
|
||||||
.listener(EventListeners::onCommandResponse)
|
.listener(EventListeners::onCommandResponse)
|
||||||
.register(this);
|
.register(this);
|
||||||
|
// 监听玩家离开事件
|
||||||
|
new EventHandler<>(PlayerQuitEvent.class)
|
||||||
|
.priority(HandlerPriority.NORMAL)
|
||||||
|
.listener(EventListeners::onPlayerQuit2)
|
||||||
|
.register(this);
|
||||||
if (runMode == Grasscutter.ServerRunMode.GAME_ONLY) {
|
if (runMode == Grasscutter.ServerRunMode.GAME_ONLY) {
|
||||||
// 仅运行游戏服务器时注册玩家加入和离开事件
|
// 仅运行游戏服务器时注册玩家加入和离开事件
|
||||||
new EventHandler<>(PlayerJoinEvent.class)
|
new EventHandler<>(PlayerJoinEvent.class)
|
||||||
@@ -76,7 +84,7 @@ public final class OpenCommandPlugin extends Plugin {
|
|||||||
} else {
|
} else {
|
||||||
getHandle().addRouter(OpenCommandHandler.class);
|
getHandle().addRouter(OpenCommandHandler.class);
|
||||||
}
|
}
|
||||||
getLogger().info("[OpenCommand] Enabled");
|
getLogger().info("[OpenCommand] Enabled. https://github.com/jie65535/gc-opencommand-plugin");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -106,11 +114,14 @@ public final class OpenCommandPlugin extends Plugin {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
config = JsonUtils.loadToClass(configFile.getAbsolutePath(), OpenCommandConfig.class);
|
config = JsonUtils.decode(Files.readString(configFile.toPath(), StandardCharsets.UTF_8),
|
||||||
|
OpenCommandConfig.class);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
config = new OpenCommandConfig();
|
|
||||||
getLogger().error("[OpenCommand] There was an error while trying to load the configuration from config.json. Please make sure that there are no syntax errors. If you want to start with a default configuration, delete your existing config.json.");
|
getLogger().error("[OpenCommand] There was an error while trying to load the configuration from config.json. Please make sure that there are no syntax errors. If you want to start with a default configuration, delete your existing config.json.");
|
||||||
}
|
}
|
||||||
|
if (config == null) {
|
||||||
|
config = new OpenCommandConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
runMode = Grasscutter.getConfig().server.runMode;
|
runMode = Grasscutter.getConfig().server.runMode;
|
||||||
@@ -126,11 +137,14 @@ public final class OpenCommandPlugin extends Plugin {
|
|||||||
saveData();
|
saveData();
|
||||||
} else {
|
} else {
|
||||||
try {
|
try {
|
||||||
data = JsonUtils.loadToClass(dataFile.getAbsolutePath(), OpenCommandData.class);
|
data = JsonUtils.decode(Files.readString(dataFile.toPath(), StandardCharsets.UTF_8),
|
||||||
|
OpenCommandData.class);
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
data = new OpenCommandData();
|
|
||||||
getLogger().error("[OpenCommand] There was an error while trying to load the data from data.json. Please make sure that there are no syntax errors. If you want to start with a default data, delete your existing data.json.");
|
getLogger().error("[OpenCommand] There was an error while trying to load the data from data.json. Please make sure that there are no syntax errors. If you want to start with a default data, delete your existing data.json.");
|
||||||
}
|
}
|
||||||
|
if (data == null) {
|
||||||
|
data = new OpenCommandData();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ import com.github.jie65535.opencommand.socket.packet.player.PlayerList;
|
|||||||
import emu.grasscutter.Grasscutter;
|
import emu.grasscutter.Grasscutter;
|
||||||
import emu.grasscutter.command.CommandMap;
|
import emu.grasscutter.command.CommandMap;
|
||||||
import emu.grasscutter.utils.JsonUtils;
|
import emu.grasscutter.utils.JsonUtils;
|
||||||
import emu.grasscutter.utils.MessageHandler;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@@ -160,19 +159,16 @@ public class SocketClient {
|
|||||||
sendPacket(new HttpPacket(404, "Player not found."), packet.packetID);
|
sendPacket(new HttpPacket(404, "Player not found."), packet.packetID);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Player MessageHandler do not support concurrency
|
|
||||||
//noinspection SynchronizationOnLocalVariableOrMethodParameter
|
//noinspection SynchronizationOnLocalVariableOrMethodParameter
|
||||||
synchronized (playerData) {
|
synchronized (playerData) {
|
||||||
|
// Player MessageHandler do not support concurrency
|
||||||
|
var handler = EventListeners.getPlayerNewMessageHandler(playerData.getUid());
|
||||||
try {
|
try {
|
||||||
var resultCollector = new MessageHandler();
|
|
||||||
playerData.setMessageHandler(resultCollector);
|
|
||||||
CommandMap.getInstance().invoke(playerData, playerData, command);
|
CommandMap.getInstance().invoke(playerData, playerData, command);
|
||||||
sendPacket(new HttpPacket(200, resultCollector.getMessage()), packet.packetID);
|
sendPacket(new HttpPacket(200, handler.toString()), packet.packetID);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
OpenCommandPlugin.getInstance().getLogger().warn("[OpenCommand] Run command failed.", e);
|
OpenCommandPlugin.getInstance().getLogger().warn("[OpenCommand] Run command failed.", e);
|
||||||
sendPacket(new HttpPacket(500, "error", e.getLocalizedMessage()), packet.packetID);
|
sendPacket(new HttpPacket(500, "error", e.getLocalizedMessage()), packet.packetID);
|
||||||
} finally {
|
|
||||||
playerData.setMessageHandler(null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -192,10 +188,10 @@ public class SocketClient {
|
|||||||
//noinspection SynchronizationOnLocalVariableOrMethodParameter
|
//noinspection SynchronizationOnLocalVariableOrMethodParameter
|
||||||
synchronized (plugin) {
|
synchronized (plugin) {
|
||||||
try {
|
try {
|
||||||
var resultCollector = new MessageHandler();
|
var resultCollector = new StringBuilder();
|
||||||
EventListeners.setConsoleMessageHandler(resultCollector);
|
EventListeners.setConsoleMessageHandler(resultCollector);
|
||||||
CommandMap.getInstance().invoke(null, null, consoleCommand.command);
|
CommandMap.getInstance().invoke(null, null, consoleCommand.command);
|
||||||
sendPacket(new HttpPacket(resultCollector.getMessage()), packet.packetID);
|
sendPacket(new HttpPacket(resultCollector.toString()), packet.packetID);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
mLogger.warn("[OpenCommand] Run command failed.", e);
|
mLogger.warn("[OpenCommand] Run command failed.", e);
|
||||||
EventListeners.setConsoleMessageHandler(null);
|
EventListeners.setConsoleMessageHandler(null);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "opencommand-plugin",
|
"name": "opencommand-plugin",
|
||||||
"description": "Open command interface for third-party clients",
|
"description": "Open command interface for third-party clients",
|
||||||
"version": "dev-1.5.0",
|
"version": "dev-1.5.2",
|
||||||
"mainClass": "com.github.jie65535.opencommand.OpenCommandPlugin",
|
"mainClass": "com.github.jie65535.opencommand.OpenCommandPlugin",
|
||||||
"authors": ["jie65535", "方块君"]
|
"authors": ["jie65535", "方块君"]
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user