Commit Graph

81 Commits

Author SHA1 Message Date
Archi
5abe69162d Revert "Revert "Remove obsolete ICustomMachineInfoProvider interface""
This reverts commit 19ffe6e761.
2023-06-25 12:54:40 +02:00
Archi
19ffe6e761 Revert "Remove obsolete ICustomMachineInfoProvider interface"
This reverts commit 9d837c15b3.
2023-06-25 12:53:42 +02:00
Archi
9d837c15b3 Remove obsolete ICustomMachineInfoProvider interface 2023-06-23 12:22:57 +02:00
Archi
0026e57e64 Misc doc 2023-05-18 12:24:48 +02:00
Archi
1d5bf32ec6 Remove default implementation from interface
Not supported on netf
2023-04-21 11:32:20 +02:00
Archi
1fb74346bd Make IWebInterface work on netf 2023-04-20 22:56:49 +02:00
Archi
55b8c8f0d4 Post-PR improvements 2023-04-20 22:24:38 +02:00
fazelukario
97da56d016 Implemented native web GUI support for plugins inside the ASF IPC. Closes #2876 (#2877)
* Implemented native web GUI support for plugins inside the ASF IPC

ref #2876

* calm down netframework

* less `#if`'s

* code optimization

* misc

* Code improvements

* Support nested paths

* Revert "Support nested paths"

This reverts commit 5d7d9ac6ae.

* Support for nested paths (no errors now I guess)

* better path naming

* fixed typos

* Use `HashSet<string>` instead of `List<string>`

* Code improvements

* Code improvements

* Code improvements

* Code improvements

* Code improvements

* Added support for overriding ASF-ui files

* Removed a modified file from pull request

* Added `IWebInterface`

* less `#if`'s

* Code improvements

* Code improvements

* Added license

* Code improvements

* Added default implementation of `IWebInterface`

* Code improvements:
*Use of `OfType<>` instead `Where` and casting.

* Code improvements:
*Null checking

* Removed useless code

* shut up `netf`

* Removed useless null check

* Code improvements:
*Misc: kvp deconstaction

