Files
Purpur/purpur-server/minecraft-patches/sources/net/minecraft/network/Connection.java.patch
granny 994dd4f476 Updated Upstream (Paper)
Upstream has released updates that appear to apply and compile correctly

Paper Changes:
PaperMC/Paper@4a903d81 Readd dropped diff
PaperMC/Paper@4fe0ac24 Some more comments
PaperMC/Paper@19a36413 Last per file patches
PaperMC/Paper@e49b5e88 Fix compile issues:
PaperMC/Paper@1b30919a Fix
PaperMC/Paper@df964545 Fixup whatever happened here
PaperMC/Paper@5933bd5b TrialSpawner compile fixes
PaperMC/Paper@20136f71 Some initial adoption of ValueInput/Output
PaperMC/Paper@a1bfc19a Some more compilation issues
PaperMC/Paper@d16b93e6 Generator
PaperMC/Paper@c34fb5f8 Test fixes
PaperMC/Paper@f3bad8c8 Prepare work on feature patches
PaperMC/Paper@ed3b39e9 14 first feature patches
PaperMC/Paper@ff05a2df Hacky EAR 2.0 fixes
2025-06-01 13:17:21 -07:00

24 lines
1.2 KiB
Diff

--- a/net/minecraft/network/Connection.java
+++ b/net/minecraft/network/Connection.java
@@ -578,11 +_,20 @@
private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper - Buffer joins to world
private static int joinAttemptsThisTick; // Paper - Buffer joins to world
private static int currTick; // Paper - Buffer joins to world
+ private static int tickSecond; // Purpur - Max joins per second
public void tick() {
this.flushQueue();
// Paper start - Buffer joins to world
if (Connection.currTick != net.minecraft.server.MinecraftServer.currentTick) {
Connection.currTick = net.minecraft.server.MinecraftServer.currentTick;
+ // Purpur start - Max joins per second
+ if (org.purpurmc.purpur.PurpurConfig.maxJoinsPerSecond) {
+ if (++Connection.tickSecond > 20) {
+ Connection.tickSecond = 0;
+ Connection.joinAttemptsThisTick = 0;
+ }
+ } else
+ // Purpur end - Max joins per second
Connection.joinAttemptsThisTick = 0;
}
// Paper end - Buffer joins to world