commit 3ff33b75b8400cd028afd3c7809511e8a1c27621
parent de04ba2b33e6b8041b485367cdb7d9d1b77ab3d8
Author: anon <anon@example.com>
Date: Mon, 26 Oct 2026 14:14:59 +0000
Reject unsupported movement before changing or relaying actor state
Native observers execute internal flight callbacks27/35 even when the server
ignores those actions locally. Admit the implemented movement request domain
before pose anchoring, follow cancellation, persistence and relay. Ignore
unsupported input while keeping the connection and later valid controls usable.
Both new regression roots fail with the previous handler. Verify all1310 server
roots (14295 results),58 focused roots,151 race roots and data/vet. Ten paired
GPU WASM states cover ordinary flight, live item removal with preserved
instance identity, ground movement, posture and jumping without page errors.
Retain complete native producer/helper ledgers and remaining mode-flow TODOs.
Remove owned fixtures, preserve unrelated SQLite rows and leave one LAN preview.
Diffstat:
4 files changed, 152 insertions(+), 1 deletion(-)
diff --git a/TODO.md b/TODO.md
@@ -1294,6 +1294,25 @@ disconnect retention and succession policy still need period corroboration.
run measured a transient 0.846 m difference with up to 57 ms between native and
server samples; settled forward/reverse errors were below 0.07 m. Keep timing
bounds explicit instead of claiming exact trajectory equivalence.
+- [x] Reject unsupported incoming movement actions before pose changes, follow
+ cancellation, persistence or relay. Native observers can execute equipment-only
+ 27/35 even when Go ignores them. Preserve the implemented1..14/20/22/23 request
+ domain, and verify that a subsequent valid native packet still works. Negative
+ state/observer/persistence and native transport tests pass, alongside paired
+ WASM flight, live removal with the same persisted item, and ground/posture
+ checks. See [incoming actions](docs/player-movement.md#incoming-movement-actions).
+- [ ] Complete native movement mode admission and callback coverage. Audit
+ swimming/sitting gates, repeated walk/run requests, and walk/run while flying
+ against helper predicate36044640 and the complete builder/callback table.
+ In the native seated fixture, W emits movement1/2 but both helpers stay idle
+ in mode8; test holding W while explicitly standing before its release so
+ rejected input cannot leave cached forward motion on the server.
+ Trace the complete sneak flow before admitting movement26/32; ordinary
+ sit/stand86/87 uses helper28/33 instead. Crawl25 is only bound to an exported
+ API, and no ordinary elevation15/16 producer is established. The helper's
+ elevation callbacks use+3/-0.8, including cached-state quirks; do not invent
+ flight up/down bindings from those names. Source ledgers:
+ `local/player-flight-input/research/{helpers,producers}/`.
- [x] Simulate ordinary outdoor jumping and physical landing. Movement13 uses raw
Strength/Agility, the native upward ceiling probe and mass/impulse float stores.
Preserve horizontal controls, reject swimming/sitting and repeated airborne
diff --git a/docs/player-movement.md b/docs/player-movement.md
@@ -55,6 +55,55 @@ through the shared integrator and its outer-frame alignment. Frame cadence,
nonzero ground orientation modes remain verification boundaries; the
flat-ground reductions above do not replace those branches.
+## Incoming movement actions
+
+The authoritative handler accepts the implemented decoded action IDs1..14,
+20 and22/23. It ignores other IDs before anchoring motion, placing the supplied
+pose, cancelling follow, checkpointing or relaying a packet. This is the current
+server support boundary; it is not a claim that the historical server accepted
+only this set.
+
+Native CharDCMove activation does not whitelist physical helper events by their
+origin. Relaying27/35 can execute an observer's flight entry/removal even when
+the Go controller ignored that event. Checking only the server's flying flag
+therefore misses observable client corruption. Water24/31 and frozen21/34 are
+other internal transitions that belong to their authoritative effect paths.
+The helper enum alone does not authorize a client request.
+
+The bounded native producer census finds fixed sender actions1..13,20,22,23,
+25,26 and32. Crawl25 is bound to an exported API without an ordinary input
+registration. Actor event162 produces26, separate from ordinary sit/stand86/87,
+which submits helper28/33. Special action79 and internal leave-sneak paths can
+produce32. The server must implement those complete flows before accepting
+their unsupported movement events. Generic exported MovementChanged accepts
+caller-supplied integers, so the fixed census is not a universal whitelist.
+
+The helper has elevation callbacks15 (+3 world-Y) and16 (-0.8), with distinct
+state gates and cached-control quirks. No ordinary keyboard producer for them
+is established. Camera Up/Down callbacks do not establish actor elevation input.
+Backspace selects run/walk through a special-action entry whose availability
+also matters. In the captured flying client it emits no22/23 and leaves flight
+unchanged; ordinary ground Backspace does toggle2/3. Full physical mode
+admission and callbacks remain a separate TODO.
+
+`local/player-flight-input/research/helpers/` retains117 complete bodies, all35
+builder entries,1,024 predicate cases and29 callback bindings. The independent
+`research/producers/` ledger retains80 complete bodies and120 input registrations,
+including constructor-to-serializer field tracing. Both have source-only hash
+verifiers. Negative tests check equipment27/35 and unknown0/127 without pose,
+helper/body, follow, ownership, output or database changes. A native transport
+test submits an unsupported event followed by valid forward input and a ping;
+only the valid movement reaches the observer and the connection remains usable.
+
+The final source passes all1,310 top-level server tests (14,295 results),58 focused
+roots (137 results),151 race roots (443 results), data checks and go vet.
+Both new regression roots fail against the previous handler. Ten final paired
+GPU WASM captures cover flight, ordinary live unequip, ground run/walk,
+sit/explicit stand and jumping, with no page errors. The same vehicle item returns
+to inventory slot64 and is present there in SQLite. Source/packet/state checks
+are retained under `local/player-flight-input/`; cleanup removes three owned
+visitors and the fixture, preserving unrelated rows and the single LAN preview.
+
## Flight transitions and facing
The shared OnWear iterator consumes authored function 53138 in order with shape
diff --git a/server/player_flight_input_test.go b/server/player_flight_input_test.go
@@ -0,0 +1,76 @@
+package main
+
+import (
+ "encoding/binary"
+ "fmt"
+ "testing"
+ "time"
+)
+
+func TestPlayerMovementRejectsEquipmentAndUnknownEvents(t *testing.T) {
+ for _, action := range []uint32{0, 27, 35, 127} {
+ t.Run(fmt.Sprint(action), func(t *testing.T) {
+ world := newPlayerFormWorld(t, 117322)
+ player, client := world.characters[1], world.clients[1]
+ observer := &combatTestConn{}
+ world.characters[2] = &character{id: 2, playfield: 705, health: 100}
+ world.clients[2] = &worldClient{id: 2, ready: true, target: true, conn: observer}
+ world.characters[1000000].playfield = 705
+ player.followTarget = 1000000
+ player.nextPositionSave = time.Time{}
+ position, rotation, movement, body := player.position, player.rotation, player.movement, player.body
+ request := playerMovementRequest(player, action)
+ binary.BigEndian.PutUint16(request[17:19], 7200)
+ client.conn.(*combatTestConn).packets = nil
+ auditCheckpointWrites(t, world)
+
+ if err := world.handleMovement(client, request); err != nil {
+ t.Fatal(err)
+ }
+
+ if player.position != position || player.rotation != rotation || player.movement != movement || player.body != body || player.followTarget != 1000000 || player.inventory.Items[0].Slot != 64 {
+ t.Fatal("unsupported events changed authoritative motion or ownership", player.position, player.movement, player.followTarget, player.inventory)
+ }
+ if len(observer.packets) != 0 || len(client.conn.(*combatTestConn).packets) != 0 || len(checkpointWrites(t, world)) != 0 {
+ t.Fatal("unsupported events reached another actor or persisted a forged pose", observer.packets, checkpointWrites(t, world))
+ }
+ })
+ }
+}
+
+func TestPlayerMovementProcessesValidInputAfterAnUnsupportedNativePacket(t *testing.T) {
+ world := newCheckpointWorld(t)
+ connection := connectZoningClient(t, world, true)
+ observer := &combatTestConn{}
+ world.mutex.Lock()
+ player := world.characters[1]
+ position := player.position
+ world.characters[2] = &character{id: 2, playfield: 950, health: 100}
+ world.clients[2] = &worldClient{id: 2, ready: true, target: true, conn: observer}
+ forged := *player
+ forged.position[0] = 70
+ invalid := targetPacket(npcMovementPacket(&forged, 27))
+ valid := targetPacket(npcMovementPacket(player, 1))
+ world.mutex.Unlock()
+ ping := systemPacket(1, nil)
+ binary.BigEndian.PutUint16(ping[2:4], 11)
+
+ for _, packet := range [][]byte{invalid, valid, ping} {
+ if _, err := connection.Write(packet); err != nil {
+ t.Fatal(err)
+ }
+ }
+ reply, err := readPacket(connection)
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ world.mutex.Lock()
+ defer world.mutex.Unlock()
+ if binary.BigEndian.Uint16(reply[2:4]) != 11 || player.position != position || player.movement.forward != 1 {
+ t.Fatal("rejected input interrupted the connection or its next valid control", reply, player.position, player.movement)
+ }
+ if len(observer.packets) != 1 || binary.BigEndian.Uint32(observer.packets[0][16:20]) != 0x54111123 || observer.packets[0][29] != 1 {
+ t.Fatal("native observer received an unsupported event or lost valid input", observer.packets)
+ }
+}
diff --git a/server/world_actions.go b/server/world_actions.go
@@ -133,6 +133,14 @@ func (server *server) handleMovement(client *worldClient, body []byte) error {
if len(body) < 52 {
return fmt.Errorf("short character movement message")
}
+ // Only supported movement inputs may change authoritative state or be relayed.
+ // Native receivers also execute internal equipment events such as 27/35.
+ action := binary.BigEndian.Uint32(body[16:20])
+ switch action {
+ case 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 20, 22, 23:
+ default:
+ return nil
+ }
server.mutex.Lock()
character := server.characters[client.id]
// Portal attempts can report the old position while a new zone loads.
@@ -152,7 +160,6 @@ func (server *server) handleMovement(client *worldClient, body []byte) error {
rotation[i] = math.Float32frombits(binary.BigEndian.Uint32(body[32+i*4:]))
}
character.placeMovement(position, rotation)
- action := binary.BigEndian.Uint32(body[16:20])
if action == 20 {
// VehicleForwardUpdate composes yaw after the common placement; MouseMove uses zero.
angle := float32(0)