- Started cleanup of command handler

- Removed IUnloadableService
- Started removing INService (removed it from services which implement behavior interfaces) - wip
- Added scrutor for better service registration - wip
This commit is contained in:
Kwoth
2021-06-28 23:20:02 +02:00
parent 1e90d7f7bb
commit 3c82c1f919
30 changed files with 217 additions and 360 deletions

View File

@@ -21,7 +21,7 @@ using Serilog;
namespace NadekoBot.Modules.Games.Services
{
public class GamesService : INService, IUnloadableService
public class GamesService : INService
{
private readonly GamesConfigService _gamesConfig;
@@ -101,26 +101,6 @@ namespace NadekoBot.Modules.Games.Services
}
}
public async Task Unload()
{
_t.Change(Timeout.Infinite, Timeout.Infinite);
AcrophobiaGames.ForEach(x => x.Value.Dispose());
AcrophobiaGames.Clear();
HangmanGames.ForEach(x => x.Value.Dispose());
HangmanGames.Clear();
await Task.WhenAll(RunningTrivias.Select(x => x.Value.StopGame())).ConfigureAwait(false);
RunningTrivias.Clear();
TicTacToeGames.Clear();
await Task.WhenAll(RunningContests.Select(x => x.Value.Stop()))
.ConfigureAwait(false);
RunningContests.Clear();
NunchiGames.ForEach(x => x.Value.Dispose());
NunchiGames.Clear();
}
public void AddTypingArticle(IUser user, string text)
{
TypingArticles.Add(new TypingArticle