Skip to content

fix(wear): ask the client's own bind-on-wear question - #2575

Merged
erwan-joly merged 1 commit into
masterfrom
claude/project-thread-amcjbv
Oct 30, 2026
Merged

erwan-joly merged 1 commit into
masterfrom
claude/project-thread-amcjbv

Conversation

@erwan-joly

@erwan-joly erwan-joly commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Erwan · project thread

Closes #1645

What changed

Wearing an unbound item that binds on wear used to prompt with a qna that carried a server-side English string (ASK_BIND). Now it sends qnai with Game18NConstString.CannotTradeAskWearing (1195), so the client renders its own question in its own language. This matches the trace in the issue: qnai … 1195 0 0 0.

  • WearHandler now sends QnaiPacket with CannotTradeAskWearing.
  • ASK_BIND is no longer used, so it is removed from LanguageKey, every .resx and the designer.
  • WearHandlerTests now checks for a qnai with 1195, a u_i yes packet in mode 1, and no qna.
  • documentation/manual-test-plan.md has two new checks under Equipment gates.

Left as is: the yes packet is still u_i … 1 (mode 1), which still goes through the same equip path. The trace in the issue shows #wear^slot^type^1 instead. That needs a third field on WearPacket in NosCore.Packets, so it is not part of this PR.

How it was verified

  • dotnet build NosCore.sln: 0 warnings, 0 errors.
  • dotnet test: Core, Database, WebApi, GameObject (647) and PacketHandlers (428) all pass.
  • In the client (browser build of the current client against a local stack). The scene is the same on both builds: character Tester on Chicken Farm Path with an unbound fire fairy (vnum 274) in the first equipment slot. The steps are: open the inventory and double-click the fairy.
Screenshot What it shows
Before (master) 1-before-master-question.png The server's English string: "Do you wish to bind with this item?"
After (this branch) 2-after-branch-question.png The client's own question: "Equipping this item makes it untradeable. Are you sure you want to equip it?"
After, Confirm 3-after-branch-confirm-worn.png The fairy leaves the inventory and flies beside the character. In the database it is in wear slot 10 and bound to the character.
After, Cancel 4-after-branch-cancel-kept.png The fairy stays in the inventory, unbound.

Before (master): the server's English string.

Master: the server's English bind question

After (this branch): the client's own question.

Branch: the client's own bind-on-wear question

After, Confirm: the fairy is worn.

Branch: after Confirm the fairy is worn

After, Cancel: the fairy stays in the inventory.

Branch: after Cancel the fairy stays in the inventory

Still needs a human (manual-test-plan.md → Equipment gates)

Both new checks passed in the browser client, in English only:

  • $CreateItem an item that binds when worn and double-click it: the client's own "cannot be traded after wearing" question opens, in the client's language. Checked with an English client. Other languages were not checked.
  • Answer yes: the item is worn. Answer no: it stays in the inventory.

A Windows client in another language would confirm the "in the client's language" part.

🤖 Generated with Claude Code

https://claude.ai/code/session_014gSmkUMqSCt7JBTq4HTzuc

Summary by CodeRabbit

  • Bug Fixes
    • Updated the confirmation prompt shown when wearing an item that cannot be traded. Confirming equips the item; declining leaves it in inventory.
  • Documentation
    • Added manual test steps for both responses to the item-wearing confirmation prompt.

A bind-on-wear item now prompts with qnai CannotTradeAskWearing, which the
client renders in its own language, instead of a qna carrying a server-side
string. The ASK_BIND resource is no longer used and is removed.

Closes #1645

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014gSmkUMqSCt7JBTq4HTzuc
@erwan-joly erwan-joly self-assigned this Oct 29, 2026
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 16bc70e and 7415920.

