fix(core): Fixes map issues at New Haven (#509)

- [X] Fixes map issues at New Haven by turning off static diffs
- [X] Some code cleanup and reformatting of tile matrix, tile matrix patch, and tile data
- [X] Adds NetState.Flush for generating spawners so it doesn't feel like the server is frozen
- [X] Reverts NativeReader changes from a while back.
- [X] Adds more string reading for BufferReader.


Notes:
BufferReader is still `little endian` compared to `SpanReader` which is `big endian` (for packets). To that end, the RunUO deserialization `ReadString()` was made obsolete since it is ambiguous, and contains extra fields other than simply reading a string. Furthermore, we shouldn't be using UTF8 (for now) since it is slow.
This commit is contained in:
Kamron Batman 2021-02-14 16:06:49 -08:00 committed by GitHub
parent d070efeab3
commit ea5d09a7d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 724 additions and 482 deletions

View file

@ -20,6 +20,7 @@ namespace Server.Tests.Network
1,
1,
1,
1,
1
);
@ -55,6 +56,7 @@ namespace Server.Tests.Network
1,
1,
1,
1,
1
);
@ -90,6 +92,7 @@ namespace Server.Tests.Network
1,
1,
1,
1,
1
);

View file

@ -6,12 +6,17 @@ namespace Server.Tests.Network
{
public class MapPatchesTests : IClassFixture<ServerFixture>
{
[Fact]
public void TestMapPatches()
[Theory]
[InlineData(ProtocolChanges.Version500a, ClientFlags.Malas | ClientFlags.Trammel | ClientFlags.Felucca)]
[InlineData(ProtocolChanges.Version7090, ClientFlags.TerMur | ClientFlags.Trammel | ClientFlags.Felucca)]
public void TestMapPatches(ProtocolChanges protocolChanges, ClientFlags flags)
{
var expected = new MapPatches().Compile();
var ns = PacketTestUtilities.CreateTestNetState();
ns.ProtocolChanges = protocolChanges;
ns.Flags = flags;
var expected = ns.ProtocolChanges >= ProtocolChanges.Version6000 ? Span<byte>.Empty : new MapPatches().Compile();
ns.SendMapPatches();
var result = ns.SendPipe.Reader.TryRead();