aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0932-Prevent-causing-expired-keys-from-impacting-new-join.patch
diff options
context:
space:
mode:
authorbooky10 <[email protected]>2023-11-04 20:20:01 +0100
committerGitHub <[email protected]>2023-11-04 20:20:01 +0100
commitf78d7ce8ffb7e4b6fd5ee256f5e3678ea04fd807 (patch)
tree8e7abee5129e15a919630824c4f194a2811f7242 /patches/server/0932-Prevent-causing-expired-keys-from-impacting-new-join.patch
parent44057da46727138e19d951b56e98ad8c25c1f869 (diff)
downloadPaper-f78d7ce8ffb7e4b6fd5ee256f5e3678ea04fd807.tar.gz
Paper-f78d7ce8ffb7e4b6fd5ee256f5e3678ea04fd807.zip
Remove "fix-curing-zombie-villager-discount" exploit option (#9895)
Diffstat (limited to 'patches/server/0932-Prevent-causing-expired-keys-from-impacting-new-join.patch')
-rw-r--r--patches/server/0932-Prevent-causing-expired-keys-from-impacting-new-join.patch59
1 files changed, 0 insertions, 59 deletions
diff --git a/patches/server/0932-Prevent-causing-expired-keys-from-impacting-new-join.patch b/patches/server/0932-Prevent-causing-expired-keys-from-impacting-new-join.patch
deleted file mode 100644
index a13ddb0b4f..0000000000
--- a/patches/server/0932-Prevent-causing-expired-keys-from-impacting-new-join.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Shane Freeder <[email protected]>
-Date: Mon, 3 Apr 2023 08:55:52 +0100
-Subject: [PATCH] Prevent causing expired keys from impacting new joins
-
-
-diff --git a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
-index 40ac5cf19934207f06755fbea02d4626d7aa0511..32e3f347e2e025e2675e9410116386e472bd6a79 100644
---- a/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
-+++ b/src/main/java/net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket.java
-@@ -96,7 +96,13 @@ public class ClientboundPlayerInfoUpdatePacket implements Packet<ClientGamePacke
- INITIALIZE_CHAT((serialized, buf) -> {
- serialized.chatSession = buf.readNullable(RemoteChatSession.Data::read);
- }, (buf, entry) -> {
-- buf.writeNullable(entry.chatSession, RemoteChatSession.Data::write);
-+ // Paper start
-+ RemoteChatSession.Data chatSession = entry.chatSession;
-+ if (chatSession != null && chatSession.profilePublicKey().hasExpired()) {
-+ chatSession = null;
-+ }
-+ buf.writeNullable(chatSession, RemoteChatSession.Data::write);
-+ // Paper end
- }),
- UPDATE_GAME_MODE((serialized, buf) -> {
- serialized.gameMode = GameType.byId(buf.readVarInt());
-diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-index f70ab11877ae04a4c9cc4ef61dc6e07c0f3fe9f2..93d84ca1d132222c8daed9d2683bf72f95dbb078 100644
---- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
-@@ -284,6 +284,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
- private final AtomicReference<Instant> lastChatTimeStamp;
- @Nullable
- private RemoteChatSession chatSession;
-+ private boolean hasLoggedExpiry = false; // Paper
- private SignedMessageChain.Decoder signedMessageDecoder;
- private final LastSeenMessagesValidator lastSeenMessages;
- private final MessageSignatureCache messageSignatureCache;
-@@ -393,6 +394,13 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
- this.disconnect(Component.translatable("multiplayer.disconnect.idling"), org.bukkit.event.player.PlayerKickEvent.Cause.IDLING); // Paper - kick event cause
- }
-
-+ // Paper start
-+ if (!hasLoggedExpiry && this.chatSession != null && this.chatSession.profilePublicKey().data().hasExpired()) {
-+ LOGGER.info("Player profile key for {} has expired!", this.player.getName().getString());
-+ hasLoggedExpiry = true;
-+ }
-+ // Paper end
-+
- }
-
- public void resetPosition() {
-@@ -3413,6 +3421,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
-
- private void resetPlayerChatState(RemoteChatSession session) {
- this.chatSession = session;
-+ this.hasLoggedExpiry = false; // Paper
- this.signedMessageDecoder = session.createMessageDecoder(this.player.getUUID());
- this.chatMessageChain.append((executor) -> {
- this.player.setChatSession(session);