From e685954cf4a70a9c10a008aff6dd8dff6303ff8e Mon Sep 17 00:00:00 2001 From: SlejmUr Date: Tue, 10 Oct 2023 18:27:24 +0200 Subject: [PATCH] Fix wss things. ChatControl now should work. --- PayCheckServerLib/Responses/IAM.cs | 3 +-- PayCheckServerLib/Servers/PC3Server.cs | 5 +++-- PayCheckServerLib/WSController/ChatControl.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PayCheckServerLib/Responses/IAM.cs b/PayCheckServerLib/Responses/IAM.cs index 0990ad9..186379a 100644 --- a/PayCheckServerLib/Responses/IAM.cs +++ b/PayCheckServerLib/Responses/IAM.cs @@ -30,8 +30,7 @@ to get game to allow email + password auth session.SendResponse(response.GetResponse()); return true; } - - + Debugger.PrintDebug(request.Body); var splitted = request.Body.Split("&"); Dictionary bodyTokens = new(); foreach (var item in splitted) diff --git a/PayCheckServerLib/Servers/PC3Server.cs b/PayCheckServerLib/Servers/PC3Server.cs index c72c3fd..49d19b1 100644 --- a/PayCheckServerLib/Servers/PC3Server.cs +++ b/PayCheckServerLib/Servers/PC3Server.cs @@ -113,8 +113,9 @@ public override void OnWsConnected(HttpRequest request) Headers.Add(headerpart.Item1.ToLower(), headerpart.Item2); } string id = ""; - //There is a bug where this LobbySession empty and it contains the bearer token :) - if (Headers.ContainsKey("x-ab-lobbysessionid")) + //There is a bug where this LobbySession empty and it contains the bearer token :) - ONLY ON RELEASE + // On beta there is an actual ID. + if (Headers.ContainsKey("x-ab-lobbysessionid") && Headers["x-ab-lobbysessionid"].Contains("Bearer")) { id = Headers["x-ab-lobbysessionid"].Replace("Authorization: Bearer ", ""); } diff --git a/PayCheckServerLib/WSController/ChatControl.cs b/PayCheckServerLib/WSController/ChatControl.cs index 49b2519..5517f53 100644 --- a/PayCheckServerLib/WSController/ChatControl.cs +++ b/PayCheckServerLib/WSController/ChatControl.cs @@ -39,7 +39,7 @@ public static void Control(byte[] buffer, long offset, long size, PC3Session ses case "actionQueryTopicById": { //PLEASE HELP ME IF THIS WORKS OR NOT. - var idk = chatbase as Chats.actionQueryTopicById; + var idk = JsonConvert.DeserializeObject(str); var party = PartyController.PartySaves.Where(x => x.Value.Id == idk.Params.TopicId.Replace("p.", "")).FirstOrDefault().Value; if (party == null) {