aorecomp

Anarchy Online classic in the browser

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


commit 8582ef2bef1b07739e5ab9f0420aad33d52f597d
parent c70d0dbb4d337d41ebf75b8f7ff8caebb9942b78
Author: anon <anon@example.com>
Date:   Mon,  2 Nov 2026 16:51:49 +0000

Verify earned level ten and cold mission-key reclaim

Diffstat:
MTODO.md | 36+++++++++++++++++++++++++++++-------
Mdocs/character-progression.md | 8+++++---
Mdocs/insurance.md | 8++++++--
Mdocs/mission-levels.md | 107+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mdocs/player-resurrection.md | 8+++++---
Mdocs/reclaim.md | 19++++++++++++++-----
Aserver/mission_key_reclaim_test.go | 114+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
7 files changed, 280 insertions(+), 20 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -787,8 +787,9 @@ for exact records, protocol, tests and remaining reconstruction assumptions. glove. The ordinary level-six boundary, training and two accepted QL8 promises are now verified. Level seven, the saved QL8 armor and its earned training also pass. Subsequent native runs verify levels eight and nine with retained - QL10 upgrades; higher levels and an original universal HP/XP/skill curve remain - unverified. See the [native upper-range check](docs/mission-levels.md#native-level-four-upper-range-check), + QL10 upgrades; level ten is verified below. Higher levels and an original + universal HP/XP/skill curve remain unverified. See the + [native upper-range check](docs/mission-levels.md#native-level-four-upper-range-check), including zero/one-free-slot reward refusals, two-slot retry and complete item accounting through reconnect. A public-handler regression now covers the level4 -> 5 boundary, atomic @@ -857,8 +858,13 @@ for exact records, protocol, tests and remaining reconstruction assumptions. Current HP remains 180 while maximum HP reaches 339, and unbuffed 1h Blunt reaches 62. Each phase cold-loads retained equipment, supplies and wallet. Six level regressions and fifteen training tests pass with 78 results; the - new regression passes under race and vet passes. Ordinary earned level ten - remains pending; see [later earned-level regression](docs/character-progression.md#later-earned-level-regression). + new regression passes under race and vet passes. The + [native earned level-ten run](docs/mission-levels.md#native-earned-level-ten) + verifies twenty full-health level-ten kills, the earned boundary, exact + 1115-IP training without a refill and four promised QL10 rewards. Ordinary + scanner travel, fatal retaliation, saved return and cold collection conserve + all 24 reclaim instances, including charged supplies and the bound mission + key. See [later earned-level regression](docs/character-progression.md#later-earned-level-regression). - [ ] [P1] Recover ordinary NPC attack selection and authored attack procs. Verify original loadouts, choice/scheduling, damage types and complete effects for one admitted family through shared rules and native combat. Period @@ -1123,13 +1129,24 @@ Historical outdoor give-up timing and obstacle navigation remain open. and fresh server/WASM recovery. Controlled tests cover its death destination and exact item collection; an ordinary earned level-seven death now returns to that scanner and recovers with bought supplies. Ordinary - earned level-10 collection remains pending. Selected original Clan/ICC pairs - now pass controlled level-ten native saving, fatal combat, saved return and + earned level-ten collection now recovers all 24 exact instances after cold + startup, including charged supplies and the interrupted mission key. + Bought supplies restore full health, the same key opens its original world + and exact-book return pays its promised item/cash once. Selected original + Clan/ICC pairs now pass controlled level-ten native saving, fatal combat, saved return and exact reclaim collection, including page/cold recovery. Connected earned - level-ten travel/recovery and original courtyard access remain open. See + level-ten Omni travel, saved return and collection now pass; broader connected + faction travel/recovery and original courtyard access remain open. See [street insurance](docs/insurance.md#street-level-omni-pair) and [Clan/ICC coverage](docs/insurance.md#clan-and-icc-scanners). Unsaved training return must not imply that training contains a reclaim booth. +- [ ] [P1] Explain scanner refusal while reclaim items remain. Recover the + original feedback route for the shipped reclaim-before-save message and show + it only for that restriction. The earned level-ten native check receives a + failure acknowledgement without an explanation; inventory/progress remain + safe. Verify pending/available reclaim, successful saving after collection, + repeated requests and unrelated faction/range failures. See + [reclaim rules](docs/reclaim.md#shipped-rules-and-placement). - [x] Admit selected original Clan/ICC scanners and reclaim through shared rules. Tir117650 uses its authored Clan-only SaveChar requirement; Newland117651 accepts all citizens. The original Omni-only hardcode is replaced by the @@ -3505,6 +3522,11 @@ and server restarts. Turn every reproduced bug into a focused regression test. replays with its physical ID after page and cold recovery. This expands the verified paths while the broader report remains open; see [native earned level nine](docs/mission-levels.md#native-earned-level-nine). + The [earned level-ten boundary](docs/mission-levels.md#native-earned-level-ten) + now conserves all 44 owned instances through fatal combat, cold loading of + 24 reclaim entries, exactly-once collection, charged recovery, bound-key + mission re-entry/settlement and the reclaimed sleeve's wear/remove/rewear. + Final cold loading retains every physical/native slot and property. - [ ] [P2] Review nearly invisible original item icons separately from ownership loss. Low-Tech sleeves 70561/85744 reference icon 1010008/13228: the original 14.9.1 PNG is almost entirely chroma-key green, with only a tiny shoulder in diff --git a/docs/character-progression.md b/docs/character-progression.md @@ -390,9 +390,11 @@ Stamina 23 -> 28 and both raw skills 45 -> 55 cost exactly 1115 IP, leaving 30678. Effective unbuffed 1h Blunt becomes 62 and maximum HP becomes 339, without refilling current HP. Every phase cold-loads the same worn QL10 bat/body/pants, laboratory/recharger quantities and wallet. This shortened -fixture checks progression bookkeeping, rather than earned native level ten -or original encounter balance. Six level-five through level-ten regressions -and fifteen skill-training tests pass with 78 tests/subtests. The new regression +fixture checks progression bookkeeping. The separate +[native earned level-ten run](mission-levels.md#native-earned-level-ten) +verifies ordinary full-health fights and the accepted 1115-IP batch; neither +check establishes original encounter balance. Six level-five through level-ten +regressions and fifteen skill-training tests pass with 78 tests/subtests. The new regression also passes under the race detector; vet passes. Evidence is retained under `local/earned-tenth-boundary/`. diff --git a/docs/insurance.md b/docs/insurance.md @@ -96,8 +96,12 @@ pass. The ordinary hot and cold WASM checks pass in 723.23s and 37.17s. Original payloads, packet decoding, ownership reports and cleanup evidence remain in `local/earned-death/`. The subsequent [earned level-seven return](player-resurrection.md#earned-level-seven-scanner-return) -verifies fatal combat and recovery at the street scanner. Ordinary level-ten -reclaim collection remains a progression check. +verifies fatal combat and recovery at the street scanner. The subsequent +[earned level-ten run](mission-levels.md#native-earned-level-ten) also verifies +ordinary saving, fatal retaliation, the level-ten inventory split and cold +collection of the same 24 instances. A save request with reclaim remaining +fails safely; saving succeeds after collection. Its missing refusal explanation +remains a separate TODO. ## Clan and ICC scanners diff --git a/docs/mission-levels.md b/docs/mission-levels.md @@ -750,3 +750,110 @@ are retained under `local/earned-ninth-boundary/`, including These fights verify progression under the admitted provisional Leet profiles; they do not establish original NPC balance or higher encounter levels. + +## Native earned level ten + +The same normally created Enforcer continues from the unchanged level-nine +checkpoint: 1725 current XP, 27793 IP, 1303 credits, 21 laboratory charges, +47 recharger charges and 44 owned instances. Ordinary travel to the medical +shop, nine earned Monster Parts sales for 54 credits and a 150-credit purchase +create laboratory 343 with 50 charges. All ten banked instances, including +pistol 163 with 12 loaded rounds, remain unchanged. + +Four ordinary contracts supply twenty full-health level-ten Leets. Each fight +starts with the owner at full health and its opponent at full 300 HP. The +sixteenth kill crosses level nine/6225 XP to level ten/25 XP, awards exactly +4000 IP and raises maximum HP from 288 to 295 and maximum nano from 38 to 40. +The native level event does not refill current HP; the final incoming weapon +hit changes it from 217 to 212. Four further kills bring current XP to 1225. +No character, enemy, outcome or reward is edited for this progression. + +Exact book returns deliver the promised QL10 pants 349, gloves 354, sleeve 358 +and boots 364. Cash reconciles as 1303 + 54 sales - 150 supplies - 36 fees + +58 corpse credits + 80 completion credits = 1309. Conditional completion +XP/tokens remain unresolved and are not awarded. Some earned parts remain +unclaimed; the independent ledger distinguishes those from owned instances. +Forty-four laboratory charges are consumed in the twenty fights, leaving 27; +the recharger retains all 47. Both page reconnects and the intermediate fresh +server/WASM startup preserve the exact earned state and physical identities. + +The native Skills form trains Stamina 23 -> 28 and raw Body Development and +1h Blunt 45 -> 55 in one 1115-IP batch. Preview leaves server state unchanged; +acceptance leaves 30678 IP and raises maximum HP to 339 without changing +current HP from 295. Two bought laboratory charges restore full health, +leaving 25. After Thug's Delight expires normally, unbuffed effective 1h Blunt +is 62. All previous worn equipment and banked ammunition remain unchanged. + +Ordinary city travel reaches the original street scanner, 51005:3221750465. +Native use saves cumulative XP 39875. A normal ten-credit request then creates +contract 365, its five level-ten encounters, book 366 and physical key 365, +promising a QL10 bat. The full-health owner starts an ordinary fight and stops +attacking after observed retaliation. The living enemy subsequently kills the +owner; no XP is earned. Native/server zero HP, one death action 99 and one +automatic return action 152 are recorded before arrival at the saved street +scanner with 1 HP and 1 nano. + +Original template flags independently predict the exact split: nine worn +pieces and the NoDrop starter First Aid remain carried/worn; 24 ordinary bag +items enter reclaim; ten banked items stay banked. Key 365 is not NoDrop and +correctly enters reclaim without losing its contract binding. The pending +checkpoint preserves all 126 global physical item/location rows and every +availability deadline. Saving while reclaim remains fails without changing +inventory or progress; the missing refusal explanation is a separate TODO. + +Fresh server/two-client startup retains the same 24 reclaim entries. Ordinary +typed booth use and native collection recover each exact instance once, +including laboratory stacks 144/309/343, recharger 284 and key 365. Counts, +qualities, templates and ammunition are unchanged. Repeated empty-cell clicks +and empty close/reopen create no items. All 34 carried/worn and ten banked +instances remain owned; the observer keeps its seven items and receives no +private reclaim contents. Saving now succeeds with reclaim empty. + +Eight charges from reclaimed laboratory 144, each under its actual 15-second +Treatment lock, restore full 339 HP. Quiet regeneration has already restored +40 nano; the recharger remains at 47. Laboratories retain 17 charges: +144 x3, 309 x10 and 343 x4. This is observed consumption, not a minimum cost. +Normal city/backyard travel and entry with the same key reopen world 65580. +The owner picks up original book 366 and returns it to the issuing booth, +without another kill. Settlement consumes only key 365/book 366, creates +promised QL10 bat 367 and pays 20 credits, leaving 1319. Current XP 1225 and +30678 IP remain unchanged; twenty contracts are now complete. + +Reclaimed QL10 sleeve 358 then equips, removes and re-equips in the left arm. +Previous Low-Tech sleeve 125 remains in the bag. The native Protection form +shows 172/154/172/132/31/31/31/31 in stat order 90..97, independently matching +the original endpoint interpolation. Both page reconnects replay all exact +identities, including the new bat. The stopped checkpoint conserves all 125 +global item/location rows, 44 owned instances, ten banked items and the loaded +pistol's 12 rounds. All 100 prior encounter records, including their existing +kill flags, remain unchanged during the return/collection sequence. + +`TestMissionKeySurvivesDeathColdReclaimAndBoundReturn` repeats the key lifecycle +through public handlers: real combat death, cold pending reclaim, resurrection, +collection and duplicate pickup, another cold load, bound mission entry, +objective pickup and duplicate settlement. Its controlled waiting-period setup +isolates credential preservation from the real elapsed-time native check. + +Final fresh server/two-client startup preserves the stopped state through both +further page reconnects. All 125 item/location rows, wallets, twenty missions, +100 encounter records, keys, doors and learned programs match exactly. Carried +slice iteration reloads in ID order while every physical/native slot remains +unchanged. The observer's allocator marker refreshes 366 -> 367 without changing +its seven items or private progress. The native Protection form retains all +eight totals. Eighteen final cold traces have empty native/protocol error lists. + +The four native stages pass in 1791.94, 4603.09, 1380.19 and 71.96 seconds, +closing all owned browsers and servers. Their 1047 saved traces have empty +native/protocol error lists. The new key regression and related selection pass +31 roots/131 tests and subtests; the new regression also passes under the race +detector and vet passes. The six earned-level regressions and fifteen training +tests separately pass with 78 results, including the tenth-level race check. + +Evidence, checkpoint hashes and independent verifiers are retained under +`local/earned-tenth-boundary/`, including `tenth-boundary-verified.json`, +`training-verified.json`, `earned-death-verified.json`, +`pending-checkpoint-verified.json`, `collection-verified.json`, +`recovery-verified.json`, `key-return-verified.json`, `sleeve-verified.json` +and `checkpoint-verified.json`. These earned +fights use the admitted provisional Leet profiles; they do not establish +original NPC balance, insurance fees, resurrection timing or higher encounters. diff --git a/docs/player-resurrection.md b/docs/player-resurrection.md @@ -227,9 +227,11 @@ The level-one observer sees the owner at the backyard booth before entry and receives no private encounter/death/return traffic. Its seven items, zero XP/credits and1500IP remain. The authored city exit requires level2 or1000credits, so it stays in the backyard. This checks public departure and private isolation; -it does not provide an observer at the scanner. Ordinary level-ten reclaim, -full inventory and the broader progression regression remain open. Mission -balance, scanner arrival offsets and returned resources remain provisional. +it does not provide an observer at the scanner. The subsequent +[earned level-ten run](mission-levels.md#native-earned-level-ten) verifies the +ordinary reclaim boundary. Full inventory and the broader progression regression +remain open. Mission balance, scanner arrival offsets and returned resources +remain provisional. Both page reconnects and a fresh server/two-client cold check retain all39 owned and114 global physical instances, exact slots/charges/qualities, earned skills, diff --git a/docs/reclaim.md b/docs/reclaim.md @@ -9,8 +9,10 @@ Ownership and availability survive reconnect and server restart. Unsaved resurrection uses the affiliated training entrance. This does not add reclaim to training: the admitted booths are in the cities. -Original Clan/ICC scanner and reclaim placements now share the same rules; -the connected earned level-ten progression check remains open. +Original Clan/ICC scanner and reclaim placements now share the same rules. +The [earned level-ten run](mission-levels.md#native-earned-level-ten) verifies +ordinary Omni travel, saved return and collection of all 24 exact bag instances, +including charged supplies and the interrupted mission's bound key. The original street-level pair and its typed placement checks are described in [street insurance](insurance.md#street-level-omni-pair). The Tir/Newland placements and authored scanner affiliation rules are recorded @@ -81,9 +83,9 @@ no booth identity, so the server checks proximity to an admitted booth. `0x1007d1a0` delegates to proxy reader `0x101516d0` and inventory reader `0x1002dba0`. Its payload starts with `(entryCount + 1) * 1009`, followed by 32-byte entries: slot, uint16 flags, uint16 count, item identity, low/high -templates, quality and auxiliary value. Entries use flags 3, count 1 and zero -auxiliary value, as in the native corpse template-proxy transfer. A final -uint32 supplies the private proxy instance, currently the owner's character +templates, quality and auxiliary value. Entries use flags 3, the actual item +stack count and zero auxiliary value, as in the native corpse template-proxy +transfer. A final uint32 supplies the private proxy instance, currently the owner's character ID. The envelope identifies that owner as type 50000. Activation `0x1007d210` installs the proxy of type 57006 and opens its native @@ -138,6 +140,13 @@ transaction preservation, pools larger than the native window and insurance rejection with unclaimed items. A native wire round trip exercises GenericCmd, CharacterAction 109/110 and page 106 pickup through normal server dispatch. +`server/mission_key_reclaim_test.go` checks an accepted key through lethal +combat, cold pending reclaim, resurrection, collection/retry, another cold load, +entry to its bound mission, exact-objective pickup and settlement/retry. The key +and objective disappear only on successful completion; the unrelated item and +single cash payment survive the final cold load. The related 31-root selection +passes with 131 results; the new regression passes under race and vet passes. + Two published WASM clients exercised the shipped booth. A fixture supplied a level-10 player with equipped axe ID 1 (template 209283), ordinary Monster Parts ID 100 (42640), and NoDrop starter weapon ID 101 (121567). At the starter fight diff --git a/server/mission_key_reclaim_test.go b/server/mission_key_reclaim_test.go @@ -0,0 +1,114 @@ +package main + +import ( + "encoding/binary" + "slices" + "testing" + "time" +) + +func TestMissionKeySurvivesDeathColdReclaimAndBoundReturn(t *testing.T) { + world, _ := newMissionEntranceWorld(t) + player, client := world.characters[1], world.clients[1] + player.level, player.resurrectionTerminal = 10, 0xc00802c1 + player.playfield, player.position = 705, [3]float32{598, 16.9, 329} + if err := world.saveUser_locked(player); err != nil { + t.Fatal(err) + } + items := slices.Clone(player.inventory.Items) + + defeatReclaimPlayer(t, world) + cold := reloadMissionEntranceWorld(t) + player = cold.characters[1] + var binding uint32 + if err := cold.db.QueryRow("SELECT mission_id FROM mission_keys WHERE item_id=2").Scan(&binding); err != nil { + t.Fatal(err) + } + + if player.health != 0 || len(player.inventory.Items) != 0 || len(player.inventory.Reclaim) != 2 || + player.inventory.Reclaim[1].Item != items[1] || items[1].ID != 2 || items[1].Template != 28577 || binding != 2 { + t.Fatal("death or cold loading lost the same mission key and its binding", player.inventory, binding) + } + + client = &worldClient{id: 1, conn: &combatTestConn{}, target: true, ready: true} + cold.clients[1] = client + if err := cold.handleResurrection(client, resurrectionRequest(1)[20:]); err != nil { + t.Fatal(err) + } + cold.clients[1], client.ready, client.loading = client, true, false + player.position = [3]float32{598, 16.9, 331} + if err := cold.savePosition_locked(player); err != nil { + t.Fatal(err) + } + + // Isolate collection from the separately tested real-time waiting period. + inventory := player.inventory + inventory.Reclaim = slices.Clone(inventory.Reclaim) + for index := range inventory.Reclaim { + inventory.Reclaim[index].AvailableAt = time.Now().Add(-time.Second).UTC() + } + if err := cold.saveInventory_locked(player, inventory); err != nil { + t.Fatal(err) + } + if err := cold.handleReclaim(client, reclaimRequest(109)); err != nil { + t.Fatal(err) + } + for _, slot := range []uint32{0, 1, 1} { + if err := cold.handleInventory(client, reclaimTakeRequest(slot)); err != nil { + t.Fatal(err) + } + } + restored := reloadMissionEntranceWorld(t) + player = restored.characters[1] + + if !slices.Equal(player.inventory.Items, items) || len(player.inventory.Reclaim) != 0 || + len(player.missions) != 1 || player.missions[0].id != 2 { + t.Fatal("collection or its retry lost or duplicated the bound key", player.inventory) + } + + player.playfield, player.position, player.rotation = 3000, [3]float32{89.30216, 115.75, 152.5}, [4]float32{0, 1, 0, 0} + if err := restored.savePosition_locked(player); err != nil { + t.Fatal(err) + } + output := &combatTestConn{} + client = &worldClient{id: 1, conn: output, target: true, ready: true} + restored.clients[1] = client + if err := restored.handleMovement(client, playerMovementRequest(player, 1)); err != nil { + t.Fatal(err) + } + + if player.playfield != 65536 || player.missions[0].objective != 3 { + t.Fatal("the collected key did not reopen its original contract", player.userData(), player.missions) + } + + restored.clients[1], client.ready, client.loading = client, true, false + player.position, player.movement = restored.worldItems[3].position, playerMovement{} + if err := restored.handleInventory(client, worldPickupRequest(1, 3)); err != nil { + t.Fatal(err) + } + player.playfield, player.position = 3000, [3]float32{100, 115.75, 145} + if err := restored.savePosition_locked(player); err != nil { + t.Fatal(err) + } + if err := restored.handleMissionReturn(client, missionReturnRequest(1)); err != nil { + t.Fatal(err) + } + if err := restored.handleMissionReturn(client, missionReturnRequest(2)); err != nil { + t.Fatal(err) + } + settled := reloadMissionEntranceWorld(t) + var credentials, bindings int + if err := settled.db.QueryRow("SELECT count(*) FROM items WHERE id IN (2,3)").Scan(&credentials); err != nil { + t.Fatal(err) + } + if err := settled.db.QueryRow("SELECT count(*) FROM mission_keys").Scan(&bindings); err != nil { + t.Fatal(err) + } + + if !slices.Equal(settled.characters[1].inventory.Items, items[:1]) || settled.characters[1].inventory.Credits != 24 || + credentials != 0 || bindings != 0 || len(settled.characters[1].missions) != 0 || + len(settled.missionExpiry) != 1 || !settled.missionExpiry[0].completed || + binary.BigEndian.Uint32(output.packets[len(output.packets)-1][29:33]) != 2 { + t.Fatal("bound return or retry lost an unrelated item, retained credentials or paid twice", settled.characters[1].inventory) + } +}