Skip to content

Commit 7dc2802

Browse files
committed
chore: reordering server config properties
1 parent ea2f135 commit 7dc2802

File tree

1 file changed

+78
-33
lines changed
  • Framework/Intersect.Framework.Core/Config

1 file changed

+78
-33
lines changed

Framework/Intersect.Framework.Core/Config/Options.cs

Lines changed: 78 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,99 @@ namespace Intersect;
88

99
public partial class Options
1010
{
11+
#region Transient Properties
12+
1113
[JsonIgnore]
1214
public string OptionsData { get; private set; } = string.Empty;
1315

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

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

20-
public List<string> AnimatedSprites { get; set; } = [];
21+
#region Configuration Properties
2122

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

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

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

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

33+
#region Game Access
34+
35+
[JsonProperty(Order = -99)]
36+
public bool AdminOnly { get; set; }
37+
38+
[JsonProperty(Order = -99)]
39+
public bool BlockClientRegistrations { get; set; }
40+
41+
[JsonProperty(Order = -99)]
3342
public int MaxClientConnections { get; set; } = 100;
3443

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

40-
[JsonProperty(Order = -1)]
50+
#endregion Game Access
51+
52+
#region Network Visibility
53+
54+
[JsonProperty(Order = -91)]
4155
public bool UPnP { get; set; } = true;
4256

57+
[JsonProperty(Order = -91)]
58+
public bool OpenPortChecker { get; set; } = true;
59+
60+
[JsonProperty(Order = -91, NullValueHandling = NullValueHandling.Include)]
61+
public string? PortCheckerUrl { get; set; }
62+
63+
#endregion Network Visibility
64+
65+
#region Logging and Metrics
66+
67+
[JsonProperty(Order = -80)]
68+
public LoggingOptions Logging = new();
69+
70+
[JsonProperty(Order = -80)]
71+
public MetricsOptions Metrics = new();
72+
73+
#endregion Logging and Metrics
74+
75+
#region Database
76+
77+
[JsonProperty(Order = -70)]
78+
public DatabaseOptions GameDatabase = new();
79+
80+
[JsonProperty(Order = -70)]
81+
public DatabaseOptions LoggingDatabase = new();
82+
83+
[JsonProperty(Order = -70)]
84+
public DatabaseOptions PlayerDatabase = new();
85+
86+
#endregion Database
87+
88+
#region Security
89+
90+
[JsonProperty(Order = -60)]
91+
public SecurityOptions Security = new();
92+
93+
[JsonProperty(Order = -60)]
94+
public SmtpSettings SmtpSettings = new();
95+
96+
#endregion Security
97+
98+
#region Other Game Properties
99+
100+
public List<string> AnimatedSprites { get; set; } = [];
101+
102+
public PacketOptions Packets = new();
103+
43104
public ChatOptions Chat = new();
44105

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

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

51-
[JsonProperty(Order = -5)]
52-
public string GameName { get; set; } = DEFAULT_GAME_NAME;
53-
54-
[JsonProperty(Order = -4)]
55-
public ushort ServerPort { get; set; } = DEFAULT_SERVER_PORT;
56-
57112
/// <summary>
58113
/// Passability configuration by map zone
59114
/// </summary>
60115
public Passability Passability { get; } = new();
61116

62-
public MapOptions Map = new();
63-
64-
public DatabaseOptions GameDatabase = new();
65-
66-
public DatabaseOptions LoggingDatabase = new();
117+
public ushort ValidPasswordResetTimeMinutes { get; set; } = 30;
67118

68-
public DatabaseOptions PlayerDatabase = new();
119+
public MapOptions Map = new();
69120

70121
public PlayerOptions Player = new();
71122

72123
public PartyOptions Party = new();
73124

74-
public SecurityOptions Security = new();
75-
76125
public LootOptions Loot = new();
77126

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

82131
public NpcOptions Npc = new();
83132

84-
public MetricsOptions Metrics = new();
85-
86-
public PacketOptions Packets = new();
87-
88-
public SmtpSettings SmtpSettings = new();
89-
90133
public QuestOptions Quest = new();
91134

92135
public GuildOptions Guild = new();
93136

94-
public LoggingOptions Logging = new();
95-
96137
public BankOptions Bank = new();
97138

98139
public InstancingOptions Instancing = new();
99140

100141
public ItemOptions Items = new();
101142

143+
#endregion Other Game Properties
144+
145+
#endregion Configuration Properties
146+
102147
public static Options Instance { get; private set; }
103148

104149
public static bool IsLoaded => Instance != null;

0 commit comments

Comments
 (0)