moved connection state to status bar

This commit is contained in:
2026-04-29 04:05:16 +02:00
parent b6a4903847
commit 06d5113711
6 changed files with 48 additions and 39 deletions
+5 -2
View File
@@ -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
+1 -2
View File
@@ -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>