Skip to content

Commit

Permalink
Updated Upstream (Paper)
Browse files Browse the repository at this point in the history
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@aebbdc9 Add proper async player disconnections
  • Loading branch information
granny committed Oct 17, 2024
1 parent 7f490a6 commit 4f2fe31
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ group = org.purpurmc.purpur
version = 1.21.1-R0.1-SNAPSHOT

mcVersion = 1.21.1
paperCommit = 4430e96e1b82f3e8244a5c979afb7a69f38222aa
paperCommit = aebbdc9e9a18b580d2647af52f77a506bcf7bbc2

org.gradle.caching = true
org.gradle.parallel = true
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0005-Purpur-client-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ index c396580a9cfd86ff261bed439bb4662ae88010b5..2e45bc48c8a86d9522e4574bf3037611
// Paper start - rewrite chunk system
private ca.spottedleaf.moonrise.patches.chunk_system.player.RegionizedPlayerChunkLoader.PlayerChunkLoaderData chunkLoader;
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 6998f32f8d79dbdb6b31ffaa126602fc4a428616..2bb1c00e350497b425da63e473d7af5c67c911b8 100644
index 7174f8c89a7cdcf40ff28f6636ecfb23b13ccdaa..0b661bbfa4279cbb26c065c3ed4f2b9eb4342c4e 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -84,6 +84,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
Expand All @@ -28,7 +28,7 @@ index 6998f32f8d79dbdb6b31ffaa126602fc4a428616..2bb1c00e350497b425da63e473d7af5c

public ServerCommonPacketListenerImpl(MinecraftServer minecraftserver, Connection networkmanager, CommonListenerCookie commonlistenercookie, ServerPlayer player) { // CraftBukkit
this.server = minecraftserver;
@@ -176,6 +177,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -172,6 +173,13 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
ServerGamePacketListenerImpl.LOGGER.error("Couldn\'t register custom payload", ex);
this.disconnect(Component.literal("Invalid payload REGISTER!"), PlayerKickEvent.Cause.INVALID_PAYLOAD); // Paper - kick event cause
}
Expand Down
6 changes: 3 additions & 3 deletions patches/server/0019-Alternative-Keepalive-Handling.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] Alternative Keepalive Handling


diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 2bb1c00e350497b425da63e473d7af5c67c911b8..9b886ebab609586f0368476331cf54cbe4bde6f1 100644
index 0b661bbfa4279cbb26c065c3ed4f2b9eb4342c4e..87e904ef07cf04d7e59c8da418c5d0458902de2d 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -79,6 +79,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
Expand Down Expand Up @@ -33,7 +33,7 @@ index 2bb1c00e350497b425da63e473d7af5c67c911b8..9b886ebab609586f0368476331cf54cb
//PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // CraftBukkit // Paper - handle ServerboundKeepAlivePacket async
if (this.keepAlivePending && packet.getId() == this.keepAliveChallenge) {
int i = (int) (Util.getMillis() - this.keepAliveTime);
@@ -266,6 +277,21 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -262,6 +273,21 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
long currentTime = Util.getMillis();
long elapsedTime = currentTime - this.keepAliveTime;

Expand All @@ -56,7 +56,7 @@ index 2bb1c00e350497b425da63e473d7af5c67c911b8..9b886ebab609586f0368476331cf54cb
if (this.keepAlivePending && !this.processedDisconnect && elapsedTime >= KEEPALIVE_LIMIT) { // Paper - check keepalive limit, don't fire if already disconnected
this.disconnect(ServerCommonPacketListenerImpl.TIMEOUT_DISCONNECTION_MESSAGE, PlayerKickEvent.Cause.TIMEOUT); // Paper - kick event cause
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
index 9e6bcdaa2b3dabb2a7c50034eed81f0064a2f98f..4ddeff1d34f5e3f7f9c6cfe1c517be0e2d57f86f 100644
index b4d43c293084b808d167dd02f2d6cf865ac17983..6bbd0021032d1979fc0133f6f859dddcf22c5708 100644
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
@@ -200,6 +200,11 @@ public class PurpurConfig {
Expand Down
4 changes: 2 additions & 2 deletions patches/server/0116-PlayerBookTooLargeEvent.patch
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Subject: [PATCH] PlayerBookTooLargeEvent


diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
index 58b90722df0b0dcd7c84976f510f43aa82ea795c..bbec4b963ca4b0804bce0c4cde49e1e88c0ae9f0 100644
index 5c9e35d9b645774e0d96c9a089ab071034827ea2..ef55fc102b06e6fec0c39c86a5b32d3b170e0a6f 100644
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
@@ -1188,6 +1188,10 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
Expand All @@ -26,6 +26,6 @@ index 58b90722df0b0dcd7c84976f510f43aa82ea795c..bbec4b963ca4b0804bce0c4cde49e1e8
- ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send a book too large. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
+ ServerGamePacketListenerImpl.LOGGER.warn("{} tried to send too large of a book. Book size: {} - Allowed: {} - Pages: {}", this.player.getScoreboardName(), byteTotal, byteAllowed, pageList.size());
+ org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent event = new org.purpurmc.purpur.event.player.PlayerBookTooLargeEvent(player.getBukkitEntity(), itemstack.asBukkitCopy()); if (event.shouldKickPlayer()) // Purpur
this.disconnect(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause
this.disconnectAsync(Component.literal("Book too large!"), org.bukkit.event.player.PlayerKickEvent.Cause.ILLEGAL_ACTION); // Paper - kick event cause // Paper - add proper async disconnect
return;
}
6 changes: 3 additions & 3 deletions patches/server/0253-Remove-Mojang-Profiler.patch
Original file line number Diff line number Diff line change
Expand Up @@ -886,10 +886,10 @@ index 6f6b9dbfa8bf4d67a9157ec870a4f14a8002ac01..d8bff9a83c4c2ad1ec1e7d44aac23068
this.connection.send(new ClientboundPlayerAbilitiesPacket(this.getAbilities()));
playerlist.sendLevelInfo(this, worldserver);
diff --git a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
index 9b886ebab609586f0368476331cf54cbe4bde6f1..0d6307db1047bb5db7e33aa425fe2564cca93cfb 100644
index 87e904ef07cf04d7e59c8da418c5d0458902de2d..a9d54c80f682d826ad272731bd6477eed0fd44d5 100644
--- a/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
+++ b/src/main/java/net/minecraft/server/network/ServerCommonPacketListenerImpl.java
@@ -271,7 +271,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -267,7 +267,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}

protected void keepConnectionAlive() {
Expand All @@ -898,7 +898,7 @@ index 9b886ebab609586f0368476331cf54cbe4bde6f1..0d6307db1047bb5db7e33aa425fe2564
// Paper start - give clients a longer time to respond to pings as per pre 1.12.2 timings
// This should effectively place the keepalive handling back to "as it was" before 1.12.2
long currentTime = Util.getMillis();
@@ -304,7 +304,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
@@ -300,7 +300,7 @@ public abstract class ServerCommonPacketListenerImpl implements ServerCommonPack
}
// Paper end - give clients a longer time to respond to pings as per pre 1.12.2 timings

Expand Down

0 comments on commit 4f2fe31

Please sign in to comment.