From 7d9afa3cb481e60d96a1a4b4719555029eb3600f Mon Sep 17 00:00:00 2001 From: CWX Date: Fri, 17 Jan 2025 15:53:50 +0000 Subject: [PATCH] string splitting for URL fix --- Core/Servers/Ws/SptWebSocketConnectionHandler.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Core/Servers/Ws/SptWebSocketConnectionHandler.cs b/Core/Servers/Ws/SptWebSocketConnectionHandler.cs index e0c12306..3497c4f2 100644 --- a/Core/Servers/Ws/SptWebSocketConnectionHandler.cs +++ b/Core/Servers/Ws/SptWebSocketConnectionHandler.cs @@ -48,8 +48,8 @@ public class SptWebSocketConnectionHandler : IWebSocketConnectionHandler public Task OnConnection(WebSocket ws, HttpContext context) { - var splitUrl = context.Request.Path.Value.Substring(0, context.Request.Path.Value.IndexOf("?")).Split("/"); - var sessionID = splitUrl.First(); + var splitUrl = context.Request.Path.Value.Split("/"); + var sessionID = splitUrl.Last(); var playerProfile = _profileHelper.GetFullProfile(sessionID); var playerInfoText = $"{playerProfile.ProfileInfo.Username} ({sessionID})";