7 Commits
v1b2 ... v1b3

Author SHA1 Message Date
Marcel Baumgartner
c6cf11626e Merge pull request #139 from Moonlight-Panel/ImproveConsoleStreaming
Improve console streaming
2023-06-04 21:42:13 +02:00
Marcel Baumgartner
233c304b3c Fixed error when closing a failed websocket connection 2023-06-04 21:41:15 +02:00
Marcel Baumgartner
343e527fb6 Added message cache clear for console streaming 2023-06-04 20:56:47 +02:00
Daniel Balk
25da3c233e Merge pull request #138 from Dannyx1604/main
Ein paar kleine Änderungen ;-)
2023-06-03 12:48:43 +02:00
Dannyx
d7fb3382f7 Ein paar kleine Änderungen ;-) 2023-06-03 09:06:22 +02:00
Marcel Baumgartner
88c9f5372d Merge pull request #137 from Moonlight-Panel/AddConsoleStreamingDispose
Add console streaming dispose
2023-06-01 00:44:56 +02:00
Marcel Baumgartner
7128a7f8a7 Add console streaming dispose 2023-06-01 00:44:14 +02:00
3 changed files with 22 additions and 5 deletions

View File

@@ -142,18 +142,28 @@ public class WingsConsole : IDisposable
switch (eventData.Event) switch (eventData.Event)
{ {
case "jwt error": case "jwt error":
await WebSocket.CloseAsync(WebSocketCloseStatus.Empty, "Jwt error detected", if (WebSocket != null)
CancellationToken.None); {
if (WebSocket.State == WebSocketState.Connecting || WebSocket.State == WebSocketState.Open)
await WebSocket.CloseAsync(WebSocketCloseStatus.Empty, null, CancellationToken.None);
WebSocket.Dispose();
}
await UpdateServerState(ServerState.Offline); await UpdateServerState(ServerState.Offline);
await UpdateConsoleState(ConsoleState.Disconnected); await UpdateConsoleState(ConsoleState.Disconnected);
await SaveMessage("Received a jwt error", true); await SaveMessage("Received a jwt error. Disconnected", true);
break; break;
case "token expired": case "token expired":
await WebSocket.CloseAsync(WebSocketCloseStatus.Empty, "Jwt error detected", if (WebSocket != null)
CancellationToken.None); {
if (WebSocket.State == WebSocketState.Connecting || WebSocket.State == WebSocketState.Open)
await WebSocket.CloseAsync(WebSocketCloseStatus.Empty, null, CancellationToken.None);
WebSocket.Dispose();
}
await UpdateServerState(ServerState.Offline); await UpdateServerState(ServerState.Offline);
await UpdateConsoleState(ConsoleState.Disconnected); await UpdateConsoleState(ConsoleState.Disconnected);
@@ -346,6 +356,7 @@ public class WingsConsole : IDisposable
public async Task Disconnect() public async Task Disconnect()
{ {
Disconnecting = true; Disconnecting = true;
Messages.Clear();
if (WebSocket != null) if (WebSocket != null)
{ {
@@ -362,6 +373,7 @@ public class WingsConsole : IDisposable
public void Dispose() public void Dispose()
{ {
Disconnecting = true; Disconnecting = true;
Messages.Clear();
if (WebSocket != null) if (WebSocket != null)
{ {

View File

@@ -311,5 +311,10 @@
{ {
await Event.Off($"server.{CurrentServer.Uuid}.installComplete", this); await Event.Off($"server.{CurrentServer.Uuid}.installComplete", this);
} }
if (Console != null)
{
Console.Dispose();
}
} }
} }