Skip to content

Commit

Permalink
Misc
Browse files Browse the repository at this point in the history
  • Loading branch information
JustArchi committed May 28, 2024
1 parent 668bf50 commit 1917c9d
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions ArchiSteamFarm.OfficialPlugins.Monitoring/TradeStatistics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,11 @@ internal sealed class TradeStatistics {
private readonly object Lock = new();

internal uint AcceptedOffers { get; private set; }

internal uint BlacklistedOffers { get; private set; }

internal uint ConfirmedOffers { get; private set; }

internal uint IgnoredOffers { get; private set; }

internal uint ItemsGiven { get; private set; }

internal uint ItemsReceived { get; private set; }

internal uint RejectedOffers { get; private set; }

internal void Include(ParseTradeResult result) {
Expand All @@ -49,25 +43,26 @@ internal void Include(ParseTradeResult result) {
lock (Lock) {
switch (result.Result) {
case ParseTradeResult.EResult.Accepted when result.Confirmed:
++ConfirmedOffers;
ConfirmedOffers++;

ItemsGiven += (uint) (result.ItemsToGive?.Count ?? 0);
ItemsReceived += (uint) (result.ItemsToReceive?.Count ?? 0);

goto case ParseTradeResult.EResult.Accepted;
case ParseTradeResult.EResult.Accepted:
++AcceptedOffers;
AcceptedOffers++;

break;
case ParseTradeResult.EResult.Rejected:
++RejectedOffers;
RejectedOffers++;

break;
case ParseTradeResult.EResult.Blacklisted:
++BlacklistedOffers;
BlacklistedOffers++;

break;
case ParseTradeResult.EResult.Ignored:
++IgnoredOffers;
IgnoredOffers++;

break;
}
Expand Down

0 comments on commit 1917c9d

Please sign in to comment.