mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-04-19 17:58:15 +02:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: PaperMC/Paper@5027a22c fix test PaperMC/Paper@7b1b5f66 applyOrMoveSourcePatches for pre-2 PaperMC/Paper@743ab685 set updatingMinecraft flag PaperMC/Paper@17d72ad2 26.1-rc-1 PaperMC/Paper@42c355e0 update to rc2 PaperMC/Paper@890e3cd4 fix setPlayerTime's rate, call TimeSkipEvent for time set <markerId> PaperMC/Paper@8077ce40 cleanup PlayerInteractEvent PaperMC/Paper@5f86e092 Start porting feature patches PaperMC/Paper@5ba0e30a More feature patches PaperMC/Paper@1abe8fe5 Apply redstone patches PaperMC/Paper@3dfcd069 Simplify CraftStructureManager#loadStructure PaperMC/Paper@392f8bf3 26.1-rc-3
24 lines
1.2 KiB
Diff
24 lines
1.2 KiB
Diff
--- a/net/minecraft/network/Connection.java
|
|
+++ b/net/minecraft/network/Connection.java
|
|
@@ -552,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
|