From f066c27857a2b572c8bb202d2fa4810ec007d1b8 Mon Sep 17 00:00:00 2001 From: Ray Koopa Date: Wed, 16 Jan 2019 06:29:11 +0100 Subject: [PATCH] Remove debug remnants. --- .../Packets/AppConnection.cs | 1 - src/Syroot.Worms.Scratchpad/Program.cs | 37 ------------------- 2 files changed, 38 deletions(-) diff --git a/src/Syroot.Worms.Mgame.GameServer/Packets/AppConnection.cs b/src/Syroot.Worms.Mgame.GameServer/Packets/AppConnection.cs index aae1d93..f9dd043 100644 --- a/src/Syroot.Worms.Mgame.GameServer/Packets/AppConnection.cs +++ b/src/Syroot.Worms.Mgame.GameServer/Packets/AppConnection.cs @@ -248,7 +248,6 @@ namespace Syroot.Worms.Mgame.GameServer.Packets { // Retrieve (decompressed) data size. ReadOnlySpan decompressedData = _packetDataStream.GetSpan(); - decompressedData = File.ReadAllBytes(@"D:\Pictures\data.bin"); ReadOnlySpan compressedData = PacketCompression.Compress(decompressedData); // Send head. diff --git a/src/Syroot.Worms.Scratchpad/Program.cs b/src/Syroot.Worms.Scratchpad/Program.cs index bf72a99..9346265 100644 --- a/src/Syroot.Worms.Scratchpad/Program.cs +++ b/src/Syroot.Worms.Scratchpad/Program.cs @@ -11,43 +11,6 @@ namespace Syroot.Worms.Scratchpad private static void Main(string[] args) { - TestWwpaPacketCompressionBug(); - Console.ReadLine(); - } - - private static void TestWwpaPacketCompressionBug() - { - ReadOnlySpan recompress(ReadOnlySpan data) - { - ReadOnlySpan compressed = PacketCompression.Compress(data); - return PacketCompression.Decompress(compressed); - } - - bool test(byte[] data) - { - ReadOnlySpan recompressed = recompress(data); - if (!recompressed.SequenceEqual(data)) - { - Console.WriteLine("Decompression failed."); - if (recompressed.Length < data.Length) - { - Console.WriteLine($" New length smaller by {data.Length - recompressed.Length} bytes."); - } - else - { - for (int i = 0; i < data.Length; i++) - { - if (data[i] != recompressed[i]) - Console.WriteLine($" Byte 0x{i:X4} differs: 0x{data[i]:X2} != 0x{recompressed[i]:X2}"); - } - } - return false; - } - return true; - } - - // Known to cause negative index bug writing undefined bytes: ??, ??, ??, ?? - test(new byte[] { 0xFC, 0xFC, 0xC2, 0x92, 0x8F, 0x66, 0x33, 0x44, 0xEF, 0x40, 0xE9, 0xAB, 0x44, 0xEF, 0x40, 0x36 }); } private static void ConvertIgdImages()