Jump to content

Problem when selling after slot 255


Recommended Posts

I have a problem when selling items, after slot 255, only one item is sold, no matter how much I have, only one is sold...

Before slot 255 everything is sold correctly

I tried to debug and the client (Python) gets the information correctly, slot number and item quantity

but nevertheless on the server (input_main) only reaches the information of the slot and not the count, only a 0 or a 1 arrives.

Explanatory image (I dont know how put it in the post): Imagen

 case SHOP_SUBHEADER_CG_SELL2: (Input_main)

Spoiler

        case SHOP_SUBHEADER_CG_SELL2:
            {
                if (uiBytes < sizeof(UINT) + sizeof(BYTE))
                    return -1;

                UINT pos = *reinterpret_cast<const UINT*>(c_pData++);
                BYTE count = *(c_pData);

                sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName());
                CShopManager::instance().Sell(ch, pos, count);

                ch->ChatPacket(CHAT_TYPE_INFO, "return pos: %d, count: %d", pos, count);
                return sizeof(UINT) + sizeof(BYTE);
            }

bool CPythonNetworkStream::SendShopSellPacketNew(UINT bySlot, BYTE byCount): (PythonNetworkPhaseGameItem.cpp)

Spoiler

bool CPythonNetworkStream::SendShopSellPacketNew(UINT bySlot, BYTE byCount)
{
    if (!__CanActMainInstance())
        return true;

    TPacketCGShop PacketShop;
    PacketShop.header = HEADER_CG_SHOP;
    PacketShop.subheader = SHOP_SUBHEADER_CG_SELL2;

    if (!Send(sizeof(TPacketCGShop), &PacketShop))
    {
        Tracef("SendShopSellPacket Error\n");
        return false;
    }
    if (!Send(sizeof(UINT), &bySlot))
    {
        Tracef("SendShopAddSellPacket Error\n");
        return false;
    }
    if (!Send(sizeof(BYTE), &byCount))
    {
        Tracef("SendShopAddSellPacket Error\n");
        return false;
    }

    Tracef(" SendShopSellPacketNew(bySlot=%d, byCount=%d)\n", bySlot, byCount);

    return SendSequence();
}

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.