Commit Graph

301 Commits

Author SHA1 Message Date
JustArchi
86230bc3f1 Apply InventoryLimiterDelay to each request
As opposed to user-basis
2018-12-08 22:21:44 +01:00
JustArchi
6a909aa1b2 R# cleanup 2018-12-06 16:23:47 +01:00
Vital7
46e01eea0c Fix wallet code redeeming (#957)
* Fix wallet code redeeming

* Fix creating wallet

* More fixes

* More fixes

* Renaming variables

* More renaming thanks to valve

* Returning actual EPRD value instead of assumed

* Additional wallet check

* Steam gives Success code even on bad key
weird response but ok

* fix fucked up logic

* Fix steam fuckup by giving user a real response, not that one which is in steam imagination

* Remove amount property

* Fix logic fuckup + add some comments

* Update BGR logic for handling wallet keys

* Fix build
2018-12-06 16:06:44 +01:00
JustArchi
6e84424db4 Further memory optimizations
Now we'll never parse more than we absolutely need, also during neutrality check
2018-12-03 02:43:24 +01:00
JustArchi
555a74e2b6 Optimize memory usage 2018-12-03 01:24:33 +01:00
JustArchi
1beb08f823 Implement ETradingPreferences.MatchActively
This will probably need a lot more tests, tweaking and bugfixing, but basic logic is:

- MatchActively added to TradingPreferences with value of 16
- User must also use SteamTradeMatcher, can't use MatchEverything
- User must have statistics enabled and be eligible for being listed (no requirement of having 100 items minimum)

Once all requirements are passed, statistics module will communicate with the listing and fetch match everything bots:
- The matching will start in 1h since ASF start and will repeat every day (right now it starts in 1 minute to aid debugging).
- Each matching is composed of up to 10 rounds maximum.
- In each round ASF will fetch our inventory and inventory of listed bots in order to find MatchableTypes items to be matched. If match is found, offer is being sent and confirmed automatically.
- Each set (composition of item type + appID it's from) can be matched in a single round only once, this is to minimize "items no longer available" as much as possible and also avoid a need to wait for each bot to react before sending all trades.
- Round ends when we try to match a total of 20 bots, or we hit no items to match in consecutive 10 tries with 10 different bots.
- If last round resulted in at least a single trade being sent, next round starts within 5 minutes since last one, otherwise matching ends and repeats the next day.

We'll see how it works in practice, expect a lot of follow-up commits, unless I won't have anything to fix or improve.
2018-11-29 18:35:58 +01:00
JustArchi
6ef8093b19 Cleanup 2018-11-19 15:33:29 +01:00
Vital7
25dcccdb54 Add method to get trade token by using Steamkit (#947)
* Fix NullReferenceException in AcceptConfirmations()

* Add method to get trade token by using steamkit

* Remove AWH way to get token and caching it

* Accidentally removed some logic, fix
2018-11-19 15:16:35 +01:00
JustArchi
7bab5a73a3 Further session improvements 2018-11-10 07:23:04 +01:00
JustArchi
8825b46218 Misc 2018-11-06 23:28:55 +01:00
JustArchi
0cd396cebf Fix logic 2018-11-06 22:55:41 +01:00
JustArchi
242284559e Implement hybrid session logic
In ASF V3.0 and before, we had a very naive mechanism with session handling that used to work fine but send a lot of requests as we always had to check session before sending a request.

Since ASF V3.1 until now we used new mechanism which refreshed session only when it indeed got invalidated, which worked good until now, but apparently due to some changed at Valve it stopped redirecting appropriately in all POST requests and non-/my GET/HEAD ones.

Therefore, implement hybrid session logic whick works V3.1+ for /my requests, and V3.0- for everything else.
2018-11-06 21:41:59 +01:00
JustArchi
8e92f62c31 Misc 2018-11-05 18:23:41 +01:00
JustArchi
353e7e7b88 Confirmations logic improvements 2018-10-13 00:17:45 +02:00
JustArchi
2bf56c8fad Correct past workaround 2018-09-27 01:57:46 +02:00
JustArchi
8d1d0f89a3 Add workaround for https://github.com/SteamRE/SteamKit/issues/594 2018-09-26 23:38:28 +02:00
JustArchi
bd2e146bef SteamParentalPIN -> SteamParentalCode + fixes for @Aareksio 2018-09-22 15:50:11 +02:00
JustArchi
9534d2b9f0 R# cleanup 2018-09-08 00:46:40 +02:00
JustArchi
e8a0080ae0 Misc 2018-09-01 18:12:45 +02:00
Vital7
a08cc48fcd Fix ArgumentNullException in GetDigitalGiftCards() (#893) 2018-09-01 08:46:33 +02:00
JustArchi
c534c7df44 Misc 2018-08-21 22:02:17 +02:00
Vital7
ca9a3458fb Autoaccepting wallet gift cards (#885)
* Add accepting of wallet gift cards

* Split function by two, move bot-related parts to Bot.cs, better xpath

* Remove unneccessary warning

* Forgot to remove beginning chars

* Request data to separate variable, session request in GetDigital..., variable renaming

* Modify XPath a bit to make it more understandable

* Move substring call further, length checking

* Implement semaphore and queue

* Fix typo

* SessionID comment, entries are in alphabetical order

* Add a few spaces to xpath

* Logging: warning -> error

* Dispose GiftCardsSemaphore

* General formatting fixes

* Final formatting fixes, HandledGifts check

* AcceptGifts config value handling

* Handling 0 in function argument
2018-08-20 03:33:09 +02:00
JustArchi
c33c1adf06 Misc 2018-08-19 19:26:41 +02:00
JustArchi
1b8e029281 Misc 2018-08-19 19:24:04 +02:00
JustArchi
13e835c3b7 Code cleanup 2018-08-19 14:37:23 +02:00
JustArchi
16d002f99b Misc code cleanup 2018-07-27 04:52:14 +02:00
JustArchi
ca0d6575d8 Packages update 2018-07-11 16:31:46 +02:00
JustArchi
e48d830dda Misc 2018-07-04 19:24:44 +02:00
JustArchi
507f6f0775 Closes #832 2018-07-04 19:13:51 +02:00
JustArchi
4f833c8fc7 ArchiBoT/ASF code unification 2018-06-27 21:18:54 +02:00
JustArchi
dfb90624e8 R# Code cleanup 2018-06-16 07:47:07 +02:00
JustArchi
47d575e82d Implement logic for dynamic VanityURL changing from ArchiBoT 2018-06-11 21:40:52 +02:00
JustArchi
b37530c0ff Misc 2018-06-10 02:43:24 +02:00
JustArchi
f596432f30 Misc 2018-06-10 02:34:11 +02:00
JustArchi
c181f2f41b ArchiBoT/ASF code unification
I'll laugh if changed order of args suddenly breaks stuff on Valve's end.

(just before questioning my own sanity)
2018-06-10 02:15:44 +02:00
JustArchi
d380a9ae6b ArchiBoT/ASF code unification 2018-06-10 01:51:03 +02:00
JustArchi
152ba0bdf2 Code review 2018-06-04 16:54:22 +02:00
JustArchi
316a6af338 Misc 2018-05-30 05:23:44 +02:00
JustArchi
bc8dde4cba Misc 2018-05-30 04:57:43 +02:00
JustArchi
589ff5dce4 Fix parental unlock 2018-05-27 04:48:09 +02:00
JustArchi
4915baa7cf Improve requests utilizing absolute profile URL
In very rare case it's possible that this request could be executed when we don't have SteamID initialized.
2018-05-20 14:42:48 +02:00
JustArchi
ed2a068c51 Cleanup after #794
@vital7

Steam.cs:
- Add missing constructor for json deserialization
- Change name into UserPrivacy since we use it for both request and response, no longer response only
- Move ECommentPermission one level above, it's not internal member of PrivacySettings
- Make UserPrivacy constructor accept PrivacySettings, since PrivacySettings is internal and not private.
- Make ECommentPermission underlying type of byte

ArchiWebHandler.cs:
- Put function in proper place alphabetically
- Cast CommentPermission to new underlying type of byte
- Remove mapping, AWH should not be in charge of correcting a caller, unless that caller can't be corrected earlier (e.g. direct Steam response). Since Bot is in charge of calling AWH, Bot should do the correction, not AWH.

Bot.cs:
- Change command to !privacy bot n,n,n,n,n,n, this makes it possible for mixing it with enum members (such as !privacy bot public,private,friendsonly,public,public), which would be preferred way of execution instead of cryptic numbers.
- Make appropriate mapping between general and comments, since userspace is in charge of that.
- Add comments and correct creating UserPrivacy object.
- Make the default option private and let user skip extra options if he wants to edit e.g. only profile to public.

Apart from that, general error handling and a lot of other misc fixed, including renaming NonZeroResponse to NumberResponse, which makes more sense.
2018-05-19 20:50:26 +02:00
Vital7
9b7dfd065d Change privacy settings feature (#794)
* Change privacy settings feature

* Fixes

* Little fix

* More fixes

* Fix little fuckup
2018-05-19 19:52:14 +02:00
JustArchi
8b44abb31f Add workaround for Steam profile bug
This is the most ridiculous code I've ever written, God forgive me.
2018-05-12 20:21:52 +02:00
JustArchi
acda39ca7f Move Steam store to https
Hopefully it's ready this time, thanks Valve!
2018-05-09 05:34:08 +02:00
JustArchi
fce94c3fa4 Add proxy support
https://www.youtube.com/watch?v=g54aPmNjMM4
2018-05-09 05:31:48 +02:00
JustArchi
49eeceeb2f Misc 2018-04-29 23:58:18 +02:00
JustArchi
475162b697 Misc 2018-04-13 15:39:39 +02:00
JustArchi
87030ea11e Allow to queue requests before their completion, but no more than WebBrowser.MaxConnections 2018-04-13 09:49:54 +02:00
JustArchi
52ac922e97 Misc 2018-04-13 09:19:10 +02:00