moved connection state to status bar
This commit is contained in:
@@ -51,10 +51,13 @@ public class LcuWebsocket : IDisposable
|
||||
}
|
||||
catch
|
||||
{
|
||||
await Task.Delay(TimeSpan.FromMilliseconds(500));
|
||||
Disconnected?.Invoke(this, EventArgs.Empty);
|
||||
return;
|
||||
}
|
||||
if (!ProcessFinder.IsPortOpen(ProcessInfo))
|
||||
{
|
||||
Disconnected?.Invoke(this, EventArgs.Empty);
|
||||
throw new InvalidOperationException("Failed to connect to LCUx process port.");
|
||||
}
|
||||
|
||||
@@ -67,8 +70,6 @@ public class LcuWebsocket : IDisposable
|
||||
{
|
||||
await _socket.ConnectAsync(uri, CancellationToken.None);
|
||||
|
||||
Connected?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
foreach (string eventName in SUBSCRIBE_EVENTS)
|
||||
{
|
||||
string message = $"[{OPCODE_SUBSCRIBE}, \"{eventName}\"]";
|
||||
@@ -77,6 +78,8 @@ public class LcuWebsocket : IDisposable
|
||||
await _socket.SendAsync(memory, WebSocketMessageType.Text, true, CancellationToken.None);
|
||||
}
|
||||
|
||||
Connected?.Invoke(this, EventArgs.Empty);
|
||||
|
||||
while (_socket.State is WebSocketState.Open)
|
||||
{
|
||||
try
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CliWrap" Version="3.10.0" />
|
||||
<PackageReference Include="MoonSharp" Version="2.0.0" />
|
||||
<PackageReference Include="CliWrap" Version="3.10.1" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user