commit bfe4aa47a211ea5d91053e24c8bb6d130649e6a1
parent d0a6f1705d7a9514a5850c4b006fffd631b14c4c
Author: anon <anon@example.com>
Date: Sun, 25 Oct 2026 12:32:54 +0000
Deliver live weapons and backpacks from shop purchases
Diffstat:
9 files changed, 347 insertions(+), 31 deletions(-)
diff --git a/TODO.md b/TODO.md
@@ -632,6 +632,16 @@ introduction and starting-item gameplay remain open below.
native live object delivery and any packing rules before admitting these categories.
Cover full inventory, freed sale slots, partial failure and stable ownership
across reconnect/restart without inventing extra packet identity fields.
+ Fixed-QL typed delivery is verified below. Keep this open for dated stock
+ membership, finite-weapon purchase ammunition and interpolated stock generation.
+- [x] Deliver live fixed-QL weapon/backpack purchases through original subclass
+ FullUpdates. Check: count-one real identities, QL/endpoints, correct first-free
+ slots after sales, immediate wear/open/transfer and cold recovery agree between
+ native clients and SQLite. Keep SQL failure, overflow, repeated Accept and lost
+ completion atomic. Two GPU WASM clients verified a mixed fixture basket,
+ both 21-slot bags, both weapons and restored production stock. This proves the
+ delivery path; fixture entries are not historical shop membership. See
+ [live purchase delivery](docs/shop-live-items.md).
- [x] Sell the five supported map-reader upgrades through the three original
Maps terminal templates. Verify native quotes, one-charge delivery,
purchase-to-upload, rejected low-skill/duplicate uploads, basket cancellation,
diff --git a/docs/shop-live-items.md b/docs/shop-live-items.md
@@ -0,0 +1,107 @@
+# 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](https://forums-archive.anarchy-online.com/showthread.php?9198-Overflow-inventory=)
+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:
+`local/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:
+
+1. Trade Complete 3, which clears selections and consumes staged native sales.
+2. Each purchased row in the same order as the durable first-free allocation:
+ typed FullUpdate for live weapons/backpacks, AddTemplate for ordinary items.
+3. 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 `local/shop-live-purchase-research/root/stock-sources.md`.
diff --git a/docs/shops.md b/docs/shops.md
@@ -179,8 +179,10 @@ This packing policy keeps native first-free allocation aligned with SQLite;
automatic merging, historical stack limits and original server packing remain
unknown. Existing partial stacks do not absorb purchases. Explicit joins remain
separate inventory actions. Admission tests require representable positive
-counts and exact supported types; weapons, containers and interpolated stock
-remain separate work. The interface
+counts and exact supported types. Fixed-QL weapons and containers now have a
+verified [live delivery path](shop-live-items.md), using typed FullUpdates with
+real identities and the original first-free sentinel. Historical stock admission,
+finite purchase clip state and interpolated stock remain separate work. The interface
uses the shared [stat-equipment path](stat-equipment.md) for HUD/utility wear.
The buy quote recovered from KKR 0x100a9610 is:
@@ -397,7 +399,10 @@ absent from the native basket. Charged tests verify separate package records,
exact AddTemplate counts, unchanged partial stacks, second-package rollback,
charge-normalized sales and purchase-to-use persistence with cooldown rejection.
Stock admission tests require positive representable charge counts and keep
-weapon/container delivery outside the fixed template catalog.
+unverified weapon/container membership outside production stock. Separate live
+delivery checks cover original subclass grants, first-free placement after sales,
+immediate wear/open/transfer, SQL failure, overflow and cold recovery; see
+[live purchase verification](shop-live-items.md#verification).
Two headed Chromium WASM clients ran on the GPU. Before restoration,
Omni room 1183 had the static identity but no native vending object or visible
diff --git a/server/equipment.go b/server/equipment.go
@@ -328,30 +328,34 @@ func equippedWeaponPackets(character *character) [][]byte {
if item.Slot != 6 || !item.isWieldableWeapon() {
continue
}
- // kkr.dll sub_360B2440: version 11, parent, playfield, identity and page/slot bytes.
- var body []byte
- for _, value := range []uint32{11, 50000, character.id, character.playfield, 0, 0} {
- body = binary.BigEndian.AppendUint32(body, value)
- }
- body = append(body, 1, 6)
- // sub_360B2830 loads StaticInstance 23, then applies item-quality stat 701.
- count := uint32(3027)
- if item.usesAmmo() {
- count = 4036
- }
- for _, value := range []uint32{count, 23, item.Template, 701, item.Quality} {
- body = binary.BigEndian.AppendUint32(body, value)
- }
- if item.usesAmmo() {
- body = binary.BigEndian.AppendUint32(body, 26)
- body = binary.BigEndian.AppendUint32(body, item.Ammo)
- }
- body = binary.BigEndian.AppendUint32(body, 0)
- return [][]byte{n3Packet(0x3b1d2268, item.Type, item.ID, body)}
+ return [][]byte{weaponPacket(character.id, character.playfield, item, 1)}
}
return nil
}
+func weaponPacket(owner, playfield uint32, item ownedItem, page uint32) []byte {
+ // kkr.dll 100b2440: SimpleItem 11, parent, playfield and page/slot bytes.
+ var body []byte
+ for _, value := range []uint32{11, 50000, owner, playfield, 0, 0} {
+ body = binary.BigEndian.AppendUint32(body, value)
+ }
+ body = append(body, byte(page), byte(item.Slot))
+ count := uint32(5 * 1009)
+ if item.usesAmmo() {
+ count = 6 * 1009
+ }
+ low, high := item.templateIDs()
+ for _, value := range []uint32{count, 23, item.Template, 701, item.Quality, 702, low, 703, high} {
+ body = binary.BigEndian.AppendUint32(body, value)
+ }
+ if item.usesAmmo() {
+ body = binary.BigEndian.AppendUint32(body, 26)
+ body = binary.BigEndian.AppendUint32(body, item.Ammo)
+ }
+ body = binary.BigEndian.AppendUint32(body, 0)
+ return n3Packet(0x3b1d2268, item.Type, item.ID, body)
+}
+
func equipmentActionPacket(owner uint32, item ownedItem, action uint32) []byte {
// kkr.dll FUN_100848d0: template endpoints, QL, count, action and two identities.
page := uint32(102)
diff --git a/server/equipment_test.go b/server/equipment_test.go
@@ -79,8 +79,8 @@ func TestEquipmentDelayedNativeMoveAndRestart(t *testing.T) {
t.Fatalf("native equipment packets: %x %x", conn.packets, observer.packets)
}
length := binary.BigEndian.Uint16(conn.packets[2][6:8])
- if hex.EncodeToString(conn.packets[2][29:length]) != "0000000b0000c35000000001000003b60000000000000000010600000bd30000001700033183000002bd0000000100000000" {
- t.Fatalf("native weapon instance: %x", conn.packets[1])
+ if hex.EncodeToString(conn.packets[2][29:length]) != "0000000b0000c35000000001000003b600000000000000000106000013b50000001700033183000002bd00000001000002be00033183000002bf0003318300000000" {
+ t.Fatalf("native weapon instance: %x", conn.packets[2])
}
}
diff --git a/server/ranged_test.go b/server/ranged_test.go
@@ -318,7 +318,10 @@ func TestPistolEquipmentUsesItsRequirementsAndPreservesLoadedRounds(t *testing.T
t.Fatal("equip or restart changed loaded rounds")
}
packet := targetPacket(equippedWeaponPackets(player)[0])
- if binary.BigEndian.Uint32(packet[55:59]) != 4036 || binary.BigEndian.Uint32(packet[75:79]) != 26 || binary.BigEndian.Uint32(packet[79:83]) != 3 {
+ if binary.BigEndian.Uint32(packet[55:59]) != 6054 ||
+ binary.BigEndian.Uint32(packet[75:79]) != 702 || binary.BigEndian.Uint32(packet[79:83]) != 123742 ||
+ binary.BigEndian.Uint32(packet[83:87]) != 703 || binary.BigEndian.Uint32(packet[87:91]) != 123742 ||
+ binary.BigEndian.Uint32(packet[91:95]) != 26 || binary.BigEndian.Uint32(packet[95:99]) != 3 {
t.Fatalf("weapon instance did not initialize its magazine: %x", packet)
}
}
diff --git a/server/shop_live_items_test.go b/server/shop_live_items_test.go
@@ -0,0 +1,174 @@
+package main
+
+import (
+ "bytes"
+ "encoding/binary"
+ "reflect"
+ "slices"
+ "testing"
+)
+
+func TestShopMixedPurchasesDeliverLiveWeaponsAndBackpacksAfterCommit(t *testing.T) {
+ world, conn := newPurchaseWorld(t)
+ client, player := world.clients[1], world.characters[1]
+ player.inventory.Credits = 100000
+ if err := world.saveInventory_locked(player, player.inventory); err != nil {
+ t.Fatal(err)
+ }
+ // Fixture stock tests delivery without asserting historical vendor membership.
+ client.shop.stock = []uint32{99228, 209283, 123742, 95577}
+ for _, index := range []uint32{0, 0, 1, 2, 3} {
+ if err := world.handleTrade(client, shopTradePacket([2]uint32{50000, 1}, 4, [2]uint32{51035, 3221488799}, [2]uint32{111, index})[20:]); err != nil {
+ t.Fatal(err)
+ }
+ }
+ conn.packets = nil
+ accept := shopTradePacket([2]uint32{50000, 1}, 1, [2]uint32{}, [2]uint32{})[20:]
+
+ for range 2 {
+ if err := world.handleTrade(client, accept); err != nil {
+ t.Fatal(err)
+ }
+ }
+ restored := newTestInventoryServer(t).characters[1].inventory
+
+ want := []ownedItem{
+ {ID: 1, Type: 51018, Template: 209283, Quality: 1, Slot: 64, Count: 1},
+ {ID: 2, Type: 51017, Template: 99228, Quality: 1, Slot: 65, Count: 1},
+ {ID: 3, Type: 51017, Template: 99228, Quality: 1, Slot: 66, Count: 1},
+ {ID: 4, Type: 51018, Template: 209283, Quality: 1, Slot: 67, Count: 1},
+ {ID: 5, Type: 51018, Template: 123742, Quality: 1, Slot: 68, Count: 1},
+ {ID: 6, Type: 51005, Template: 95577, Quality: 1, Slot: 69, Count: 1},
+ }
+ if !reflect.DeepEqual(restored.Items, want) || !reflect.DeepEqual(player.inventory.Items, want) || restored.Credits != 83794 || world.nextItem != 6 || client.shop != nil {
+ t.Fatalf("mixed purchase lost cash, counts or durable identities: %+v", restored)
+ }
+ if len(conn.packets) != 7 || binary.BigEndian.Uint32(conn.packets[0][29:33]) != 1 || binary.BigEndian.Uint32(conn.packets[0][33:37]) != 3 {
+ t.Fatalf("purchase delivery preceded shop completion: %x", conn.packets)
+ }
+ for index, key := range []uint32{0x465a5d73, 0x465a5d73, 0x3b1d2268, 0x3b1d2268} {
+ packet, item := conn.packets[index+1], want[index+1]
+ if binary.BigEndian.Uint32(packet[16:20]) != key || binary.BigEndian.Uint32(packet[20:24]) != item.Type || binary.BigEndian.Uint32(packet[24:28]) != item.ID ||
+ binary.BigEndian.Uint32(packet[33:37]) != 50000 || binary.BigEndian.Uint32(packet[37:41]) != 1 || packet[53] != 104 || packet[54] != 111 {
+ t.Fatalf("live purchase has no identity, parent or first-free sentinel: %x", packet)
+ }
+ for field, value := range []uint32{23, item.Template, 701, 1, 702, item.Template, 703, item.Template} {
+ if binary.BigEndian.Uint32(packet[59+4*field:]) != value {
+ t.Fatalf("live purchase quality/endpoints: %x", packet)
+ }
+ }
+ }
+ if !bytes.Equal(conn.packets[4][91:103], []byte{0, 0, 0, 26, 0, 0, 0, 0, 0, 0, 0, 0}) ||
+ binary.BigEndian.Uint32(conn.packets[5][16:20]) != 0x052e2f0c || binary.BigEndian.Uint32(conn.packets[6][29:33]) != 61 {
+ t.Fatal("weapon ammunition or ordinary template/cash delivery changed")
+ }
+}
+
+func TestShopLivePurchaseSQLFailurePublishesNothingAndRetriesOnce(t *testing.T) {
+ world, conn := newPurchaseWorld(t)
+ client, player := world.clients[1], world.characters[1]
+ client.shop.stock = []uint32{99228}
+ if err := world.handleTrade(client, shopTradePacket([2]uint32{50000, 1}, 4, [2]uint32{51035, 3221488799}, [2]uint32{111, 0})[20:]); err != nil {
+ t.Fatal(err)
+ }
+ if _, err := world.db.Exec("CREATE TRIGGER fail_live_purchase BEFORE INSERT ON items WHEN NEW.template=99228 BEGIN SELECT RAISE(ABORT, 'live purchase failure'); END"); err != nil {
+ t.Fatal(err)
+ }
+ conn.packets = nil
+ accept := shopTradePacket([2]uint32{50000, 1}, 1, [2]uint32{}, [2]uint32{})[20:]
+
+ failed := world.handleTrade(client, accept)
+ if failed == nil || len(conn.packets) != 0 || len(player.inventory.Items) != 1 || player.inventory.Credits != 1000 || world.nextItem != 1 || client.shop == nil {
+ t.Fatal("failed live purchase published cash, identity or native delivery")
+ }
+ if _, err := world.db.Exec("DROP TRIGGER fail_live_purchase"); err != nil {
+ t.Fatal(err)
+ }
+ err := world.handleTrade(client, accept)
+ restored := newTestInventoryServer(t).characters[1].inventory
+
+ if err != nil || len(conn.packets) != 3 || binary.BigEndian.Uint32(conn.packets[1][16:20]) != 0x465a5d73 || world.nextItem != 2 || restored.Credits != 158 ||
+ !reflect.DeepEqual(restored.Items[1:], []ownedItem{{ID: 2, Type: 51017, Template: 99228, Quality: 1, Slot: 65, Count: 1}}) {
+ t.Fatalf("live purchase retry lost or duplicated its result: %v %+v", err, restored)
+ }
+}
+
+func TestShopLivePurchaseRejectsOverflowWithoutPartialDelivery(t *testing.T) {
+ world, conn := newPurchaseWorld(t)
+ client, player := world.clients[1], world.characters[1]
+ client.shop.stock = []uint32{99228}
+ player.inventory.Credits = 2000
+ for slot := uint32(65); slot < 93; slot++ {
+ player.inventory.Items = append(player.inventory.Items, ownedItem{ID: slot - 63, Type: 51005, Template: 95577, Quality: 1, Slot: slot, Count: 1})
+ }
+ player.inventory.LastID = 29
+ if err := world.saveInventory_locked(player, player.inventory); err != nil {
+ t.Fatal(err)
+ }
+ for range 2 {
+ if err := world.handleTrade(client, shopTradePacket([2]uint32{50000, 1}, 4, [2]uint32{51035, 3221488799}, [2]uint32{111, 0})[20:]); err != nil {
+ t.Fatal(err)
+ }
+ }
+ before, next := slices.Clone(player.inventory.Items), world.nextItem
+ conn.packets = nil
+
+ err := world.handleTrade(client, shopTradePacket([2]uint32{50000, 1}, 1, [2]uint32{}, [2]uint32{})[20:])
+ restored := newTestInventoryServer(t).characters[1].inventory
+
+ if err != nil || client.shop != nil || world.nextItem != next || restored.Credits != 2000 || !reflect.DeepEqual(restored.Items, before) ||
+ len(conn.packets) != 1 || binary.BigEndian.Uint32(conn.packets[0][33:37]) != 2 {
+ t.Fatal("overflow committed or published a partial live purchase", err)
+ }
+}
+
+func TestShopLivePurchaseLostCompletionRecoversEveryInstanceOnce(t *testing.T) {
+ world, _ := newPurchaseWorld(t)
+ client, player := world.clients[1], world.characters[1]
+ client.shop.stock = []uint32{99228, 123742}
+ player.inventory.Credits = 10000
+ if err := world.saveInventory_locked(player, player.inventory); err != nil {
+ t.Fatal(err)
+ }
+ for _, index := range []uint32{0, 0, 1} {
+ if err := world.handleTrade(client, shopTradePacket([2]uint32{50000, 1}, 4, [2]uint32{51035, 3221488799}, [2]uint32{111, index})[20:]); err != nil {
+ t.Fatal(err)
+ }
+ }
+ client.conn = &failingCombatConn{}
+ accept := shopTradePacket([2]uint32{50000, 1}, 1, [2]uint32{}, [2]uint32{})[20:]
+
+ failed := world.handleTrade(client, accept)
+ err := world.handleTrade(client, accept)
+ restored := newTestInventoryServer(t).characters[1].inventory
+
+ if failed == nil || err != nil || client.shop != nil || world.nextItem != 4 || restored.Credits != 6018 ||
+ !reflect.DeepEqual(restored.Items[1:], []ownedItem{
+ {ID: 2, Type: 51017, Template: 99228, Quality: 1, Slot: 65, Count: 1},
+ {ID: 3, Type: 51017, Template: 99228, Quality: 1, Slot: 66, Count: 1},
+ {ID: 4, Type: 51018, Template: 123742, Quality: 1, Slot: 67, Count: 1},
+ }) {
+ t.Fatalf("lost completion lost or repeated a live purchase: %v %v %+v", failed, err, restored)
+ }
+}
+
+func TestLiveItemFullUpdatesTranslateOrdinarySlotsAndKeepFirstFree(t *testing.T) {
+ for _, kind := range []uint32{51017, 51018} {
+ for _, scenario := range []struct{ page, slot, want uint32 }{{104, 64, 48}, {104, 93, 77}, {104, 111, 111}, {105, 64, 64}, {1, 6, 6}} {
+ item := ownedItem{ID: 7, Type: kind, Template: 99228, Quality: 1, Slot: scenario.slot, Count: 1}
+ if kind == 51018 {
+ item.Template = 123742
+ }
+ packet := backpackPacket(1, 950, item, scenario.page)
+ if kind == 51018 {
+ packet = weaponPacket(1, 950, item, scenario.page)
+ }
+
+ packet = targetPacket(packet)
+
+ if packet[53] != byte(scenario.page) || packet[54] != byte(scenario.want) {
+ t.Fatalf("kind %d page %d slot %d translated to %d", kind, scenario.page, scenario.slot, packet[54])
+ }
+ }
+ }
+}
diff --git a/server/shops.go b/server/shops.go
@@ -437,9 +437,22 @@ func (server *server) handleTrade(client *worldClient, body []byte) error {
if err := client.send(shopTradePacket([2]uint32{50000, client.id}, 3, [2]uint32{}, [2]uint32{})); err != nil {
return err
}
- // AddTemplate chooses first-free slots, matching the allocation above.
- // Native catalog entries have no instance identity; durable IDs live in SQLite.
+ // Deliver first-free rows in the same order as the durable allocation.
for _, item := range purchased {
+ // The native first-free sentinel creates a row with the live identity.
+ if item.Type == 51018 || item.isPortableContainer() {
+ item.Slot = 111
+ var packet []byte
+ if item.isPortableContainer() {
+ packet = backpackPacket(player.id, player.playfield, item, 104)
+ } else {
+ packet = weaponPacket(player.id, player.playfield, item, 104)
+ }
+ if err := client.send(packet); err != nil {
+ return err
+ }
+ continue
+ }
var body []byte
for _, value := range []uint32{item.Template, item.Template, item.Quality, uint32(item.Count)} {
body = binary.BigEndian.AppendUint32(body, value)
diff --git a/server/target_protocol.go b/server/target_protocol.go
@@ -113,9 +113,9 @@ func targetPacket(packet []byte) []byte {
if binary.BigEndian.Uint32(packet[44:48]) == 50000 && destination >= 64 && destination < 94 {
binary.BigEndian.PutUint32(packet[52:56], destination-16)
}
- case 0x465a5d73:
- // Owned Chest placement follows its parent, playfield and auxiliary identity.
- if packet[60] == 104 {
+ case 0x465a5d73, 0x3b1d2268:
+ // Preserve first-free sentinel 111; translate only ordinary shared slots.
+ if packet[60] == 104 && packet[61] >= 64 && packet[61] < 94 {
packet[61] -= 16
}
case 0x35505644: