Repository navigation
fix(network): a pick up reply which can't be read no longer blocks every further pick up - #1165
Conversation
…ery further pick up ReceiveGetItem cleared SendGetItem only at its end, so the early returns for a reply too short to read left it set. Pickup.cpp, the pets and the zen pick up only send a request while SendGetItem is -1, so after such a reply the client sent no pick up anymore until the next login. OpenMU sends exactly such a reply since MUnique/OpenMU#1498: a pile of zen which doesn't fit into the inventory money is refused with C1 04 22 FE, the code of the zen update without its amount. The client logged "safe_cast <PRECEIVE_INVENTORY_MONEY>: received 4 bytes, expected at least 8 -- packet dropped", and the items next to the zen couldn't be picked up. SendGetItem is now cleared as soon as the reply arrives, and 0xFE without the amount is read as a refusal.
hiro-nitoy
left a comment
There was a problem hiding this comment.
What this change does: Releases the outstanding pickup gate as soon as a reply arrives, and treats OpenMU's four-byte zen refusal as a refusal without changing inventory money. This prevents that refusal from blocking later manual, pet, and helper pickups.
No functional or architecture blocker found. I traced all SendGetItem readers/writers and the reply dispatcher: the reply handler does not need the old pending value, and normal zen updates retain their previous behavior.
Should fix (non-blocking):
- [P3] Add an early-return regression beyond the special four-byte zen refusal; the current tests do not protect the placement of the gate reset (inline comment).
Verdict: Ship. Finding 1 is a test-coverage improvement, not a bug in the current implementation.
Validation: replayed the exact head's ReceiveGetItem body and three submitted test bodies in an isolated MSVC Release-mode harness, with inventory/chat/audio/logging dependencies stubbed. All three cases passed, as did two additional malformed-reply checks. Moving only the gate reset back to the end kept all three submitted tests green but failed both additional checks. Both GitHub CI runs for this head succeeded. No checkout changes; temporary files removed.
Not checked: live OpenMU pickup behavior or a full local client build; the isolated harness does not verify the real inventory/UI integration.
Summary
ReceiveGetItemclearedSendGetItemonly at its end, so the early returns for a reply too short to read left itset.
Pickup.cpp, the pets and the zen pick up only send a request whileSendGetItemis -1: after such a replythe client sent no pick up anymore until the next login.
OpenMU sends exactly such a reply since MUnique/OpenMU#1498: zen which doesn't fit into the inventory money is refused
with
C1 04 22 FE, the code of the zen update without its amount. The client loggedsafe_cast<PRECEIVE_INVENTORY_MONEY>: received 4 bytes, expected at least 8 -- packet dropped, and the items next to the zen couldn't be picked up. Theserver is being fixed too (MUnique/OpenMU#1573, general failure plus a message), but the client shouldn't lock
itself on any reply.
The change, in
ReceiveGetItemonly:SendGetItemis cleared as soon as the reply arrives, so every reply answers the pending request;assert.Related issues
Closes #1164. Server side: MUnique/OpenMU#1572.
Screenshots or videos
Before
before_zen_fix_small.mp4
After
after_zen_fix_small.mp4
Testing
C1 04 22 FE),LaCleon, a Magic Gladiator with 2,146,732,329 zen, so the zen of the Dark Mammoths doesn't fit. Bug reproduced on
mainfirst: after clicking a refused pile of zen, clicks on the items next to it do nothing and the server gets norequest; only a new login helps. With this change the zen is still refused (the server's decision) and the items are
picked up. The after build was this change on top of my local client branch, whose other changes don't touch
picking up.
test_pickup_reply([network][pickup-reply]): a zen refusal without the amount and thegeneral refusal clear
SendGetItemand leave the zen as it was; a zen update with the amount still sets it. Thefull suite passes (3200 tests, 2 GPU ones skipped); clang-format 21.1.8 on the changed lines and cppcheck 2.13 and
2.19 with the CI flags are clean.
Checklist
docs/CODING_RULES.mdanddocs/PULL_REQUESTS.md; deliberate exceptions are named above with the reason.docs/build/README.md).