aorecomp

Anarchy Online classic in the browser

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


commit 58481396e5454eed1861e767d027bd3708184c3e
parent 2ef20f828395aa349215d8c131bceb9982672448
Author: anon <anon@example.com>
Date:   Mon, 26 Oct 2026 03:51:01 +0000

Acknowledge camping cancellation with the native UI response

Share deadline cancellation for standing, abort and StopCamping requests,
and send CharacterAction122 only for an active countdown. Trace the original
UI destruction route and retain the remaining eligibility and input gaps.

Verified all three routes and repeat/no-countdown behavior through real
world connections, focused and race tests, vet, and two GPU WASM clients.

Diffstat:
MTODO.md | 21+++++++++++++++------
Mdocs/client-behavior.md | 5+++++
Mdocs/open-questions.md | 5+++++
Mdocs/protocol.md | 4++++
Mdocs/server-action-coverage.md | 57+++++++++++++++++++++++++++++++++++++++++++--------------
Mserver/logout_cancellation_test.go | 180++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------
Mserver/main.go | 23+++++++++--------------
7 files changed, 191 insertions(+), 104 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -1512,12 +1512,21 @@ and unresolved indoor lifecycle are explicit in [flight](docs/vehicles.md#yalmah works. Keep successful logout and ordinary Escape cancellation working. The separate UI binding that emits121 remains unverified; see [camping cancellation](docs/server-action-coverage.md#camping-cancellation). -- [ ] Reconcile native camping UI after cancellation. Escape108 leaves the - connection alive beyond the old deadline and standing87 still works, but - the smoke retains an empty gray Logout progress bar. Recover the original - controller/response contract and the UI binding for StopCamping121. Check - start/cancel/restart, movement/standing/nano interactions, normal logout and - reconnect without hiding the issue with a scene reset. +- [x] Reconcile the 14.9.1 camping UI with server cancellation. Trace the + CharacterAction 122 receiver through AFCM module 22/message 388 to the native + camping timer's destructor. Share stand87/abort108/StopCamping121 deadline + cancellation and notify the owner only for an active countdown. Regressions + cover all three routes, repeat/no-countdown suppression and usable world + traffic; hardware WASM checks observe bar removal without a scene reset, + independent owner/observer countdowns, normal logout and reconnect. Focused + tests, race checks and vet pass; evidence is retained in + `local/camping-ui-research/milestone-verification.json`. + See [camping cancellation](docs/server-action-coverage.md#camping-cancellation). +- [ ] Complete camping eligibility and input-binding research. Establish the + ordinary UI binding for StopCamping121 and historical combat/nano/death/zoning + restrictions. Check resource refunds and observer isolation when cancelling + during an actual nano cast; the generic abort and camping UI regressions do + not establish every combined lifecycle rule. - [ ] Implement player Follow from the original action29 request. Recover target eligibility and FollowTarget delivery before sharing movement logic. Check self/invalid/dead/different-zone targets, moving leader, keyboard diff --git a/docs/client-behavior.md b/docs/client-behavior.md @@ -164,6 +164,11 @@ remained. Echoing action 108 and sending an empty StopLogoutIIR_t both failed to clear it. The original cancellation UI contract is unresolved; normal quit success does not resolve cancellation. +For 14.9.1, the separate CharacterAction 122 response reaches the camping timer's +destructor and removes the bar in hardware WASM testing. See +[camping cancellation](server-action-coverage.md#camping-cancellation) for the +complete source path. This does not establish the 11.0 cancellation receiver. + ## What the historical server probably supplied The evidence supports the following division, with important gaps: diff --git a/docs/open-questions.md b/docs/open-questions.md @@ -60,6 +60,11 @@ conditions. The camp/quit UI in ddr.dll is another lead. A convincing check must observe the bar disappearing and the connection remaining alive beyond the old deadline, then verify that a subsequent normal quit still completes. +The 14.9.1 camping bar now has a separate source-bound CharacterAction 122 +destruction path and hardware WASM verification. See +[camping cancellation](server-action-coverage.md#camping-cancellation). +The 11.0 receiver and every historical server eligibility rule remain open. + ## Playfield origins, materials, and arrivals Borealis has established world origin (37107,38360); other playfield origins diff --git a/docs/protocol.md b/docs/protocol.md @@ -516,6 +516,10 @@ string at 0x10185490 names StopLogoutIIR_t, whose string-XOR key is 0x56353038. An empty message with that key and echoing character action 108 both failed to clear the bar. Its required payload or activation conditions remain unknown. +The later14.9.1 client has a separately verified CharacterAction 122 UI +cancellation path; see [camping cancellation](server-action-coverage.md#camping-cancellation). +It must not be assumed to establish the 11.0 contract described above. + Later [CellAO sources](https://github.com/CellAO/CellAO-NightPredator) supplied candidate names and a training-area spawn position. Original-client static and runtime evidence determines the recovered layouts; later serialization cannot diff --git a/docs/server-action-coverage.md b/docs/server-action-coverage.md @@ -65,26 +65,55 @@ not call the posture or nano-cancellation sender. The native action dispatcher receiver also has separate120/121 branches. Their UI behavior is not a reason to leave a server disconnect deadline active after a cancellation request. -The server now clears its logout flag and connection read deadline on 121, -independently of standing (87) or abort (108). Repeated cancellation and cancellation -without a countdown are harmless. The existing 30-second successful logout -policy is unchanged; this fix does not establish the historical server's exact -logout eligibility/countdown or every native UI binding. - -Connection-level native-framing regressions first reproduce ignored 121, then -verify deadline removal, repeated requests and a subsequent ping. They exercise -the real world dispatcher. The initial fixture attempts used the wrong native -initialization drain and are excluded from the baseline conclusion. +Standing (87), abort (108) and StopCamping (121) share deadline cancellation. +If a countdown is active, the server sends CharacterAction 122 to that client. +Repeated cancellation and cancellation without a countdown clear the deadline +without producing another UI notification. Normal nano abort and posture +handling still run. The existing 30-second successful logout policy does not +establish the historical server's exact eligibility rules or every UI binding. + +The original 14.9.1 receiver has a complete UI destruction path. In maintained +`client/game/kkr.dll/lifted-0033.c`, `sub_3606FA30` maps action 122 to 0x3607055d, +then calls `sub_3601DB30`. That wrapper sends UI notification 41 through +`sub_3601D080` and `sub_36004C50`: AFCM module 22/message 388. In maintained +`client/game/ddr.dll/lifted-0024.c`, `sub_2B059F50` registers message 388 to +`sub_2B05A270` (CancelCampMessage), which destroys the TimerSystem through +`sub_2B083710` and clears its singleton pointer. Camping constructs the timer +with automatic deletion disabled, explaining why it otherwise remains gray +after reaching zero. Action 120/121 receiver branches call a return-only stub; +an echo of either request does not substitute for 122. The 122 branch's UI +notification is unconditional after a local-character control check, so it must +be addressed only to the cancelling client, never broadcast to observers. + +Complete function bodies, registration/jump-table bytes, import linkage and +source hashes are retained in `local/camping-ui-research/`. The distinct +StartLogout/StopLogout subclass readers require an additional identity at +object+0x20; the earlier empty StopLogout experiment did not supply it. These +classes are not used for this independently traced action 122 response. + +Connection-level native-framing regressions reproduce missing 122 for all three +cancellation routes, then verify deadline removal, the addressed UI response, +repeat/no-countdown suppression and a subsequent ping. They exercise the real +world dispatcher after native initialization and readiness. Native Escape sends 108, not 121, and already cancels the countdown. The hardware WASM smoke distinguishes that working route from the newly handled protocol request. It also captures an uncancelled 120 closing the world connection after 30.004 seconds. The separate ordinary UI binding that emits 121 has not been established; no synthetic native call or packet is substituted for that gap. -Screenshots, traffic and timing are retained in `local/logout-cancel-smoke/`. -An empty gray Logout progress bar remains after Escape and standing, despite -the working connection. Its native controller/response contract is a separate -open TODO; this change does not claim to repair that UI state. +The earlier gray-bar failure is retained in `local/logout-cancel-smoke/`. +New screenshots and complete traffic are in `local/camping-ui-smoke/` and +`local/camping-ui-observer-smoke/`. Escape and standing receive 122, remove the +bar and display "Timed logout aborted." without a scene reset. Both connections +remain usable beyond the old deadline. A second Escape with no active countdown +produces no additional 122. Two simultaneously camping players independently +cancel their own bars; the other player's bar keeps counting down until their +own cancellation. A subsequent uncancelled countdown closes after 30.004 seconds +and the browser reconnects. W while seated produces neither movement nor a +cancellation request, so it is not evidence of a separate movement-cancel route. +These 14.9.1 results do not establish the 11.0 receiver. The focused Go checks, +race checks, vet and runtime verification ledger are retained in +`local/camping-ui-research/milestone-verification.json`. ## Catalog requirements and events diff --git a/server/logout_cancellation_test.go b/server/logout_cancellation_test.go @@ -3,6 +3,7 @@ package main import ( "encoding/binary" "net" + "slices" "testing" "time" ) @@ -20,81 +21,120 @@ func (conn *logoutDeadlineConn) SetReadDeadline(deadline time.Time) error { return nil } -func TestStopCampingCancelsLogoutDeadline(t *testing.T) { - for _, camping := range []bool{false, true} { - name := "without countdown" - if camping { - name = "during countdown" - } - t.Run(name, func(t *testing.T) { - world := newTestServer(t) - world.newCharacter() - client, connection := net.Pipe() - serverConn := &logoutDeadlineConn{Conn: connection, deadlines: make(chan time.Time, 4)} - if err := client.SetDeadline(time.Now().Add(5 * time.Second)); err != nil { - t.Fatal(err) - } - done := make(chan error, 1) - go func() { - defer connection.Close() - done <- world.serveWorldConnection(serverConn) - }() - t.Cleanup(func() { - client.Close() - if err := <-done; err != nil { - t.Error(err) - } - }) - cookie := systemPacket(0x1b, binary.BigEndian.AppendUint32(nil, 1)) - binary.BigEndian.PutUint16(cookie, 0xdfdf) - if _, err := client.Write(cookie); err != nil { - t.Fatal(err) - } - for { - packet, err := readPacket(client) - if err != nil { - t.Fatal(err) +func TestCampingCancellationClearsDeadlineAndNativeUI(t *testing.T) { + for _, action := range []struct { + name string + code uint32 + }{{"stand", 87}, {"abort", 108}, {"StopCamping", 121}} { + t.Run(action.name, func(t *testing.T) { + for _, camping := range []bool{false, true} { + name := "without countdown" + if camping { + name = "during countdown" } - if binary.BigEndian.Uint32(packet[16:20]) == 0x5f52412e { - break - } - } - if camping { - if _, err := client.Write(targetPacket(characterActionPacket(1, [5]uint32{120}))); err != nil { - t.Fatal(err) - } - select { - case deadline := <-serverConn.deadlines: - if remaining := time.Until(deadline); remaining < 29*time.Second || remaining > 30*time.Second { - t.Fatal("camping did not start the logout countdown", remaining) + t.Run(name, func(t *testing.T) { + world := newTestServer(t) + world.newCharacter() + client, connection := net.Pipe() + serverConn := &logoutDeadlineConn{Conn: connection, deadlines: make(chan time.Time, 4)} + if err := client.SetDeadline(time.Now().Add(5 * time.Second)); err != nil { + t.Fatal(err) + } + done := make(chan error, 1) + go func() { + defer connection.Close() + done <- world.serveWorldConnection(serverConn) + }() + t.Cleanup(func() { + client.Close() + if err := <-done; err != nil { + t.Error(err) + } + }) + cookie := systemPacket(0x1b, binary.BigEndian.AppendUint32(nil, 1)) + binary.BigEndian.PutUint16(cookie, 0xdfdf) + if _, err := client.Write(cookie); err != nil { + t.Fatal(err) + } + for { + packet, err := readPacket(client) + if err != nil { + t.Fatal(err) + } + if binary.BigEndian.Uint32(packet[16:20]) == 0x5f52412e { + break + } + } + if _, err := client.Write(targetPacket(n3Packet(0x570c2039, 50000, 1, nil))); err != nil { + t.Fatal(err) + } + for { + packet, err := readPacket(client) + if err != nil { + t.Fatal(err) + } + if binary.BigEndian.Uint32(packet[16:20]) == 0x570c2039 { + break + } + } + if camping { + if _, err := client.Write(targetPacket(characterActionPacket(1, [5]uint32{120}))); err != nil { + t.Fatal(err) + } + select { + case deadline := <-serverConn.deadlines: + if remaining := time.Until(deadline); remaining < 29*time.Second || remaining > 30*time.Second { + t.Fatal("camping did not start the logout countdown", remaining) + } + case <-time.After(time.Second): + t.Fatal("camping did not set a disconnect deadline") + } } - case <-time.After(time.Second): - t.Fatal("camping did not set a disconnect deadline") - } - } - for range 2 { - if _, err := client.Write(targetPacket(characterActionPacket(1, [5]uint32{121}))); err != nil { - t.Fatal(err) - } + for attempt := range 2 { + if _, err := client.Write(targetPacket(characterActionPacket(1, [5]uint32{action.code}))); err != nil { + t.Fatal(err) + } - select { - case deadline := <-serverConn.deadlines: - if !deadline.IsZero() { - t.Fatal("canceling camping retained a disconnect deadline", deadline) + select { + case deadline := <-serverConn.deadlines: + if !deadline.IsZero() { + t.Fatal("canceling camping retained a disconnect deadline", deadline) + } + case <-time.After(time.Second): + t.Fatal("cancellation did not clear the logout deadline") + } + ping := systemPacket(1, nil) + binary.BigEndian.PutUint16(ping[2:4], 11) + if _, err := client.Write(ping); err != nil { + t.Fatal(err) + } + var actions []uint32 + for { + packet, err := readPacket(client) + if err != nil { + t.Fatal("cancelled camping did not leave a usable world connection", err) + } + if binary.BigEndian.Uint16(packet[2:4]) == 11 && binary.BigEndian.Uint32(packet[16:20]) == 2 { + break + } + if binary.BigEndian.Uint32(packet[16:20]) != 0x5e477770 || binary.BigEndian.Uint32(packet[20:24]) != 50000 || binary.BigEndian.Uint32(packet[24:28]) != 1 { + t.Fatalf("unexpected cancellation response: %x", packet) + } + actions = append(actions, binary.BigEndian.Uint32(packet[29:33])) + } + var expected []uint32 + if action.code == 87 { + expected = append(expected, 87) + } + if camping && attempt == 0 { + expected = append(expected, 122) + } + if !slices.Equal(actions, expected) { + t.Fatalf("camping cancellation responses: got %v, want %v", actions, expected) + } } - case <-time.After(time.Second): - t.Fatal("StopCamping was ignored instead of clearing the logout deadline") - } - } - ping := systemPacket(1, nil) - binary.BigEndian.PutUint16(ping[2:4], 11) - if _, err := client.Write(ping); err != nil { - t.Fatal(err) - } - pong, err := readPacket(client) - if err != nil || binary.BigEndian.Uint16(pong[2:4]) != 11 || binary.BigEndian.Uint32(pong[16:20]) != 2 { - t.Fatal("cancelled camping did not leave a usable world connection", err, pong) + }) } }) } diff --git a/server/main.go b/server/main.go @@ -530,7 +530,8 @@ func (server *server) serveWorldClient(client *worldClient) error { if len(body) < 36 { return fmt.Errorf("short character action message") } - switch binary.BigEndian.Uint32(body[16:20]) { + action := binary.BigEndian.Uint32(body[16:20]) + switch action { case 22, 24, 25, 26, 28: if err := server.handleTeamAction(client, body); err != nil { return err @@ -569,12 +570,6 @@ func (server *server) serveWorldClient(client *worldClient) error { } case 86, 87: // Acknowledge sitting and standing so the client updates its posture. - if binary.BigEndian.Uint32(body[16:20]) == 87 { - loggingOut = false - if err := conn.SetReadDeadline(time.Time{}); err != nil { - return err - } - } if err := server.handlePosture(client, body); err != nil { return err } @@ -584,20 +579,20 @@ func (server *server) serveWorldClient(client *worldClient) error { if err := conn.SetReadDeadline(time.Now().Add(30 * time.Second)); err != nil { return err } - case 121: - // StopCamping cancels logout independently of posture or nano actions. - loggingOut = false - if err := conn.SetReadDeadline(time.Time{}); err != nil { - return err - } case 108: if err := server.handleNanoCast(client, body); err != nil { return err } - loggingOut = false + } + if action == 87 || action == 108 || action == 121 { + // Native action122 destroys the camping timer; abort108 alone does not. if err := conn.SetReadDeadline(time.Time{}); err != nil { return err } + if loggingOut { + response = characterActionPacket(character.id, [5]uint32{122}) + } + loggingOut = false } case 0x570c2039: if err := server.handleCharacterReady(client); err != nil {