mirror of
https://github.com/JustArchiNET/ArchiSteamFarm
synced 2024-11-10 15:14:41 +00:00
Update RemoteCommunication on bot modules reload
Archi, you designed that interface yourself exactly for this purpose, silly! This way bot reload in config will trigger remote communication changes.
This commit is contained in:
parent
5c53f65bc1
commit
7894b0132f
1 changed files with 10 additions and 2 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Composition;
|
||||
using System.Threading.Tasks;
|
||||
using ArchiSteamFarm.Core;
|
||||
|
@ -30,12 +31,13 @@ using ArchiSteamFarm.Plugins.Interfaces;
|
|||
using ArchiSteamFarm.Steam;
|
||||
using ArchiSteamFarm.Steam.Storage;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using SteamKit2;
|
||||
|
||||
namespace ArchiSteamFarm.OfficialPlugins.ItemsMatcher;
|
||||
|
||||
[Export(typeof(IPlugin))]
|
||||
internal sealed class ItemsMatcherPlugin : OfficialPlugin, IBot, IBotIdentity {
|
||||
internal sealed class ItemsMatcherPlugin : OfficialPlugin, IBot, IBotIdentity, IBotModules {
|
||||
private static readonly ConcurrentDictionary<Bot, RemoteCommunication> RemoteCommunications = new();
|
||||
|
||||
[JsonProperty]
|
||||
|
@ -52,7 +54,13 @@ internal sealed class ItemsMatcherPlugin : OfficialPlugin, IBot, IBotIdentity {
|
|||
}
|
||||
}
|
||||
|
||||
public async Task OnBotInit(Bot bot) {
|
||||
public Task OnBotInit(Bot bot) {
|
||||
ArgumentNullException.ThrowIfNull(bot);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public async Task OnBotInitModules(Bot bot, IReadOnlyDictionary<string, JToken>? additionalConfigProperties = null) {
|
||||
ArgumentNullException.ThrowIfNull(bot);
|
||||
|
||||
if (RemoteCommunications.TryRemove(bot, out RemoteCommunication? remoteCommunications)) {
|
||||
|
|
Loading…
Reference in a new issue