Commit graph

48 commits

Author SHA1 Message Date
Łukasz Domeradzki
afa602f940
Resolve remainings of CA1863 2024-08-05 02:45:53 +02:00
Łukasz Domeradzki
203dc6daf6
Misc 2024-05-19 21:36:37 +02:00
Łukasz Domeradzki
e895850f17
Misc 2024-05-19 21:35:20 +02:00
Archi
48a14136a9
Update all file headers, again 2024-03-17 02:35:40 +01:00
Archi
f98a159799
File header update 2024-03-17 00:06:13 +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
119caebfa8
Deprecate CachedAccessToken, move to Bot.AccessToken instead
Thanks to @xPaw findings, it seems that access token we get on logon can be used for all functionality we require in ASF. This means we no longer need to fetch the one from points shop in AWH and can safely remove that.

Since access token in AWH is public API, this commit:
- Makes Bot.AccessToken public API.
- Deprecates ArchiWebHandler.CachedAccessToken with intention of removal in the next version. Until then, it resolves to Bot.AccessToken internally so all plugins can keep working during transition period.
- Deprecates Utilities.ReadJwtToken(), probably nobody else than me used it, just switch over to Utilities.TryReadJwtToken(), much better design.
- Reverts ArchiCacheable parts back to stable API, as we no longer need the breaking change done in #3133
2024-01-29 18:42:21 +01:00
Archi
2e0771b8d9
Closes #3133
After investigation, it turns out that the token actually has correct scope (THANK GOD), it's the fact that Valve started issuing those on much shorter notice than our cache.

Up until now, we played it smartly by assuming cached access token should be valid for at least 6 hours, since every time we visited the page, we got a new token that was valid for 24h since issuing. This however is no longer the case and Valve seems to recycle the same token for every request now, probably until we get close to its expiration. This also means that with unlucky timing, we might be trying to use access token that has expired already even for up to 6 more hours, which is unwanted and causes all kind of issues, with 403 in trade offers being one of them.

