mirror of
https://github.com/jie65535/gc-opencommand-plugin.git
synced 2025-12-15 19:31:35 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a084d39b02 | |||
| 6c19c09c00 |
@@ -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
|
||||||
|
|||||||
@@ -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."));
|
||||||
|
|||||||
@@ -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."));
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user