3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-12-27 08:30:18 +01:00

Don't forward chat acknowledgement if the client didn't acknowledge any chat

Dieser Commit ist enthalten in:
Gegy 2023-11-27 18:42:11 +01:00 committet von Riley Park
Ursprung c6bb15c69b
Commit 4eae510fb7
2 geänderte Dateien mit 5 neuen und 5 gelöschten Zeilen

Datei anzeigen

@ -52,10 +52,6 @@ public class LastSeenMessages {
buf.writeBytes(Arrays.copyOf(acknowledged.toByteArray(), DIV_FLOOR)); buf.writeBytes(Arrays.copyOf(acknowledged.toByteArray(), DIV_FLOOR));
} }
public boolean isEmpty() {
return acknowledged.isEmpty();
}
public int getOffset() { public int getOffset() {
return this.offset; return this.offset;
} }

Datei anzeigen

@ -60,7 +60,11 @@ public class SessionCommandHandler implements CommandHandler<SessionPlayerComman
} }
// An unsigned command with a 'last seen' update will not happen as of 1.20.5+, but for earlier versions - we still // An unsigned command with a 'last seen' update will not happen as of 1.20.5+, but for earlier versions - we still
// need to pass through the acknowledgement // need to pass through the acknowledgement
return new ChatAcknowledgementPacket(packet.lastSeenMessages.getOffset()); final int offset = packet.lastSeenMessages.getOffset();
if (offset != 0) {
return new ChatAcknowledgementPacket(offset);
}
return null;
} }
@Nullable @Nullable