Add handling for KickPlayerRaw

This commit is contained in:
Shane Freeder
2024-07-10 23:00:08 +01:00
parent 5154f02910
commit 82e81909d8

View File

@@ -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) { private void processForwardToPlayer(ByteBufDataInput in) {
Optional<Player> player = proxy.getPlayer(in.readUTF()); Optional<Player> player = proxy.getPlayer(in.readUTF());
if (player.isPresent()) { if (player.isPresent()) {
@@ -372,6 +379,9 @@ public class BungeeCordMessageResponder {
case "KickPlayer": case "KickPlayer":
this.processKick(in); this.processKick(in);
break; break;
case "KickPlayerRaw":
this.processKickRaw(in);
break;
default: default:
// Do nothing, unknown command // Do nothing, unknown command
break; break;