feat(market): add asynchronous web market order queue processor (IOMarket::processWebOrders) - #909
Open
berrytern wants to merge 14 commits into
Open
feat(market): add asynchronous web market order queue processor (IOMarket::processWebOrders)#909berrytern wants to merge 14 commits into
berrytern wants to merge 14 commits into
Conversation
berrytern
force-pushed
the
feat/web-market-order-queue
branch
from
August 19, 2026 02:12
a22aaae to
20bca68
Compare
Collaborator
|
Check Linux build error and fix please |
…rket::processWebOrders)
…ivery with tier preservation
…llback, and migrations 64/65
berrytern
force-pushed
the
feat/web-market-order-queue
branch
from
August 19, 2026 18:26
3edce21 to
26b8f4f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Integrating web-based marketplace purchases and sales with an active OpenTibia game server has historically been challenging due to the "dual-truth" memory problem:
balance) or inventory directly in MySQL leads to silent rollbacks when the C++ server saves the player's RAM state.This PR implements an Asynchronous Outbox Order Queue System directly in
IOMarket::processWebOrders:market_web_ordersholds queued purchase requests submitted from web portals / AACs / APIs.player->getBankBalance(),player->setBankBalance(),internalAddItem()) and notifies the player in-game via text message.player_depotitems).market_offersand logs transaction history inmarket_history.Behaviour
Actual
Expected
market_web_orderswith status 'PENDING'.Type of change
How Has This Been Tested
Test A: Web purchase with offline buyer and seller
INSERT INTO market_offers (player_id, sale, itemtype, amount, created, anonymous, price, tier) VALUES (5, 1, 3360, 1, UNIX_TIMESTAMP(), 0, 15000, 0);market_web_orders:INSERT INTO market_web_orders (offer_id, buyer_id, buyer_account_id, seller_id, seller_account_id, itemtype, amount, price, tier, currency_type, status, created_at) VALUES (LAST_INSERT_ID(), 4, 1, 5, 1, 3360, 1, 15000, 0, 'gold', 'PENDING', UNIX_TIMESTAMP());ℹ️ PR Dependency Note
This PR (
feat/web-market-order-queue) is stacked on top of #908 (feat/player-concurrency-lock):64.lua,db_version = 64).65.lua,db_version = 65), building on top of the concurrency lock to ensure safe item deliveries and balance updates.Merge Order:
Please review and merge #908 first.