Yardım game >warnıng

Konu sahibi bu konuda soru soruyor. Sorusu ile ilgili bilgisi olanların yanıtlamasını bekliyor.

aykutleee

Üye
Üye
Mesaj
108
Çözümler
5
Beğeni
25
Puan
454
Ticaret Puanı
0
yeni offline shop eklerken game bu şekilde hatalar veriyor. ilgili kod satırları aşağıdaki gibi. Sanırım serverimde ekli olmayan attr lerde mevcut. Bunları nasıl tespit edebilirim ?

h1.png



C++:
        id = 0;
        owner_id = 0;
        pos = 0;
        count = 0;
        price = 0;
#ifdef __CHEQUE_SYSTEM__
        price_cheque = 0;
#endif
        vnum = 0;
        alSockets[0] = 0;
        alSockets[1] = 0;
        alSockets[2] = 0;
        alSockets[3] = 0;
        alSockets[4] = 0;
        alSockets[5] = 0;
        aAttr[0].bType = 0;
        aAttr[0].sValue = 0;
        aAttr[1].bType = 0;
        aAttr[1].sValue = 0;
        aAttr[2].bType = 0;
        aAttr[2].sValue = 0;
        aAttr[3].bType = 0;
        aAttr[3].sValue = 0;
        aAttr[4].bType = 0;
        aAttr[4].sValue = 0;
        aAttr[5].bType = 0;
        aAttr[5].sValue = 0;
        aAttr[6].bType = 0;
        aAttr[6].sValue = 0;
        aAttr[7].bType = 0;
        aAttr[7].sValue = 0;
        aAttr[8].bType = 0;
        aAttr[8].sValue = 0;
        aAttr[9].bType = 0;
        aAttr[9].sValue = 0;
        aAttr[10].bType = 0;
        aAttr[10].sValue = 0;
        aAttr[11].bType = 0;
        aAttr[11].sValue = 0;
        aAttr[12].bType = 0;
        aAttr[12].sValue = 0;
        aAttr[13].bType = 0;
        aAttr[13].sValue = 0;
        aAttr[14].bType = 0;
        aAttr[14].sValue = 0;
        status = 0;
        szBuyerName[CHARACTER_NAME_MAX_LEN + 1] = 0;
#ifdef __BL_TRANSMUTATION__
        dwTransmutationVnum = 0;
#endif
#ifdef __PRIVATE_SHOP_SEARCH_SYSTEM__
        szName[ITEM_NAME_MAX_LEN + 1] = 0;
        refine_level = 0;
        shop_id = 0;
#endif
 
Olmayan bir indexe ulaşmaya çalıştığınız için böyle bir hata veriyor. Kodu bu şekilde düzenleyin hem warninginiz gidicektir, hem de bu kadar kod fazla :D
C++:
        id = 0;
        owner_id = 0;
        pos = 0;
        count = 0;
        price = 0;
#ifdef __CHEQUE_SYSTEM__
        price_cheque = 0;
#endif
        vnum = 0;
        for (int i = 0; i < ITEM_SOCKET_MAX_NUM; ++i)
            alSockets[i] = 0;
        for (int i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; ++i)
        {
            aAttr[i].bType = 0;
            aAttr[i].sValue = 0;
        }
        
        status = 0;
        szBuyerName[CHARACTER_NAME_MAX_LEN + 1] = 0;
#ifdef __BL_TRANSMUTATION__
        dwTransmutationVnum = 0;
#endif
#ifdef __PRIVATE_SHOP_SEARCH_SYSTEM__
        szName[ITEM_NAME_MAX_LEN + 1] = 0;
        refine_level = 0;
        shop_id = 0;
#endif
 
Olmayan bir indexe ulaşmaya çalıştığınız için böyle bir hata veriyor. Kodu bu şekilde düzenleyin hem warninginiz gidicektir, hem de bu kadar kod fazla :D
C++:
        id = 0;
        owner_id = 0;
        pos = 0;
        count = 0;
        price = 0;
