2 Commits

Author SHA1 Message Date
a084d39b02 Update version to v1.6.1 2023-06-04 20:05:50 +08:00
6c19c09c00 Fix deserialization formatting error (#185) 2023-06-04 20:05:32 +08:00
4 changed files with 4 additions and 4 deletions

View File

@@ -4,7 +4,7 @@ plugins {
} }
group 'com.github.jie65535.opencommand' group 'com.github.jie65535.opencommand'
version '1.6.0' version '1.6.1'
sourceCompatibility = 17 sourceCompatibility = 17
targetCompatibility = 17 targetCompatibility = 17

View File

@@ -58,7 +58,7 @@ public final class OpenCommandHandler implements Router {
var req = context.bodyAsClass(JsonRequest.class); var req = context.bodyAsClass(JsonRequest.class);
if (req.action.equals("sendCode")) { if (req.action.equals("sendCode")) {
int playerId = Integer.parseInt(req.data.toString()); int playerId = (int)Double.parseDouble(req.data.toString());
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."));

View File

@@ -61,7 +61,7 @@ public final class OpenCommandOnlyHttpHandler implements Router {
var req = context.bodyAsClass(JsonRequest.class); var req = context.bodyAsClass(JsonRequest.class);
if (req.action.equals("sendCode")) { if (req.action.equals("sendCode")) {
int playerId = Integer.parseInt(req.data.toString()); int playerId = (int)Double.parseDouble(req.data.toString());
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."));

View File

@@ -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": "1.6.0", "version": "1.6.1",
"mainClass": "com.github.jie65535.opencommand.OpenCommandPlugin", "mainClass": "com.github.jie65535.opencommand.OpenCommandPlugin",
"authors": ["jie65535", "方块君"], "authors": ["jie65535", "方块君"],
"api": 2 "api": 2