From d3c32fef29679d1b85f5fa3cb480d0f18380c9c1 Mon Sep 17 00:00:00 2001 From: MattEqualsCoder Date: Sat, 14 Sep 2024 15:35:47 -0400 Subject: [PATCH] Fix MSU messages Also fixes the twitch cancelled poll responses --- src/TrackerCouncil.Smz3.Chat.Twitch/Models/TwitchPoll.cs | 2 +- .../Configuration/ConfigServiceCollectionExtensions.cs | 4 ++-- .../VoiceCommands/MsuModule.cs | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/TrackerCouncil.Smz3.Chat.Twitch/Models/TwitchPoll.cs b/src/TrackerCouncil.Smz3.Chat.Twitch/Models/TwitchPoll.cs index c9fc7be3b..00d04e9bb 100644 --- a/src/TrackerCouncil.Smz3.Chat.Twitch/Models/TwitchPoll.cs +++ b/src/TrackerCouncil.Smz3.Chat.Twitch/Models/TwitchPoll.cs @@ -36,7 +36,7 @@ public class TwitchPoll : TwitchAPIResponse /// public bool IsPollSuccessful => WinningChoice?.Votes > 0; - public bool WasPollTerminated => "TERMINATED".Equals(Status, StringComparison.OrdinalIgnoreCase); + public bool WasPollTerminated => "TERMINATED".Equals(Status, StringComparison.OrdinalIgnoreCase) || "ARCHIVED".Equals(Status, StringComparison.OrdinalIgnoreCase); /// /// Returns choice that was voted on the most diff --git a/src/TrackerCouncil.Smz3.Data/Configuration/ConfigServiceCollectionExtensions.cs b/src/TrackerCouncil.Smz3.Data/Configuration/ConfigServiceCollectionExtensions.cs index fbe6a39dc..83ee500e6 100644 --- a/src/TrackerCouncil.Smz3.Data/Configuration/ConfigServiceCollectionExtensions.cs +++ b/src/TrackerCouncil.Smz3.Data/Configuration/ConfigServiceCollectionExtensions.cs @@ -7,10 +7,10 @@ public static class ConfigServiceCollectionExtensions { public static IServiceCollection AddConfigs(this IServiceCollection services) { - services.AddSingleton(); + services.AddSingleton(); services.AddTransient(serviceProvider => { - var configProvider = serviceProvider.GetRequiredService(); + var configProvider = serviceProvider.GetRequiredService(); return configProvider.GetMapConfig(); }); diff --git a/src/TrackerCouncil.Smz3.Tracking/VoiceCommands/MsuModule.cs b/src/TrackerCouncil.Smz3.Tracking/VoiceCommands/MsuModule.cs index 29039514b..828c6d25b 100644 --- a/src/TrackerCouncil.Smz3.Tracking/VoiceCommands/MsuModule.cs +++ b/src/TrackerCouncil.Smz3.Tracking/VoiceCommands/MsuModule.cs @@ -9,6 +9,7 @@ using MSURandomizerLibrary.Models; using MSURandomizerLibrary.Services; using TrackerCouncil.Smz3.Abstractions; +using TrackerCouncil.Smz3.Data.Configuration; using TrackerCouncil.Smz3.Data.Configuration.ConfigFiles; using TrackerCouncil.Smz3.Tracking.Services; @@ -40,7 +41,7 @@ public class MsuModule : TrackerModule, IDisposable /// /// /// - /// + /// /// public MsuModule( TrackerBase tracker, @@ -51,14 +52,14 @@ public MsuModule( IMsuMonitorService msuMonitorService, IMsuTypeService msuTypeService, IMsuUserOptionsService msuUserOptionsService, - MsuConfig msuConfig, + Configs config, IGameService gameService) : base(tracker, itemService, worldService, logger) { _gameService = gameService; _msuMonitorService = msuMonitorService; var msuType = msuTypeService.GetSMZ3MsuType(); - _msuConfig = msuConfig; + _msuConfig = config.MsuConfig; _validTrackNumbers = msuType!.ValidTrackNumbers; if (!File.Exists(tracker.RomPath))