3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Fix cancelling commands on <1.19 clients (#827)

Dieser Commit ist enthalten in:
Andrew Steinborn 2022-08-08 00:42:31 -04:00
Ursprung 0b22985f4b
Commit 6496983ca3

Datei anzeigen

@ -743,14 +743,16 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
@Nullable SignedChatCommand signedCommand, @Nullable SignedChatCommand signedCommand,
Instant passedTimestamp) { Instant passedTimestamp) {
IdentifiedKey playerKey = player.getIdentifiedKey(); IdentifiedKey playerKey = player.getIdentifiedKey();
if (result == CommandResult.denied() && playerKey != null) { if (result == CommandResult.denied()) {
if (signedCommand != null && playerKey.getKeyRevision() if (playerKey != null) {
.compareTo(IdentifiedKey.Revision.LINKED_V2) >= 0) { if (signedCommand != null && playerKey.getKeyRevision()
logger.fatal("A plugin tried to deny a command with signable component(s). " .compareTo(IdentifiedKey.Revision.LINKED_V2) >= 0) {
+ "This is not supported. " logger.fatal("A plugin tried to deny a command with signable component(s). "
+ "Disconnecting player " + player.getUsername()); + "This is not supported. "
player.disconnect(Component.text("A proxy plugin caused an illegal protocol state. " + "Disconnecting player " + player.getUsername());
+ "Contact your network administrator.")); player.disconnect(Component.text("A proxy plugin caused an illegal protocol state. "
+ "Contact your network administrator."));
}
} }
return CompletableFuture.completedFuture(null); return CompletableFuture.completedFuture(null);
} }