mavzermete 1
mavzermete
Psych0SoociaL 1
Psych0SoociaL
noisiv 1
noisiv
Manwe Work 1
Manwe Work
Hikaye Ekle

Offline Shop İsim game.core Fix

  • Konuyu başlatan Konuyu başlatan LethalStrikeR
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 47
  • Görüntüleme Görüntüleme 7K
Merhaba Turkmmo Halkı;

Arkadaşlar konu önceden paylaşıldıysa kusura bakmayın detaylı bir araştırma yapamadım ama bende bugu dev'de buldum ve fixini araştırıp buldum paylaşmak istedim.

Pazar ismini böyle açınca game.core veriyor. %s%S(bunu yazın sonra ctrl+a ya basın) ondan sonra pazarı kurun game.core verecek.

kX7Ozr.png


Anlatıma geçelim:

Char.cpp açılır

ARATILIR
Kod:
void CHARACTER::OpenMyOfflineShop(const char * c_pszSign, TShopItemTable * pTable, BYTE bItemCount, BYTE bTime)

Kod bloğunun içinde aratılır;
Kod:
    char szSign[SHOP_SIGN_MAX_LEN+1];

    strlcpy(szSign, c_pszSign, sizeof(szSign));

Altına boşluk bırak ekle;
Kod:
    if (strlen(szSign) == 0)
    {
        ChatPacket(CHAT_TYPE_INFO, "Geçersiz çevrimdışı pazar ismi girdiniz!");
        return;
    }
   
    if (strstr(szSign, "%") || strstr(szSign, "'"))
    {
        ChatPacket(CHAT_TYPE_INFO, "Geçersiz çevrimdışı pazar ismi girdiniz!");
        return;      
    }

KANIT:
yzJ0ZM.png


İsim bozukluğunu kodlarda güncelleme yaparak giderdim attığım kanıttaki gibi gözükmeyecektir.

Herkese iyi forumlar.



char szSign[SHOP_SIGN_MAX_LEN+1];

strlcpy(szSign, c_pszSign, sizeof(szSign));

bu kodlar yok ara dediğiniz satır var ama o yok



Kod:
#ifdef ENABLE_MAXIMUM_YANG_FOR_OFFLINE_SHOP
void CHARACTER::OpenMyOfflineShop(const char * c_pszSign, TOfflineShopItemTable * pTable, BYTE bItemCount, BYTE bTime)
#else
void CHARACTER::OpenMyOfflineShop(const char * c_pszSign, TShopItemTable * pTable, BYTE bItemCount, BYTE bTime)
#endif
{
    quest::PC * pPC = quest::CQuestManager::instance().GetPC(GetPlayerID());

    if (pPC && pPC->IsRunning())
        return;

    if (bItemCount == 0)
        return;

    if (GetShop() || GetOfflineShop())
        return;

    if (g_bEnableEmpireLimit)
    {
        if (GetEmpire() == 1 && (GetMapIndex() == 41 || GetMapIndex() == 21))
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't build offline shop in this village!"));
            return;
        }
        else if (GetEmpire() == 2 && (GetMapIndex() == 1 || GetMapIndex() == 41))
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't build offline shop in this village!"));
            return;
        }
        else if (GetEmpire() == 3 && (GetMapIndex() == 1 || GetMapIndex() == 21))
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't build offline shop in this village!"));
            return;
        }
    }

    {
        std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT COUNT(*) FROM %soffline_shop_item WHERE owner_id = %u and status = 1", get_table_postfix(), GetPlayerID()));
        MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);

        BYTE bResult = 0;
        str_to_number(bResult, row[0]);

        if (bResult)
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("At first, you have to get your unsold items at admin panel."));
            return;
        }
    }

    {
        std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT COUNT(*) FROM %soffline_shop_npc WHERE owner_id = %u", get_table_postfix(), GetPlayerID()));
        MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);

        BYTE bResult = 0;
        str_to_number(bResult, row[0]);

        if (bResult)
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You already have an offline-shop."));
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot open a new offline-shop before close old one."));
            return;
        }
    }

    if (g_bOfflineShopMapAllowLimit)
    {
        if (!offlineshop_map_allow_find(GetMapIndex()))
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot open an offline-shop here!"));
            return;
        }
    }

    if (g_bNeededItem)
    {
        BYTE bCount = quest::CQuestManager::instance().GetCurrentCharacterPtr()->CountSpecifyItem(g_iItemVnum);
        if (bCount < g_iItemVnum)
        {
            LPITEM pItem = ITEM_MANAGER::instance().CreateItem(g_iItemVnum);
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You cannot open an offline-shop at the moment. You need to x%d %s"), g_bItemCount, pItem->GetName());
            return;
        }
    }

    if (g_bNeededMoney)
    {
#ifdef ENABLE_MAXIMUM_YANG_FOR_OFFLINE_SHOP
        if (GetGold() < static_cast<long long>(g_dwNeedMoney))
#else
        if (GetGold() < static_cast<int>(g_dwNeedMoney))
#endif
        {
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You do not have enough money to open an offline-shop at the moment."));
            ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Required money : %u"), g_dwNeedMoney);
            return;
        }
    }

    if (g_bNeedMinLevel && GetLevel() < g_bMinLevel)
    {
        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Your level is not enough to open an offline shop!"));
        return;
    }

    {
        if (g_wCoinsForUnlimited > 0 && bTime == 4)
        {
            std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT coins FROM account.account WHERE id = %u", GetAID()));
            if (pMsg->Get()->uiNumRows == 0) return;
            MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
            long lCoins = 0;
            str_to_number(lCoins, row[0]);

            if (lCoins < static_cast<long>(g_wCoinsForUnlimited))
            {
                ChatPacket(CHAT_TYPE_INFO, LC_TEXT("You can't open an offline shop. You need to %d coins to open an offline shop!"), g_wCoinsForUnlimited);
                return;
            }

            DBManager::instance().DirectQuery("UPDATE account.account SET coins = coins - %d where id = %u", g_wCoinsForUnlimited, GetAID());
        }
    }
 

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

Geri
Üst