[skipci]Fixed session id changing not working in the Web Socket Chat bot.

This commit is contained in:
Anon 2026-03-25 22:02:22 +01:00 committed by GitHub
commit 7da47d36dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -99,15 +99,15 @@ public class WebSocketServer
{
var message = Encoding.UTF8.GetString(messageBuffer.ToArray());
messageBuffer.Clear();
MessageReceived?.Invoke(sessionId, message);
MessageReceived?.Invoke(session.SessionId, message);
}
}
}
catch { /* connection dropped */ }
finally
{
_sessions.TryRemove(sessionId, out _);
SessionDropped?.Invoke(sessionId);
_sessions.TryRemove(session.SessionId, out _);
SessionDropped?.Invoke(session.SessionId);
if (ws.State == WebSocketState.Open || ws.State == WebSocketState.CloseReceived)
{