Çözüldü Offline shop - "Pazar geçmişi" hakkında sorun

Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

aykutleee

Üye
Üye
Mesaj
108
Çözümler
5
Beğeni
25
Puan
454
Ticaret Puanı
0
Mysqldaki offline_shop_sales tablosunda pazardan alınan veriler işleniyor. Ancak oyun içi pazar geçmişine tıklayınca açılan guiye veriler gelmiyor ve client syser bu şekilde ; (won sistemi kullanmıyorum)
Python:
1025 15:35:44369 :: Unknown Server Command ClearOfflineShopSales | ClearOfflineShopSales
1025 15:35:44371 :: Unknown Server Command OpenOfflineShopSalesWindow | OpenOfflineShopSalesWindow

ilgili kod blokları;
client - PythonNetworkStreamCommand.py

C++:
#ifdef ENABLE_OFFLINE_SHOP_SYSTEM
    else if (!strcmpi(szCmd, "OfflineShopCount"))
    {
        if (TokenVector.size() < 2)
        {
            TraceError("CPythonNetworkStream::ServerCommand(c_szCommand=%s) - Strange Parameter Count : %s", c_szCommand);
            return;
        }

        BYTE count = atoi(TokenVector[1].c_str());
        PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_OfflineShop_Count", Py_BuildValue("i", count));
    }
    else if (!strcmpi(szCmd, "OfflineShopSales"))
    {
        if (TokenVector.size() < 5)
        {
            TraceError("CPythonNetworkStream::ServerCommand(c_szCommand=%s) - Strange Parameter Count : %s", c_szCommand);
            return;
        }

        const std::string & buyerName = TokenVector[1].c_str();
        UINT itemVnum = atoi(TokenVector[2].c_str());
        UINT itemCount = atoi(TokenVector[3].c_str());
        long long itemPrice = atoi(TokenVector[4].c_str());
/*        UINT itemCheque = atoi(TokenVector[5].c_str());*/
        UINT itemDate = atoi(TokenVector[5].c_str());
        /*PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_OfflineShop_Sales", Py_BuildValue("(siiLii)", buyerName.c_str(), itemVnum, itemCount, itemPrice, itemCheque, itemDate));*/
        PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_OfflineShop_Sales", Py_BuildValue("(siiLi)", buyerName.c_str(), itemVnum, itemCount, itemPrice, itemDate));
    }
#endif

game - cmd_gm.cpp

C++:
.
.
.
ACMD(do_offline_shop_sales)
{
    char szQuery[1024];

/*    snprintf(szQuery, sizeof(szQuery), "SELECT buyer_name, item_vnum, item_count, item_price, item_cheque, datetime "*/
    snprintf(szQuery, sizeof(szQuery), "SELECT buyer_name, item_vnum, item_count, item_price, datetime "
        "FROM %soffline_shop_sales WHERE item_owner = %u ORDER BY datetime DESC LIMIT 100;", get_table_postfix(), ch->GetPlayerID());
    std::unique_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery(szQuery));

    ch->ChatPacket(CHAT_TYPE_COMMAND, "ClearOfflineShopSales");
    if (pMsg->Get()->uiNumRows > 0)
    {
        for (int i = 0; i < pMsg->Get()->uiNumRows; ++i)
        {
            MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);

            const char* szBuyerName = row[0]; // buyer name

            DWORD dwItemVnum = 0;
            str_to_number(dwItemVnum, row[1]); // item vnum

            BYTE bItemCount = 0;
            str_to_number(bItemCount, row[2]); // item count

            long long llItemPrice = 0;
            str_to_number(llItemPrice, row[3]); // item price

/*            int iItemCheque = 0;
            str_to_number(iItemCheque, row[4]); // item cheque*/

            DWORD dwItemDate = 0;
            str_to_number(dwItemDate, row[4]); // item date

/*            ch->ChatPacket(CHAT_TYPE_COMMAND, "OfflineShopSales %s %u %d %lld %d %u", szBuyerName, dwItemVnum, bItemCount, llItemPrice, iItemCheque, dwItemDate);*/
            ch->ChatPacket(CHAT_TYPE_COMMAND, "OfflineShopSales %s %u %d %lld %u", szBuyerName, dwItemVnum, bItemCount, llItemPrice, dwItemDate);

        }
    }
    ch->ChatPacket(CHAT_TYPE_COMMAND, "OpenOfflineShopSalesWindow");
}
#endif

mysql - soffline_shop_sales;

Adsız.png
 
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst