Skip to content

Cash Shop requests and cash equips - #523

Merged
neeerp merged 4 commits into
masterfrom
v83/cash-shop-requests
Oct 18, 2026
Merged

neeerp merged 4 commits into
masterfrom
v83/cash-shop-requests

Conversation

@neeerp

@neeerp neeerp commented Oct 18, 2026

Copy link
Copy Markdown
Owner

Stacked on #522 (v83/megaphones-rocks-name-tag). Please change the base to master once #522 is merged, since GitHub won't retarget it here.

Cash Shop request handling (L186) and cash equips (L190).

What changed

  • PLAYER_UPDATE (0xDF): sent on every field change, as v83's CField::OnSetField does. HeavenClient used to send it only on entering the game. The server's handler is still a no-op.
  • One Cash Shop request at a time:
    • v83 keeps a pending flag and silently drops Cash Shop requests while one is unanswered. HeavenClient now does the same through UICashShop::request.
    • Results 324 and 325 clear the flag.
  • Cursor after dialogs: closing a focused dialog in the Cash Shop passes the cursor event on, so the first Buy click after the purchase notice works.
  • Cash equips (L190):
    • Worn cash equips go at -(100 + slot), over the regular item, as v83 does.
    • The server only lets an item with a cash serial be worn there.
    • HeavenClient keeps the two apart and shows the cash item in the equip window and on the character.
    • The character still draws the regular weapon, since HeavenClient has no cash weapon art over a weapon's stances.

Verification

  • No new test files. Cash equips were checked against the harness inventory_moves, scrolls, cash_shop* and pets tests and in the client on Xvfb.
  • This layer passes cargo fmt --check and cargo check --workspace --tests.
  • At the top of the stack the full harness suite passes (run at 45e356d, the last server commit; the commits after it change only HeavenClient). All 83 client tests pass in a debug build.

v83 sends PLAYER_UPDATE (0xDF) from FUN_00a03eba inside CField::OnSetField
whenever a field is set, not only when the character data arrives.
HeavenClient sent it only on entering the game, so a plain map change
sent nothing. The server's handler is still a no-op.
v83 keeps a pending flag in CCashShop (+0x18). Every cash shop request
checks it first and returns silently while it is set, and sets it once
the request is sent. Only a QUERY_CASH or CASHSHOP_OPERATION result
clears it. The checks happen before the buy and gift dialogs open, so a
click on Buy while an answer is awaited does nothing.

HeavenClient now does the same. The Check button, the balance check on
regaining focus, the wish list buttons, buying, gifting, slot
expansions, and taking items out of or putting them back in the Cash
Inventory all go through UICashShop::request. Results 324 and 325
clear the flag. The server already answers every request the client
sends, including a failure for the modes it does not serve.
When a focused dialog such as the purchase notice went inactive, the cash
shop's UI state cleared the focus but returned the old cursor state without
passing the event on. The button under the cursor never saw it hover, so the
first click after closing the dialog did nothing. The event now falls through
to the front window, so the first Buy click after the notice opens the buy
dialog.
The v83 client decides an equip is cash by its Cash Shop serial (4f2cbb)
and wears it at -(100 + slot), over whatever regular item is in that slot.
The equip window draws the cash item in the cell when there is one, and
dragging or double-clicking the cell takes that item off. The server
already wrote positions under -100 as the cash list in the character
data, but nothing ever put an item there.

The server now only lets an item with a cash serial be worn 100 below its
slot, and any other item at the slot itself. The overall and two-handed
conflicts stay with the regular slots.

HeavenClient used to read the worn cash items into the regular slots,
where they overwrote the regular items. It now keeps them 100 above,
shows them in the equip window and on the character over the regular
ones, and sends the cash position when wearing an item with a serial or
taking off the one a cell shows. Scrolls dropped on a cell go to the
item it shows. The character keeps drawing the regular weapon, because
HeavenClient has no cash weapon art over a weapon's stances.
@neeerp
neeerp changed the base branch from v83/megaphones-rocks-name-tag to master October 18, 2026 18:46
@neeerp
neeerp merged commit 12cb0d9 into master Oct 18, 2026
1 check 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.

1 participant