Commit Graph

126 Commits

Author SHA1 Message Date
ArchiBot
92a946c1cb Automatic translations update 2021-12-12 02:12:16 +00: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
0eab358af9 Plugins breaking: Convert all synchronous interface methods to Task
Okay, I wish we had uncovered it earlier as part of V5.2 but it has bitten us in the back just now, so I'm addressing it as part of monthly cycle instead.

Previously used void methods did not allow async operations in plugins in a "nice way". If plugin didn't require synchronization with the ASF and just minded its own business, it wasn't half bad as it could use async void signature. However, if plugin by any chance had to do something BEFORE ASF continued with the rest of the logic, it had to explicitly leave non-async void signature and call its async-capable stuff in synchronous manner (usually with Wait() or .Result), which is vastly suboptimal.

This was visible even in our STD plugin, which previously had (and still has) GlobalCache initialization in OnASFInit(). If that cache initialization took a bit longer time, STD would hit InvalidOperationException() in OnLicenseList() callback as global cache didn't load yet while we were already long past OnASFInit().

Therefore, I've decided to make a breaking change for a very good reason - all previous methods were converted to tasks, which allows from plugin to do one of three things:

- If plugin is async and requires synchronization (like STD), it can declare itself as async await, and do its awaits as-needed, and ASF will wait for those.
- If plugin is truly synchronous (and not just a synchronous signature with awful Wait() or .Result, see above), it can simply return Task.CompletedTask and has exactly the same logic.
- Finally, if plugin calls some async stuff but doesn't need ASF synchronization, it can "offload" itself from it by calling e.g. ASF's Utilities.InBackground() with whole logic, while returning Task.CompletedTask from the main method. This will allow it to effectively do what async void previously did, by just hooking into the process without intention of slowing it down.

All in all I'm confident this approach, while a bit counter-intuitive at first, will result in better compatibility between ASF and the plugins, as if I wanted to fix my STD issue right now without that breaking change, I'd have to actually call .Result on my async global cache loader function, which is utterly stupid if we can fix ASF to do the right thing instead.

This "approach" can be commonly found in some other libs with similar to ASF's event-hook behaviour, e.g. Discord.Net.

You'll sadly need to do some method signature changes in all of your plugins, as the core OnLoaded() was also changed. See the ones I did in SteamTokenDumperPlugin.cs if you need a practical example, and see ExamplePlugin.cs if you need further explanation.
2021-12-08 16:52:27 +01:00
ArchiBot
a5cd6314e4 Automatic translations update 2021-11-28 02:07:25 +00:00
ArchiBot
ece06abbc7 Automatic translations update 2021-11-21 02:10:14 +00:00
Archi
c709d529c1 Closes #2455 2021-11-18 21:33:06 +01:00
Archi
62effc4af1 STD: Postpone registering updated app change numbers
This is important as we don't want to miss a depot, by moving it below we ensure that all depot tasks succeeded before we mark appIDs as "finished with"
2021-11-15 19:53:46 +01:00
Archi
260875da7e Use shared Random across ASF
This also removes PublicAPI of ASF's "shared random"
2021-11-11 19:34:21 +01:00
Archi
d46e532458 Code cleanup 2021-11-10 21:47:42 +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
ArchiBot
62704be1f3 Automatic translations update 2021-11-04 02:10:42 +00:00
Archi
eb876aa4d1 Warn about incomplete translation also in our plugin 2021-10-24 18:40:26 +02:00
ArchiBot
d340dc57f3 Automatic translations update 2021-10-24 02:10:15 +00:00
ArchiBot
8eade49343 Automatic translations update 2021-10-14 02:10:42 +00:00
Łukasz Domeradzki
965d3050a5 Address new Rider inspections (EAP) (#2418) 2021-10-01 01:21:09 +02: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
ArchiBot
383868351d Automatic translations update 2021-09-22 02:10:42 +00:00
Archi
c60d413a70 Misc 2021-09-15 12:43:25 +02:00
ArchiBot
6aaec3ce8f Automatic translations update 2021-09-15 02:08:29 +00:00
ArchiBot
9c0582452f Automatic translations update 2021-09-12 02:09:51 +00:00
ArchiBot
84d4fd422a Automatic translations update 2021-08-30 02:07:09 +00:00
ArchiBot
f9391e493b Automatic translations update 2021-08-29 02:07:53 +00:00
ArchiBot
3f426546c2 Automatic translations update 2021-08-24 02:06:55 +00:00
ArchiBot
2e1694c65d Automatic translations update 2021-08-23 02:06:54 +00:00
Archi
3dec189e14 Misc 2021-08-20 14:31:12 +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
Archi
13ea9df707 Fix STD plugin for generic-netf
It failed because it couldn't find immutable collections, ASF doesn't have it either, it doesn't look like it's needed to satisfy the compiler anymore (SK2 includes it through protobuf-net)
2021-07-30 16:09:05 +02:00
renovate[bot]
97a5a94220 Update dependency SteamKit2 to v2.4.0-Alpha.3 (#2392)
* Update dependency SteamKit2 to v2.4.0-Alpha.3

* Address SK2 breaking changes

Co-authored-by: Renovate Bot <bot@renovateapp.com>
Co-authored-by: Archi <JustArchi@JustArchi.net>
2021-07-30 15:33:29 +02:00
ArchiBot
677fcfa198 Automatic translations update 2021-07-30 02:14:21 +00:00
ArchiBot
98c18756c5 Automatic translations update 2021-07-26 02:11:26 +00:00
ArchiBot
a875c2377f Automatic translations update 2021-07-25 02:09:17 +00:00
Archi
37689f4de6 Misc XML cleanup 2021-07-15 23:06:16 +02:00
ArchiBot
dd8fd251cc Automatic translations update 2021-07-14 02:08:07 +00:00
ArchiBot
6aef4ad5ed Automatic translations update 2021-07-13 02:10:08 +00:00
Archi
d479eb9f97 Address Rider EAP inspections/cleanup 2021-07-12 21:45:17 +02:00
Archi
2dc2202e30 Misc 2021-07-09 00:19:39 +02:00
Archi
aa6b9b9bea STD: Add support for new custom swagger attributes 2021-06-30 23:12:15 +02:00
ArchiBot
f9dd40c2c6 Automatic translations update 2021-06-19 02:16:40 +00:00
ArchiBot
e23cfb3a9c Automatic translations update 2021-06-14 02:16:34 +00:00
ArchiBot
eefc5a2b07 Automatic translations update 2021-06-12 02:11:17 +00:00
ArchiBot
977dfc55cc Automatic translations update 2021-06-10 02:22:27 +00:00
ArchiBot
36a7e1f1fe Automatic translations update 2021-06-06 02:37:40 +00:00
ArchiBot
1ca6debef5 Automatic translations update 2021-06-04 02:59:47 +00:00
Archi
535e6fb334 STD: Explicitly refuse to initialize upon any config parsing issue 2021-06-03 12:58:15 +02:00
Archi
31a06a8af3 STD: Fix wrong logic interpreting custom config 2021-06-03 11:51:11 +02:00