This commit is contained in:
JustArchi
2017-09-26 05:59:41 +02:00
parent f2187c5ca1
commit 7ab4027d0a
2 changed files with 22 additions and 3 deletions

View File

@@ -101,9 +101,6 @@ namespace ArchiSteamFarm {
[JsonProperty(Required = Required.DisallowNull)]
internal readonly bool Statistics = true;
[JsonProperty(Required = Required.DisallowNull)]
internal readonly ProtocolTypes SteamProtocols = ProtocolTypes.Tcp;
[JsonProperty(Required = Required.DisallowNull)]
internal readonly EUpdateChannel UpdateChannel = EUpdateChannel.Stable;
@@ -125,6 +122,9 @@ namespace ArchiSteamFarm {
[JsonProperty(Required = Required.DisallowNull)]
internal ulong SteamOwnerID { get; private set; }
[JsonProperty(Required = Required.DisallowNull)]
internal ProtocolTypes SteamProtocols { get; private set; } = ProtocolTypes.Tcp;
// This constructor is used only by deserializer
private GlobalConfig() { }
@@ -174,6 +174,13 @@ namespace ArchiSteamFarm {
return null;
}
if (globalConfig.SteamProtocols.HasFlag(ProtocolTypes.WebSocket) && !OS.SupportsWebSockets()) {
globalConfig.SteamProtocols &= ProtocolTypes.WebSocket;
if (globalConfig.SteamProtocols == 0) {
globalConfig.SteamProtocols = ProtocolTypes.Tcp;
}
}
GlobalConfig result = globalConfig;
return result;
}