Skip to content

fix(network): a pick up reply which can't be read no longer blocks every further pick up - #1165

Merged
nitoygo merged 1 commit into
Mutizens:mainfrom
pllanosclaria:fix/pickup-reply-never-locks
Nov 21, 2026
Merged

nitoygo merged 1 commit into
Mutizens:mainfrom
pllanosclaria:fix/pickup-reply-never-locks

Conversation

@pllanosclaria

@pllanosclaria pllanosclaria commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

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: 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: 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. The
server 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 ReceiveGetItem only:

  • SendGetItem is cleared as soon as the reply arrives, so every reply answers the pending request;
  • 0xFE without the amount is read as a refusal, without the error log and the 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

  • Built on: Linux x64, Release (Ninja Multi-Config).
  • Tested in game: local OpenMU server (master + my local changes, which still refuse zen with 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
    main first: after clicking a refused pile of zen, clicks on the items next to it do nothing and the server gets no
    request; 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.
  • In-game tests: picking up isn't covered by the in-game tests yet.
  • Automated tests: new test_pickup_reply ([network][pickup-reply]): a zen refusal without the amount and the
    general refusal clear SendGetItem and leave the zen as it was; a zen update with the amount still sets it. The
    full 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.
  • Not tested: Windows and macOS.

Checklist

  • I have read and followed docs/CODING_RULES.md and docs/PULL_REQUESTS.md; deliberate exceptions are named above with the reason.
  • Visible changes have before and after screenshots or videos (or nothing visible changes).
  • The Testing section lists what was tested and what was not.
  • I have built the project locally (see docs/build/README.md).
  • Changes are focused on one concern; the diff is as small as it reasonably can be.

…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 hiro-nitoy left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

  1. [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.

@nitoygo
nitoygo merged commit befbbb6 into Mutizens:main Nov 21, 2026
16 checks passed
@Mutizens Mutizens deleted a comment from hiro-nitoy Nov 21, 2026
@pllanosclaria
pllanosclaria deleted the fix/pickup-reply-never-locks branch December 2, 2026 17:10
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.

A pick up reply which can't be read blocks every further pick up until the next login

3 participants