fix #234: port retail appraisal floaty and inscriptions
This commit is contained in:
parent
643cdfe66e
commit
f1a7912160
23 changed files with 1310 additions and 106 deletions
|
|
@ -148,4 +148,42 @@ public sealed class InventoryActionsTests
|
|||
Assert.Equal(0x0195u, BinaryPrimitives.ReadUInt32LittleEndian(b.AsSpan(8)));
|
||||
Assert.Equal(0x500000C9u, BinaryPrimitives.ReadUInt32LittleEndian(b.AsSpan(12)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildSetInscription_UsesRetailOpcodeGuidAndCp1252String16L()
|
||||
{
|
||||
byte[] body = InventoryActions.BuildSetInscription(
|
||||
seq: 7,
|
||||
itemGuid: 0x50000A01u,
|
||||
inscription: "Café");
|
||||
|
||||
Assert.Equal(24, body.Length);
|
||||
Assert.Equal(0xF7B1u,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(body));
|
||||
Assert.Equal(7u,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(body.AsSpan(4)));
|
||||
Assert.Equal(0x00BFu,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(body.AsSpan(8)));
|
||||
Assert.Equal(0x50000A01u,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(body.AsSpan(12)));
|
||||
Assert.Equal(4,
|
||||
BinaryPrimitives.ReadUInt16LittleEndian(body.AsSpan(16)));
|
||||
Assert.Equal(new byte[] { 0x43, 0x61, 0x66, 0xE9 },
|
||||
body.AsSpan(18, 4).ToArray());
|
||||
Assert.Equal(new byte[] { 0, 0 }, body.AsSpan(22, 2).ToArray());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildSetInscription_EmptyTextPacksAlignedClearRequest()
|
||||
{
|
||||
byte[] body = InventoryActions.BuildSetInscription(
|
||||
seq: 1,
|
||||
itemGuid: 0x50000A01u,
|
||||
inscription: string.Empty);
|
||||
|
||||
Assert.Equal(20, body.Length);
|
||||
Assert.Equal(0,
|
||||
BinaryPrimitives.ReadUInt16LittleEndian(body.AsSpan(16)));
|
||||
Assert.Equal(new byte[] { 0, 0 }, body.AsSpan(18, 2).ToArray());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue