mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Updated reconnection logic to always fire even if it's an initial "reconnection". This is to avoid the bot lingering outside the channel after fetching a fresh token as it was triggering a ByUser reconnect then an Initial reconnect and therefore not sending the join message.
This commit is contained in:
@@ -66,7 +66,6 @@ public class KickBot
|
|||||||
_kickClient.OnStopStreamBroadcast += OnStopStreamBroadcast;
|
_kickClient.OnStopStreamBroadcast += OnStopStreamBroadcast;
|
||||||
|
|
||||||
_kfClient.StartWsClient().Wait(_cancellationToken);
|
_kfClient.StartWsClient().Wait(_cancellationToken);
|
||||||
_kfClient.JoinRoom(_config.KfChatRoomId);
|
|
||||||
|
|
||||||
_kickClient.StartWsClient().Wait(_cancellationToken);
|
_kickClient.StartWsClient().Wait(_cancellationToken);
|
||||||
foreach (var channel in _config.PusherChannels)
|
foreach (var channel in _config.PusherChannels)
|
||||||
|
|||||||
@@ -103,11 +103,6 @@ public class ChatClient
|
|||||||
private void WsReconnection(ReconnectionInfo reconnectionInfo)
|
private void WsReconnection(ReconnectionInfo reconnectionInfo)
|
||||||
{
|
{
|
||||||
_logger.Error($"Websocket connection dropped and reconnected. Reconnection type is {reconnectionInfo.Type}");
|
_logger.Error($"Websocket connection dropped and reconnected. Reconnection type is {reconnectionInfo.Type}");
|
||||||
if (reconnectionInfo.Type == ReconnectionType.Initial)
|
|
||||||
{
|
|
||||||
_logger.Error("Not firing the reconnection event as this is the initial event");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
OnWsReconnect?.Invoke(this, reconnectionInfo);
|
OnWsReconnect?.Invoke(this, reconnectionInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user