Added proper slave mode - additional clients after the first connection. Fixed a few issues. Updated to version 4.8.2.

This commit is contained in:
Tom
2025-03-06 16:05:15 +00:00
parent cbdca1c008
commit 622b359b12
17 changed files with 146 additions and 33 deletions

15
TTS.cs
View File

@@ -22,7 +22,8 @@ namespace TwitchChatTTS
public class TTS : IHostedService
{
public const int MAJOR_VERSION = 4;
public const int MINOR_VERSION = 7;
public const int MINOR_VERSION = 8;
public const int PATCH_VERSION = 2;
private readonly User _user;
private readonly HermesApiClient _hermesApiClient;
@@ -77,6 +78,9 @@ namespace TwitchChatTTS
Console.Title = "TTS - Twitch Chat";
Console.OutputEncoding = Encoding.UTF8;
License.iConfirmCommercialUse("abcdef");
_user.Slave = true;
_logger.Information($"This is running on version {MAJOR_VERSION}.{MINOR_VERSION}.{PATCH_VERSION}.");
if (string.IsNullOrWhiteSpace(_configuration.Hermes?.Token))
{
@@ -92,9 +96,9 @@ namespace TwitchChatTTS
_logger.Error("Failed to fetch latest TTS version. Something went wrong.");
return;
}
if (hermesVersion.MajorVersion > TTS.MAJOR_VERSION || hermesVersion.MajorVersion == TTS.MAJOR_VERSION && hermesVersion.MinorVersion > TTS.MINOR_VERSION)
if (hermesVersion.MajorVersion > TTS.MAJOR_VERSION || hermesVersion.MajorVersion == TTS.MAJOR_VERSION && (hermesVersion.MinorVersion > TTS.MINOR_VERSION || hermesVersion.MinorVersion == TTS.MINOR_VERSION && (hermesVersion.PatchVersion == null || hermesVersion.PatchVersion > TTS.PATCH_VERSION)))
{
_logger.Information($"A new update for TTS is avaiable! Version {hermesVersion.MajorVersion}.{hermesVersion.MinorVersion} is available at {hermesVersion.Download}");
_logger.Information($"A new update for TTS is avaiable! Version {hermesVersion.MajorVersion}.{hermesVersion.MinorVersion}.{hermesVersion.PatchVersion} is available at {hermesVersion.Download}");
var changes = hermesVersion.Changelog.Split("\n");
if (changes != null && changes.Any())
_logger.Information("Changelog:\n - " + string.Join("\n - ", changes) + "\n\n");
@@ -168,7 +172,12 @@ namespace TwitchChatTTS
{
await Task.Delay(TimeSpan.FromSeconds(5));
if (_user.TwitchUserId == default)
{
_logger.Warning("Ensure your Tom to Speech token in the tts.config.yml file is valid.");
_logger.Warning("Re-open the application once you have made sure the token is valid.");
}
disposables.ForEach(d => d.Dispose());
});
}