Make it possible to run steam client with UDP

This commit is contained in:
JustArchi
2016-03-19 11:33:39 +01:00
parent 8a8ec29b41
commit 3597c8f138
3 changed files with 17 additions and 1 deletions

View File

@@ -186,7 +186,7 @@ namespace ArchiSteamFarm {
}
// Initialize
SteamClient = new SteamClient();
SteamClient = new SteamClient(Program.GlobalConfig.SteamProtocol);
if (Program.GlobalConfig.Debug && !Debugging.NetHookAlreadyInitialized && Directory.Exists(Program.DebugDirectory)) {
try {

View File

@@ -26,6 +26,7 @@ using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Sockets;
namespace ArchiSteamFarm {
internal sealed class GlobalConfig {
@@ -47,6 +48,9 @@ namespace ArchiSteamFarm {
[JsonProperty(Required = Required.DisallowNull)]
internal EUpdateChannel UpdateChannel { get; private set; } = EUpdateChannel.Stable;
[JsonProperty(Required = Required.DisallowNull)]
internal ProtocolType SteamProtocol { get; private set; } = ProtocolType.Tcp;
[JsonProperty(Required = Required.DisallowNull)]
internal ulong SteamOwnerID { get; private set; } = 0;
@@ -107,6 +111,17 @@ namespace ArchiSteamFarm {
return null;
}
// SK2 supports only TCP and UDP steam protocols
// Make sure that user can't screw this up
switch (globalConfig.SteamProtocol) {
case ProtocolType.Tcp:
case ProtocolType.Udp:
break;
default:
globalConfig.SteamProtocol = ProtocolType.Tcp;
break;
}
return globalConfig;
}

View File

@@ -2,6 +2,7 @@
"Debug": false,
"AutoUpdates": true,
"UpdateChannel": 1,
"SteamProtocol": 6,
"SteamOwnerID": 0,
"MaxFarmingTime": 10,
"IdleFarmingPeriod": 3,