I could make stupid solution and cache token for shorter, e.g. 1 minute, but instead I did 200 IQ move and rewrote the functionality in a way to actually parse that token, its validity, and set the cache to be valid for a brief moment before the token actually expires. This way, we're not only more efficient (we can cache the token even for 24h if needed), but we're also invalidating it as soon as it goes out of the scope.
2024-01-29 17:53:46 +01:00
Sebastian Göls
dbf7148fbe
Happy new year! (#3121)
Co-authored-by: Sebastian Göls <sebastian.goels@salvagninigroup.com>
2024-01-08 11:33:28 +01:00
Archi
12c4b7e924
Apply frozen collections optimizations 2024-01-03 13:46:54 +01:00
Archi
da2fd37aa1
Make STD work also in on-demand mode 2023-12-05 01:43:55 +01:00
Archi
8d1d508fe5
Use ASF's global database for STD package access tokens 2023-12-05 00:05:16 +01:00
Archi
adbf0748f8
Closes #3066 2023-11-14 21:10:35 +01:00
Łukasz Domeradzki
b34f18497d
.NET 8 (#3005)
* Initial .NET 8

* Make it compile in release mode ignoring warnings for now

* First round of improvements

* Second round of improvements

* Third round of improvements

* Use new throws

* Fix .NET Framework, YAY, thanks madness!

Madness devs are awesome

* Misc

* Misc

* AF_NETLINK might be required for some http calls

No clue why

* Fix service files

Doesn't do what it should

* Update CardsFarmer.cs

* New improvements

* Address feedback

* Misc

* Misc

* Misc refactor

* Misc
2023-11-14 19:12:33 +01:00
Archi
2a231982ed
Misc 2023-10-30 22:44:07 +01:00
Archi
8bb48d829e
STD: Add support for KnownDepotIDs 2023-01-23 12:08:30 +01:00
Archi
a01ea00873
STD: Add 500ms delay between depot key requests 2023-01-21 21:16:01 +01:00
JustArchi
e6579e4355
Enhance STD plugin errors
- 403: Stop submission for now
- 409: Purge cache and continue
2022-10-10 22:38:35 +02:00
Sebastian Göls
b8bfcd5df3
Simplify LogNullError calls (#2554)
* Remove necessity of nameof(...) in calls to ArchiLogger.LogNullError(...)

* Upgrade Madness

* Upgrade Madness

* Split up compound null log statements
2022-04-13 23:16:36 +02:00
Archi
e00ee2cc55
Misc 2022-02-26 01:26:13 +01:00
Archi
8893fc8e70
Misc 2022-02-26 01:21:37 +01:00
Archi
1809028c77
Rider cleanup 2022-01-06 20:22:38 +01:00
Archi
225003c5d1
Try to fix netf, once again into the breach 2021-12-12 01:44:17 +01:00
Archi
4f598d5c8f
Latest Rider cleanups 2021-12-12 01:12:54 +01:00
Archi
e259f9e32f
STD: Misc 2021-12-11 15:17:28 +01:00
Archi
c2cabfba49
STD: Add additional safeguards against depot keys corruption 2021-12-11 15:11:35 +01:00
Archi
c709d529c1
Closes #2455 2021-11-18 21:33:06 +01:00
Archi
1e6ab11d9f
Use file-scoped namespaces 2021-11-10 21:23:24 +01:00
Sebastian Göls
fb4eb0b03a
Use Madness via global usings (#2447)
* Use Madness via global usings

* Apply feedback

* Disable false positive null warning
2021-11-09 16:33:09 +01:00
Archi
7e9e90764b
Use static lambdas wherever possible
Thanks Rider
2021-09-27 21:33:52 +02:00
Archi
f2d3a2a894
Use string interpolation wherever possible
Majority of cases still need to go through string.Format() due to localization requirements
2021-09-27 19:59:00 +02:00
Archi
c60d413a70
Misc 2021-09-15 12:43:25 +02:00
Łukasz Domeradzki
9f281c6055
Embrace madness (#2394)
* Embrace madness

* Remove unused code

* Misc

* Address Abry's note

* Update for Madness 0.3.0
2021-08-07 14:03:46 +02:00
JustArchi
d21d2473fe RuntimeCompatibility -> Compatibility 2021-05-08 01:43:08 +02:00
JustArchi
e60b54e402 Refactor EVERYTHING
Directories structure + namespaces relevant to them
2021-05-08 01:37:22 +02:00
JustArchi
04ff460d69 Resolve CA1307 2021-05-07 15:59:06 +02:00
JustArchi
ef52e076d3 Cleanup round 2021-05-06 20:28:25 +02:00
JustArchi
b6772b9b1e Resolve CA1034 2021-05-06 20:16:06 +02:00
JustArchi
9afbcee163 STD: Add feature to skip appIDs, packageIDs and depotIDs 2021-05-03 01:08:12 +02:00
JustArchi
9ed27b5f66 Finish STD localization 2021-04-25 23:44:47 +02:00
JustArchi
45a5fec95a Happy 2021
And let's hope it'll be better than 2020
2021-01-03 22:24:22 +01:00
JustArchi
e2c7671f00 STD: Perform Save() of GlobalCache in background
We don't need to slow down the process with I/O there, at all. ASF already handles its own database like that.
2021-01-03 22:02:24 +01:00
JustArchi
10381dfdba Add extra safeguard in STD against zeros 2020-11-21 17:07:18 +01:00
JustArchi
2d7979e9ee STD: Save information about submitted tokens/keys
This also allows us to resubmit the same app/package/depot upon token/key change, which didn't happen previously.
2020-11-21 13:54:09 +01:00
JustArchi
e82560259b Final code cleanup 2020-11-14 22:37:00 +01: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
d776e483cf Misc 2020-07-15 16:43:59 +02:00
JustArchi
2a43a87e08 Initial SteamTokenDumper upload 2020-06-13 12:08:21 +02:00