Skip to content

Commit ffd9126

Browse files
committed
test: cover dead rebootstrap ground gold gate
1 parent a9debb6 commit ffd9126

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

internal/minimal/shared_world_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15119,9 +15119,12 @@ func TestSharedWorldRegistryVisibleGroundItemFramesRejectsDeadSubject(t *testing
1511915119
if !registry.RegisterGroundItem(ownerID, "ground-owner-login", owner, 0x0A0B0C31, inventory.ItemInstance{ID: 1031, Vnum: 27001, Count: 1, Slot: 5}) {
1512015120
t.Fatal("expected owner ground item registration to succeed")
1512115121
}
15122+
if !registry.RegisterGroundGold(ownerID, "ground-owner-login", owner, 0x0A0B0C32, 350) {
15123+
t.Fatal("expected owner ground gold registration to succeed")
15124+
}
1512215125

1512315126
if frames := registry.VisibleGroundItemFrames(deadSubject); len(frames) != 0 {
15124-
t.Fatalf("expected dead subject to receive no visible ground-item rebootstrap frames, got %d", len(frames))
15127+
t.Fatalf("expected dead subject to receive no visible ground-item or ground-gold rebootstrap frames, got %d", len(frames))
1512515128
}
1512615129
}
1512715130

spec/protocol/non-player-reward-bootstrap.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ The guard checks the current registered owner snapshot, not only the caller-supp
120120
Ground reward visibility fanout and lookup are also live-recipient guarded: dead visible peers do not receive `ITEM_GROUND_ADD` / `ITEM_OWNERSHIP` on registration, do not receive `ITEM_GROUND_DEL` when the ground entry is later removed, and cannot resolve pending ground handles through the visibility/pickup seam while they remain at the current bootstrap `0`-HP floor.
121121
Transfer/rebootstrap destination visibility uses the same recipient gate for both item-shaped and gold-shaped entries: moving a zero-HP owner into a map/AOI with existing ground entries queues no destination `ITEM_GROUND_ADD` / `ITEM_OWNERSHIP` burst to that dead recipient, while the ground entry remains available to living visible sessions.
122122
Ordinary session position updates that rebuild destination visibility use the same zero-HP gate, so a dead recipient cannot reacquire ground-entry visibility by arriving through a movement/sync-style shared-world update path instead of the structured transfer path.
123-
Fresh same-socket rebootstrap uses the same guard before building the selected character's trailing ground-entry burst, so a still-dead session cannot reacquire `ITEM_GROUND_ADD` / `ITEM_OWNERSHIP` visibility frames for pending ground rewards merely by re-entering the map while still at the bootstrap `0`-HP floor.
123+
Fresh same-socket rebootstrap uses the same guard before building the selected character's trailing ground-entry burst, so a still-dead session cannot reacquire `ITEM_GROUND_ADD` / `ITEM_OWNERSHIP` visibility frames for pending ground item-shaped or gold-shaped rewards merely by re-entering the map while still at the bootstrap `0`-HP floor.
124124
Ground pickup also skips party-style delivery back into an owner that has since reached the bootstrap `0` HP floor: the ground handle keeps its owner metadata for display/ownership, but the live owner snapshot is withheld so a living collector either takes the item through the ordinary collector path or fails closed on collector capacity without mutating the dead owner's inventory/gold.
125125
Ground reward registration re-checks the registered owner snapshot before trusting the caller-supplied character copy, so a stale owner snapshot cannot create item-shaped or gold-shaped reward ground entries after the registered owner has already changed selected-character identity (`id`, `vid`, or name) or moved to a different runtime location.
126126
Lookup, pickup-resolution, and removal also re-check the registered collector snapshot before trusting the caller-supplied character copy, so a stale collector snapshot cannot see, resolve, or remove item-shaped or gold-shaped reward ground entries after that collector has already reached the bootstrap `0`-HP floor, changed selected-character identity (`id`, `vid`, or name), or moved out of the exact runtime location represented by the supplied pickup attempt.

0 commit comments

Comments
 (0)