Repository navigation
feat(ItemRestoration): restore vendored and disenchanted items - #223
Conversation
The core now also records items sold to a vendor or disenchanted, with the copper and materials the player got for them. The store offers those rows behind a new admin option and charges that cost back from the character's bags through mod-enhanced-support's .support recovery check/redeem commands. - The option is greyed out unless mod-enhanced-support is installed, and saving it checks that the worldserver knows the command. - The cost is checked when the item is added to the cart and again at checkout, then redeemed on payment. - A restoration that fails after payment puts the order on hold with the server's reply, instead of completing it silently. - The free restoration page keeps offering destroyed items only.
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
…224) ## What and why mod-enhanced-support's `.support recovery check|redeem` now count disenchant materials in the bank and bank bags too, online and offline. They take from the bags first, then the bank. This updates the store note, the admin tooltip and the `ToolsApi` docblock from #223, which said bags only. Text only, no behavior change on the website side.
What and why
Since azerothcore/azerothcore-wotlk#28357 the core also keeps items players sold to a vendor or disenchanted, together with the copper or materials they got for them. The Item Restoration product can now sell those back too. On top of the points, the store takes that copper from the character's money and those materials from their bags or bank. It sits behind a new admin option in Tools, off by default, and needs the
.support recoverycommands from mod-enhanced-support.Decisions worth knowing
.support recovery check|redeemover SOAP, which handles the character online or fully logged out (no session on the account for at least a minute). The option is greyed out unlessmod-enhanced-supportis in the modules list, and saving it asks the worldserver forhelp support recovery(SettingsController.php).CartValidation.php,ItemRestoration::checkout_order_processed).item restoreleft the order completed with no trace. This covers destroyed items too.getOwnedRestorableItemCharacterNameis limited toSource = 0, so the free endpoint can't hand out a sold item without its cost.Review guide
ItemRestoration.phpholds the flow:checkRecoveryCostand the rewrittenpayment_complete.ToolsApi.phpruns the commands and decides what counts as success.ACoreServices.phpadds Source, Money and the materials to the list (one extra query) and the ownership lookup.Tools.php,Opts.php,ItemRestorationPage.phpand the cost display JS are mechanical.Known gaps
item restore), becauseAcoreSoap::executeCommand()returns command errors as text. A non-English worldserver locale would see every restoration fail and every order go on hold.woocommerce_checkout_order_processed, which the block checkout doesn't fire. The cart check and the on-hold fallback still apply there.