fix: Tibia Coins cannot be offered on the market (resource 0x5B never sent) - #868
Merged
Conversation
O Resource_t parava em 0x57. O cliente 15.x le quantas Tibia Coins podem ir ao market por getResourceBalance(91) -- 0x5B -- e nao pelo pacote 0xDF que o sendCoinBalance ja enviava. Sem isso o t_market.lua faz setRange(0, 0) e a barra de quantidade da oferta trava em zero: da pra digitar o preco, mas nao a quantidade, sem mensagem de erro nenhuma. O cliente le esse resource como u64 (protocolgameparse.cpp, branch default), que e o formato que o sendResourceBalance ja usa.
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.
On a 15.25 client it is impossible to create a market offer for Tibia Coins. The price field accepts input, but the amount control stays locked at zero, with no error message.
Cause.
Resource_tinsrc/server/server_definitions.hppends at0x57. The 15.x client reads how many coins may be offered from the resource balance:and then:
The server does send the balance, but only through
0xDF(sendCoinBalance), which the market module does not read. Since0x5Bnever arrives,getResourceBalance(91)is always0.This is server-side only —
Game::playerCreateMarketOfferalready handlesITEM_STORE_COINcorrectly; the client simply never lets the request be built.Fix. Add
RESOURCE_COIN_NORMAL = 0x5A/RESOURCE_COIN_TRANSFERRABLE = 0x5Band emit them at the end ofsendCoinBalance(). The client parses this resource asu64(default branch ofparseResourceBalance), which is whatsendResourceBalancealready writes, so no format change is needed.Guarded by
!oldProtocol, so 11.00 clients are unaffected.Reported by a player on a 15.25 OTClient build: the amount control is locked at zero while the price field works.
grepoverResource_tconfirms0x5Bhas no sender on the server side. I have not yet had the reporter re-test with the patch applied, so treat the fix as reasoned from both sources rather than confirmed end to end.