mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 06:00:46 +00:00
HttpTimeout -> ConnectionTimeout
Since HttpTimeout started affecting WCF timeout as well, and now I'm about to add yet another responsibility to this, this should be renamed to ConnectionTimeout. Basically new HeartBeats() are cool, but user should have a direct way to configure the number of failed attempts allowed, as it can differ between stable and unstable networks, same like HttpTimeout. This change apart from renaming HttpTimeout makes HeartBeats depend on it, allowing ConnectionTimeout / 10 failed attempts, and giving ConnectionTimeout / 30 minutes for steam servers to respond to out connection attempt. Both divisions are rounded up. This should allow people with less unstable networks to get less clients being abandoned due to steam instability
This commit is contained in:
@@ -36,8 +36,8 @@ namespace ConfigGenerator {
|
||||
[SuppressMessage("ReSharper", "MemberCanBePrivate.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Global")]
|
||||
internal sealed class GlobalConfig : ASFConfig {
|
||||
private const byte DefaultConnectionTimeout = 60;
|
||||
private const byte DefaultFarmingDelay = 15;
|
||||
private const byte DefaultHttpTimeout = 60;
|
||||
private const byte DefaultMaxFarmingTime = 10;
|
||||
private const ProtocolType DefaultSteamProtocol = ProtocolType.Tcp;
|
||||
private const ushort DefaultWCFPort = 1242;
|
||||
@@ -56,6 +56,10 @@ namespace ConfigGenerator {
|
||||
[JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)]
|
||||
public List<uint> Blacklist { get; set; } = new List<uint>(GlobalBlacklist);
|
||||
|
||||
[LocalizedCategory("Debugging")]
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
public byte ConnectionTimeout { get; set; } = DefaultConnectionTimeout;
|
||||
|
||||
[JsonProperty]
|
||||
public string CurrentCulture { get; set; } = null;
|
||||
|
||||
@@ -75,10 +79,6 @@ namespace ConfigGenerator {
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
public bool Headless { get; set; } = false;
|
||||
|
||||
[LocalizedCategory("Debugging")]
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
public byte HttpTimeout { get; set; } = DefaultHttpTimeout;
|
||||
|
||||
[LocalizedCategory("Performance")]
|
||||
[JsonProperty(Required = Required.DisallowNull)]
|
||||
public byte IdleFarmingPeriod { get; set; } = 3;
|
||||
@@ -163,6 +163,27 @@ namespace ConfigGenerator {
|
||||
internal override void ValidateAndFix() {
|
||||
base.ValidateAndFix();
|
||||
|
||||
if (ConnectionTimeout == 0) {
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.ErrorConfigPropertyInvalid, nameof(ConnectionTimeout), ConnectionTimeout));
|
||||
ConnectionTimeout = DefaultConnectionTimeout;
|
||||
Save();
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.WarningConfigPropertyModified, nameof(ConnectionTimeout), ConnectionTimeout));
|
||||
}
|
||||
|
||||
if (FarmingDelay == 0) {
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.ErrorConfigPropertyInvalid, nameof(FarmingDelay), FarmingDelay));
|
||||
FarmingDelay = DefaultFarmingDelay;
|
||||
Save();
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.WarningConfigPropertyModified, nameof(FarmingDelay), FarmingDelay));
|
||||
}
|
||||
|
||||
if (MaxFarmingTime == 0) {
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.ErrorConfigPropertyInvalid, nameof(MaxFarmingTime), MaxFarmingTime));
|
||||
MaxFarmingTime = DefaultMaxFarmingTime;
|
||||
Save();
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.WarningConfigPropertyModified, nameof(MaxFarmingTime), MaxFarmingTime));
|
||||
}
|
||||
|
||||
switch (SteamProtocol) {
|
||||
case ProtocolType.Tcp:
|
||||
case ProtocolType.Udp:
|
||||
@@ -175,28 +196,6 @@ namespace ConfigGenerator {
|
||||
break;
|
||||
}
|
||||
|
||||
if (MaxFarmingTime == 0) {
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.ErrorConfigPropertyInvalid, nameof(MaxFarmingTime), MaxFarmingTime));
|
||||
MaxFarmingTime = DefaultMaxFarmingTime;
|
||||
Save();
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.WarningConfigPropertyModified, nameof(MaxFarmingTime), MaxFarmingTime));
|
||||
|
||||
}
|
||||
|
||||
if (FarmingDelay == 0) {
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.ErrorConfigPropertyInvalid, nameof(FarmingDelay), FarmingDelay));
|
||||
FarmingDelay = DefaultFarmingDelay;
|
||||
Save();
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.WarningConfigPropertyModified, nameof(FarmingDelay), FarmingDelay));
|
||||
}
|
||||
|
||||
if (HttpTimeout == 0) {
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.ErrorConfigPropertyInvalid, nameof(HttpTimeout), HttpTimeout));
|
||||
HttpTimeout = DefaultHttpTimeout;
|
||||
Save();
|
||||
Logging.LogGenericWarning(string.Format(CGStrings.WarningConfigPropertyModified, nameof(HttpTimeout), HttpTimeout));
|
||||
}
|
||||
|
||||
if (WCFPort != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user