Fix bad serials (#304)

- [X] Fixes bad serial calculations
- [X] Tightens HexStrings

Bumps release version
Updates documentation
This commit is contained in:
Kamron Batman 2020-11-08 12:09:26 -08:00 • committed by GitHub
parent b0c1076cb5
commit ae436cb55f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 76 additions and 51 deletions

View file

@ -0,0 +1,62 @@
using System;
using Server.Network;
using Xunit;
namespace Server.Tests.Network
{
public class MapPatchesTests : IClassFixture<ServerFixture>
{
[Fact]
public void TestMapPatches()
{
var data = new MapPatches().Compile();
Span<byte> expectedData = stackalloc byte[]
{
0xBF, // Packet ID
0x00, 0x29, // Length
0x00, 0x18, // Sub-packet
0x00, 0x00, 0x00, 0x04, // 4 maps
0x00, 0x00, 0x00, 0x00, // Felucca
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, // Trammel
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, // Ilshenar
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, // Malas
0x00, 0x00, 0x00, 0x00
};
AssertThat.Equal(data, expectedData);
}
[Fact]
public void TestInvalidMapEnable()
{
var data = new InvalidMapEnable().Compile();
Span<byte> expectedData = stackalloc byte[]
{
0xC6 // Packet ID
};
AssertThat.Equal(data, expectedData);
}
[Fact]
public void TestMapChange()
{
var data = new MapChange(Map.Felucca).Compile();
Span<byte> expectedData = stackalloc byte[]
{
0xBF, // Packet ID
0x00, 0x06, // Length
0x00, 0x08, // Sub-packet
0x00 // Felucca
};
AssertThat.Equal(data, expectedData);
}
}
}