Files ignored due to path filters: 1
  • src/NosCore.Data/Resource/LocalizedResources.Designer.cs is excluded by !**/*.Designer.cs
Files selected for processing: 13
  • documentation/manual-test-plan.md
  • src/NosCore.Data/Enumerations/I18N/LanguageKey.cs
  • src/NosCore.Data/Resource/LocalizedResources.cs.resx
  • src/NosCore.Data/Resource/LocalizedResources.de.resx
  • src/NosCore.Data/Resource/LocalizedResources.es.resx
  • src/NosCore.Data/Resource/LocalizedResources.fr.resx
  • src/NosCore.Data/Resource/LocalizedResources.it.resx
  • src/NosCore.Data/Resource/LocalizedResources.pl.resx
  • src/NosCore.Data/Resource/LocalizedResources.resx
  • src/NosCore.Data/Resource/LocalizedResources.ru.resx
  • src/NosCore.Data/Resource/LocalizedResources.tr.resx
  • src/NosCore.GameObject/Messaging/Handlers/UseItem/WearHandler.cs
  • test/NosCore.GameObject.Tests/Messaging/Handlers/UseItem/WearHandlerTests.cs
Files with no reviewable changes: 10
  • src/NosCore.Data/Resource/LocalizedResources.cs.resx
  • src/NosCore.Data/Resource/LocalizedResources.ru.resx
  • src/NosCore.Data/Resource/LocalizedResources.tr.resx
  • src/NosCore.Data/Resource/LocalizedResources.es.resx
  • src/NosCore.Data/Resource/LocalizedResources.it.resx
  • src/NosCore.Data/Resource/LocalizedResources.resx
  • src/NosCore.Data/Resource/LocalizedResources.de.resx
  • src/NosCore.Data/Resource/LocalizedResources.pl.resx
  • src/NosCore.Data/Resource/LocalizedResources.fr.resx
  • src/NosCore.Data/Enumerations/I18N/LanguageKey.cs

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

When a bind-on-wear item is used, WearHandler now sends a QnaiPacket with the cannot-trade confirmation question. The ASK_BIND enum member and localized resource entries were removed. Tests and the manual test plan cover the confirmation flow.

Changes

Bind-on-wear confirmation

Layer / File(s) Summary
Update bind-on-wear confirmation
src/NosCore.GameObject/Messaging/Handlers/UseItem/WearHandler.cs, test/NosCore.GameObject.Tests/Messaging/Handlers/UseItem/WearHandlerTests.cs, src/NosCore.Data/Enumerations/I18N/LanguageKey.cs, src/NosCore.Data/Resource/LocalizedResources*.resx, documentation/manual-test-plan.md
WearHandler now sends a QnaiPacket with CannotTradeAskWearing instead of a localized QnaPacket. The test checks the question and its yes response, which uses UseItemPacket mode 1. The old ASK_BIND key and translations are removed. The manual test plan covers accepting or declining the prompt.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: denislauri1999

Merge Risk: Minimal · up to 74159

The bind-on-wear confirmation flow is correctly localized and preserves the existing acceptance behavior.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: using the client's own bind-on-wear question when wearing an item.
Linked Issues check Passed Linked issue #1645 reports that WearHandler uses the wrong packet for the bind-on-wear prompt. The official packet is qnai #wear^44^0^1 1195 0 0 0. The PR changes WearHandler to send QnaiPacket with…
Out of Scope Changes check Passed All changes support the linked objective or its direct cleanup. WearHandler.cs changes the prompt packet to qnai with 1195. WearHandlerTests.cs covers the new packet and the absence of qna. Removing A…
Full details: Linked Issues check

Explanation

Linked issue #1645 reports that WearHandler uses the wrong packet for the bind-on-wear prompt. The official packet is qnai #wear^44^0^1 1195 0 0 0. The PR changes WearHandler to send QnaiPacket with Game18NConstString.CannotTradeAskWearing (1195), which matches the question packet type and question id of the official packet. WearHandlerTests checks for a qnai with 1195, a yes response using u_i mode 1, and no qna. The author reports a browser check in which the client showed its own question, and the Confirm and Cancel paths behaved as expected. The yes-response callback in the official packet (#wear^44^0^1) is not implemented. The PR keeps u_i ... 1. The PR description states that this needs a third field on WearPacket in NosCore.Packets and is deferred. The issue does not list this callback as a separate requirement, so it does not change the verdict for the core packet objective. Evidence used: PR summary, PR description, and the changed-file summaries. No repository inspection was made.

Full details: Out of Scope Changes check

Explanation

All changes support the linked objective or its direct cleanup. WearHandler.cs changes the prompt packet to qnai with 1195. WearHandlerTests.cs covers the new packet and the absence of qna. Removing ASK_BIND from LanguageKey, the .resx files, and the designer is required cleanup, because the string is no longer used after the WearHandler change. manual-test-plan.md adds two manual checks for the changed behavior. These are documentation for the change and are not unrelated work. The file src/NosCore.Data/Resource/LocalizedResources.Designer.cs is in ignored_files, so its diff was not reviewed. This does not affect the verdict, because the designer removal is cleanup and not a stated requirement. The PR description says the designer removal is part of the change, and the author reports a successful build with 0 warnings and 0 errors. No unrelated behavior change was found in the summarized diff.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@erwan-joly
erwan-joly marked this pull request as ready for review October 29, 2026 15:08
@erwan-joly
erwan-joly merged commit f79f74f into master Oct 30, 2026
2 checks passed
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.

BindItem wrong packet on WearHandler

2 participants