Compare commits

..

10 Commits

Author SHA1 Message Date
JustArchi
5d21cd3452 Misc 2016-12-30 13:10:09 +01:00
JustArchi
b316224af3 Misc 2016-12-30 13:02:49 +01:00
JustArchi
c210480231 Fix default LootableTypes not being possible to remove 2016-12-30 13:01:02 +01:00
JustArchi
a44d097d4e Bump 2016-12-30 07:39:44 +01:00
JustArchi
df1e83130d Fix duplicating of LootableTypes in CG 2016-12-30 03:17:35 +01:00
JustArchi
2f1b6311ac Use HttpTimeout for WCF timeout 2016-12-29 10:40:35 +01:00
JustArchi
2c1127e57b Change default LoginID
Various bad scripts and other bots use LoginID of 0, so we will use LoginID of 1242, or whatever else, as long as it's static
2016-12-27 17:44:00 +01:00
JustArchi
9722059bb0 Don't crash on SteamDirectory failure 2016-12-27 16:18:42 +01:00
JustArchi
cb077a2c4a Add minutes to human-readable TimeSpan, #387 2016-12-27 16:00:21 +01:00
JustArchi
fb21b225bc Bump 2016-12-26 23:57:12 +01:00
8 changed files with 27 additions and 13 deletions

View File

@@ -43,7 +43,7 @@ namespace ArchiSteamFarm {
internal sealed class Bot : IDisposable {
private const ushort CallbackSleep = 500; // In miliseconds
private const byte FamilySharingInactivityMinutes = 5;
private const uint LoginID = 0; // This must be the same for all ASF bots and all ASF processes
private const uint LoginID = GlobalConfig.DefaultWCFPort; // This must be the same for all ASF bots and all ASF processes
private const ushort MaxSteamMessageLength = 2048;
internal static readonly ConcurrentDictionary<string, Bot> Bots = new ConcurrentDictionary<string, Bot>();
@@ -314,8 +314,13 @@ namespace ArchiSteamFarm {
// Normally we wouldn't need to do this, but there is a case where our list might be invalid or outdated
// Ensure that we always ask once for list of up-to-date servers, even if we have list saved
Program.ArchiLogger.LogGenericInfo("Initializing SteamDirectory...");
await SteamDirectory.Initialize(cellID).ConfigureAwait(false);
Program.ArchiLogger.LogGenericInfo("Done!");
try {
await SteamDirectory.Initialize(cellID).ConfigureAwait(false);
Program.ArchiLogger.LogGenericInfo("Done!");
} catch {
Program.ArchiLogger.LogGenericWarning("Could not initialize SteamDirectory, connecting with Steam Network might take much longer than usual!");
}
}
internal async Task LootIfNeeded() {

View File

@@ -72,7 +72,7 @@ namespace ArchiSteamFarm {
[JsonProperty(Required = Required.DisallowNull)]
internal readonly bool IsBotAccount = false;
[JsonProperty(Required = Required.DisallowNull)]
[JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)]
internal readonly HashSet<Steam.Item.EType> LootableTypes = new HashSet<Steam.Item.EType> { Steam.Item.EType.BoosterPack, Steam.Item.EType.FoilTradingCard, Steam.Item.EType.TradingCard };
[JsonProperty(Required = Required.DisallowNull)]

View File

@@ -35,11 +35,11 @@ namespace ArchiSteamFarm {
[SuppressMessage("ReSharper", "ConvertToConstant.Global")]
internal sealed class GlobalConfig {
internal const byte DefaultHttpTimeout = 60;
internal const ushort DefaultWCFPort = 1242;
private const byte DefaultFarmingDelay = 15;
private const byte DefaultMaxFarmingTime = 10;
private const ProtocolType DefaultSteamProtocol = ProtocolType.Tcp;
private const ushort DefaultWCFPort = 1242;
// This is hardcoded blacklist which should not be possible to change
internal static readonly HashSet<uint> GlobalBlacklist = new HashSet<uint> { 267420, 303700, 335590, 368020, 425280, 480730, 566020 };
@@ -50,7 +50,7 @@ namespace ArchiSteamFarm {
[JsonProperty(Required = Required.DisallowNull)]
internal readonly bool AutoUpdates = true;
[JsonProperty(Required = Required.DisallowNull)]
[JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)]
internal readonly HashSet<uint> Blacklist = new HashSet<uint>(GlobalBlacklist);
[JsonProperty(Required = Required.DisallowNull)]

View File

@@ -44,7 +44,7 @@ namespace ArchiSteamFarm {
internal const string ServiceDescription = "ASF is an application that allows you to farm steam cards using multiple steam accounts simultaneously.";
internal const string ServiceName = "ArchiSteamFarm";
internal const string StatisticsServer = "asf.justarchi.net";
internal const string VersionNumber = "2.2.0.1";
internal const string VersionNumber = "2.2.0.3";
internal static readonly Version Version = Assembly.GetEntryAssembly().GetName().Version;
}

View File

@@ -99,6 +99,15 @@ namespace ArchiSteamFarm {
result.Append(',');
}
if (timeSpan.Minutes > 0) {
result.Append(" " + timeSpan.Minutes + " minute");
if (timeSpan.Minutes > 1) {
result.Append('s');
}
result.Append(',');
}
if (timeSpan.Seconds > 0) {
result.Append(" " + timeSpan.Hours + " second");
if (timeSpan.Seconds > 1) {

View File

@@ -102,7 +102,7 @@ namespace ArchiSteamFarm {
// We use SecurityMode.None for Mono compatibility
// Yes, also on Windows, for Mono<->Windows communication
Security = { Mode = SecurityMode.None },
SendTimeout = new TimeSpan(0, 5, 0)
SendTimeout = new TimeSpan(0, 0, Program.GlobalConfig.HttpTimeout)
},
new EndpointAddress(URL)
);
@@ -126,7 +126,7 @@ namespace ArchiSteamFarm {
// We use SecurityMode.None for Mono compatibility
// Yes, also on Windows, for Mono<->Windows communication
Security = { Mode = SecurityMode.None },
SendTimeout = new TimeSpan(0, 5, 0)
SendTimeout = new TimeSpan(0, 0, Program.GlobalConfig.HttpTimeout)
},
string.Empty
);

View File

@@ -78,7 +78,8 @@ namespace ConfigGenerator {
[JsonProperty(Required = Required.DisallowNull)]
public bool IsBotAccount { get; set; } = false;
[JsonProperty(Required = Required.DisallowNull)]
[Category("\tAdvanced")]
[JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)]
public List<Steam.Item.EType> LootableTypes { get; set; } = new List<Steam.Item.EType> { Steam.Item.EType.BoosterPack, Steam.Item.EType.FoilTradingCard, Steam.Item.EType.TradingCard };
[Category("\tAccess")]

View File

@@ -53,8 +53,8 @@ namespace ConfigGenerator {
[JsonProperty(Required = Required.DisallowNull)]
public bool AutoUpdates { get; set; } = true;
[JsonProperty(Required = Required.DisallowNull)]
public List<uint> Blacklist { get; set; } = new List<uint>();
[JsonProperty(ObjectCreationHandling = ObjectCreationHandling.Replace, Required = Required.DisallowNull)]
public List<uint> Blacklist { get; set; } = new List<uint>(GlobalBlacklist);
[Category("\tDebugging")]
[JsonProperty(Required = Required.DisallowNull)]
@@ -126,7 +126,6 @@ namespace ConfigGenerator {
throw new ArgumentNullException(nameof(filePath));
}
Blacklist.AddRange(GlobalBlacklist);
Save();
}