Cevaplanmadı The online shop problem

  • Konuyu başlatan Konuyu başlatan Justice777
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 5
  • Görüntüleme Görüntüleme 557

Justice777

Level 3
Katılım
13 Tem 2019
Konular
22
Mesajlar
129
Çözüm
13
Reaksiyon Skoru
11
Altın Konu
0
TM Yaşı
6 Yıl 11 Ay 6 Gün
Başarım Puanı
51
MmoLira
184
DevLira
0
Ticaret - 0%
0   0   0

HERAKLES Otomatik Avlı kalıcı sunucu. 19 Haziran'da açılıyor. Atius & Wizard güvencesiyle hemen kayıt ol, ön kayıt ödülleri aktif. HEMEN TIKLA!

Hello friends
I have a problem with the Offline Shop. I am using this version of the Offline Shop


the problem


All I need to know is the reason for issuing the problem or the files responsible for the problem. Thank you
 
Offline shop cpp üzerinden itemattr attr vaulpe kısımlarının socketlerini düzenleyiniz
 
Offline shop cpp üzerinden itemattr attr vaulpe kısımlarının socketlerini düzenleyiniz

offlineshop.cpp

All I did in that file was to delete the second coins and just make them Won and Yang

Kod:
    char szColumns[QUERY_MAX_LEN], szValues[QUERY_MAX_LEN];

    snprintf(szColumns, sizeof(szColumns),
        "owner_id, pos, count, price, price7, vnum,"
        "socket0, socket1, socket2,"
        "attrtype0, attrvalue0, attrtype1, attrvalue1,"
        "attrtype2, attrvalue2, attrtype3, attrvalue3,"
        "attrtype4, attrvalue4, attrtype5, attrvalue5,"
        "attrtype6, attrvalue6");

    snprintf(szValues, sizeof(szValues), "%u, %d, %u, %u, %u, %u, %ld, %ld, %ld, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d, %d",
        ch->GetPlayerID(), iPos, pkItem->GetCount(), iPrice, iPrice7, pkItem->GetVnum(),
        pkItem->GetSocket(0), pkItem->GetSocket(1),
        pkItem->GetSocket(2),
        pkItem->GetAttributeType(0), pkItem->GetAttributeValue(0), pkItem->GetAttributeType(1), pkItem->GetAttributeValue(1),
        pkItem->GetAttributeType(2), pkItem->GetAttributeValue(2), pkItem->GetAttributeType(3), pkItem->GetAttributeValue(3),
        pkItem->GetAttributeType(4), pkItem->GetAttributeValue(4), pkItem->GetAttributeType(5), pkItem->GetAttributeValue(5),
        pkItem->GetAttributeType(6), pkItem->GetAttributeValue(6));

offlineshop_manager.cpp

Kod:
void COfflineShopManager::FetchMyItems(LPCHARACTER ch)
{
    if (!ch)
        return;

    char szQuery[1024];
    snprintf(szQuery, sizeof(szQuery),
        "SELECT pos, count, vnum, socket0, socket1, socket2, "
        "attrtype0, attrvalue0, attrtype1, attrvalue1,"
        "attrtype2, attrvalue2, attrtype3, attrvalue3,"
        "attrtype4, attrvalue4, attrtype5, attrvalue5,"
        "attrtype6, attrvalue6 "
        "FROM %soffline_shop_item WHERE owner_id = %u", get_table_postfix(), ch->GetPlayerID());

    std::unique_ptr<SQLMsg> pMsg(DBManager::Instance().DirectQuery(szQuery));

    if (pMsg->Get()->uiNumRows == 0)
    {
        ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Nothing found."));
        return;
    }

    MYSQL_ROW row;
    while (NULL != (row = mysql_fetch_row(pMsg->Get()->pSQLResult)))
    {
        TPlayerItem item;

        str_to_number(item.pos, row[0]);
        str_to_number(item.count, row[1]);
        str_to_number(item.vnum, row[2]);

        for (int i = 0, n = 3; i < ITEM_SOCKET_MAX_NUM; ++i, n++)
            str_to_number(item.alSockets[i], row[n]);

        for (int i = 0, iStartAttributeType = 6, iStartAttributeValue = ITEM_ATTRIBUTE_MAX_NUM; i < ITEM_ATTRIBUTE_MAX_NUM; ++i, iStartAttributeType += 2, iStartAttributeValue += 2)
        {
            str_to_number(item.aAttr[i].bType, row[iStartAttributeType]);
            str_to_number(item.aAttr[i].sValue, row[iStartAttributeValue]);
        }

        LPITEM pItem = ITEM_MANAGER::instance().CreateItem(item.vnum, item.count);

        if (pItem)
        {
            pItem->SetSockets(item.alSockets);
            pItem->SetAttributes(item.aAttr);

            int cell;
            cell = ch->GetEmptyInventory(pItem->GetSize());

            if (cell != -1)
            {
                pItem->AddToCharacter(ch, TItemPos(INVENTORY, cell));
            }
            else
            {
                pItem->AddToGround(ch->GetMapIndex(), ch->GetXYZ());
                pItem->StartDestroyEvent();
                pItem->SetOwnership(ch, 60);
            }

            DBManager::instance().DirectQuery("DELETE FROM %soffline_shop_item WHERE owner_id = %u AND pos = %d AND vnum = %d LIMIT 1", get_table_postfix(), ch->GetPlayerID(), item.pos, item.vnum);

            LogManager::instance().OfflineShopLog(ch->GetDesc()->GetAccountTable().id, pItem->GetName(), "FETCH");
        }
    }
}
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)