aorecomp

Anarchy Online classic in the browser

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


commit 7da4480ed5836cae08fd7f424da9b19e53680cde
parent 451633dfcf21ac8f91ec4de5a66edf7512427add
Author: anon <anon@example.com>
Date:   Sun,  1 Nov 2026 08:15:57 +0000

Verify sixth-level training and earned recovery restock

Diffstat:
MTODO.md | 17+++++++++++++++++
Mdocs/character-progression.md | 21+++++++++++++++++++++
Mdocs/mission-levels.md | 36++++++++++++++++++++++++++++++++++++
Aserver/sixth_level_training_test.go | 103+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 177 insertions(+), 0 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -122,6 +122,12 @@ player level 6 and conditional mission XP/tokens remain open. See [earned next-quality weapon](docs/mission-levels.md#earned-next-quality-weapon). See also [earned body reward](docs/mission-levels.md#earned-metaplast-body-reward). +Seven retained Monster Parts were sold before another 50-charge laboratory +purchase through ordinary city/shop travel. Exact item/location accounting +retains all other instances, the older laboratory counts 31/21 and wallet 116; +see [earned recovery restock](docs/mission-levels.md#earned-recovery-restock). +Two fresh WASM clients and page reconnects retain all 34 player-owned items +and the same progress, with all 108 global physical records accounted for. Next execution order: @@ -756,6 +762,11 @@ for exact records, protocol, tests and remaining reconstruction assumptions. It also checks the higher health maximum without refilling current health. See [later earned-level regression](docs/character-progression.md#later-earned-level-regression) and [native earned level five](docs/mission-levels.md#native-earned-level-five). + The level5 -> 6 public-handler regression also covers the raw Body Development + and 1h Blunt caps 30 -> 35, the 4000-IP award, exact 320-IP training cost, + observer privacy and cold item/wallet conservation. Higher maximum health + preserves current health. This controlled fixture does not establish native + earned level six or original encounter balance. - [x] Verify mapped Tiny Stalkers as a second ordinary early combat family. Admit only SR01 at levels 2..4 through shared profiles, preserving medium identity confidence, attack-selection uncertainty and provisional balance. @@ -3132,6 +3143,9 @@ with payloads and known client/server provenance. the original kit-37 post-reload scan omitted its previous top-row cell. Saved native icon maps and explicit wheel-row screenshots now establish the focused case; see [merged-kit audit](docs/starter-progression.md#merged-kit-visual-cell-audit). + The later seven-part sale also confirms that initially sparse logical slots + can occupy compact GUI cells. Its wire offers identify exact sources despite + the visual order; see [earned recovery restock](docs/mission-levels.md#earned-recovery-restock). - [ ] [P1] Audit native inventory-proxy identities immediately after rewards. Mission 81's new boots have the correct slot, QL, templates and count while their raw proxy still reports type/id 0; page replay populates exact ID 87. @@ -3140,6 +3154,9 @@ with payloads and known client/server provenance. before attributing this snapshot difference to missing ownership or a delayed reply. All 29 exact physical instances survive page/cold recovery. Evidence: `local/todo-progression-play/runtime-level21/mission81-handin-settled/`. + A later ordinary laboratory purchase has the same initial proxy shape; + cold reconstruction supplies permanent ID253 with all 50 charges intact. + See [earned recovery restock](docs/mission-levels.md#earned-recovery-restock). - [ ] [P1] Audit inventory layout persistence through city/shop zoning and earned sales. The connected run starts with its saved 516-byte map, then an OPFS inspection after the ten-part sale/laboratory purchase returns no icon files. diff --git a/docs/character-progression.md b/docs/character-progression.md @@ -286,6 +286,27 @@ Development 25, maximum health rises from 173 to 180 while current health stays fixture does not measure encounter balance; the ordinary native journey is recorded in [mission levels](mission-levels.md#native-earned-level-five). +`TestEarnedSixthLevelUnlocksMeleeAndBodyDevelopmentTraining` covers the next +server boundary with a controlled one-hit encounter worth 150 XP. A level-five +Atrox Enforcer at 4350 current XP cannot raise raw Body Development or 1h Blunt +from 30 to 35. The rejected batch preserves both skills and all IP, including +cold reconstruction. + +The kill earns level six with zero remaining XP and awards 4000 IP exactly +once. The native level-up payload retains cumulative XP 15650 and the next +threshold 20650. The observer receives the visible level without private XP or +IP. Training both skills to 35 then costs 160 IP each, reducing 18324 to 18004. +Maximum health rises from 200 to 207 on leveling and to 227 after training; +current health stays 150 throughout. Every accepted phase cold-loads the exact +weapon, laboratory, shirt and wallet. This fixture checks bookkeeping rather +than native encounter balance; earning level six through ordinary WASM play +remains open. + +The focused progression/training selection passes 18 root tests and 81 total +test/subtest results both normally and under the race detector. It includes +both later earned-level regressions, all six kill attack paths and the skill +training suite. `go vet ./server/...` also passes. + ## Retained evidence The selected relocated `kkr.dll` has SHA-256 diff --git a/docs/mission-levels.md b/docs/mission-levels.md @@ -297,3 +297,39 @@ Player level remains 5 with 2,725 current XP, 14,324 IP and full 200 HP. Conditional completion XP/tokens remain outside this verified reward path. Evidence: `local/earned-level-six/body-fights-verified.json`, `body-reward-verified.json`, `body-cold-restart.json` and `body-cycle-verified.json`. + +## Earned recovery restock + +The retained level-five Enforcer reached the basic medical machine in +playfield 1183 through ordinary backyard/city/shop travel. Seven previously +earned Monster Parts, instances 242, 243, 244, 248, 249, 250 and 251, sold in +three accepted baskets for 18, 18 and 6 credits. The wallet increased from 224 +to 266. Native offer requests identify each exact inventory source; the +initially sparse logical slots do not imply the visible GUI cell positions. + +An ordinary stock selection quoted 150 credits for a QL1 Treatment Laboratory +with 50 charges. Acceptance created instance 253 at slot 68 and left 116 +credits. The older laboratory instances 239 and 144 retained 31 and 21 charges. +No charges were consumed during this restock. The worn QL8 bat, QL5 body, +QL6 gloves, other equipment and all spare items remained unchanged. The owner +retained level five, 2725 current XP, 14324 IP and full 200 HP; the observer +retained its seven issued items and zero XP/cash. + +The stopped database audit compares complete item and location rows, including +unrelated players and static resources. Its only physical changes are the seven +sold parts and the new laboratory, leaving 108 global records and placements. +Every other item row and unrelated wallet is identical. SQLite integrity and +foreign-key checks pass. Native screenshots, wire traces, the stopped database +and independent accounting are retained in +`local/earned-sixth-boundary/run-20261101-004507/` and `shop-verified.json`. +The newly bought laboratory initially has the original native type/id-zero +proxy shape; the durable item already has its permanent identity. This run +does not establish native earned level six or additional historical stock. + +A fresh server and two fresh WASM contexts reconstructed all 34 player-owned +items, including laboratory 253 with its permanent type/ID, template, quality, +slot and 50 charges. Both page reconnects retained the same state without page +errors. The cold database audit retains all 108 physical records and placements, +all wallets and player stats, and the stored mission records exactly. The +check passed in 25.42 seconds; evidence is in +`local/earned-sixth-boundary/cold-20261101-011428/` and `cold-verified.json`. diff --git a/server/sixth_level_training_test.go b/server/sixth_level_training_test.go @@ -0,0 +1,103 @@ +package main + +import ( + "encoding/binary" + "slices" + "testing" + "time" +) + +func TestEarnedSixthLevelUnlocksMeleeAndBodyDevelopmentTraining(t *testing.T) { + world := newOmniTrainingBossKillWorld(t, "unarmed") + player, client := world.characters[1], world.clients[1] + player.appearance = player.appearance&^(7<<4) | 4<<4 + player.profession, player.level, player.experience = 9, 5, 4350 + player.stats = defaultCharacterStats(4) + player.stats.Abilities = characterAbilitiesStats{19, 21, 22, 6, 7, 3} + player.stats.Body.BodyDevelopment, player.stats.Melee.OneHandBlunt = 30, 30 + player.stats.Body.Brawling, player.stats.Body.Dimach = 21, 11 + player.stats.Melee.SneakAttack, player.stats.Melee.FastAttack = 19, 19 + player.stats.ImprovementPoints, player.health = 14324, 150 + if err := world.saveUser_locked(player); err != nil { + t.Fatal(err) + } + items := []ownedItem{ + {ID: 3, Type: 51018, Template: 122691, Quality: 8, Slot: 6, Count: 1}, + {ID: 4, Type: 51005, Template: 25812, Quality: 1, Slot: 64, Count: 31}, + {ID: 5, Type: 51022, Template: 29426, Quality: 1, Slot: 65, Count: 1}, + } + if err := world.saveInventory_locked(player, playerInventory{LastID: 5, Items: slices.Clone(items), Credits: 224}); err != nil { + t.Fatal(err) + } + observer := world.newCharacter() + observer.playfield = player.playfield + if err := world.saveUser_locked(observer); err != nil { + t.Fatal(err) + } + otherOutput := &combatTestConn{} + world.clients[observer.id] = &worldClient{id: observer.id, conn: otherOutput, target: true, ready: true, npcs: map[uint32]bool{1000000: true}} + // The one-hit boss isolates level, IP and health bookkeeping. + world.combatRoll = func(uint32) uint32 { return 0 } + trained := player.baseStats() + trained.Body.BodyDevelopment, trained.Melee.OneHandBlunt = 35, 35 + + if err := world.handleSkillTraining(client, skillTrainingRequest(trained)[20:]); err != nil { + t.Fatal(err) + } + cold := newTestInventoryServer(t) + + if player.level != 5 || player.experience != 4350 || player.stats.Body.BodyDevelopment != 30 || player.stats.Melee.OneHandBlunt != 30 || + player.stats.ImprovementPoints != 14324 || player.health != 150 || player.maximumHealth() != 200 || cold.characters[1].stats != player.stats || + !slices.Equal(cold.characters[1].inventory.Items, items) { + t.Fatal("level-five training exceeded its cap or changed retained ownership", player.stats) + } + + attackForExperience(t, world, "unarmed") + world.advanceCombat(player.rechargeUntil.Add(time.Second)) + cold = newTestInventoryServer(t) + + for _, current := range []*server{world, cold} { + owner := current.characters[1] + if owner.level != 6 || owner.experience != 0 || owner.stats.ImprovementPoints != 18324 || owner.health != 150 || owner.maximumHealth() != 207 || + owner.stats.Body.BodyDevelopment != 30 || owner.stats.Melee.OneHandBlunt != 30 || !slices.Equal(owner.inventory.Items, items) || owner.inventory.Credits != 224 { + t.Fatal("earned level lost XP, IP, current health or a retained instance", owner.profile(), owner.inventory) + } + } + levels, visibleLevels := 0, 0 + for _, packet := range client.conn.(*combatTestConn).packets { + if binary.BigEndian.Uint32(packet[16:20]) == 0x7f405a16 { + levels++ + for index, expected := range []uint32{6, 18324, 15650, 15650, 20650, 0, 2, 150} { + if binary.BigEndian.Uint32(packet[29+index*4:]) != expected { + t.Fatal("incorrect native sixth-level award", index, packet) + } + } + } + } + for _, packet := range otherOutput.packets { + key := binary.BigEndian.Uint32(packet[16:20]) + if key == 0x7f405a16 || key == 0x2b333d6e && (binary.BigEndian.Uint32(packet[29:33]) == 52 || binary.BigEndian.Uint32(packet[29:33]) == 53) { + t.Fatal("observer received private XP or IP") + } + if key == 0x2b333d6e && binary.BigEndian.Uint32(packet[29:33]) == 54 && binary.BigEndian.Uint32(packet[33:37]) == 6 { + visibleLevels++ + } + } + if levels != 1 || visibleLevels != 1 || observer.level != 1 || observer.experience != 0 || cold.characters[observer.id].experience != 0 { + t.Fatal("the sixth-level award was repeated or leaked to an observer") + } + + if err := world.handleSkillTraining(client, skillTrainingRequest(trained)[20:]); err != nil { + t.Fatal(err) + } + cold = newTestInventoryServer(t) + + for _, current := range []*server{world, cold} { + owner := current.characters[1] + if owner.level != 6 || owner.experience != 0 || owner.stats.Body.BodyDevelopment != 35 || owner.stats.Melee.OneHandBlunt != 35 || + owner.stats.ImprovementPoints != 18004 || owner.health != 150 || owner.maximumHealth() != 227 || owner.inventory.Credits != 224 || + !slices.Equal(owner.inventory.Items, items) { + t.Fatal("sixth-level training lost its exact cost, health maximum or owned items", owner.profile(), owner.inventory) + } + } +}