mirror of
https://gitlab.com/Syroot/Worms.git
synced 2025-03-04 09:25:22 +03:00
Remove debug remnants.
This commit is contained in:
parent
2d5fa21c00
commit
f066c27857
@ -248,7 +248,6 @@ namespace Syroot.Worms.Mgame.GameServer.Packets
|
||||
{
|
||||
// Retrieve (decompressed) data size.
|
||||
ReadOnlySpan<byte> decompressedData = _packetDataStream.GetSpan();
|
||||
decompressedData = File.ReadAllBytes(@"D:\Pictures\data.bin");
|
||||
ReadOnlySpan<byte> compressedData = PacketCompression.Compress(decompressedData);
|
||||
|
||||
// Send head.
|
||||
|
@ -11,43 +11,6 @@ namespace Syroot.Worms.Scratchpad
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
TestWwpaPacketCompressionBug();
|
||||
Console.ReadLine();
|
||||
}
|
||||
|
||||
private static void TestWwpaPacketCompressionBug()
|
||||
{
|
||||
ReadOnlySpan<byte> recompress(ReadOnlySpan<byte> data)
|
||||
{
|
||||
ReadOnlySpan<byte> compressed = PacketCompression.Compress(data);
|
||||
return PacketCompression.Decompress(compressed);
|
||||
}
|
||||
|
||||
bool test(byte[] data)
|
||||
{
|
||||
ReadOnlySpan<byte> 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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user