aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


commit 33da05bad6eabe4910239457b66e28940fa3ab61
parent 12f68591ae036d79a7bc80ec31375b7e698ee96d
Author: anon <anon@example.com>
Date:   Wed, 28 Oct 2026 01:46:35 +0000

Exercise gameplay movement in persistence regressions

Diffstat:
Mserver/target_protocol_test.go | 5++++-
Mserver/users_test.go | 14+++++++++++---
2 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/server/target_protocol_test.go b/server/target_protocol_test.go @@ -113,9 +113,12 @@ initialized: if hex.EncodeToString(npc[60:89]) != "000005cb0b456469746564204e50430000000000000000000000000007" { t.Fatalf("target NPC appearance, name and new stats: %x", npc[60:89]) } - if hex.EncodeToString(full[57:105]) != "000003f1000186330000003600000001000000340000000000000039000000000000015e000005aa000000ec00000000" { + if hex.EncodeToString(full[57:105]) != "000003f100018e150000003600000001000000340000000000000039000000000000015e000005aa000000ec00000000" { t.Fatalf("target seventh list and initial progression/insurance stats: %x", full[57:105]) } + if hex.EncodeToString(full[105:121]) != "0000003e000000000000004b00000000" { + t.Fatalf("initial Clan/Omni token stats: %x", full[105:121]) + } } func TestTargetFullInventoryUsesAllThirtyNativeSlots(t *testing.T) { diff --git a/server/users_test.go b/server/users_test.go @@ -319,7 +319,10 @@ func TestPositionUpdatesDoNotRewritePlayerProfile(t *testing.T) { destination.Position = [3]float32{960, 16.375, 510} destination.Rotation = [4]float32{0, 0, 0, 1} - if err := world.updateUser(destination); err != nil { + // Gameplay poses stay in memory; explicit admin edits commit immediately. + client := &worldClient{id: 1, conn: &combatTestConn{}, target: true, ready: true} + world.clients[1] = client + if err := world.handleMovement(client, playerMovementRequest(destination.character(), 20)); err != nil { t.Fatal(err) } positionPending, err := readTestPlayerRecord(1, "position") @@ -390,7 +393,10 @@ func TestFailedPositionTransactionPreservesProfileAndRetries(t *testing.T) { destination := world.characters[1].userData() destination.Position = [3]float32{960, 16.375, 510} - if err := world.updateUser(destination); err != nil { + // Gameplay poses stay in memory; explicit admin edits commit immediately. + client := &worldClient{id: 1, conn: &combatTestConn{}, target: true, ready: true} + world.clients[1] = client + if err := world.handleMovement(client, playerMovementRequest(destination.character(), 20)); err != nil { t.Fatal(err) } saveErr := world.flushPositions(time.Now().Add(20 * time.Second)) @@ -439,7 +445,9 @@ func TestPositionSavesFollowEachPlayersFixedSchedule(t *testing.T) { for _, id := range []uint32{1, 2} { destination := world.characters[id].userData() destination.Position = [3]float32{53, 14, 60} - if err := world.updateUser(destination); err != nil { + client := &worldClient{id: id, conn: &combatTestConn{}, target: true, ready: true} + world.clients[id] = client + if err := world.handleMovement(client, playerMovementRequest(destination.character(), 20)); err != nil { t.Fatal(err) } }