aorecomp

Anarchy Online classic in the browser

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


commit 643e743f30a6018a427b97d454c543b6b13007f5
parent af44d4dadc84d8f6a755f16c04a42de6496d6e4a
Author: anon <anon@example.com>
Date:   Sun, 25 Oct 2026 03:15:48 +0000

Admit original ordinary nano metadata variants

Diffstat:
MTODO.md | 9++++++---
Mdocs/first-aid.md | 20++++++++++++++++----
Mdocs/nano-buffs.md | 17++++++++++-------
Mdocs/nano-healing.md | 11+++++++++++
Mdocs/nano-learning.md | 4++--
Mdocs/nano-skill-buffs.md | 71++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
Mserver/nano_buffs.go | 7+++++--
Aserver/nano_metadata_test.go | 101+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mserver/stat_buff_catalog_test.go | 4++--
Mserver/testdata/ordinary-skill-nanos.json | 3+++
10 files changed, 222 insertions(+), 25 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -617,9 +617,12 @@ introduction and starting-item gameplay remain open below. cold recovery; preserve trained values. Use native defaults for omitted metadata and anchor held movement when RunSpeed changes. See [skill nanos](docs/nano-skill-buffs.md) for source and verification boundaries. -- [ ] Research remaining skill-program contracts: Can8 programs 29302/29312, - Minor Suppressor43370's different flags, Take The Shot32065's critical-hit - function, Trader transfers/wrangles and team targeting. Verify complete +- [x] Admit the complete Can8 programs Mocham's Gift: MatMet29302 and PsyMod + Mastery29312, plus Fixer startup Minor Suppressor43370's exact flag variant. + Retain both skill/profession gates, all effects and ordinary lifecycle; + reject unverified metadata neighbors. See [skill nanos](docs/nano-skill-buffs.md). +- [ ] Research remaining skill-program contracts: Take The Shot32065's + critical-hit function, Trader transfers/wrangles and team targeting. Verify complete effects, requirements, rejection, persistence and lifecycle before admission. Establish acquisition for Shijima's Cloak31405; the decoded original catalog has no ordinary LearnNano uploader for it. diff --git a/docs/first-aid.md b/docs/first-aid.md @@ -139,12 +139,24 @@ ordinary absolute setter. ActionIIR's live SimpleItem dispatch uses virtual `+0x44`, then `0x10097c30 -> 0x1009ed70`, for lock, close, repair, trap and removal handling. The inspected base callbacks supply no new healing primitive. Twenty-two bounded activation call sites and 58 wider syntactic candidates -also yielded no established additive health message. This leaves derived-item -overrides and complete data-flow coverage open. The ledger and 22 complete REA +also yielded no established additive health message. Complete data-flow +coverage remains open. The ledger and 22 complete REA records are under `local/healing-delivery-research/`; SkillIIR evidence includes `ev_f78b8b0e8d641d2187061bd6824639eb2e2872cdce64bffbb2f74cbdec9b5246`. -The next useful question is the original AttackInfo/queued-impact timing -contract, ideally alongside a correlated original-server combat-heal capture. + +A further original RTTI-backed audit accounts for all six distinct ActionIIR ++0x44 callbacks across 18 primary SimpleItem-derived vtables in this KKR. +The four additional targets handle corpses, mines, traps and weapon-item +explosions; none establishes an additive HP writer or neutral weapon-result +reconciliation. Their authored effects still use the common executor. The +vtable identity is corrected: 10171fec belongs to Book_t, while SimpleItem_t's +primary table is 10173d14. Full raw RTTI, exact evidence IDs and callback +coverage are retained under `local/combat-heal-derived-item-research/`. +This closes that enumerated override lead, while imported/missing-RTTI classes, +other protocol routes and the historical server's timing remain unresolved. + +The original AttackInfo/queued-impact timing contract and a correlated +original-server combat-heal capture remain useful evidence. The authored combat-use rule still applies; this result does not justify delaying First Aid until incoming combat stops. diff --git a/docs/nano-buffs.md b/docs/nano-buffs.md @@ -1,17 +1,18 @@ # Temporary nano research for 14.9.1 Ordinary ability, health, skill and passive regeneration buffs share one -timed-effect path. Complete-contract checks admit 239 original programs and -238 original crystals; see [skill buffs](nano-skill-buffs.md) for the expansion. +timed-effect path. Complete-contract checks admit 242 original programs and +241 original crystals; see [skill buffs](nano-skill-buffs.md) for the expansion. Learning and casting remain separate operations; arbitrary nano functions are not enabled by this family. ## Complete contract admission -Programs require native header51051, ItemType0, Can0 and the audited raw -Flags0 values `0x80010000` or `0x10000`. Both carry BuffNano0x10000 and lack the -hostile/nonoverwrite flags used by the reviewed cast and cancellation paths. -These are two exact audited values, not a claim that arbitrary other flag bits +Programs require native header51051, ItemType0, audited Can0/8 and the raw +Flags0 values `0x80010000`, `0x10000` or `0x10002`. All carry BuffNano0x10000 +and lack the hostile/nonoverwrite flags used by the reviewed cast and +cancellation paths. +These are three exact audited values, not a claim that arbitrary other flag bits are harmless. Duration, NCU, strain, cost, range, attack and recharge must resolve to positive finite values, including original constructor defaults for omitted fields. Authored zero values remain zero. Each OnUse0 effect is an @@ -42,7 +43,9 @@ The catalog audit covers all 4,366 decoded nanos. The health-buff records and earlier 29-program boundary are retained in `local/maximum-resource-nano-research/catalog/`. The expanded skill audit re-parses 778 selected records from the original ResourceDatabase, retaining -full fields and hashes in `local/skill-nano-research/defaults-audit/`. +full fields and hashes in `local/skill-nano-research/defaults-audit/`. The +subsequent Can/flag audit re-verifies 781 records under +`local/nano-contract-research/catalog/`. Raw flags identify this bounded content class; they are not reinterpreted as evidence of historical death or offline-clock rules. diff --git a/docs/nano-healing.md b/docs/nano-healing.md @@ -70,6 +70,17 @@ and both fully reparsed original program records are retained in execution lead; the historical server's HP and weapon-impact exchange remains unresolved. No client behavior was changed and no analysis session was opened. +## Derived item callbacks + +The remaining ActionIIR derived-item lead was audited using original KKR RTTI: +18 primary SimpleItem-derived tables resolve to six callback targets. Corpse, +mine, trap and weapon-item overrides add item/explosion/effect behavior, with +no established current-HP addition or neutral AttackInfo drain. Common authored +execution still rejects Hit53002. The full bounded audit, source hashes, raw +RTTI and 23 new complete evidence records are under +`local/combat-heal-derived-item-research/`. Its owned analysis session was closed. +This narrows the unresolved delivery search; it does not enable healing casts. + ## Verification Go tests cover exact BM/MM boundaries, profession and quality rejection, diff --git a/docs/nano-learning.md b/docs/nano-learning.md @@ -26,8 +26,8 @@ basic ability Boost crystals and QL 4 Augment Strength now share this upload path. Their exact crystal/program IDs and qualities are tabulated there; each uses its authored LearnNano function and requirements. -Complete-contract admission covers 238 ordinary ability, health, skill and -regeneration crystals for 239 programs. Shijima's Cloak 31405 has no original +Complete-contract admission covers 241 ordinary ability, health, skill and +regeneration crystals for 242 programs. Shijima's Cloak 31405 has no original ordinary uploader in the decoded catalog; no replacement crystal is invented. Both upload and casting use the shared postfix requirement evaluator, including the authored BM/MM/PM/MC thresholds and real or visual profession predicates. diff --git a/docs/nano-skill-buffs.md b/docs/nano-skill-buffs.md @@ -1,10 +1,10 @@ # Ordinary skill buffs in 14.9.1 -The shared timed-buff path admits 210 additional original positive skill +The shared timed-buff path admits 213 additional original positive skill programs, covering 60 of the 69 trained skills. It retains every effect in each program, including mixed contracts such as Offensive Steamroller 29240: Melee, Ranged, Physical and Nano Initiative +133, and Fling Shot +30. This -brings ordinary supported buffs to 239 programs and 238 crystal uploaders. +brings ordinary supported buffs to 242 programs and 241 crystal uploaders. The exact new program, crystal, authored quality, profession, modifiers, NCU, duration and native cost expectations are in @@ -90,7 +90,7 @@ REA evidence IDs: ## Verification -Public upload/cast/cancel tests cover all 210 new programs, exact complete +Public upload/cast/cancel tests cover all 213 skill programs, exact complete modifiers across every trained skill, costs, NCU, duration and cold recovery. Separate tests isolate all seven omitted defaults, skill-buff requirements and RunSpeed application/expiry anchoring. Additional public-operation tests cover @@ -100,7 +100,7 @@ regressions passed under the race detector in 205.419 seconds; `go vet` passed for all tracked Go packages. The complete tracked Go suite (`go test ./server/... ./tools/data/export_gamedata --count=1 -timeout=30m`) passed: server 662.096 seconds, game data 9.692 seconds. +-count=1 -timeout=30m`) passed: server 629.645 seconds, game data 7.548 seconds. Two real WASM clients ran in headed Chromium with the GPU OpenGL renderer against the sole shared HTTPS preview. Ordinary native crystal use @@ -133,7 +133,7 @@ Native checks verified: High skills, the QL300 NCU ear, Pre-Universe Storage Device, armor and pistol placement were explicit GM fixtures. Crystal upload, program selection, casting, cancellation and movement used the native UI. These representative -native checks do not claim manual execution of all 210 programs. Screenshots, +native checks do not claim manual execution of all 213 programs. Screenshots, read-only native state, GPU identity, wire captures, database snapshots and verification scripts are retained under `local/skill-nano-smoke/`. @@ -141,3 +141,64 @@ Both owned browser contexts were closed. Cleanup removed the two test characters and eight remaining fixture items; foreign-key and integrity checks passed, and hashes confirmed every unrelated database row was unchanged. The sole shared HTTPS preview was restarted with Visitor8 retained. + +## Additional original metadata variants + +The ordinary path also admits three complete programs without adding any +program-ID branches. Program Can 8 is accepted alongside 0, and the exact +program flag value `0x10002` is accepted alongside the two earlier values. +Other Can/flag values retain their existing rejection boundary. + +| Program | Crystal / QL | Complete modifiers | NCU | Duration | Requirements | +| --- | --- | --- | --- | --- | --- | +| Mocham's Gift: MatMet 29302 | 29399 / 162 | Matter Metamorphosis 127 +140 | 50 | 60 min | PM/SI >751, visual MP12 | +| PsyMod Mastery 29312 | 29409 / 47 | Psychological Modification 129 +50 | 15 | 45 min | PM/SI >225, visual MP12 | +| Minor Suppressor 43370 | 43380 / 1 | SMG 114 +8, Burst 148 +7 | 1 | 30 min | PM >9, SI >8, visual Fixer4 | + +The two MP programs author Can 8. Minor Suppressor authors Flags `0x10002`. +The original cast admission `100646a0`, action-3 requirement lookup +`1008fc40 -> 1008f990`, selector-derived self-target metadata `100b3e70`, +friendly gate `10066310`, nonoverwrite gate `10066f40`, buff delivery +`10066010` and cancellation sender `100232a0` establish the same reviewed +ordinary path for these exact variants. This does not assign an unverified +symbolic meaning to bit 2 or establish arbitrary Can/flag combinations. + +All three programs, their three ordinary uploaders and two bulk uploaders +were freshly parsed from the original ResourceDatabase. The full expanded +catalog audit re-verifies 781 original records and admits exactly 242 programs +and 241 crystals. Bulk uploads remain rejected. The matching original KKR +snapshot was reused; the owned session was exported and closed. + +Source records and native evidence are retained under +`local/nano-contract-research/`. Exact new native evidence IDs: +`ev_f07d8782989fcd6d0617b5f18e819e5ca4e9f1af72fb843d687d2cb59a4d66d9`, +`ev_9f240eb448be4a3c178fdae1a4f2c32ce0233c0174d8796e97b79f5186f60a5a`, +and `ev_b5a9294e92f4b7fb4f696143dd17effb84d69c0cef84fa6db1b8f29afacc23d8`. + +The complete program fixtures cover upload, cast, complete modifiers, NCU, +duration, cost, cold recovery and cancellation for all three. Separate cases +reject equality at either required skill and the wrong profession in both +upload and casting. Negative metadata cases reject Can 4/16 and hostile, +nonoverwrite or additional unaudited flag variants without charging nano. + +Two headed GPU WASM clients verified all three additions through ordinary +crystal use and program selection. Mocham's Gift: MatMet applied +140/50 NCU; +PsyMod Mastery applied +50/15 NCU. Insufficient remaining NCU rejected the +second program until the first was cancelled. Minor Suppressor rejected at +effective PM9, then uploaded at PM10/SI9 and applied both SMG +8 and Burst +7 +for 1 NCU. The Fixer also cast it on the MP, retaining a separate complete +contribution on each recipient. + +A server restart restored the Can8 mastery and both Minor Suppressor recipients, +with unchanged trained values, learned program sets and NCU. Native right-click +cancellation removed every contribution and freed all used NCU. Wire assertions +verify crystal qualities 162/47/1 and the friendly cast. Both runs had no client +errors. These profiles used explicit GM skills, professions and MP NCU gear; +ordinary acquisition of that fixture gear was not tested here. Evidence is in +`local/nano-contract-smoke/`. + +The focused metadata and rejection tests passed under the race detector in +111.080 seconds, and `go vet` passed. Both owned browser contexts were closed; +cleanup removed the two test players and two remaining fixture items. Database +integrity and foreign keys passed, and unrelated-row hashes were unchanged. +Visitor8 was retained and the sole shared HTTPS preview was restarted. diff --git a/server/nano_buffs.go b/server/nano_buffs.go @@ -21,10 +21,13 @@ type activeNano struct { func statBuffNano(program uint32) bool { definition := gamedata.NanoTemplates[program] if definition == nil || definition.RecordType != 1040005 || definition.HeaderWords[0] != 51051 || definition.Undecoded != nil || - itemStat(definition, 76) != 0 || itemStat(definition, 30) != 0 { + itemStat(definition, 76) != 0 { return false } - if flags := itemStat(definition, 0); flags != 0x80010000 && flags != 0x10000 { + if can := itemStat(definition, 30); can != 0 && can != 8 { + return false + } + if flags := itemStat(definition, 0); flags != 0x80010000 && flags != 0x10000 && flags != 0x10002 { return false } // Ordinary timed buffs have finite duration, NCU, strain, range and casting costs. diff --git a/server/nano_metadata_test.go b/server/nano_metadata_test.go @@ -0,0 +1,101 @@ +package main + +import ( + "ao/server/gamedata" + "encoding/binary" + "fmt" + "slices" + "testing" + "time" +) + +func TestOrdinaryNanoMetadataVariantsRetainBothSkillAndProfessionGates(t *testing.T) { + for _, fixture := range []struct { + program, crystal uint32 + profession, psychological, sensory uint16 + }{ + {29302, 29399, 12, 751, 751}, + {29312, 29409, 12, 225, 225}, + {43370, 43380, 4, 9, 8}, + } { + for _, scenario := range []string{"psychological equality", "sensory equality", "wrong profession", "qualified"} { + t.Run(fmt.Sprintf("%d/%s", fixture.program, scenario), func(t *testing.T) { + world, conn := newSkillNanoWorld(t) + player, client := world.characters[1], world.clients[1] + player.profession = fixture.profession + player.stats.Abilities = characterAbilitiesStats{1, 1, 1, 1, 1, 1} + player.stats.NanoAiding.PsychologicalModification = fixture.psychological + 1 + player.stats.NanoAiding.SensoryImprovement = fixture.sensory + 1 + switch scenario { + case "psychological equality": + player.stats.NanoAiding.PsychologicalModification-- + case "sensory equality": + player.stats.NanoAiding.SensoryImprovement-- + case "wrong profession": + player.profession = 1 + } + if err := world.saveUser_locked(player); err != nil { + t.Fatal(err) + } + if granted, err := world.grantItem_locked(player, fixture.crystal); err != nil || !granted { + t.Fatal(granted, err) + } + + if err := world.handleOwnedItemUse(client, backpackUseRequest(1, 64, 1)[20:]); err != nil { + t.Fatal(err) + } + learned := len(player.inventory.LearnedNanos) == 1 + // Seed only the learned entry to independently check cast admission. + player.inventory.LearnedNanos = []uint32{fixture.program} + if err := world.handleNanoCast(client, characterActionPacket(1, [5]uint32{19, 50000, 1, 53019, fixture.program})[20:]); err != nil { + t.Fatal(err) + } + + if scenario == "qualified" { + if !learned || client.nanoCast == nil || len(player.inventory.Items) != 2 { + t.Fatal("qualified original upload or cast was rejected") + } + world.advanceNanos(client.nanoCast.readyAt.Add(time.Nanosecond)) + if len(player.activeNanos) != 1 || player.activeNanos[0].program != fixture.program { + t.Fatal("qualified program did not complete") + } + return + } + if learned || client.nanoCast != nil || player.nano != 50000 || len(player.inventory.Items) != 3 || len(player.activeNanos) != 0 || + len(conn.packets) != 2 || binary.BigEndian.Uint32(conn.packets[0][29:33]) != 2 || binary.BigEndian.Uint32(conn.packets[1][29:33]) != 108 { + t.Fatal("metadata variant bypassed its crystal or program requirements") + } + }) + } + } +} + +func TestOrdinaryNanoMetadataRejectsUnverifiedCanAndFlagVariants(t *testing.T) { + for _, fixture := range []struct{ stat, value uint32 }{ + {30, 4}, {30, 16}, {0, 0x18002}, {0, 0x810002}, {0, 0x10006}, + } { + t.Run(fmt.Sprintf("%d/%x", fixture.stat, fixture.value), func(t *testing.T) { + world, conn := newSkillNanoWorld(t) + player, client := world.characters[1], world.clients[1] + player.profession = 4 + player.inventory.LearnedNanos = []uint32{43370} + original := gamedata.NanoTemplates[43370] + program := *original + program.Stats = slices.Clone(original.Stats) + for index, stat := range program.Stats { + if stat[0] == fixture.stat { + program.Stats[index][1] = fixture.value + } + } + gamedata.NanoTemplates[43370] = &program + t.Cleanup(func() { gamedata.NanoTemplates[43370] = original }) + + err := world.handleNanoCast(client, characterActionPacket(1, [5]uint32{19, 50000, 1, 53019, 43370})[20:]) + + if err != nil || client.nanoCast != nil || player.nano != 50000 || len(player.activeNanos) != 0 || + len(conn.packets) != 1 || binary.BigEndian.Uint32(conn.packets[0][29:33]) != 108 { + t.Fatal("unverified program metadata started a cast or charged nano", err) + } + }) + } +} diff --git a/server/stat_buff_catalog_test.go b/server/stat_buff_catalog_test.go @@ -68,10 +68,10 @@ func TestStatBuffCatalogAdmitsOnlyCompleteOrdinaryContracts(t *testing.T) { slices.Sort(crystals) // Exact IDs come from the independent complete-original-record catalog audit. - if len(programs) != 239 || !slices.Equal(programs, expectedPrograms) { + if len(programs) != 242 || !slices.Equal(programs, expectedPrograms) { t.Fatal("buff admission differs from the complete effect/metadata audit", programs) } - if len(crystals) != 238 || !slices.Equal(crystals, expectedCrystals) { + if len(crystals) != 241 || !slices.Equal(crystals, expectedCrystals) { t.Fatal("crystal admission differs from the complete upload audit", crystals) } } diff --git a/server/testdata/ordinary-skill-nanos.json b/server/testdata/ordinary-skill-nanos.json @@ -146,8 +146,10 @@ {"program": 29299, "crystal": 29396, "quality": 165, "profession": 12, "modifiers": [[128, 140]], "ncu": 51, "duration": 360000, "nano_cost": 620}, {"program": 29300, "crystal": 29397, "quality": 165, "profession": 12, "modifiers": [[130, 140]], "ncu": 51, "duration": 360000, "nano_cost": 620}, {"program": 29301, "crystal": 29398, "quality": 162, "profession": 12, "modifiers": [[131, 140]], "ncu": 50, "duration": 360000, "nano_cost": 592}, + {"program": 29302, "crystal": 29399, "quality": 162, "profession": 12, "modifiers": [[127, 140]], "ncu": 50, "duration": 360000, "nano_cost": 600}, {"program": 29303, "crystal": 29400, "quality": 169, "profession": 12, "modifiers": [[129, 140]], "ncu": 52, "duration": 360000, "nano_cost": 650}, {"program": 29304, "crystal": 29401, "quality": 165, "profession": 12, "modifiers": [[122, 140]], "ncu": 51, "duration": 360000, "nano_cost": 635}, + {"program": 29312, "crystal": 29409, "quality": 47, "profession": 12, "modifiers": [[129, 50]], "ncu": 15, "duration": 270000, "nano_cost": 158}, {"program": 29315, "crystal": 29412, "quality": 43, "profession": 12, "modifiers": [[122, 50]], "ncu": 14, "duration": 270000, "nano_cost": 151}, {"program": 29327, "crystal": 29424, "quality": 93, "profession": 12, "modifiers": [[160, 92]], "ncu": 29, "duration": 180000, "nano_cost": 317}, {"program": 29630, "crystal": 29792, "quality": 76, "profession": 9, "modifiers": [[107, 87], [102, 87]], "ncu": 24, "duration": 270000, "nano_cost": 290}, @@ -188,6 +190,7 @@ {"program": 32064, "crystal": 32105, "quality": 43, "profession": 5, "modifiers": [[113, 50], [151, 15]], "ncu": 14, "duration": 270000, "nano_cost": 146}, {"program": 32067, "crystal": 32108, "quality": 136, "profession": 5, "modifiers": [[146, 30], [113, 120]], "ncu": 42, "duration": 360000, "nano_cost": 485}, {"program": 43369, "crystal": 43382, "quality": 1, "profession": 2, "modifiers": [[120, 8], [100, 12]], "ncu": 1, "duration": 360000, "nano_cost": 23}, + {"program": 43370, "crystal": 43380, "quality": 1, "profession": 4, "modifiers": [[114, 8], [148, 7]], "ncu": 1, "duration": 180000, "nano_cost": 15}, {"program": 43371, "crystal": 43379, "quality": 1, "profession": 9, "modifiers": [[102, 14]], "ncu": 1, "duration": 360000, "nano_cost": 19}, {"program": 93125, "crystal": 93140, "quality": 17, "profession": 4, "modifiers": [[155, 2], [154, 2], [153, 2], [156, 140]], "ncu": 6, "duration": 360000, "nano_cost": 18}, {"program": 93126, "crystal": 93133, "quality": 136, "profession": 4, "modifiers": [[155, 70], [154, 70], [153, 70], [156, 620]], "ncu": 42, "duration": 420000, "nano_cost": 350},