mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 01:47:42 +01:00
merge upstream
This commit is contained in:
@@ -6,19 +6,19 @@ Subject: [PATCH] Max joins per second
|
||||
When this option is set to true the `max-joins-per-tick` setting in paper.yml will be used per second instead of per tick
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/network/Connection.java b/src/main/java/net/minecraft/network/Connection.java
|
||||
index 7030c38980dbebfd374c2369294555650cf7880b..7a7b93d46650faa16f2e6df36c5363cf47db75ba 100644
|
||||
index f76c52e4661ef740dc924b0704a9ce28982294f1..f08c24920aebe5a84927024fdd14d954053129d3 100644
|
||||
--- a/src/main/java/net/minecraft/network/Connection.java
|
||||
+++ b/src/main/java/net/minecraft/network/Connection.java
|
||||
@@ -517,11 +517,20 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
private static final int MAX_PER_TICK = com.destroystokyo.paper.PaperConfig.maxJoinsPerTick; // Paper
|
||||
@@ -516,11 +516,20 @@ public class Connection extends SimpleChannelInboundHandler<Packet<?>> {
|
||||
private static final int MAX_PER_TICK = io.papermc.paper.configuration.GlobalConfiguration.get().misc.maxJoinsPerTick; // Paper
|
||||
private static int joinAttemptsThisTick; // Paper
|
||||
private static int currTick; // Paper
|
||||
+ private static int tickSecond; // Purpur
|
||||
public void tick() {
|
||||
this.flushQueue();
|
||||
// Paper start
|
||||
if (currTick != MinecraftServer.currentTick) {
|
||||
currTick = MinecraftServer.currentTick;
|
||||
if (currTick != net.minecraft.server.MinecraftServer.currentTick) {
|
||||
currTick = net.minecraft.server.MinecraftServer.currentTick;
|
||||
+ // Purpur start
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.maxJoinsPerSecond) {
|
||||
+ if (++tickSecond > 20) {
|
||||
|
||||
Reference in New Issue
Block a user