-using System.Text.Json.Serialization;
-using Impostor.Server.Utils;
+using Impostor.Server.Utils;
namespace Impostor.Server.Config
{
private string? _resolvedListenIp;
- [JsonConstructor]
- public AnnouncementsServerConfig(bool enabled = true, string listenIp = "0.0.0.0", ushort listenPort = 22024)
- {
- Enabled = enabled;
- ListenIp = listenIp;
- ListenPort = listenPort;
- }
-
- public bool Enabled { get; }
+ public bool Enabled { get; set; } = true;
- public string ListenIp { get; }
+ public string ListenIp { get; set; } = "0.0.0.0";
- public ushort ListenPort { get; }
+ public ushort ListenPort { get; set; } = 22024;
public string ResolveListenIp()
{
-using System.Text.Json.Serialization;
-
-namespace Impostor.Server.Config
+namespace Impostor.Server.Config
{
public class DebugConfig
{
public const string Section = "Debug";
- [JsonConstructor]
- public DebugConfig(bool gameRecorderEnabled = false, string? gameRecorderPath = null)
- {
- GameRecorderEnabled = gameRecorderEnabled;
- GameRecorderPath = gameRecorderPath;
- }
-
- public bool GameRecorderEnabled { get; }
+ public bool GameRecorderEnabled { get; set; }
- public string? GameRecorderPath { get; }
+ public string GameRecorderPath { get; set; } = string.Empty;
}
}
using System.Collections.Generic;
-using System.Text.Json.Serialization;
+using System.Diagnostics.CodeAnalysis;
namespace Impostor.Server.Config
{
{
public const string Section = "ServerRedirector";
- [JsonConstructor]
- public ServerRedirectorConfig(bool enabled = false, bool master = false, NodeLocator? locator = null, List<ServerRedirectorNode>? nodes = null)
- {
- Enabled = enabled;
- Master = master;
- Locator = locator;
- Nodes = nodes;
- }
+ public bool Enabled { get; set; }
- public bool Enabled { get; }
+ public bool Master { get; set; }
- public bool Master { get; }
+ public NodeLocator? Locator { get; set; }
- public NodeLocator? Locator { get; }
-
- public List<ServerRedirectorNode>? Nodes { get; }
+ public List<ServerRedirectorNode>? Nodes { get; set; }
public class NodeLocator
{
- [JsonConstructor]
- public NodeLocator(string redis, string udpMasterEndpoint)
- {
- Redis = redis;
- UdpMasterEndpoint = udpMasterEndpoint;
- }
-
- public string Redis { get; }
+ [AllowNull]
+ public string Redis { get; set; }
- public string UdpMasterEndpoint { get; }
+ [AllowNull]
+ public string UdpMasterEndpoint { get; set; }
}
}
}
-using System.Text.Json.Serialization;
+using System.Diagnostics.CodeAnalysis;
namespace Impostor.Server.Config
{
public class ServerRedirectorNode
{
- [JsonConstructor]
- public ServerRedirectorNode(string ip, ushort port)
- {
- Ip = ip;
- Port = port;
- }
+ [AllowNull]
+ public string Ip { get; set; }
- public string Ip { get; }
-
- public ushort Port { get; }
+ [AllowNull]
+ public ushort Port { get; set; }
}
}