Skip to content

Commit 639067d

Browse files
committed
More bugs slained
1 parent 03885ba commit 639067d

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

ArchiSteamFarm/ArchiSteamFarm.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<AssemblyName>ArchiSteamFarm</AssemblyName>
1212
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
1313
<FileAlignment>512</FileAlignment>
14+
<IsWebBootstrapper>false</IsWebBootstrapper>
1415
<PublishUrl>publish\</PublishUrl>
1516
<Install>true</Install>
1617
<InstallFrom>Disk</InstallFrom>
@@ -23,7 +24,6 @@
2324
<MapFileExtensions>true</MapFileExtensions>
2425
<ApplicationRevision>0</ApplicationRevision>
2526
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
26-
<IsWebBootstrapper>false</IsWebBootstrapper>
2727
<UseApplicationTrust>false</UseApplicationTrust>
2828
<BootstrapperEnabled>true</BootstrapperEnabled>
2929
</PropertyGroup>
@@ -39,14 +39,17 @@
3939
</PropertyGroup>
4040
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
4141
<PlatformTarget>AnyCPU</PlatformTarget>
42-
<DebugType>pdbonly</DebugType>
42+
<DebugType>none</DebugType>
4343
<Optimize>true</Optimize>
4444
<OutputPath>bin\Release\</OutputPath>
4545
<DefineConstants>
4646
</DefineConstants>
4747
<ErrorReport>prompt</ErrorReport>
4848
<WarningLevel>4</WarningLevel>
4949
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
50+
<DocumentationFile>
51+
</DocumentationFile>
52+
<Prefer32Bit>true</Prefer32Bit>
5053
</PropertyGroup>
5154
<ItemGroup>
5255
<Reference Include="HtmlAgilityPack, Version=1.4.9.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a, processorArchitecture=MSIL">

ArchiSteamFarm/ArchiWebHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ internal ArchiWebHandler(Bot bot, string apiKey) {
6262
}
6363

6464
internal void Init(SteamClient steamClient, string webAPIUserNonce, string vanityURL) {
65-
if (steamClient == null || steamClient.SteamID == null || string.IsNullOrEmpty(webAPIUserNonce) || string.IsNullOrEmpty(vanityURL)) {
65+
if (steamClient == null || steamClient.SteamID == null || string.IsNullOrEmpty(webAPIUserNonce)) {
6666
return;
6767
}
6868

ArchiSteamFarm/CardsFarmer.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,21 @@ internal async Task StartFarming() {
4444
// Find the number of badge pages
4545
HtmlDocument badgesDocument = await Bot.ArchiWebHandler.GetBadgePage(1).ConfigureAwait(false);
4646
if (badgesDocument == null) {
47+
Logging.LogGenericWarning(Bot.BotName, "Could not get badges information, farming is stopped!");
4748
return;
4849
}
4950

5051
var maxPages = 1;
5152
HtmlNodeCollection badgesPagesNodeCollection = badgesDocument.DocumentNode.SelectNodes("//a[@class='pagelink']");
5253
if (badgesPagesNodeCollection != null) {
53-
maxPages = (byte) (badgesPagesNodeCollection.Count / 2 + 1); // Don't do this at home
54+
maxPages = (badgesPagesNodeCollection.Count / 2) + 1; // Don't do this at home
5455
}
5556

5657
// Find APPIDs we need to farm
5758
List<uint> appIDs = new List<uint>();
5859
for (var page = 1; page <= maxPages; page++) {
60+
Logging.LogGenericInfo(Bot.BotName, "Checking page: " + page + "/" + maxPages);
61+
5962
if (page > 1) { // Because we fetched page number 1 already
6063
badgesDocument = await Bot.ArchiWebHandler.GetBadgePage(page).ConfigureAwait(false);
6164
if (badgesDocument == null) {
@@ -71,14 +74,14 @@ internal async Task StartFarming() {
7174
foreach (HtmlNode badgesPageNode in badgesPageNodes) {
7275
string steamLink = badgesPageNode.GetAttributeValue("href", null);
7376
if (steamLink == null) {
74-
page = maxPages; // Break from outer loop
75-
break;
77+
Logging.LogGenericWarning(Bot.BotName, "Couldn't get steamLink for one of the games: " + badgesPageNode.OuterHtml);
78+
continue;
7679
}
7780

7881
uint appID = (uint) Utilities.OnlyNumbers(steamLink);
7982
if (appID == 0) {
80-
page = maxPages; // Break from outer loop
81-
break;
83+
Logging.LogGenericWarning(Bot.BotName, "Couldn't get appID for one of the games: " + badgesPageNode.OuterHtml);
84+
continue;
8285
}
8386

8487
appIDs.Add(appID);

ArchiSteamFarm/Logging.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ limitations under the License.
2323
*/
2424

2525
using System;
26+
using System.Diagnostics;
2627
using System.Runtime.CompilerServices;
2728

2829
namespace ArchiSteamFarm {
@@ -49,10 +50,12 @@ internal static void LogGenericInfo(string botName, string message, [CallerMembe
4950
Log("[*] INFO: " + previousMethodName + "() <" + botName + "> " + message);
5051
}
5152

53+
[Conditional("DEBUG")]
5254
internal static void LogGenericDebug(string botName, string message, [CallerMemberName] string previousMethodName = "") {
5355
Log("[#] DEBUG: " + previousMethodName + "() <" + botName + "> " + message);
5456
}
5557

58+
[Conditional("DEBUG")]
5659
internal static void LogGenericDebug(string message, [CallerMemberName] string previousMethodName = "") {
5760
LogGenericDebug("DEBUG", message, previousMethodName);
5861
}

ArchiSteamFarm/Trading.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ internal Trading(Bot bot) {
3737
}
3838

3939
internal void CheckTrades() {
40+
Logging.LogGenericDebug("");
4041
if (ParsingTasks < 2) {
4142
ParsingTasks++;
4243
Task.Run(() => ParseActiveTrades());
@@ -87,7 +88,7 @@ private async Task ParseTrade(SteamTradeOffer tradeOffer) {
8788
}
8889

8990
if (!success) {
90-
Logging.LogGenericWarning(Bot.BotName, "Response to trade " + tradeID + " failed!");
91+
Logging.LogGenericWarning(Bot.BotName, "Response <accept: " + tradeAccepted + "> to trade " + tradeID + " failed!");
9192
}
9293

9394
if (tradeAccepted && success) {

0 commit comments

Comments
 (0)