From 691a5e090418fb72b12a44ad09d764b3cb27bb62 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Sat, 22 Mar 2025 14:09:18 +0800 Subject: [PATCH] Try again using List<> instead of a Tuple? --- KfChatDotNetBot/Services/Clashgg.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/KfChatDotNetBot/Services/Clashgg.cs b/KfChatDotNetBot/Services/Clashgg.cs index 1bea81f..d8919b5 100644 --- a/KfChatDotNetBot/Services/Clashgg.cs +++ b/KfChatDotNetBot/Services/Clashgg.cs @@ -117,9 +117,9 @@ public class Clashgg : IDisposable try { - var packet = JsonSerializer.Deserialize>(message.Text); + var packet = JsonSerializer.Deserialize>(message.Text); if (packet == null) throw new InvalidOperationException("Caught a null when deserializing Clash.gg packet"); - if (packet.Item1 == "online") + if (packet[0].GetString() == "online") { _logger.Info("Received online packet from Clash.gg. Subscribing to Plinko, Mines and Keno"); _wsClient.Send("[\"subscribe\",\"plinko\"]"); @@ -128,10 +128,10 @@ public class Clashgg : IDisposable return; } - if (packet.Item1 == "plinko:social-game") + if (packet[0].GetString() == "plinko:social-game") { _logger.Debug("Received Plinko game from Clash.gg. Deserializing payload"); - var betPacket = packet.Item2.Deserialize(); + var betPacket = packet[1].Deserialize(); if (betPacket == null) { throw new Exception("Caught a null when deserializing a Clash.gg Plinko packet"); @@ -150,10 +150,10 @@ public class Clashgg : IDisposable return; } - if (packet.Item1 == "mines:game") + if (packet[0].GetString() == "mines:game") { _logger.Debug("Received Mines game from Clash.gg. Deserializing payload"); - var betPacket = packet.Item2.Deserialize(); + var betPacket = packet[1].Deserialize(); if (betPacket == null) { throw new Exception("Caught a null when deserializing a Clash.gg Mines packet"); @@ -173,10 +173,10 @@ public class Clashgg : IDisposable return; } - if (packet.Item1 == "keno:game") + if (packet[0].GetString() == "keno:game") { _logger.Debug("Received Keno game from Clash.gg. Deserializing payload"); - var betPacket = packet.Item2.Deserialize(); + var betPacket = packet[1].Deserialize(); if (betPacket == null) { throw new Exception("Caught a null when deserializing a Clash.gg Keno packet");