Mirror von
https://github.com/ViaVersion/ViaBackwards.git
synchronisiert 2024-11-16 04:50:10 +01:00
Always map command to signed command in 1.20.5->1.20.3
Sending any message, any non-message command, and again any message would kick the client with a chat validation error. Let's see if this is better
Dieser Commit ist enthalten in:
Ursprung
9ca523620d
Commit
eb4d30ae73
@ -124,19 +124,8 @@ public final class Protocol1_20_5To1_20_3 extends BackwardsProtocol<ClientboundP
|
|||||||
wrapper.write(Types.BOOLEAN, wrapper.user().get(SecureChatStorage.class).enforcesSecureChat());
|
wrapper.write(Types.BOOLEAN, wrapper.user().get(SecureChatStorage.class).enforcesSecureChat());
|
||||||
});
|
});
|
||||||
|
|
||||||
registerServerbound(ServerboundPackets1_20_3.CHAT_COMMAND, ServerboundPackets1_20_5.CHAT_COMMAND_SIGNED, wrapper -> {
|
// Always write as signed, even if there is 0 signatures attached, else the validation chain gets broken
|
||||||
final String command = wrapper.passthrough(Types.STRING); // Command
|
registerServerbound(ServerboundPackets1_20_3.CHAT_COMMAND, ServerboundPackets1_20_5.CHAT_COMMAND_SIGNED);
|
||||||
wrapper.passthrough(Types.LONG); // Timestamp
|
|
||||||
wrapper.passthrough(Types.LONG); // Salt
|
|
||||||
final int signatures = wrapper.passthrough(Types.VAR_INT); // Signatures
|
|
||||||
if (signatures == 0) {
|
|
||||||
wrapper.cancel();
|
|
||||||
|
|
||||||
final PacketWrapper chatCommand = wrapper.create(ServerboundPackets1_20_5.CHAT_COMMAND);
|
|
||||||
chatCommand.write(Types.STRING, command);
|
|
||||||
chatCommand.sendToServer(Protocol1_20_5To1_20_3.class);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
registerClientbound(State.LOGIN, ClientboundLoginPackets.COOKIE_REQUEST.getId(), -1, wrapper -> handleCookieRequest(wrapper, ServerboundLoginPackets.COOKIE_RESPONSE));
|
registerClientbound(State.LOGIN, ClientboundLoginPackets.COOKIE_REQUEST.getId(), -1, wrapper -> handleCookieRequest(wrapper, ServerboundLoginPackets.COOKIE_RESPONSE));
|
||||||
cancelClientbound(ClientboundConfigurationPackets1_20_5.RESET_CHAT); // Old clients already reset chat when entering the configuration phase
|
cancelClientbound(ClientboundConfigurationPackets1_20_5.RESET_CHAT); // Old clients already reset chat when entering the configuration phase
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren