mirror of
https://github.com/jie65535/gc-opencommand-plugin.git
synced 2025-06-02 17:49:12 +08:00
Fix deserialization formatting error
This commit is contained in:
parent
bcb88740f1
commit
c6e0b51ea6
@ -58,7 +58,7 @@ public final class OpenCommandHandler implements Router {
|
||||
|
||||
var req = context.bodyAsClass(JsonRequest.class);
|
||||
if (req.action.equals("sendCode")) {
|
||||
int playerId = (int) req.data;
|
||||
int playerId = Integer.parseInt(req.data.toString());
|
||||
var player = plugin.getServer().getPlayerByUid(playerId);
|
||||
if (player == null) {
|
||||
context.json(new JsonResponse(404, "Player Not Found."));
|
||||
|
@ -61,7 +61,7 @@ public final class OpenCommandOnlyHttpHandler implements Router {
|
||||
|
||||
var req = context.bodyAsClass(JsonRequest.class);
|
||||
if (req.action.equals("sendCode")) {
|
||||
int playerId = (int) req.data;
|
||||
int playerId = Integer.parseInt(req.data.toString());
|
||||
var player = SocketData.getPlayer(playerId);
|
||||
if (player == null) {
|
||||
context.json(new JsonResponse(404, "Player Not Found."));
|
||||
|
Loading…
Reference in New Issue
Block a user