Skip to content

handlers: item inventory — equip, favourite, sell, mix, and tutorial seeding - #33

Open
Seltraeh wants to merge 1 commit into
decompfrontier:devfrom
Seltraeh:split/04-items
Open

handlers: item inventory — equip, favourite, sell, mix, and tutorial seeding#33
Seltraeh wants to merge 1 commit into
decompfrontier:devfrom
Seltraeh:split/04-items

Conversation

@Seltraeh

@Seltraeh Seltraeh commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

handlers: item inventory — equip, favourite, sell, mix, and tutorial seeding

Branch: split/04-items
Base: dev
Merge position: 04 of 13

Part of the PR #28 split. Each PR branches from dev and contains only its
own changes, so this diff is exactly one subsystem. The set is designed to be
merged in numeric order; merging all 13 reproduces PR #28 byte for byte
(verified against tree 79a4e065).

Later PRs in the series touch Handlers.hpp, GmeControllerHandlers.cpp and
UserInfo.cpp too, so once earlier ones land this branch may need a rebase.
Those conflicts are always additions on both sides — keep both. Maintainer
edits are enabled, so feel free to push the rebase directly to this branch.

First gameplay PR. Implements the item inventory against user_items.

What's included

Handler Request Purpose
ItemSphereEqp 0IXGiC9t Move spheres between warehouse and a unit's two slots
ItemSell qDQerU74 Convert stacks to zel at the item_mst price
ItemFavorite I8il6EiI Persist the lock flag
ItemMix 4P5GELTF Credit the compounded result
ItemEdit ruoB7bD8 Acknowledge the pre-mission loadout

ItemEdit matters more than its size suggests: without it, preparing a mission item loadout closes the session.

Tutorial seeds one starter potion through CreateUser, so a new account grows its inventory naturally rather than receiving a hardcoded response.

Design note

Stacks decrement rather than delete, so instance_id stays stable across sells — the client holds these ids and reusing them causes mismatches. Zero-quantity rows are filtered off the wire but still feed the item dictionary, so a species stays in the encyclopedia once seen.

Verification

Tutorial completes with a potion in inventory; equip/unequip round-trips; sell credits zel and leaves the stack row intact at zero.

…seeding

Implements the item inventory against the user_items table.

ItemSphereEqp equips and unequips spheres, moving them between the warehouse
and the unit's two sphere slots. ItemSell converts stacks to zel using the
per-item price from item_mst. ItemFavorite persists the lock flag. ItemMix
credits the compounded result through addUserItem. ItemEdit acknowledges the
pre-mission item loadout so preparing a loadout no longer closes the session.

Tutorial seeds a single starter potion through CreateUser, so a new account
grows its inventory naturally instead of receiving a hardcoded response.

UserInfo now builds warehouse_info, equip_info, item_dictionary_info and
item_favorite from the table, replacing the hardcoded potion and its TODO.
Stacks decrement rather than delete so instance ids stay stable across sells;
zero-quantity rows are filtered off the wire but still feed the item
dictionary, so a species stays in the encyclopedia once seen.
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