mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Removed disconnect/connect and replaced with Reconnect as it's made things worse
This commit is contained in:
@@ -147,8 +147,7 @@ public class ChatBot
|
|||||||
// Yeah, super dodgy
|
// Yeah, super dodgy
|
||||||
KfClient.LastPacketReceived = DateTime.UtcNow;
|
KfClient.LastPacketReceived = DateTime.UtcNow;
|
||||||
_logger.Error("Forcing disconnect and restart as bot is completely dead");
|
_logger.Error("Forcing disconnect and restart as bot is completely dead");
|
||||||
await KfClient.DisconnectAsync();
|
await KfClient.ReconnectAsync();
|
||||||
await KfClient.StartWsClient();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -171,9 +170,8 @@ public class ChatBot
|
|||||||
_logger.Error($"inactivityTime -> {inactivityTime:g}");
|
_logger.Error($"inactivityTime -> {inactivityTime:g}");
|
||||||
_logger.Error($"deadTime -> {deadTime:g}");
|
_logger.Error($"deadTime -> {deadTime:g}");
|
||||||
if (shouldExit) Environment.Exit(1);
|
if (shouldExit) Environment.Exit(1);
|
||||||
_logger.Error("Since we didn't exit, let's try forcing a connection");
|
_logger.Error("Since we didn't exit, let's try forcing a reconnect");
|
||||||
await KfClient.DisconnectAsync();
|
await KfClient.ReconnectAsync();
|
||||||
await KfClient.StartWsClient();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -659,6 +657,8 @@ public class ChatBot
|
|||||||
{
|
{
|
||||||
_logger.Info("Chat 203'd, getting a new token");
|
_logger.Info("Chat 203'd, getting a new token");
|
||||||
RefreshXfToken().Wait(_cancellationToken);
|
RefreshXfToken().Wait(_cancellationToken);
|
||||||
|
_logger.Info("Reconnecting");
|
||||||
|
KfClient.ReconnectAsync().Wait(_cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user