feat(net): Phase B.2 — MoveToState + AutonomousPosition message builders

Outbound GameAction message builders for player movement:
- MoveToState (0xF61C): sent on motion state changes (start/stop
  walking, turn, speed change). Carries RawMotionState (flag-driven
  variable fields) + WorldPosition + sequence numbers.
- AutonomousPosition (0xF753): periodic position heartbeat sent
  every ~200ms while moving. No RawMotionState — just WorldPosition
  + sequences + contact byte.

Both follow the GameAction envelope pattern (0xF7B1 + sequence +
action type) established by GameActionLoginComplete. Wire format
ported from references/holtburger movement protocol — field order
and alignment match exactly (contact byte + pad_to_4).

Also:
- Adds WriteFloat to PacketWriter (needed by both builders)
- Adds SendGameAction + NextGameActionSequence to WorldSession
  (public wrappers for PlayerMovementController in Task 2)

11 new tests, 265 total, all green.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-04-12 14:28:35 +02:00
parent d9cd2b0b1d
commit fe1c949775
6 changed files with 577 additions and 0 deletions

View file

@ -88,6 +88,13 @@ public sealed class PacketWriter
_position += bytes.Length;
}
public void WriteFloat(float value)
{
EnsureCapacity(4);
BinaryPrimitives.WriteSingleLittleEndian(_buffer.AsSpan(_position), value);
_position += 4;
}
/// <summary>Pad with zeros so the buffer length is a multiple of 4.</summary>
public void AlignTo4()
{