This commit is contained in:
JustArchi
2017-09-26 06:13:34 +02:00
parent 7ab4027d0a
commit 06b6a7ce16
2 changed files with 7 additions and 0 deletions

View File

@@ -174,12 +174,15 @@ namespace ArchiSteamFarm {
return null;
}
ASF.ArchiLogger.LogGenericDebug("Checking for websockets support!");
if (globalConfig.SteamProtocols.HasFlag(ProtocolTypes.WebSocket) && !OS.SupportsWebSockets()) {
ASF.ArchiLogger.LogGenericDebug("Disabling websockets!");
globalConfig.SteamProtocols &= ProtocolTypes.WebSocket;
if (globalConfig.SteamProtocols == 0) {
globalConfig.SteamProtocols = ProtocolTypes.Tcp;
}
}
ASF.ArchiLogger.LogGenericDebug("Done!");
GlobalConfig result = globalConfig;
return result;

View File

@@ -50,9 +50,13 @@ namespace ArchiSteamFarm {
internal static bool SupportsWebSockets() {
try {
using (new ClientWebSocket()) {
ASF.ArchiLogger.LogGenericDebug("Inside using!");
new ClientWebSocket().Dispose();
ASF.ArchiLogger.LogGenericDebug("Returning true!");
return true;
}
} catch (PlatformNotSupportedException) {
ASF.ArchiLogger.LogGenericDebug("Returning false!");
return false;
}
}