3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-20 06:50:08 +01:00

Fix 1.19.0 chat signing causing error message (#3494)

Dieser Commit ist enthalten in:
RK_01 2023-10-23 00:28:44 +00:00 committet von GitHub
Ursprung 0e269fa493
Commit a60342359b
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -135,8 +135,8 @@ public final class Protocol1_19_1To1_19 extends AbstractProtocol<ClientboundPack
map(Type.STRING); // Message map(Type.STRING); // Message
map(Type.LONG); // Timestamp map(Type.LONG); // Timestamp
map(Type.LONG); // Salt map(Type.LONG); // Salt
read(Type.BYTE_ARRAY_PRIMITIVE); // Signature map(Type.BYTE_ARRAY_PRIMITIVE); // Signature
read(Type.BOOLEAN); // Signed preview map(Type.BOOLEAN); // Signed preview
handler(wrapper -> { handler(wrapper -> {
final ChatSession1_19_0 chatSession = wrapper.user().get(ChatSession1_19_0.class); final ChatSession1_19_0 chatSession = wrapper.user().get(ChatSession1_19_0.class);
@ -150,11 +150,8 @@ public final class Protocol1_19_1To1_19 extends AbstractProtocol<ClientboundPack
final DecoratableMessage decoratableMessage = new DecoratableMessage(message); final DecoratableMessage decoratableMessage = new DecoratableMessage(message);
final byte[] signature = chatSession.signChatMessage(metadata, decoratableMessage); final byte[] signature = chatSession.signChatMessage(metadata, decoratableMessage);
wrapper.write(Type.BYTE_ARRAY_PRIMITIVE, signature); // Signature wrapper.set(Type.BYTE_ARRAY_PRIMITIVE, 0, signature); // Signature
wrapper.write(Type.BOOLEAN, decoratableMessage.isDecorated()); // Signed preview wrapper.set(Type.BOOLEAN, 0, decoratableMessage.isDecorated()); // Signed preview
} else {
wrapper.write(Type.BYTE_ARRAY_PRIMITIVE, new byte[0]); // Signature
wrapper.write(Type.BOOLEAN, false); // Signed preview
} }
}); });
read(Type.PLAYER_MESSAGE_SIGNATURE_ARRAY); // Last seen messages read(Type.PLAYER_MESSAGE_SIGNATURE_ARRAY); // Last seen messages