From 82e81909d8e77f5206a75fa5567cf4b7a7e0b986 Mon Sep 17 00:00:00 2001 From: Shane Freeder Date: Wed, 10 Jul 2024 23:00:08 +0100 Subject: [PATCH] Add handling for KickPlayerRaw --- .../connection/backend/BungeeCordMessageResponder.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BungeeCordMessageResponder.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BungeeCordMessageResponder.java index ea28d2c97..b047d1868 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BungeeCordMessageResponder.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BungeeCordMessageResponder.java @@ -260,6 +260,13 @@ public class BungeeCordMessageResponder { }); } + private void processKickRaw(ByteBufDataInput in) { + proxy.getPlayer(in.readUTF()).ifPresent(player -> { + String kickReason = in.readUTF(); + player.disconnect(GsonComponentSerializer.gson().deserialize(kickReason)); + }); + } + private void processForwardToPlayer(ByteBufDataInput in) { Optional player = proxy.getPlayer(in.readUTF()); if (player.isPresent()) { @@ -372,6 +379,9 @@ public class BungeeCordMessageResponder { case "KickPlayer": this.processKick(in); break; + case "KickPlayerRaw": + this.processKickRaw(in); + break; default: // Do nothing, unknown command break;