Skip to content

feat(gateway): answer item name, sale, read and loot-pass messages - #701

Merged
Mathih13 merged 6 commits into
mainfrom
feat/opcode-parity-item-loot
Oct 15, 2026
Merged

Mathih13 merged 6 commits into
mainfrom
feat/opcode-parity-item-loot

Conversation

@Mathih13

@Mathih13 Mathih13 commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

The 1.12 client waits for answers to several item, vendor and loot messages that the Gateway never sent. A refused sale gave no error. An item name query got no reply. When every roller passed, nobody was told. A death that damaged worn gear showed no durability message.

This change sends those answers where the Module already holds the state.

  • CMSG_ITEM_NAME_QUERY is answered from the item template catalog. An unknown entry gets no reply, as in vmangos.
  • A refused CMSG_SELL_ITEM gets SMSG_SELL_ITEM with the matching error code.
  • CMSG_READ_ITEM on an item with page text gets SMSG_READ_ITEM_FAILED in the 5875 layout (guid plus reason byte) and a System Message. Page text has no catalog. Other items get Inventory Refusal 23.
  • When all rollers pass, the Module queues a new ALL_PASSED event (kind 12) and the Gateway sends SMSG_LOOT_ALL_PASSED.
  • A death that lowers the durability of worn gear queues a DEATH_DURABILITY event (kind 13) and the Gateway sends the empty SMSG_DURABILITY_DAMAGE_DEATH.
  • CMSG_AUTOSTORE_GROUND_ITEM, CMSG_STORE_LOOT_IN_SLOT, CMSG_SKILL_BUY_STEP, CMSG_SKILL_BUY_RANK and CMSG_BUY_LOTTERY_TICKET_OBSOLETE are ignored without a reply.

Not sent, with the reason: SMSG_BUY_ITEM (no stock depletion), SMSG_ITEM_COOLDOWN (no item-use cooldown state), SMSG_ITEM_TIME_UPDATE and SMSG_ITEM_ENCHANT_TIME_UPDATE (no item duration), SMSG_GAMEOBJECT_PAGETEXT (no page text), and SMSG_LOOT_ITEM_NOTIFY, SMSG_OPEN_CONTAINER, SMSG_ENCHANTMENTLOG, SMSG_ITEM_QUERY_MULTIPLE_RESPONSE (the client ignores them or no 1.12 server sends them).

Durable tests added, left to CI (not run locally):

  • module/tests/death_durability_notice.rs (two tests)
  • module/tests/loot_roll_promotion.rs: an_all_pass_resolution_tells_every_roller_and_a_win_does_not

Unit tests: cargo test -p lyracore-gateway, -p lyracore-shared and -p lyracore-module --lib pass. Clippy is clean.

Claude Sonnet 5.5 in Claude Code.

Review fixes: a sale of a guid that resolves to no item stays silent (vmangos). Item guid lookups for sell, repair, enchant and item-target casts now require the item to belong to the acting Character. The durable fixtures disarm the event reaper. The sharded all-pass unlock gap is not part of this change.

Verification after rebasing onto main (#698, #699, #704): fmt check, Gateway and Module clippy, Gateway, Module lib and shared tests, the wasm check, the inventory example and durable --no-run all pass. Durable tests were not run locally.

Comment review (CODING_STANDARDS.md): scope is every added or changed comment in the full diff against main, including new test files and retained comments next to changed code. Result: passed. Kept: two interface contracts on the owner-checked guid lookups, the raw SMSG_READ_ITEM_FAILED body layout, the unhandled-request note beside the ignore arm, the reaper note in two fixtures, one unknown-entry and one page-text-catalog note in the item handler, and byte annotations in packet tests. Removed: citation essays, doc comments that repeat names, and section dividers. No pointers were removed or needed.

Mathih13 and others added 6 commits October 15, 2026 12:33
…es durability

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Add CMSG_ITEM_NAME_QUERY, SMSG_SELL_ITEM refusals, CMSG_READ_ITEM failure,
SMSG_LOOT_ALL_PASSED and SMSG_DURABILITY_DAMAGE_DEATH. Ignore the unhandled
vanilla requests as vmangos does.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Disarm the event reaper in both fixtures and count new events by id.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A guid that resolves to no item now stays silent on sale, as in vmangos.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@Mathih13
Mathih13 force-pushed the feat/opcode-parity-item-loot branch from a6bdf3f to af1ddf4 Compare October 15, 2026 10:42
@Mathih13
Mathih13 merged commit 0c40d64 into main Oct 15, 2026
9 checks passed
@Mathih13
Mathih13 deleted the feat/opcode-parity-item-loot branch October 15, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant