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

@@ -101,7 +101,7 @@ namespace ArchiSteamFarm {
};
// Listing is free to deny our announce request, hence we don't retry
if (await Program.WebBrowser.UrlPost(request, data, maxTries: 1).ConfigureAwait(false) != null) {
if (await Bot.ArchiWebHandler.WebBrowser.UrlPost(request, data, maxTries: 1).ConfigureAwait(false) != null) {
LastHeartBeat = DateTime.UtcNow;
}
} finally {
@@ -176,16 +176,16 @@ namespace ArchiSteamFarm {
};
// Listing is free to deny our announce request, hence we don't retry
ShouldSendHeartBeats = await Program.WebBrowser.UrlPost(request, data, maxTries: 1).ConfigureAwait(false) != null;
ShouldSendHeartBeats = await Bot.ArchiWebHandler.WebBrowser.UrlPost(request, data, maxTries: 1).ConfigureAwait(false) != null;
} finally {
RequestsSemaphore.Release();
}
}
private static async Task<HashSet<ListedUser>> GetListedUsers() {
private async Task<HashSet<ListedUser>> GetListedUsers() {
const string request = URL + "/Api/Bots";
WebBrowser.ObjectResponse<HashSet<ListedUser>> objectResponse = await Program.WebBrowser.UrlGetToJsonObject<HashSet<ListedUser>>(request).ConfigureAwait(false);
WebBrowser.ObjectResponse<HashSet<ListedUser>> objectResponse = await Bot.ArchiWebHandler.WebBrowser.UrlGetToJsonObject<HashSet<ListedUser>>(request).ConfigureAwait(false);
return objectResponse?.Content;
}