From 151b75a351401903be370a9c397991370452e695 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Sat, 18 May 2024 10:34:04 +1000 Subject: [PATCH] Allow disabling auto name verification for LAN IPs --- MCGalaxy/Server/Authentication/LoginAuthenticator.cs | 2 +- MCGalaxy/Server/ServerConfig.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MCGalaxy/Server/Authentication/LoginAuthenticator.cs b/MCGalaxy/Server/Authentication/LoginAuthenticator.cs index a04d89ed2..feabe90b3 100644 --- a/MCGalaxy/Server/Authentication/LoginAuthenticator.cs +++ b/MCGalaxy/Server/Authentication/LoginAuthenticator.cs @@ -43,7 +43,7 @@ public static bool VerifyLogin(Player p, string mppass) { if (auth.Verify(p, mppass)) return true; } - return !Server.Config.VerifyNames || IPUtil.IsPrivate(p.IP); + return !Server.Config.VerifyNames || (IPUtil.IsPrivate(p.IP) && !Server.Config.VerifyLanIPs); } } diff --git a/MCGalaxy/Server/ServerConfig.cs b/MCGalaxy/Server/ServerConfig.cs index 67be9fe4d..507645149 100644 --- a/MCGalaxy/Server/ServerConfig.cs +++ b/MCGalaxy/Server/ServerConfig.cs @@ -160,6 +160,8 @@ public sealed class ServerConfig : EnvConfig public List DisabledModules = new List(); [ConfigTimespan("death-invulnerability-cooldown", "Other", 2, false)] public TimeSpan DeathCooldown = TimeSpan.FromSeconds(2); + [ConfigBool("verify-lan-ips", "Other", false)] + public bool VerifyLanIPs = false; [ConfigBool("irc", "IRC bot", false)] public bool UseIRC = false;