Changed command dictionary to a command tree. Fixed various requests. OBS reconnection added if identified previously.

This commit is contained in:
Tom
2024-07-19 16:56:41 +00:00
parent e6b3819356
commit 472bfcee5d
56 changed files with 1943 additions and 1553 deletions

View File

@@ -26,9 +26,9 @@ namespace TwitchChatTTS.OBS.Socket.Handlers
string? password = string.IsNullOrWhiteSpace(_configuration.Obs?.Password) ? null : _configuration.Obs.Password.Trim();
_logger.Verbose("OBS websocket password: " + password);
if (message.Authentication == null || string.IsNullOrWhiteSpace(password))
if (message.Authentication == null || string.IsNullOrEmpty(password))
{
await sender.Send(1, new IdentifyMessage(message.RpcVersion, string.Empty, 1023 | 262144));
await sender.Send(1, new IdentifyMessage(message.RpcVersion, null, 1023 | 262144));
return;
}
@@ -39,7 +39,7 @@ namespace TwitchChatTTS.OBS.Socket.Handlers
string secret = password + salt;
byte[] bytes = Encoding.UTF8.GetBytes(secret);
string hash = null;
string? hash = null;
using (var sha = SHA256.Create())
{
bytes = sha.ComputeHash(bytes);