Commit Graph

441 Commits

Author SHA1 Message Date
JustArchi
377df12924 Resolve CA1308 2021-05-07 16:30:57 +02:00
JustArchi
04ff460d69 Resolve CA1307 2021-05-07 15:59:06 +02:00
JustArchi
9a8a61e111 Resolve CA1054 2021-05-06 22:50:59 +02:00
JustArchi
b6772b9b1e Resolve CA1034 2021-05-06 20:16:06 +02:00
JustArchi
65dc5def01 Resolve CA1002 2021-05-06 18:26:29 +02:00
JustArchi
3903ef0dfb Misc 2021-05-06 18:07:01 +02:00
JustArchi
efec44e593 R# code improvements & cleanups 2021-04-11 00:33:32 +02:00
JustArchi
835611547f Mist optimization
No need to initialize assetIDs if inventory is empty. Also we know exact amount of items this way.
2021-02-20 23:49:05 +01:00
JustArchi
400b19d190 Further remove restrictions 2021-01-04 17:59:59 +01:00
JustArchi
4700ed2706 Further code cleanup 2021-01-04 17:42:31 +01:00
JustArchi
3756a62eac Misc 2021-01-04 00:58:52 +01:00
JustArchi
aa372d020b Misc 2021-01-04 00:56:27 +01:00
JustArchi
df527b03e0 Closes #2116 2021-01-04 00:26:05 +01:00
JustArchi
45a5fec95a Happy 2021
And let's hope it'll be better than 2020
2021-01-03 22:24:22 +01:00
JustArchi
34c5f5cf8b Closes #2012 2020-12-18 22:06:15 +01:00
JustArchi
6265aa7271 Misc code improvements 2020-12-05 20:27:10 +01:00
JustArchi
b712706149 Remove no-longer-needed casts after C# compiler got smarter 2020-12-02 23:50:49 +01:00
JustArchi
82ff7762f2 Convert possible substring calls to string ranges 2020-12-02 23:45:20 +01:00
JustArchi
74a30a8215 Make GetOwnedGames display also profile-limited games 2020-11-22 18:16:32 +01:00
Vitaliy
3ac04c6aaf Fix parsing tags in GetActiveTradeOffers (#2060)
* Fix parsing tags in GetActiveTradeOffers

* Accept empty values in Tag constructor

* Throw on null value in constructor

* Fix mindless copypaste
2020-11-21 15:42:19 +01:00
JustArchi
e82560259b Final code cleanup 2020-11-14 22:37:00 +01:00
JustArchi
47b42d6fc0 More code cleanups 2020-11-11 19:51:52 +01:00
Łukasz Domeradzki
35f4651ed6 .NET 5.0 (#1999)
* Initial work

* Fix CIs

* Fix warnings

* Update .travis.yml

* Update dockerfiles

* Update libraries to .NET 5.0

* Misc

* Remove workaround for #1812

* Update cc.sh

* CI updates

* CI updates

* Update .travis.yml
2020-11-10 23:22:57 +01:00
Vitaliy
93cd30f820 Add itemsPerTrade argument (#2011)
* Add itemsPerTrade argument

* Validate parameter, add to Actions.SendInventory

* Add check, fix merge
2020-10-21 21:41:09 +02:00
JustArchi
4b00be7f66 Misc 2020-10-21 18:49:49 +02:00
JustArchi
25e549b7e2 Code cleanup after #2004 2020-10-21 18:48:13 +02:00
Sebastian Göls
1f8b68f5ee Implement #852 (#2004)
* Update Actions.cs, Bot.cs, and BotConfig.cs

* First round of refactoring

* Check all badge pages

* Update Bot.cs

* Make sure multiple pages of badges work with foil badges and Make item selection algorithm work with all kinds of amount values we could get from Valve

* Change order of params in Actions.SendInventory(...), Cache amount of cards for game ids, Count card elements on page when fetching card count per game, Calculate items to send for all games in parallel

* Add unit tests

* Make sure only one real app id and one asset type are present while computing cards to send and Test it

* Update ArchiWebHandler.cs

* Update Bot.cs

* Fix iteration over badge pages

* Update Bot.cs

* Make stackable item stacks smaller if possible

* Simplify code based on changing stack size of stackable items and Adapt tests

* Consider only cards of the same rarity to be of one set and Add handling of already crafted level 5 badges

* Implement feedback

* Update Bot.cs

* Update Bot.cs

* Implement feedback from review

* Adapt tests

* Improve XPath efficiency

* Check real result for additional values in unit tests

* Implement feedback

* Add additional test combining classID, type and rarity

* Make collections readonly wherever you can

* Optimize misc. code and Add SetTypesToComplete to BotConfig

* Throw exception if we have more card types than cards per set

* Remove SendSetsOnCompleted and Make CompleteTypesToSend empty per default

* Fix existing unit tests and add new ones due to new exception

* Please nitpicky Archi

* Update Bot.cs

* Change expected exception type

* Make appID constants local

* Update Bot.cs and BotConfig.cs

* Do as JetBrains Rider says

* Only fetch card count for badge if we have cards for it

* Improve naming and fix handling of URIs for foil badges

* Add Bot.LoadCardsPerSet(...), Bot.GetItemsForFullSets(...) and Trading.GetInventorySets(...) to public API

* Let AWH do its job

* Make Bot.GetPossiblyCompletedBadgeAppIDs() part of public API as well
2020-10-21 18:41:20 +02:00
Vitaliy
78c21c7b29 Fix wallet code redeeming (#1993)
* Fix wallet code redeeming

* Remove trailing slash
2020-09-28 00:27:27 +02:00
JustArchi
d4345a1a16 Closes #1964 2020-09-13 21:43:25 +02:00
JustArchi
d2f242f368 Closes #1958 2020-09-08 16:41:36 +02:00
JustArchi
b3d476dea4 Round 2 of nullable checks 2020-08-23 20:45:24 +02:00
JustArchi
f99043db30 Closes #1832 2020-08-23 19:24:10 +02:00
Łukasz Domeradzki
9fc1ea65a5 Closes #1543 (#1944)
* Start working on nullable checks

help me

* Update GlobalConfig.cs

* Finish initial fixup round

* nullability code review
2020-08-22 21:41:01 +02:00
JustArchi
97e5969362 Closes #1891 2020-07-10 00:28:46 +02:00
JustArchi
0ce04415ea Rewrite HasPublicInventory() from AWH to AH
Feels good man
2020-07-04 23:43:49 +02:00
JustArchi
bdf924918e Also set initialized to false at session check
Even if refresh doesn't happen, it's still not initialized
2020-06-26 14:40:09 +02:00
JustArchi
f0401f2b47 Reset Initialized back to false on session refresh trigger
Otherwise we might get sessionID being null in a very tiny window between Steam invalidating it in our cookie container and ASF not yet having the new one
2020-06-26 14:22:58 +02:00
JustArchi
d5c55407b3 Misc 2020-06-26 10:57:11 +02:00
Vitaliy
d13da54dab Fix getting privacy settings (#1866)
* Fix getting privacy settings

* Cleanup

* Misc
2020-06-26 10:52:06 +02:00
JustArchi
56f4604819 Misc 2020-06-22 16:43:02 +02:00
JustArchi
8206dff4c1 Slightly improve session refresh
Previous solution of assuming that session is valid for at least N amount of seconds is pretty optimistic, too optimistic for real usage, instead, we won't assume anything like that and force every request to go through session refresh, but at the same time limit session refresh checks to just one at a time - if additional requests asked for session refresh, they'll use already-calculated value.

This way sending 100 requests at once won't always trigger 100 session refreshes but most likely around 2-3, while still allowing ASF to check session refresh with every request, if deemed necessary (due to delay between session checks
2020-06-22 16:40:49 +02:00
JustArchi
aa1fc829b7 Misc 2020-06-21 00:15:06 +02:00
JustArchi
cb6c5e2de2 Make it possible for WebBrowser to post custom data
While this isn't required for ASF (at least right now), it'll allow plugins to use ASF's WebBrowser for sending e.g. json to third-party endpoints.
2020-06-06 16:34:20 +02:00
JustArchi
d9355ceab0 Unify NumberResponse as EResultResponse
Since it uses a number, very likely it is indeed EResult under the hood, and not just a boolean written as 0 and 1.
2020-06-03 16:52:08 +02:00
JustArchi
01482e8dd0 Misc 2020-05-21 22:47:23 +02:00
JustArchi
6c22724835 Implement OS-wide, cross-process semaphores for ASF instances
Distinction is preserved on webproxy basis (even for LoginLimiter which shouldn't work like that)

Addresses crucial part of #1798
2020-05-20 22:01:29 +02:00
JustArchi
5db6df045c When registering API key for ASF usage, signalize it in the domain name
This way user knows it's us who generated it, even though other people may access it as well
2020-05-05 20:14:08 +02:00
JustArchi
8e5735726b Misc 2020-05-04 15:31:35 +02:00
JustArchi
1d92dbe57f Convert error to warning 2020-04-18 19:23:07 +02:00
JustArchi
4b4b323164 R# code improvements 2020-04-18 16:54:57 +02:00