• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Market system tfs 1.5 protocol 8.6

johnsamir

Advanced OT User
Joined
Oct 13, 2009
Messages
1,135
Solutions
6
Reaction score
214
Location
Nowhere
Hello, have enabled market system it seems to work, it display items, the buttons in the gui windows are enabled but when i try to create an offer to buy ex: an armor nothing happens if i re-click in create button, i get a message that i have to wait few seconds, the offer is not being created
in client i get this
LUA:
ERROR: ProtocolGame parse message exception (22 bytes, 1 unread, last opcode is 0x00 (0), prev opcode is 0xf6 (246)): InputMessage eof reached
Packet has been saved to packet.log, you can use it to find what was wrong. (Protocol: 860)
this is the log
Code:
ProtocolGame parse message exception (22 bytes, 1 unread, last opcode is 0x00 (0), prev opcode is 0xf6 (246), proto: 860): InputMessage eof reached
14 00 6c 06 d6 3b 0e 00
f6 00 00 00 ee 00 00 00 00 00 00 00
00 00

protocolgame.cpp
Code:
case 0xF6: parseMarketCreateOffer(msg); break;
Code:
void ProtocolGame::sendMarketEnter()
{
    NetworkMessage msg;
    msg.addByte(0xF6);
    msg.addByte(
        std::min<uint32_t>(IOMarket::getPlayerOfferCount(player->getGUID()), std::numeric_limits<uint8_t>::max()));

    player->setInMarket(true);

    std::map<uint16_t, uint32_t> depotItems;
    std::forward_list<Container*> containerList{ player->getInbox() };

    for (const auto& chest : player->depotChests) {
        if (!chest.second->empty()) {
            containerList.push_front(chest.second);
        }
    }

    do {
        Container* container = containerList.front();
        containerList.pop_front();

        for (Item* item : container->getItemList()) {
            Container* c = item->getContainer();
            if (c && !c->empty()) {
                containerList.push_front(c);
                continue;
            }

            const ItemType& itemType = Item::items[item->getID()];
            if (itemType.wareId == 0) {
                continue;
            }

            if (c && (!itemType.isContainer() || c->capacity() != itemType.maxItems)) {
                continue;
            }

            if (!item->hasMarketAttributes()) {
                continue;
            }

            depotItems[itemType.id] += Item::countByType(item, -1);
        }
    } while (!containerList.empty());

    uint16_t itemsToSend = std::min<size_t>(depotItems.size(), std::numeric_limits<uint16_t>::max());
    uint16_t i = 0;

    msg.add<uint16_t>(itemsToSend);
    for (std::map<uint16_t, uint32_t>::const_iterator it = depotItems.begin(); i < itemsToSend; ++it, ++i) {
        const ItemType& itemType = Item::items[it->first];
        msg.add<uint16_t>(itemType.wareId);
        if (itemType.classification > 0) {
            msg.addByte(0);
        }
        msg.add<uint16_t>(std::min<uint32_t>(0xFFFF, it->second));
    }
    writeToOutputBuffer(msg);

    sendResourceBalance(RESOURCE_BANK_BALANCE, player->getBankBalance());
    //sendResourceBalance(RESOURCE_GOLD_EQUIPPED, player->getMoney());
    //sendStoreBalance();
}
untitled.png


any help would be appreciated
ps: i've took the code from main tfs repository and for the client im using part of the code of sabreheaven otc at
LUA:
local function parseMarketEnter(protocol, msg)
in game.cpp changed spriteId to browseid( things related to market ofc)

like here
Code:
-void Game::playerBrowseMarket(uint32_t playerId, uint16_t spriteId)
+void Game::playerBrowseMarket(uint32_t playerId, uint16_t browseId)
{
    Player* player = getPlayerByID(playerId);
    if (!player) {

@@ -5262,7 +5262,7 @@ void Game::playerBrowseMarket(uint32_t playerId, uint16_t spriteId)
        player->sendMarketEnter();
    }

    -const ItemType& it = Item::items.getItemIdByClientId(spriteId);
   + const ItemType& it = Item::items.getItemIdByClientId(browseId);
 
Last edited:
nope :/ not easy to do the most easy thing to do is use a protocol for example 10.x with older graphics, because some info is taken directly from spr/dat /otb files. a solution is do add an array in otclient but it sucks
 
You can activate or deploy the market in your source and use the market module from that project.
it does not work, the items appears but wont make items be buyable or sellable, it's incomplete. not a bad project but that's not the best option or easier one at all , as i've said before. would be easier use a 10.x protocol with 8.x graphics and it will be an easier approach
 
can't be working... there are no spr/dat/otb files with market flag in it or normal client that allows it. it need otc client or dll modificatins plus source server side modifications. also using that system. items by now with no knowlegde must be added manually. by no menthion, that it's made only for shitaslrius, which does not handle the same system data by handling items as tfs or other distros. so...
nice release anyway
 
not easy to do the most easy thing to do is use a protocol for example 10.x with older graphics
I've implemented it using TFS 1.4 10.98 market code on 8.6 downgrade, then added extra code to send list of items from server (in 8.6 .dat there is no item names) and set in OTCv8 market module protocol version to 1098, so TFS 1.4 code was compatible with market module with 8.6 protocol.
can't be working... there are no spr/dat/otb files with market flag in it or normal client that allows it
In this line I left code that use real protocol version (860), to make it read list of items from server:
All other g_game.getProtocolVersion() in game_market module I've replaced with 1098.
You must also add code to read categories from items.xml, send them in market protocol and set categories for all tradeable items in items.xml.
 
this Game Marketing can be implemented in source 1.2 for 8.6?
I've implemented it using TFS 1.4 10.98 market code on 8.6 downgrade, then added extra code to send list of items from server (in 8.6 .dat there is no item names) and set in OTCv8 market module protocol version to 1098, so TFS 1.4 code was compatible with market module with 8.6 protocol.

In this line I left code that use real protocol version (860), to make it read list of items from server:
All other g_game.getProtocolVersion() in game_market module I've replaced with 1098.
You must also add code to read categories from items.xml, send them in market protocol and set categories for all tradeable items in items.xml.
 
Back
Top