Repository navigation
fix(drops): refuse money at the inventory limit with the general failure, so the client keeps picking up - #1573
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 4 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
b3d8d25 to
571a9c5
Compare
sven-n
left a comment
There was a problem hiding this comment.
Thanks, the fix is right, and it corrects my mistake in #1498: MaximumInventoryMoneyReached goes out as 0xFE, which clients read as the money update, so a refused pile has to get the general failure (0xFF) plus a message. I'd like to merge this soon, because it leaves MuMain without pickups until the next login.
One thing blocks it: the first commit regenerates the whole PlayerMessage.Designer.cs (~1,960 changed lines). That alone makes this PR conflict with every open PR which adds a player message (#1548, #1491, and #1571 via the .zh-CN.resx), and it would conflict again after each of their merges. Please drop the regeneration commit and only add the block of the new MoneyPickupLimitReached property to the designer, in the existing format, as the other recent PRs did. The rest (PickupItemAction, the enum remark, the resx entries, PickupMoneyRefusalTest) looks good.
Generated by Claude Code
|
One more thing besides the designer: #1578 (Spanish player messages) was just merged, and Generated by Claude Code |
571a9c5 to
00d3f42
Compare
sven-n
left a comment
There was a problem hiding this comment.
Thanks for adding the Spanish message. #1548 was merged now, and as expected the full regeneration of PlayerMessage.Designer.cs (still ~1,960 changed lines, commit bfffa908) makes this PR conflict (PlayerMessage.Designer.cs, PlayerMessage.zh-CN.resx).
Please rebase onto master, drop the regeneration commit, and only add the block of MoneyPickupLimitReached to the designer. Then this small, important fix won't collide with every other message PR any more, and I'll merge it right away. The fix itself is approved from my side.
Generated by Claude Code
…ure, so the client keeps picking up Since MUnique#1498 a pile of money which doesn't fit into the inventory money was refused with the reason MaximumInventoryMoneyReached (C1 04 22 FE). 0xFE is the code of the money update (C1 08 22 FE <money>), the packet definition says the value should not be used for that reason. The open source client reads it as the money update, drops the reply because the amount is missing, and keeps waiting for its pick up request: it sends no further pick up until the next login. The refusal is now the general failure (0xFF), which every client handles, and a blue message tells the player that they can't carry more zen.
00d3f42 to
e005fe5
Compare
sven-n
left a comment
There was a problem hiding this comment.
Thanks for slimming it down: only the new designer entry and the Spanish text are added now. I built it on master (before #1571) and ran the tests (all except the slow initialization tests): everything passes, including PickupMoneyRefusalTest.
Unfortunately, #1571 (Lord's Mix) was merged right before, so there's one small conflict left, in src/GameLogic/Properties/PlayerMessage.zh-CN.resx (both add entries at the end). Please rebase and keep both entries. I'll merge it as soon as it's clean.
Generated by Claude Code
Conflict in the Chinese player messages: both sides added entries.
|
Thanks for resolving the conflict. I built the rebased branch on current master and ran the tests again (all except the slow initialization tests): everything passes except Generated by Claude Code |
…ure, so the client keeps picking up (MUnique#1573) Since MUnique#1498 a pile of money which doesn't fit into the inventory money was refused with the reason MaximumInventoryMoneyReached (C1 04 22 FE). 0xFE is the code of the money update (C1 08 22 FE <money>), the packet definition says the value should not be used for that reason. The open source client reads it as the money update, drops the reply because the amount is missing, and keeps waiting for its pick up request: it sends no further pick up until the next login. The refusal is now the general failure (0xFF), which every client handles, and a blue message tells the player that they can't carry more zen. (cherry picked from commit 65c685f)
Closes #1572
Since #1498, a pile of money which doesn't fit into the inventory money is refused with the reason
MaximumInventoryMoneyReached, which goes out asC1 04 22 FE. 0xFE is the code of the money update(
C1 08 22 FE <money>); the packet definition says the value shouldn't be used for this reason. The open source clientreads the reply as the money update, drops it because the amount is missing, and keeps waiting for its pick up
request: it sends no pick up anymore until the next login (Mutizens/MuMain#1164).
Changes
PickupItemAction: a refused pile of money always gets the general failure (0xFF), which every client handles. Whenthe reason is the money limit, a blue message tells the player (
MoneyPickupLimitReached, "You can't carry morezen.", in en/de/es/pt/zh-CN; es since feat(localization): add Spanish player messages #1578). The log line of fix(drops): tell the player when money can't be picked up because of the inventory money limit #1498 stays as it is.
ItemPickFailReason.MaximumInventoryMoneyReached: its remark said it was unused because no money was dropped; it nowsays why it must not be sent. I left the value in place, it's part of a public enum.
Testing
PickupMoneyRefusalTest: at the money limit the reply is the general failure (neverMaximumInventoryMoneyReached) plus one blue message, and the money stays as it was; a pile out of reach gets thegeneral failure and no message. The first test fails on master.
dotnet build src/MUnique.OpenMU.sln, no new warnings;dotnet test src/MUnique.OpenMU.sln --no-buildpassed on97a1f34. After rebasing onto 45678e3 (Spanish player messages feat(localization): add Spanish player messages #1578, item expiration feat(items): items which expire, to sell the time-limited cash shop products #1548): MUnique.OpenMU.Tests
3400 passed, 3 skipped, and MUnique.OpenMU.Web.Tests 802 passed, including
TranslationCoverageTestswith the Spanish string.BotMapFloorTest.HuntingGroundIsPickedOnTheOwnFloorAsyncfailed once and passed alone (3 times) and in the nextfull run of the project; it's about bots, not this change.
ClampMoneyOnPickupoff, the open source client frommainwithout fix(network): a pick up reply which can't be read no longer blocks every further pick up Mutizens/MuMain#1165, a Magic Gladiator with2,146,732,329 zen in LaCleon (Dark Mammoths): the piles of 600,000+ zen are refused with "You can't carry more zen."
and the items next to them are still picked up. Before (same client, server without this change): after the first
refused pile no item could be picked up until the next login.