Live weapons and backpacks from shop purchases
The purchase transaction can now deliver native WeaponItem and Chest instances with their durable identities. This establishes delivery, immediate use and recovery for fixed-QL fixture stock. Production stock membership is unchanged: dated evidence for backpack/weapon entries, full stock generation, interpolated stock and the original finite-weapon purchase clip state remain open.
Konril's January 31, 2002 Overflow inventory? post
recommends buying two small packs for loot and portable storage. This period
advice establishes neither a named terminal nor template 99228's membership.
The retained extraction, date, context and direct-fetch limitations are in
local/shop-live-purchase-research/period-content/findings.txt.
Original client contract
Original 14.9.1 KKR SHA256 is
a37bc1c15053fdcc5572772309f7074c4f83baffe2faa164df40b059b7c480c0.
10063340 attaches a live item's inventory row. With placement slot 111 it
selects the first empty ordinary slot from 48 and invokes 1002d870. The row
has flags 0x22, count 1, the item's real type/ID, QL stat 701 and template endpoints
702/703. An explicit placement slot only updates an existing row's identity
and flags; it cannot populate an empty slot.
WeaponItemFullUpdate 0x3b1d2268 creates a native weapon through activation
100b38b0 and constructor 100aba20. ChestFullUpdate 0x465a5d73 creates a
Chest through 100af370 and 1008b3b0. Both carry SimpleItem version 11,
parent character, playfield, page 104 and slot 111, then stats 23/701/702/703.
Finite weapons also carry the durable ammunition stat 26. Chest adds its
Lockable version 2 and Chest version 3 suffix. Existing dynel identities are
not replaced by these FullUpdates.
AddTemplate creates a separate template row with no instance identity. Sending it before a slot 111 live grant would create two rows. The server instead sends one typed FullUpdate per live purchase, preserving count-one allocation. Other supported item types retain their existing AddTemplate delivery. Their anonymous proxy representation before reconnect does not imply lost durable ownership.
The existing weapon packet builder is shared by equipment and shop delivery, with explicit QL/endpoints. The 14.9.1 converter translates only ordinary shared slots 64..93 to native 48..77 for both typed messages. It preserves sentinel 111; subtracting 16 from that sentinel would skip native row creation.
The source ledger contains 17 checked citations in 23 complete retained records:
docs/research-notes/shop-live-purchase-research/native/README.md. This proves the native
operations, not the original server's purchase message sequence. Their ordering
below is a reconstruction verified in the actual client.
Transaction and delivery order
The existing atomic purchase path validates funds, eligibility, sales, Unique ownership and final capacity before allocating its detached inventory. It commits all sales, new instances and cash together. Only afterward does it send:
- Trade Complete 3, which clears selections and consumes staged native sales.
- Each purchased row in the same order as the durable first-free allocation: typed FullUpdate for live weapons/backpacks, AddTemplate for ordinary items.
- Absolute cash stat 61.
No native row is granted on insufficient space or SQL failure. A lost completion reply leaves the entire durable result available on reconnect; repeating Accept cannot allocate a second result. N identical live purchases create N identities and N count-one native rows. There is no invented extra identity field in AddTemplate or inferred automatic merging.
Verification
Go regressions cover a mixed two-backpack/axe/pistol/tool basket, exact cash and durable identities, message order, endpoint/ammunition fields, first-free versus explicit placement, repeated Accept, overflow after prospective allocation, SQL rollback/retry and lost-completion recovery. Regressions fail against the previous code on missing live identity and the converted sentinel 95.
Focused shop/equipment/backpack checks passed in 48.224 seconds. Live purchase and conversion checks passed three race-detector repetitions in 98.210 seconds; the additional lost-completion case passed three in 96.632 seconds. Vet and diff checks passed. The full Go suite passed 4858 tests and subtests: server 763.146 seconds and game data 7.630 seconds.
Two published GPU WASM clients used temporary stock containing Small Backpack 99228, Kinetic Axe 209283, Flechette Pistol 123742 and Lock Pick 95577. These fixture rows assert no historical Tools membership. The native basket quoted 16206 purchase cost and 734 for the staged old axe. Accept changed 100000 cash to 84528 and created exactly five new instances, with both native and SQLite allocation agreeing across the hole freed by that sale.
The two new backpacks had real IDs 241/242 and capacity 21. The owner immediately opened the first and put both an existing and a newly purchased lockpick inside; the second remained empty. Each purchased weapon equipped immediately. Native owner/observer probes agreed on the equipped pistol identity 244, weapon vtable and explicit empty clip. Its empty clip is the existing grant policy used by this fixture, not a recovered historical purchase rule.
Both owned clients were closed, and the one preview was restarted with the production binary and normal catalog. Fresh clients retained 84528 cash, the equipped pistol and both bags' identities. Opening the recovered bag exposed both saved lockpicks; the purchased one could be taken out. The stored purchased axe then equipped again, and both clients bound identity 243. Cold Tools stock contained only its original supported Lock Pick entry. There were no browser errors or unsupported adapters.
local/shop-live-purchase-smoke/verification.json checks the wire, native heaps,
SQLite snapshots, GPU renderer and cleanup. Only the owned two players and six
remaining items were removed; unrelated-row hashes and foreign-key/integrity
checks passed, retaining existing players 8/24. The single production preview
remains on its default ports. Historical stock research and source limitations
are in docs/research-notes/shop-live-purchase-research/root/stock-sources.md.