mirror of
https://github.com/Dreeam-qwq/Gale.git
synced 2025-12-22 08:19:31 +00:00
Make slow login timeout configurable
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Martijn Muijsers <martijnmuijsers@live.nl>
|
||||
Date: Sat, 24 Dec 2022 22:50:13 +0100
|
||||
Subject: [PATCH] Make slow login timeout configurable
|
||||
|
||||
License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
|
||||
Gale - https://galemc.org
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
index 2ed3f42b1e487374287d033ac634a922a5ef37bd..b4458776442df2b1e42e143e0b217973618d0af8 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerLoginPacketListenerImpl.java
|
||||
@@ -37,6 +37,7 @@ import net.minecraft.util.Crypt;
|
||||
import net.minecraft.util.CryptException;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import org.apache.commons.lang3.Validate;
|
||||
+import org.galemc.gale.configuration.GaleGlobalConfiguration;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
// CraftBukkit start
|
||||
@@ -96,7 +97,7 @@ public class ServerLoginPacketListenerImpl implements ServerLoginPacketListener,
|
||||
}
|
||||
}
|
||||
|
||||
- if (this.tick++ == 600) {
|
||||
+ if (this.tick++ >= GaleGlobalConfiguration.get().misc.premiumAccountSlowLoginTimeout) { // Gale - make slow login timeout configurable
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.slow_login"));
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
index d87db127a13c37cd4d9e0ff2f0a5b5387c5fbb0b..b25c861d7ea1c167c27fb30fceaf4bbca899a666 100644
|
||||
--- a/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
+++ b/src/main/java/org/galemc/gale/configuration/GaleGlobalConfiguration.java
|
||||
@@ -42,6 +42,20 @@ public class GaleGlobalConfiguration extends ConfigurationPart {
|
||||
public Misc misc;
|
||||
public class Misc extends ConfigurationPart {
|
||||
|
||||
+ // Gale start - make slow login timeout configurable
|
||||
+ /**
|
||||
+ * The maximum time that a premium account login can take.
|
||||
+ * If this time is exceeded, the connection is closed.
|
||||
+ * Given in ticks.
|
||||
+ * Any value < 1 uses the default timeout, which is currently 600 ticks (30 seconds).
|
||||
+ * <ul>
|
||||
+ * <li><i>Default</i>: -1</li>
|
||||
+ * <li><i>Vanilla</i>: -1</li>
|
||||
+ * </ul>
|
||||
+ */
|
||||
+ public int premiumAccountSlowLoginTimeout = 600;
|
||||
+ // Gale end - make slow login timeout configurable
|
||||
+
|
||||
public IncludeInTimingsReport includeInTimingsReport;
|
||||
|
||||
public class IncludeInTimingsReport extends ConfigurationPart {
|
||||
Reference in New Issue
Block a user