fix(core): Converts death animation (#356)

- [X] Converts death animation
- [X] Fixes tests for movement packets
This commit is contained in:
Kamron Batman 2020-12-21 23:43:45 -08:00 • committed by GitHub
parent 77ce2e1980
commit 90393fea2a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 65 additions and 89 deletions

View file

@ -13,19 +13,13 @@ namespace Server.Tests.Network
Serial killed = 0x1;
Serial corpse = 0x1000;
var data = new DeathAnimation(killed, corpse).Compile();
var expected = new DeathAnimation(killed, corpse).Compile();
Span<byte> expectedData = stackalloc byte[13];
var pos = 0;
using var ns = PacketTestUtilities.CreateTestNetState();
ns.SendDeathAnimation(killed, corpse);
expectedData.Write(ref pos, (byte)0xAF); // Packet ID
expectedData.Write(ref pos, killed);
expectedData.Write(ref pos, corpse);
#if NO_LOCAL_INIT
expectedData.Write(ref pos, 0);
#endif
AssertThat.Equal(data, expectedData);
var result = ns.SendPipe.Reader.TryRead();
AssertThat.Equal(result.Buffer[0].AsSpan(0), expected);
}
[Fact]