From a2d3ccfb2f1bae1da6c1fb799ac2c1ef84f27c4a Mon Sep 17 00:00:00 2001 From: Tim203 Date: Wed, 3 Mar 2021 19:57:52 +0100 Subject: [PATCH] Whoops. Forgot to update Geyser to match recent global api changes --- .../connector/skin/FloodgateSkinUploader.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/connector/src/main/java/org/geysermc/connector/skin/FloodgateSkinUploader.java b/connector/src/main/java/org/geysermc/connector/skin/FloodgateSkinUploader.java index ad3310c8d..9f1a515a0 100644 --- a/connector/src/main/java/org/geysermc/connector/skin/FloodgateSkinUploader.java +++ b/connector/src/main/java/org/geysermc/connector/skin/FloodgateSkinUploader.java @@ -103,16 +103,25 @@ public final class FloodgateSkinUploader { break; case SKIN_UPLOADED: // if Geyser is the only subscriber we have send it to the server manually + // otherwise it's handled by the Floodgate plugin subscribers if (subscribersCount != 1) { break; } String xuid = node.get("xuid").asText(); - String value = node.get("value").asText(); - String signature = node.get("signature").asText(); - GeyserSession session = connector.getPlayerByXuid(xuid); + if (session != null) { + if (!node.get("success").asBoolean()) { + logger.info("Failed to upload skin for " + session.getName()); + return; + } + + JsonNode data = node.get("data"); + + String value = data.get("value").asText(); + String signature = data.get("signature").asText(); + byte[] bytes = (value + '\0' + signature) .getBytes(StandardCharsets.UTF_8); PluginMessageUtils.sendMessage(session, getSkinChannel(), bytes);