#ifdef __CHEQUE_SYSTEM__
        price_cheque = 0;
#endif
        vnum = 0;
        for (int i = 0; i < ITEM_SOCKET_MAX_NUM; ++i)
            alSockets[i] = 0;
        for (int i = 0; i < ITEM_ATTRIBUTE_MAX_NUM; ++i)
        {
            aAttr[i].bType = 0;
            aAttr[i].sValue = 0;
        }
    
        status = 0;
        szBuyerName[CHARACTER_NAME_MAX_LEN + 1] = 0;
#ifdef __BL_TRANSMUTATION__
        dwTransmutationVnum = 0;
#endif
#ifdef __PRIVATE_SHOP_SEARCH_SYSTEM__
        szName[ITEM_NAME_MAX_LEN + 1] = 0;
        refine_level = 0;
        shop_id = 0;
#endif

ama offlineshop.cpp bu şekilde ;

C++:
            OFFLINE_SHOP_ITEM & item = m_itemVector[pos];

            str_to_number(item.id, row[0]);                                    // 0
            str_to_number(item.owner_id, row[1]);                            // 1
            str_to_number(item.pos, row[2]);                                // 2
            str_to_number(item.count, row[3]);                                // 3
            str_to_number(item.vnum, row[4]);                                // 4
            str_to_number(item.alSockets[0], row[5]);                        // 5
            str_to_number(item.alSockets[1], row[6]);                        // 6
            str_to_number(item.alSockets[2], row[7]);                        // 7
#ifdef __ITEM_SOCKET5__
            str_to_number(item.alSockets[3], row[8]);                        // 8
            str_to_number(item.alSockets[4], row[9]);                        // 9
            str_to_number(item.alSockets[5], row[10]);                        // 10
#endif
            str_to_number(item.aAttr[0].bType, row[11]);                    // 11 ~ 8
            str_to_number(item.aAttr[0].sValue, row[12]);                    // 12 ~ 9
            str_to_number(item.aAttr[1].bType, row[13]);                    // 13 ~ 10
            str_to_number(item.aAttr[1].sValue, row[14]);                    // 14 ~ 11
            str_to_number(item.aAttr[2].bType, row[15]);                    // 15 ~ 12
            str_to_number(item.aAttr[2].sValue, row[16]);                    // 16 ~ 13
            str_to_number(item.aAttr[3].bType, row[17]);                    // 17 ~ 14
            str_to_number(item.aAttr[3].sValue, row[18]);                    // 18 ~ 15
            str_to_number(item.aAttr[4].bType, row[19]);                    // 19 ~ 16
            str_to_number(item.aAttr[4].sValue, row[20]);                    // 20 ~ 17
            str_to_number(item.aAttr[5].bType, row[21]);                    // 21 ~ 18
            str_to_number(item.aAttr[5].sValue, row[22]);                    // 22 ~ 19
            str_to_number(item.aAttr[6].bType, row[23]);                    // 23 ~ 20
            str_to_number(item.aAttr[6].sValue, row[24]);                    // 24 ~ 21
            str_to_number(item.aAttr[7].bType, row[25]);                    // 25 ~ 22
            str_to_number(item.aAttr[7].sValue, row[26]);                    // 26 ~ 23
            str_to_number(item.aAttr[8].bType, row[27]);                    // 27 ~ 24
            str_to_number(item.aAttr[8].sValue, row[28]);                    // 28 ~ 25
            str_to_number(item.aAttr[9].bType, row[29]);                    // 29 ~ 26
            str_to_number(item.aAttr[9].sValue, row[30]);                    // 30 ~ 27
            str_to_number(item.aAttr[10].bType, row[31]);                    // 31 ~ 28
            str_to_number(item.aAttr[10].sValue, row[32]);                    // 32 ~ 29
            str_to_number(item.aAttr[11].bType, row[33]);                    // 33 ~ 30
            str_to_number(item.aAttr[11].sValue, row[34]);                    // 34 ~ 31
            str_to_number(item.aAttr[12].bType, row[35]);                    // 35 ~ 32
            str_to_number(item.aAttr[12].sValue, row[36]);                    // 36 ~ 33
            str_to_number(item.aAttr[13].bType, row[37]);                    // 37 ~ 34
            str_to_number(item.aAttr[13].sValue, row[38]);                    // 38 ~ 35
            str_to_number(item.aAttr[14].bType, row[39]);                    // 39 ~ 36
            str_to_number(item.aAttr[14].sValue, row[40]);                    // 40 ~ 37
            str_to_number(item.price, row[41]);                                // 41 ~ 38
