Skip to content

Commit

Permalink
chore: reordering server config properties
Browse files Browse the repository at this point in the history
  • Loading branch information
lodicolo committed Jan 21, 2025
1 parent ea2f135 commit 7dc2802
Showing 1 changed file with 78 additions and 33 deletions.
111 changes: 78 additions & 33 deletions Framework/Intersect.Framework.Core/Config/Options.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,99 @@ namespace Intersect;

public partial class Options
{
#region Transient Properties

[JsonIgnore]
public string OptionsData { get; private set; } = string.Empty;

[JsonIgnore]
public bool SendingToClient { get; set; } = true;

[JsonProperty(Order = -3)]
public bool AdminOnly { get; set; }
#endregion Transient Properties

public List<string> AnimatedSprites { get; set; } = [];
#region Configuration Properties

[JsonProperty(Order = -2)]
public bool BlockClientRegistrations { get; set; }
#region Game Core

public ushort ValidPasswordResetTimeMinutes { get; set; } = 30;
[JsonProperty(Order = -100)]
public string GameName { get; set; } = DEFAULT_GAME_NAME;

[JsonProperty(Order = 0)]
public bool OpenPortChecker { get; set; } = true;
[JsonProperty(Order = -100)]
public ushort ServerPort { get; set; } = DEFAULT_SERVER_PORT;

[JsonProperty(NullValueHandling = NullValueHandling.Include)]
public string? PortCheckerUrl { get; set; }
#endregion Game Core

#region Game Access

[JsonProperty(Order = -99)]
public bool AdminOnly { get; set; }

[JsonProperty(Order = -99)]
public bool BlockClientRegistrations { get; set; }

[JsonProperty(Order = -99)]
public int MaxClientConnections { get; set; } = 100;

/// <summary>
/// Defines the maximum amount of logged-in users our server is allowed to handle.
/// </summary>
[JsonProperty(Order = -99)]
public int MaximumLoggedInUsers { get; set; } = 50;

[JsonProperty(Order = -1)]
#endregion Game Access

#region Network Visibility

[JsonProperty(Order = -91)]
public bool UPnP { get; set; } = true;

[JsonProperty(Order = -91)]
public bool OpenPortChecker { get; set; } = true;

[JsonProperty(Order = -91, NullValueHandling = NullValueHandling.Include)]
public string? PortCheckerUrl { get; set; }

#endregion Network Visibility

#region Logging and Metrics

[JsonProperty(Order = -80)]
public LoggingOptions Logging = new();

[JsonProperty(Order = -80)]
public MetricsOptions Metrics = new();

#endregion Logging and Metrics

#region Database

[JsonProperty(Order = -70)]
public DatabaseOptions GameDatabase = new();

[JsonProperty(Order = -70)]
public DatabaseOptions LoggingDatabase = new();

[JsonProperty(Order = -70)]
public DatabaseOptions PlayerDatabase = new();

#endregion Database

#region Security

[JsonProperty(Order = -60)]
public SecurityOptions Security = new();

[JsonProperty(Order = -60)]
public SmtpSettings SmtpSettings = new();

#endregion Security

#region Other Game Properties

public List<string> AnimatedSprites { get; set; } = [];

public PacketOptions Packets = new();

public ChatOptions Chat = new();

public CombatOptions Combat = new();
Expand All @@ -48,31 +109,19 @@ public partial class Options

public int EventWatchdogKillThreshold { get; set; } = 5000;

[JsonProperty(Order = -5)]
public string GameName { get; set; } = DEFAULT_GAME_NAME;

[JsonProperty(Order = -4)]
public ushort ServerPort { get; set; } = DEFAULT_SERVER_PORT;

/// <summary>
/// Passability configuration by map zone
/// </summary>
public Passability Passability { get; } = new();

public MapOptions Map = new();

public DatabaseOptions GameDatabase = new();

public DatabaseOptions LoggingDatabase = new();
public ushort ValidPasswordResetTimeMinutes { get; set; } = 30;

public DatabaseOptions PlayerDatabase = new();
public MapOptions Map = new();

public PlayerOptions Player = new();

public PartyOptions Party = new();

public SecurityOptions Security = new();

public LootOptions Loot = new();

public ProcessingOptions Processing = new();
Expand All @@ -81,24 +130,20 @@ public partial class Options

public NpcOptions Npc = new();

public MetricsOptions Metrics = new();

public PacketOptions Packets = new();

public SmtpSettings SmtpSettings = new();

public QuestOptions Quest = new();

public GuildOptions Guild = new();

public LoggingOptions Logging = new();

public BankOptions Bank = new();

public InstancingOptions Instancing = new();

public ItemOptions Items = new();

#endregion Other Game Properties

#endregion Configuration Properties

public static Options Instance { get; private set; }

public static bool IsLoaded => Instance != null;
Expand Down

0 comments on commit 7dc2802

Please sign in to comment.