fix: Adds better client verification (#853)

* Adds MinRequired and MaxRequired settings
* Removes god client detection
* Streamlines the kick messaging
* Fixes detecting client version on mac/linux
This commit is contained in:
Kamron Batman 2021-11-27 10:06:39 -08:00 committed by GitHub
parent fcc91cbd99
commit 1ac803e778
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 158 additions and 113 deletions

View file

@ -38,11 +38,11 @@ namespace Server
public static List<IPEndPoint> Listeners => m_Settings.Listeners;
public static string GetSetting(string key, string defaultValue)
{
m_Settings.Settings.TryGetValue(key, out var value);
return value ?? defaultValue;
}
public static ClientVersion GetSetting(string key, ClientVersion defaultValue) =>
m_Settings.Settings.TryGetValue(key, out var value) ? new ClientVersion(value) : defaultValue;
public static string GetSetting(string key, string defaultValue) =>
m_Settings.Settings.TryGetValue(key, out var value) ? value : defaultValue;
public static int GetSetting(string key, int defaultValue)
{