mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 15:14:41 +00:00
Cleanup + missing CG bits
This commit is contained in:
parent
24350dcba5
commit
72141c53a3
3 changed files with 22 additions and 12 deletions
|
@ -98,15 +98,15 @@ namespace ArchiSteamFarm {
|
||||||
[JsonProperty(Required = Required.DisallowNull)]
|
[JsonProperty(Required = Required.DisallowNull)]
|
||||||
internal readonly EUpdateChannel UpdateChannel = EUpdateChannel.Stable;
|
internal readonly EUpdateChannel UpdateChannel = EUpdateChannel.Stable;
|
||||||
|
|
||||||
[JsonProperty]
|
|
||||||
internal string WCFHost { get; set; } = "127.0.0.1";
|
|
||||||
|
|
||||||
[JsonProperty(Required = Required.DisallowNull)]
|
[JsonProperty(Required = Required.DisallowNull)]
|
||||||
internal readonly ushort WCFPort = DefaultWCFPort;
|
internal readonly ushort WCFPort = DefaultWCFPort;
|
||||||
|
|
||||||
[JsonProperty(Required = Required.DisallowNull)]
|
[JsonProperty(Required = Required.DisallowNull)]
|
||||||
internal readonly EWCFProtocol WCFProtocol = EWCFProtocol.NetTcp;
|
internal readonly EWCFProtocol WCFProtocol = EWCFProtocol.NetTcp;
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
|
internal string WCFHost { get; set; } = "127.0.0.1";
|
||||||
|
|
||||||
// This constructor is used only by deserializer
|
// This constructor is used only by deserializer
|
||||||
private GlobalConfig() { }
|
private GlobalConfig() { }
|
||||||
|
|
||||||
|
|
|
@ -165,15 +165,6 @@ namespace ArchiSteamFarm {
|
||||||
ServiceHost = null;
|
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() {
|
private static Binding GetTargetBinding() {
|
||||||
Binding result;
|
Binding result;
|
||||||
switch (Program.GlobalConfig.WCFProtocol) {
|
switch (Program.GlobalConfig.WCFProtocol) {
|
||||||
|
@ -205,6 +196,15 @@ namespace ArchiSteamFarm {
|
||||||
return result;
|
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() {
|
private void StopClient() {
|
||||||
if (Client == null) {
|
if (Client == null) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -125,6 +125,10 @@ namespace ConfigGenerator {
|
||||||
[JsonProperty(Required = Required.DisallowNull)]
|
[JsonProperty(Required = Required.DisallowNull)]
|
||||||
public ushort WCFPort { get; set; } = DefaultWCFPort;
|
public ushort WCFPort { get; set; } = DefaultWCFPort;
|
||||||
|
|
||||||
|
[LocalizedCategory("Access")]
|
||||||
|
[JsonProperty(Required = Required.DisallowNull)]
|
||||||
|
public EWCFProtocol WCFProtocol { get; set; } = EWCFProtocol.NetTcp;
|
||||||
|
|
||||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||||
private GlobalConfig() { }
|
private GlobalConfig() { }
|
||||||
|
|
||||||
|
@ -220,5 +224,11 @@ namespace ConfigGenerator {
|
||||||
Stable,
|
Stable,
|
||||||
Experimental
|
Experimental
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal enum EWCFProtocol : byte {
|
||||||
|
NetTcp,
|
||||||
|
BasicHttp,
|
||||||
|
WSHttp
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue