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
This commit is contained in:
Łukasz Domeradzki
2019-01-10 22:33:07 +01:00
committed by GitHub
parent 62a770479e
commit 0f2a816b92
49 changed files with 3025 additions and 1653 deletions

View File

@@ -22,9 +22,10 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using JetBrains.Annotations;
namespace ArchiSteamFarm.Helpers {
internal sealed class ArchiCacheable<T> : IDisposable {
public sealed class ArchiCacheable<T> : IDisposable {
private readonly TimeSpan CacheLifetime;
private readonly SemaphoreSlim InitSemaphore = new SemaphoreSlim(1, 1);
private readonly Func<Task<(bool Success, T Result)>> ResolveFunction;
@@ -53,7 +54,8 @@ namespace ArchiSteamFarm.Helpers {
MaintenanceTimer?.Dispose();
}
internal async Task<(bool Success, T Result)> GetValue() {
[PublicAPI]
public async Task<(bool Success, T Result)> GetValue() {
if (IsInitialized && IsRecent) {
return (true, InitializedValue);
}