Implement IPCPrefixes

This makes it possible to not only listen on multiple different host/port combinations, but also different protocols or base URLs (even though this will probably break things up, need to do more tests)
This commit is contained in:
JustArchi
2018-02-12 22:07:02 +01:00
parent b06f7394da
commit 0cca2fd7b4
4 changed files with 20 additions and 27 deletions

View File

@@ -75,8 +75,8 @@ namespace ArchiSteamFarm {
[JsonProperty]
internal readonly string IPCPassword;
[JsonProperty(Required = Required.DisallowNull)]
internal readonly ushort IPCPort = DefaultIPCPort;
[JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)]
internal readonly HashSet<string> IPCPrefixes = new HashSet<string> { "http://127.0.0.1:" + DefaultIPCPort + "/" };
[JsonProperty(Required = Required.DisallowNull)]
internal readonly byte LoginLimiterDelay = DefaultLoginLimiterDelay;
@@ -99,9 +99,6 @@ namespace ArchiSteamFarm {
[JsonProperty(Required = Required.DisallowNull)]
internal readonly byte UpdatePeriod = 24;
[JsonProperty]
internal string IPCHost { get; set; } = "127.0.0.1";
[JsonProperty(Required = Required.DisallowNull)]
internal ulong SteamOwnerID { get; private set; }
@@ -162,11 +159,6 @@ namespace ArchiSteamFarm {
return null;
}
if (globalConfig.IPCPort == 0) {
ASF.ArchiLogger.LogGenericError(string.Format(Strings.ErrorConfigPropertyInvalid, nameof(globalConfig.IPCPort), globalConfig.IPCPort));
return null;
}
if (globalConfig.SteamProtocols.HasFlag(ProtocolTypes.WebSocket) && !OS.SupportsWebSockets()) {
globalConfig.SteamProtocols &= ~ProtocolTypes.WebSocket;
if (globalConfig.SteamProtocols == 0) {