#ifdef __CHEQUE_SYSTEM__
            str_to_number(item.price_cheque, row[42]);                        // 42 ~ 39
#endif
            str_to_number(item.status, row[43]);                                // 43 ~ 40
            strlcpy(item.szBuyerName, row[44], sizeof(item.szBuyerName));    // 44 ~ 41
#ifdef __BL_TRANSMUTATION__
            str_to_number(item.dwTransmutationVnum, row[45]);                        // 45 ~ 42
#endif
#ifdef __PRIVATE_SHOP_SEARCH_SYSTEM__
            strlcpy(item.szName, row[46], sizeof(item.szName));                // 46 ~ 43
            str_to_number(item.refine_level, row[47]);                        // 47 ~ 44

            DWORD vid = GetOfflineShopNPC()->GetVID();
            item.shop_id = vid;
#endif

ve ofline shop.h da

C++:
                id = 0;
                owner_id = 0;
                pos = 0;
                count = 0;
                price = 0;
#ifdef __CHEQUE_SYSTEM__
                price_cheque = 0;
#endif
                vnum = 0;
                alSockets[0] = 0;
                alSockets[1] = 0;
                alSockets[2] = 0;
                alSockets[3] = 0;
                alSockets[4] = 0;
                alSockets[5] = 0;
                aAttr[0].bType = 0;
                aAttr[0].sValue = 0;
                aAttr[1].bType = 0;
                aAttr[1].sValue = 0;
                aAttr[2].bType = 0;
                aAttr[2].sValue = 0;
                aAttr[3].bType = 0;
                aAttr[3].sValue = 0;
                aAttr[4].bType = 0;
                aAttr[4].sValue = 0;
                aAttr[5].bType = 0;
                aAttr[5].sValue = 0;
                aAttr[6].bType = 0;
                aAttr[6].sValue = 0;
                aAttr[7].bType = 0;
                aAttr[7].sValue = 0;
                aAttr[8].bType = 0;
                aAttr[8].sValue = 0;
                aAttr[9].bType = 0;
                aAttr[9].sValue = 0;
                aAttr[10].bType = 0;
                aAttr[10].sValue = 0;
                aAttr[11].bType = 0;
                aAttr[11].sValue = 0;
                aAttr[12].bType = 0;
                aAttr[12].sValue = 0;
                aAttr[13].bType = 0;
                aAttr[13].sValue = 0;
                aAttr[14].bType = 0;
                aAttr[14].sValue = 0;
                status = 0;
                szBuyerName[CHARACTER_NAME_MAX_LEN + 1] = 0;
#ifdef __BL_TRANSMUTATION__
                dwTransmutationVnum = 0;
#endif
#ifdef __PRIVATE_SHOP_SEARCH_SYSTEM__
                szName[ITEM_NAME_MAX_LEN + 1] = 0;
                refine_level = 0;
                shop_id = 0;
#endif

bu şekilde kod blogları var benzer olarak.

Bu warningden dolayı olması gerek oyuna girince offline shop dükkanını açıyorum. Ofline shop guileri geliyor ekrana ama hemen 2 saniye sonra oyundan giriş ekranına atıyor ve oyun client syser;

Kod:
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24505 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0
1001 17:33:24506 :: Cannot find item by 0

veriyor
 
Geri
Üst