Skip to content

Commit

Permalink
Make HandleWarnings output errors correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
PintTheDragon committed Dec 1, 2021
1 parent d00c7ba commit 42ac498
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions SCPStats/Websocket/WebsocketRequests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ internal static IEnumerator<float> DequeueRequests()

private static void HandleWarnings(string info)
{
var res = info.Substring(4);

var msgId = info.Substring(0, 4);
var intMsgId = int.Parse(msgId);
if (info == "E")

if (res == "E")
{
if (MessageIDsStore.WarningsDict.TryGetValue(intMsgId, out var promise1))
{
Expand All @@ -78,7 +80,7 @@ private static void HandleWarnings(string info)
return;
}

var warnings = info.Substring(4).Split('`');
var warnings = res.Split('`');

var warningsList = warnings.Select(warning => new Warning(warning.Split('|'))).ToList();

Expand Down

0 comments on commit 42ac498

Please sign in to comment.