Adds settings (#126)

This commit is contained in:
Kamron Batman 2020-05-02 23:41:30 -07:00 • committed by GitHub
parent 8028a85ffe
commit f336a56364
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 229 additions and 99 deletions

View file

@ -6,10 +6,12 @@ namespace Server
{
public class BuffInfo
{
public static bool Enabled => Core.ML;
public static bool Enabled { get; private set; }
public static void Initialize()
{
Enabled = ServerConfiguration.GetOrUpdateSetting("buffIcons.enabled", Core.ML);
if (Enabled)
EventSink.ClientVersionReceived += ResendBuffsOnClientVersionReceived;
}

View file

@ -9,11 +9,11 @@ namespace Server.Misc
{
public class ClientVerification
{
private static readonly bool m_DetectClientRequirement = true;
private static readonly OldClientResponse m_OldClientResponse = OldClientResponse.LenientKick;
private static bool m_DetectClientRequirement;
private static OldClientResponse m_OldClientResponse;
private static readonly TimeSpan m_AgeLeniency = TimeSpan.FromDays(10);
private static readonly TimeSpan m_GameTimeLeniency = TimeSpan.FromHours(25);
private static TimeSpan m_AgeLeniency;
private static TimeSpan m_GameTimeLeniency;
public static ClientVersion Required { get; set; }
@ -23,10 +23,17 @@ namespace Server.Misc
public static bool AllowGod { get; set; } = true;
public static TimeSpan KickDelay { get; set; } = TimeSpan.FromSeconds(20.0);
public static TimeSpan KickDelay { get; set; }
public static void Initialize()
{
m_DetectClientRequirement = ServerConfiguration.GetOrUpdateSetting("clientVerification.enabled", true);
m_OldClientResponse =
ServerConfiguration.GetOrUpdateSetting("clientVerification.oldClientResponse", OldClientResponse.Kick);
m_AgeLeniency = ServerConfiguration.GetOrUpdateSetting("clientVerification.ageLeniency", TimeSpan.FromDays(10));
m_GameTimeLeniency = ServerConfiguration.GetOrUpdateSetting("clientVerification.gameTimeLeniency", TimeSpan.FromHours(25));
KickDelay = ServerConfiguration.GetOrUpdateSetting("clientVerification.kickDelay", TimeSpan.FromSeconds(20.0));
EventSink.ClientVersionReceived += EventSink_ClientVersionReceived;
// ClientVersion.Required = null;

View file

@ -1,41 +0,0 @@
using Server.Accounting;
using Server.Items;
using Server.Network;
namespace Server
{
public class CurrentExpansion
{
private static readonly Expansion Expansion = Expansion.TOL;
public static void Configure()
{
Core.Expansion = Expansion;
AccountGold.Enabled = Core.TOL;
AccountGold.ConvertOnBank = true;
AccountGold.ConvertOnTrade = false;
VirtualCheck.UseEditGump = true;
bool Enabled = Core.AOS;
Mobile.InsuranceEnabled = Enabled;
ObjectPropertyList.Enabled = Enabled;
Mobile.VisibleDamageType = Enabled ? VisibleDamageType.Related : VisibleDamageType.None;
Mobile.GuildClickMessage = !Enabled;
Mobile.AsciiClickMessage = !Enabled;
if (Enabled)
{
AOS.DisableStatInfluences();
if (ObjectPropertyList.Enabled)
PacketHandlers.SingleClickProps =
true; // single click for everything is overridden to check object property list
Mobile.ActionDelay = 1000;
Mobile.AOSStatusHandler = AOS.GetStatus;
}
}
}
}

View file

@ -36,18 +36,21 @@ namespace Server.Misc
* IP address or hostname, whichever is applicable. Loopback clients will be directed to loopback.
*
* If you would like to listen on additional ports (i.e. 22, 23, 80, for clients behind highly restrictive egress
* firewalls) or specific IP adddresses you can do so by modifying the file SocketOptions.cs found in this directory.
* firewalls) or specific IP addresses you can do so by modifying the file SocketOptions.cs found in this directory.
*/
public static readonly string Address = null;
public const string ServerName = "ModernUO TC";
public static string Address { get; private set; }
public static string ServerName { get; private set; }
public const bool AutoDetect = true;
public static bool AutoDetect { get; private set; }
private static IPAddress m_PublicAddress;
public static void Initialize()
{
Address = ServerConfiguration.GetOrUpdateSetting("serverListing.address", "(-null-)");
AutoDetect = ServerConfiguration.GetOrUpdateSetting("serverListing.autoDetect", true);
if (Address == null)
{
if (AutoDetect)