Commit Graph

93 Commits

Author SHA1 Message Date
Łukasz Domeradzki
8618b01800 Fix for edge case of MatchableTypes being empty
Thanks @ezhevita
2025-09-08 23:17:23 +02:00
Łukasz Domeradzki
a0401a3962 Improve efficiency of MatchActively
Trade hold duration check made sense, but back when we were fetching inventories ourselves. Now, it's much better to find match first, as we have the full data loaded, and only if match is found, check user next.
2025-07-17 13:40:35 +02:00
Łukasz Domeradzki
27562e52ef Respect LastAnnouncement fully in public listing
I don't recall why we needed that ShouldSendHeartBeats condition here before, it causes the routine to run always if the bot is currently not listed, which is unwanted e.g. if the server tells user to go away, or due to any other reason.
2025-06-14 21:10:00 +02:00
Łukasz Domeradzki
61f876480a General code cleanups 2025-03-31 00:06:05 +02:00
Łukasz Domeradzki
9e207025c5 Happy new year 2025-01-05 02:40:56 +01:00
Łukasz Domeradzki
c2abbf0fc0 Misc optimization 2024-09-30 19:19:26 +02:00
Łukasz Domeradzki
773698a0d4 Closes #3264
THANKS @ezhevita
2024-08-05 02:37:50 +02:00
Łukasz Domeradzki
08907e8953 Emit format methods for ItemsMatcher, #3264 2024-08-05 02:15:58 +02:00
Łukasz Domeradzki
d3dbfc5e9e Closes #3262 2024-08-03 15:36:45 +02:00
Łukasz Domeradzki
ca3f3e0cab Resolve selected .NET 9 analyzer warnings 2024-06-25 00:18:38 +02:00
Łukasz Domeradzki
1841cde776 Misc code enhancements 2024-04-04 02:15:16 +02:00
Łukasz Domeradzki
9a02c79e0a Closes #3174 2024-03-27 19:55:07 +01:00
Archi
84ff83bbe2 Improve performance when matching multiple users 2024-03-18 13:52:12 +01:00
Archi
787bcc3546 Extract ItemsMatcher-exclusively parts out of ASF core, decrease dependency on DeepClone() 2024-03-18 13:45:13 +01:00
Archi
fd811d8cf4 Implement DeepClone() for asset and description 2024-03-18 12:44:29 +01:00
Archi
48a14136a9 Update all file headers, again 2024-03-17 02:35:40 +01:00
Archi
c9acbb7bf2 Big post-PR cleanup 2024-03-17 02:29:04 +01:00
Archi
f98a159799 File header update 2024-03-17 00:06:13 +01:00
Vita Chumakova
184232995d Inventory fetching through CM (#3155)
* New inventory fetching

* use new method everywhere

* Store description in the asset, add protobuf body as a backing field for InventoryDescription, add properties to description

* parse trade offers as json, stub descriptions, fix build

* formatting, misc fixes

* fix pragma comments

* fix passing tradable property

* fix convesion of assets, add compatibility method

* fix fetching tradeoffers

* use 40k as default count per request

* throw an exception instead of silencing the error
2024-03-16 23:57:25 +01:00
Archi
556f3fdac0 Misc 2024-02-28 21:40:54 +01:00
Łukasz Domeradzki
6b0bf0f9c1 Closes #3061 (#3145)
* Good start

* Misc

* Make ApiAuthenticationMiddleware use new json

* Remove first newtonsoft dependency

* Pull latest ASFB json enhancements

* Start reimplementing newtonsoft!

* One thing at a time

* Keep doing all kind of breaking changes which need to be tested later

* Add back ShouldSerialize() support

* Misc

* Eradicate remaining parts of newtonsoft

* WIP

* Workaround STJ stupidity in regards to derived types

STJ can't serialize derived type properties by default, so we'll use another approach in our serializable file function

* Make CI happy

* Bunch of further fixes

* Fix AddFreeLicense() after rewrite

* Add full support for JsonDisallowNullAttribute

* Optimize our json utilities even further

* Misc

* Add support for fields in disallow null

* Misc optimization

* Fix deserialization of GlobalCache in STD

* Fix non-public [JsonExtensionData]

* Fix IM missing method exception, correct db storage helpers

* Fix saving into generic databases

Thanks STJ

* Make Save() function abstract to force inheritors to implement it properly

* Correct ShouldSerializeAdditionalProperties to be a method

* Misc cleanup

* Code review

* Allow JSON comments in configs, among other

* Allow trailing commas in configs

Users very often add them accidentally, no reason to throw on them

* Fix confirmation ID

Probably needs further fixes, will need to check later

* Correct confirmations deserialization

* Use JsonNumberHandling

* Misc

* Misc

* [JsonDisallowNull] corrections

* Forbid [JsonDisallowNull] on non-nullable structs

* Not really but okay

* Add and use ToJson() helpers

* Misc

* Misc
2024-02-21 03:09:36 +01:00
Archi
348c43b259 Skip spamming ASFB with requests from unlicensed users
Check license prior to fetching inventory and sending data to ASFB, will also limit traffic on Steam side.
2024-02-04 22:28:59 +01:00
Archi
4a9e6f6cc6 Deprioritize bots with 1-game inventory
Those are usually stash accounts, and while we still want to match them, we can leave them only as a last resort if no other bots are available.

This decreases chance of hitting a bot that was just recently turned off or had its items traded away, as what usually happens with such accounts.
2024-01-11 16:46:45 +01:00
Archi
12c4b7e924 Apply frozen collections optimizations 2024-01-03 13:46:54 +01:00
Archi
be2e173404 Misc followup 2024-01-03 00:34:12 +01:00
Archi
3d503ed5ee Fix invalid heartbeats from inactive STM accounts
It was possible before if the inventory state was the same as previously announced, even if server purged the info long time ago. Also, add required logic for recovery if that happens regardless.
2024-01-03 00:23:27 +01:00
Archi
7f1ecdd585 Misc 2024-01-01 23:22:19 +01:00
Archi
d398e84f25 Misc 2024-01-01 23:00:58 +01:00
Archi
ac427ed1ec Misc match improvements 2024-01-01 22:58:54 +01:00
Archi
2bef94e3b4 Misc 2023-12-23 23:37:29 +01:00
Archi
cf94c417d2 Misc 2023-12-23 23:16:44 +01:00
Archi
e480aca8b2 Use inventories items deduplication logic aligned with ASFB 2023-12-22 00:18:52 +01:00
Archi
2befe20f76 Use set parts also as inventories request optimization 2023-12-21 23:46:42 +01:00
Archi
40ab1d848c .NET 8 code enhancements 2023-12-11 23:55:13 +01:00
Archi
27f965d4af Kill API keys entirely
Economy bans we can handle ourselves server-side
2023-12-03 21:49:05 +01:00
Archi
eff60bf307 Implement background announcements for ASF STM
This will be used exclusively by users with extraordinary large inventories, or if ASF backend will just be slower than usual.
2023-12-02 19:36:34 +01:00
Archi
c7546194f8 Add handling of points shop items, and skip them for announcements 2023-11-29 19:17:02 +01:00
Archi
aea9dee4ea Further decrease server load
We can keep inventory checksum before deduplication in the cache. If it's determined to be the same, then our inventory state didn't change, so it also doesn't make much sense to ask server for set parts and announcement.
2023-11-29 14:26:57 +01:00
Archi
a3270e4081 Misc optimization 2023-11-29 13:21:12 +01:00
Łukasz Domeradzki
36ae066c65 Closes #3073 (#3077)
* Initial implementation of announce with diff

* Add missing logic pieces

* Change in logic

* Fix checksums

* Add deduplication logic

* Update SetPart.cs

* Use standalone endpoint for diff

* Use different hashcode impl

* Update AssetForListing.cs

* Misc

* Push all the changes for this to finally work

* Use original index rather than self-calculated

ASFB makes some calculations based on index, it's better for us to have holes rather than hiding skipped items.

* Handle edge case of no assets after deduplication

* Remove dead code

* Address trim warnings

* Misc optimization
2023-11-29 00:08:16 +01:00
Archi
f2ff2f4929 Closes #3060 2023-11-14 20:01:29 +01:00
Archi
3f91b18a4d Refactor confirmations
Make it so the design actually follows what Steam gives us now. There is no need for standalone Confirmation object anymore, rather re-use what Steam gives us. Optimize parsing type, expose it as public API. Small breaking change in HandleConfirmations() action.
2023-06-29 22:34:26 +02:00
Archi
57ac7e2816 Bullet-proof against invalid Steam items 2023-06-04 16:39:16 +02:00
Archi
09ff465f4a Misc 2023-06-03 17:56:27 +02:00
Archi
cd8c9cf80e Closes #2908 2023-06-03 17:50:50 +02:00
Archi
def3bdf24a Bump limit slightly 2023-05-31 15:39:42 +02:00
Archi
b39b64e11f Add server-side limit of items also to client side 2023-05-31 15:32:56 +02:00
Jack Nolddor
db65ed7545 Minimize chances of TooManyOffersSent during MatchActively (#2904) 2023-05-28 12:50:37 +02:00
Archi
3006290170 Stop matching actively on disconnection 2023-05-23 14:28:30 +02:00
Archi
a557b62e0b Fix for accounts without SG timestamp
Initially I added check against zero as bullet-proofing for unexpected events, but some accounts actually report 0.

Assume 0 is older than needed, if we don't have information available, we shouldn't jump to conclusions.
2023-05-18 12:01:48 +02:00