Skip to content

Commit

Permalink
Fix deserialization formatting error
Browse files Browse the repository at this point in the history
  • Loading branch information
jie65535 committed Jun 2, 2023
1 parent bcb8874 commit c6e0b51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static void handle(Context context) {

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."));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public static void handle(Context context) {

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."));
Expand Down

0 comments on commit c6e0b51

Please sign in to comment.