Dev Log #3 Marketplace
Marketplace Overhaul: Listing Lifecycle & Economy Safety
The marketplace has been completely reworked with a new status-based listing lifecycle and several economy safety improvements.
New Listing Lifecycle
Previously, marketplace listings were just active or inactive. Now every listing flows through four states:
Active (0) -- Listed and visible to buyers
Sold (1) -- Someone bought it, seller must claim gold
Expired (2) -- Time ran out, seller must reclaim item
Completed (3) -- Resolved, no longer counts toward your slot limit
Key behavioral changes:
> Sold items require manual gold claim -- When someone buys your item, you will see a Sold badge in My Listings. Double-tap to claim your gold (minus 2% marketplace tax). Gold is credited immediately.
> Expired items require manual reclaim -- Expired items show a Expired badge. Double-tap to get your item back. If your inventory is full, the claim fails with a warning -- free up a slot first.
> Listing slots include unresolved items -- Your 7-slot limit now counts Active + Sold + Expired listings. Slots only free up after you claim or cancel.
> Cancel only works on Active listings -- You cannot cancel something that has already been sold or expired.
Economy Safety Net
Beyond the lifecycle changes, we locked down several edge cases:
> Buying an item with socketed gems now correctly preserves the gems (was silently destroying them)
> If your inventory is full when a purchase completes, gold is refunded atomically -- no more lost gold
> Canceling a listing with a full inventory is now blocked instead of silently losing the item
> Items inside bags can now be listed on the marketplace (server searches bag contents)
> Shop buy/sell operations have integer overflow protection against malicious inputs
> Soulbound and container items no longer appear in the Sell on Market context menu
The marketplace panel also got an auto-retry system -- if the server does not respond within 2 seconds (network hiccup, DB latency), the panel automatically resends your request. No more staring at a blank page.
-- Admin