From ec9745769f24299f8773320c33be221ac0b24680 Mon Sep 17 00:00:00 2001 From: Gegy Date: Mon, 27 Nov 2023 18:40:45 +0100 Subject: [PATCH] Explicitly reject consuming signed command when denied by event This would fail down the line anyway due to inconsistent chat state (if holding a 'last seen' update) --- .../chat/session/SessionCommandHandler.java | 27 +++++++++++-------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/session/SessionCommandHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/session/SessionCommandHandler.java index 0bb2ff1a7..16a02a783 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/session/SessionCommandHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/packet/chat/session/SessionCommandHandler.java @@ -44,10 +44,23 @@ public class SessionCommandHandler implements CommandHandler { CommandExecuteEvent.CommandResult result = event.getResult(); if (result == CommandExecuteEvent.CommandResult.denied()) { - if (packet.isSigned()) { - logger.fatal("A plugin tried to deny a command with signable component(s). " - + "This is not supported. " - + "Disconnecting player " + player.getUsername() + ". Command packet: " + packet); - player.disconnect(Component.text( - "A proxy plugin caused an illegal protocol state. " - + "Contact your network administrator.")); - } return CompletableFuture.completedFuture(consumeCommand(packet)); }