diff --git a/ArchiSteamFarm/GlobalConfig.cs b/ArchiSteamFarm/GlobalConfig.cs index b95ca8b31..0127ee1b9 100644 --- a/ArchiSteamFarm/GlobalConfig.cs +++ b/ArchiSteamFarm/GlobalConfig.cs @@ -98,15 +98,15 @@ namespace ArchiSteamFarm { [JsonProperty(Required = Required.DisallowNull)] internal readonly EUpdateChannel UpdateChannel = EUpdateChannel.Stable; - [JsonProperty] - internal string WCFHost { get; set; } = "127.0.0.1"; - [JsonProperty(Required = Required.DisallowNull)] internal readonly ushort WCFPort = DefaultWCFPort; [JsonProperty(Required = Required.DisallowNull)] internal readonly EWCFProtocol WCFProtocol = EWCFProtocol.NetTcp; + [JsonProperty] + internal string WCFHost { get; set; } = "127.0.0.1"; + // This constructor is used only by deserializer private GlobalConfig() { } diff --git a/ArchiSteamFarm/WCF.cs b/ArchiSteamFarm/WCF.cs index f88975e56..76b117db5 100644 --- a/ArchiSteamFarm/WCF.cs +++ b/ArchiSteamFarm/WCF.cs @@ -165,15 +165,6 @@ namespace ArchiSteamFarm { ServiceHost = null; } - private static string GetUrlFromBinding(Binding binding) { - if (binding != null) { - return binding.Scheme + "://" + Program.GlobalConfig.WCFHost + ":" + Program.GlobalConfig.WCFPort + "/ASF"; - } - - ASF.ArchiLogger.LogNullError(nameof(binding)); - return null; - } - private static Binding GetTargetBinding() { Binding result; switch (Program.GlobalConfig.WCFProtocol) { @@ -205,6 +196,15 @@ namespace ArchiSteamFarm { return result; } + private static string GetUrlFromBinding(Binding binding) { + if (binding != null) { + return binding.Scheme + "://" + Program.GlobalConfig.WCFHost + ":" + Program.GlobalConfig.WCFPort + "/ASF"; + } + + ASF.ArchiLogger.LogNullError(nameof(binding)); + return null; + } + private void StopClient() { if (Client == null) { return; diff --git a/ConfigGenerator/GlobalConfig.cs b/ConfigGenerator/GlobalConfig.cs index cce83d176..446c87557 100644 --- a/ConfigGenerator/GlobalConfig.cs +++ b/ConfigGenerator/GlobalConfig.cs @@ -125,6 +125,10 @@ namespace ConfigGenerator { [JsonProperty(Required = Required.DisallowNull)] public ushort WCFPort { get; set; } = DefaultWCFPort; + [LocalizedCategory("Access")] + [JsonProperty(Required = Required.DisallowNull)] + public EWCFProtocol WCFProtocol { get; set; } = EWCFProtocol.NetTcp; + [SuppressMessage("ReSharper", "UnusedMember.Local")] private GlobalConfig() { } @@ -220,5 +224,11 @@ namespace ConfigGenerator { Stable, Experimental } + + internal enum EWCFProtocol : byte { + NetTcp, + BasicHttp, + WSHttp + } } } \ No newline at end of file