3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-07-03 22:18:04 +02:00

Assume enforce secure chat as false by default

Setting it to true will result in chat validation errors on the client for other players without chat sessions or valid signatures
Dieser Commit ist enthalten in:
Nassim Jahnke 2024-04-24 10:26:35 +02:00
Ursprung 9654a613cd
Commit d2ca6a82be
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: EF6771C01F6EF02F

Datei anzeigen

@ -210,9 +210,15 @@ public final class EntityPacketRewriter1_20_5 extends EntityRewriter<Clientbound
handler(playerTrackerHandler());
handler(wrapper -> {
// Enforces secure chat - moved from server data (which is unfortunately sent a while after this)
// Just put in what we know if this is sent multiple times
final AcknowledgedMessagesStorage storage = wrapper.user().get(AcknowledgedMessagesStorage.class);
wrapper.write(Type.BOOLEAN, storage.isSecureChatEnforced());
if (storage.secureChatEnforced() != null) {
// Just put in what we know if this is sent multiple times
wrapper.write(Type.BOOLEAN, storage.isSecureChatEnforced());
} else {
// Assume that it isn't, otherwise the client will disregard chat messages from players
// without chat sessions if it assumes secure chat is enforced
wrapper.write(Type.BOOLEAN, false);
}
storage.clear();