* Added support for absolute path
2023-04-20 22:02:49 +02:00
Archi
a536a411dd Misc 2023-04-10 15:04:08 +02:00
Archi
067d478a76 Closes #2873 2023-04-10 14:55:35 +02:00
Sebastian Göls
0c125db118 Happy new year! (#2809) 2023-01-25 15:43:12 +01:00
Archi
14efac34aa Misc 2022-12-16 20:11:00 +01:00
Łukasz Domeradzki
98ef37e722 Extract PublicListing and MatchActively to a plugin, resurrect MatchActively (#2759)
* Start work on extracting remote communication

* ok

* Dockerfile fixes

* More fixes

* Prepare /Api/Announce and /Api/HeartBeat

* Decrease publish race conditions

* OK

* Misc

* Misc

* Misc

* Move Steam group part back to ASF core

* Finally implement match actively v2 core

* Update RemoteCommunication.cs

* Use single round exclusively, report inventories more often

* Use randomization when asking others for assetIDs

* Add support for license and crowdin

* Kill dead code

* Fix return type of inventories

* Fix responses for good

* Unify old backend with new

* Report whole inventory, always

Helps with optimization on the backend side in terms of inventory fetching

* Update RemoteCommunication.cs

* Determine index of each asset and tell server about it

* Update AnnouncementRequest.cs

* Fix ASF screwing up with the order

* Fix warnings

* Misc rename

* Final logging touches
2022-12-15 18:46:37 +01:00
JustArchi
604652c03d Make PluginsCore public 2022-07-16 18:00:42 +02:00
JustArchi
7b3ae25d58 Misc 2022-07-08 19:20:29 +02:00
JustArchi
06843ebf9f Misc 2022-07-08 19:16:58 +02:00
JustArchi
6ca395795c Move network group logic into plugins core
This will allow plugin creators to make use of network groups
2022-07-08 19:16:29 +02:00
JustArchi
0e5490cc3a Allow plugin creators to initialize their own limiters 2022-07-08 19:11:27 +02:00
Sebastian Göls
68e30b43c2 Use ArgumentNullException.ThrowIfNull when possible (#2591)
* Misc.

* Fix mistake
2022-05-26 13:29:12 +02:00
Archi
a2585ec8c9 Remove obsolete features 2022-02-04 14:46:09 +01:00
Archi
3e2951d1d0 Fix old IBotCommand plugin answers 2022-01-23 14:27:54 +01:00
Archi
dae6f9d328 Use newer syntax for Enum.IsDefined() 2022-01-23 01:37:43 +01:00
Łukasz Domeradzki
4258fed873 Closes #2500 (#2501)
* Start work on #2500

* Update Bot.cs

* Misc refactor

* Update Bot.cs

* Add fallback for older plugins

* Misc

* Apply feedback
2022-01-23 00:14:14 +01:00
Archi
bf4bb7225c More Rider cleanups 2022-01-06 20:37:00 +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
5d33bca611 Add IUpdateAware plugin interface 2021-12-08 19:48:59 +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
Archi
cdd35ad29d Address new trimming warnings 2021-11-19 22:54:26 +01:00
Archi
0673b2e298 Closes #2420 2021-11-18 23:44:49 +01:00
Archi
1e6ab11d9f Use file-scoped namespaces 2021-11-10 21:23:24 +01:00
Archi
7e9e90764b Use static lambdas wherever possible
Thanks Rider
2021-09-27 21:33:52 +02:00
Archi
dcacdd802c Optimize LoadAssemblies()
We can be smart about it and avoid loading the same assemblies twice
2021-07-04 18:33:24 +02:00
Archi
fe43aa6cb6 Convert UTF-8 BOM to files to UTF-8 2021-05-22 19:45:27 +02:00
JustArchi
e60b54e402 Refactor EVERYTHING
Directories structure + namespaces relevant to them
2021-05-08 01:37:22 +02:00
JustArchi
5a8e2720fa Hide info about loaded assemblies under debug option 2021-05-07 00:30:31 +02:00
JustArchi
b6772b9b1e Resolve CA1034 2021-05-06 20:16:06 +02:00
JustArchi
efec44e593 R# code improvements & cleanups 2021-04-11 00:33:32 +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
32a8f4bed4 Misc optimization
If we're starting from 0, pointless to ask plugins what they prefer.
2021-01-03 22:12:17 +01:00
JustArchi
cc1eb6bee2 Start saving LastChangeNumber in GlobalDatabase
Due to the fact that we're now dependent on PICS changes ourselves, we have to start saving our own LastChangeNumber in order to avoid invalidating cache every time.
2021-01-03 21:58:41 +01:00
JustArchi
34c5f5cf8b Closes #2012 2020-12-18 22:06:15 +01:00
JustArchi
d1ca1e9b2c Add a pre-container assembly verification for detecting failing plugins 2020-11-25 12:26:46 +01:00
JustArchi
e82560259b Final code cleanup 2020-11-14 22:37:00 +01:00
JustArchi
6a811008eb More code cleanups 2020-11-11 18:02:17 +01:00
Łukasz Domeradzki
35f4651ed6 .NET 5.0 (#1999)
* Initial work

* Fix CIs

* Fix warnings

* Update .travis.yml

* Update dockerfiles

* Update libraries to .NET 5.0

* Misc

* Remove workaround for #1812

* Update cc.sh

* CI updates

* CI updates

* Update .travis.yml
2020-11-10 23:22:57 +01:00
JustArchi
b3d476dea4 Round 2 of nullable checks 2020-08-23 20:45:24 +02: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
69936d55b6 Add GET /Api/Plugins endpoint,
In regards to https://github.com/JustArchiNET/ASF-ui/issues/1015
2020-06-24 20:54:41 +02:00