Fix bad serials (#304)
- [X] Fixes bad serial calculations - [X] Tightens HexStrings Bumps release version Updates documentation
This commit is contained in:
parent
b0c1076cb5
commit
ae436cb55f
46 changed files with 76 additions and 51 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue