Commit Graph

108 Commits

Author SHA1 Message Date
JustArchi
b524758017 Code cleanup 2019-04-10 23:15:34 +02:00
JustArchi
d90a4017c8 Misc 2019-04-06 11:05:51 +02:00
JustArchi
92758eaf5b Misc screwup 2019-04-05 16:25:44 +02:00
JustArchi
91e495605b Port ArchiBot's WebBrowser client errors handling
First important change is for all requests sent by ASF. Across those 4 years of development I do not remember a single situation where retrying on 4xx status code brought any improvement, bad request has to be handled by us, access denied and not found won't disappear after retry, all other ones are rather unused. Therefore, it makes sense to skip remaining tries on 4xx errors and do not flood the service with requests that are very unlikely to change anything.
Second change is smaller one and it allows the consumer of WebBrowser to declare that he's interested in handling client error codes himself. This way he can add extra logic and appropriately react to them - ASF uses it in statistics module, where the listing can signal refusal to list due to e.g. outdated ASF version through 403. Previously this was treated on the same level as timeout, which wasn't optimal.
2019-04-05 16:24:02 +02:00
JustArchi
2c68e9f70e Further statistics improvements 2019-04-05 15:12:54 +02:00
JustArchi
d7ed1e3cd9 Misc 2019-04-05 14:29:35 +02:00
JustArchi
44c5bf4ad5 Misc 2019-04-04 17:56:38 +02:00
JustArchi
4920e28ac9 Misc string comparison optimizations 2019-04-02 20:43:17 +02:00
JustArchi
e6d07f5fd5 Misc 2019-03-03 16:22:25 +01:00
JustArchi
b677ba8202 Code/style cleanup 2019-02-16 17:34:17 +01:00
JustArchi
761b46065c Extra optimization of MatchActively 2019-02-04 03:09:20 +01:00
JustArchi
5ca35d0db4 Closes #1050 2019-02-02 22:54:23 +01:00
JustArchi
c594da5acb Add 2FA actions to ASF API 2019-01-23 17:58:37 +01:00
JustArchi
ceff02df22 Avoid matching the same set with the same user as well
In several cases ASF sent more than 1 trade considering the same items, this happens when we have more possible matches than just one but for the same card of other side.

Since we do not preserve the state (due to various reasons), the proper thing to do is to make set exclusive not only to user, but also to a single trade offer. At worst we'll just finish remaining part of it in the next round, if by any chance our trade offer is so huge it stumbles upon 255 items limit.
2019-01-18 03:31:36 +01:00
JustArchi
a48510b765 Open global database for public API 2019-01-17 20:43:45 +01:00
JustArchi
e1e9a9f457 Rider cleanup 2019-01-14 19:11:17 +01:00
JustArchi
3547f09464 Deconstruct KeyValuePairs globally
And add support for doing this in .NET Framework
2019-01-11 00:16:20 +01:00
JustArchi
192656cd02 Implement basic code contracts 2019-01-10 23:44:32 +01:00
Łukasz Domeradzki
0f2a816b92 Implement plugin system (#1020)
* Implement basic plugin system

* The dawn of new era

* Add plugins warning

* Move more members to PublicAPI

* Open commands for the plugins

* Add IBotHackNewChat

* Run plugin events in parallel

* Use properties in IPlugin

* Hook our custom plugin into CI to ensure it compiles

* Fix dotnet brain damage

* Add IBotsComparer

* Add code documentation

* Add IBotTradeOffer

* Add IBotTradeOffer example

* Add IBotTradeOfferResults

* Final bulletproofing

* Final renaming
2019-01-10 22:33:07 +01:00
JustArchi
3bbddcf723 Happy new year 🎉 2019-01-02 16:32:53 +01:00
JustArchi
6acb2d8ed4 Misc 2018-12-20 17:40:51 +01:00
JustArchi
4b7c631689 Misc 2018-12-20 17:22:50 +01:00
JustArchi
f8aa8babcf R# cleanup 2018-12-15 00:27:15 +01:00
JustArchi
c95653e72b Code review 2018-12-14 16:07:46 +01:00
JustArchi
4c0dc570fe Improve confirmations code 2018-12-12 21:17:12 +01:00
JustArchi
cd0962f14c Another logical fixes 2018-12-09 21:26:22 +01:00
JustArchi
c6c7f35f7e Make MatchActively take into account non-tradable items 2018-12-09 18:08:14 +01:00
JustArchi
9bfd26a3d8 Remove debug, misc 2018-12-08 01:45:13 +01:00
JustArchi
e61212a00f Rewrite active matching code for more fairness and robustness 2018-12-05 23:13:55 +01:00
JustArchi
dd1f567d80 Misc 2018-12-05 22:16:38 +01:00
JustArchi
f0a6907603 Make MatchActively more fair
This will also help with users not having anything interesting to offer
2018-12-05 19:13:46 +01:00
JustArchi
bb6276835f Code review, bugfixing, remove loot& command 2018-12-04 02:05:09 +01:00
JustArchi
577c2436d0 Misc 2018-12-03 05:21:12 +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
4582c40dbe Update timers 2018-12-03 00:59:01 +01:00
JustArchi
ec26a30ddf Misc 2018-12-03 00:45:09 +01:00
JustArchi
a385aa9ce5 When matching actively, take into account number of trades and items in each 2018-12-02 19:04:53 +01:00
JustArchi
3c7c3ccc58 Misc 2018-12-02 06:28:03 +01:00
JustArchi
def23e5ba9 Remove excessive debug from new feature
As it's not needed anymore
2018-12-02 06:24:36 +01:00
JustArchi
a64ce524aa Closes #954 2018-12-02 00:56:08 +01:00
JustArchi
ff2c0b3b79 Add semaphore to active matching
Very unlikely to be hit, but still
2018-11-29 21:05:40 +01:00
JustArchi
c9908add44 Implement better no-more-dupes logic 2018-11-29 19:21:41 +01:00
JustArchi
e1305f1855 Double the limits 2018-11-29 18:56:28 +01:00
JustArchi
0767f256e8 Fix build 2018-11-29 18:47:53 +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
a53bf0fd3d Expose cached SteamID to IPC 2018-09-23 02:17:17 +02:00
JustArchi
9534d2b9f0 R# cleanup 2018-09-08 00:46:40 +02:00