Skip to content

Commit

Permalink
More bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed Mar 6, 2016
1 parent a7f2dd9 commit 220a9ba
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
10 changes: 7 additions & 3 deletions ArchiSteamFarm/ArchiSteamFarm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="config\example.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="config\minimal.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
Expand All @@ -143,9 +149,7 @@
<Name>SteamAuth</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="config\" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>
Expand Down
7 changes: 1 addition & 6 deletions ArchiSteamFarm/Bot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,14 @@ private async Task<string> ResponseSendTrade() {
return "Trade couldn't be send because SteamMasterID is not defined!";
}

string token = null;
if (!string.IsNullOrEmpty(BotConfig.SteamTradeToken) && !BotConfig.SteamTradeToken.Equals("null")) {
token = BotConfig.SteamTradeToken;
}

await Trading.LimitInventoryRequestsAsync().ConfigureAwait(false);
List<SteamItem> inventory = await ArchiWebHandler.GetMyTradableInventory().ConfigureAwait(false);

if (inventory == null || inventory.Count == 0) {
return "Nothing to send, inventory seems empty!";
}

if (await ArchiWebHandler.SendTradeOffer(inventory, BotConfig.SteamMasterID, token).ConfigureAwait(false)) {
if (await ArchiWebHandler.SendTradeOffer(inventory, BotConfig.SteamMasterID, BotConfig.SteamTradeToken).ConfigureAwait(false)) {
await AcceptAllConfirmations().ConfigureAwait(false);
return "Trade offer sent successfully!";
} else {
Expand Down
6 changes: 5 additions & 1 deletion ArchiSteamFarm/BotConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ internal sealed class BotConfig {
[JsonProperty(Required = Required.DisallowNull)]
internal bool SendOnFarmingFinished { get; private set; } = false;

[JsonProperty(Required = Required.DisallowNull)]
[JsonProperty]
internal string SteamTradeToken { get; private set; } = null;

[JsonProperty(Required = Required.DisallowNull)]
Expand Down Expand Up @@ -230,6 +230,10 @@ internal static BotConfig LoadOldFormat(string path) {
botConfig.SteamParentalPIN = null;
}

if (botConfig.SteamTradeToken != null && botConfig.SteamTradeToken.Equals("null")) {
botConfig.SteamTradeToken = null;
}

return botConfig;
}

Expand Down
2 changes: 1 addition & 1 deletion ArchiSteamFarm/config/example.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"UseAsfAsMobileAuthenticator": false,
"ShutdownOnFarmingFinished": false,
"SendOnFarmingFinished": false,
"SteamTradeToken": "null",
"SteamTradeToken": null,
"SendTradePeriod": 0,
"GamesPlayedWhileIdle": [
0
Expand Down

0 comments on commit 220a9ba

Please sign in to comment.