feat(mosstank): add VTank-style automation PoC
This commit is contained in:
parent
f6fe0f2a4f
commit
4e6e9bc9d9
212 changed files with 49462 additions and 416 deletions
|
|
@ -8,6 +8,31 @@ namespace AcDream.Core.Net.Tests.Messages;
|
|||
|
||||
public sealed class InventoryActionsTests
|
||||
{
|
||||
[Fact]
|
||||
public void CreateTinkeringToolMatchesRetailToolThenPackableGuidList()
|
||||
{
|
||||
byte[] body = InventoryActions.BuildCreateTinkeringTool(
|
||||
7u,
|
||||
0x50000010u,
|
||||
[0x50000020u, 0x50000030u]);
|
||||
|
||||
Assert.Equal(28, body.Length);
|
||||
Assert.Equal(InventoryActions.GameActionEnvelope,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(body));
|
||||
Assert.Equal(7u,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(body.AsSpan(4)));
|
||||
Assert.Equal(InventoryActions.CreateTinkeringToolOpcode,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(body.AsSpan(8)));
|
||||
Assert.Equal(0x50000010u,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(body.AsSpan(12)));
|
||||
Assert.Equal(2u,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(body.AsSpan(16)));
|
||||
Assert.Equal(0x50000020u,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(body.AsSpan(20)));
|
||||
Assert.Equal(0x50000030u,
|
||||
BinaryPrimitives.ReadUInt32LittleEndian(body.AsSpan(24)));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void BuildStackableMerge_CarriesBothGuidsAndAmount()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -5,6 +5,24 @@ namespace AcDream.Core.Net.Tests;
|
|||
|
||||
public sealed class WorldSessionInventoryActionTests
|
||||
{
|
||||
[Fact]
|
||||
public void SendSalvageUsesNextSequenceAndRetailBody()
|
||||
{
|
||||
using var session = new WorldSession(
|
||||
new IPEndPoint(IPAddress.Loopback, 65000));
|
||||
byte[]? captured = null;
|
||||
session.GameActionCapture = body => captured = body;
|
||||
|
||||
session.SendSalvage(0x50000010u, [0x50000020u]);
|
||||
|
||||
Assert.Equal(
|
||||
InventoryActions.BuildCreateTinkeringTool(
|
||||
1u,
|
||||
0x50000010u,
|
||||
[0x50000020u]),
|
||||
captured);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SendStackableMerge_UsesNextSequenceAndExactBuilderBytes()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue