#1.) Add this:
Code:
#define __OFFLINE_SHOP_FIX_OPEN #define __OFFLINE_SHOP_VALUE_MAX 2000000000 #define __OFFLINE_SHOP_WARNING "[Protect Offline] Have more than 2.000.000.000 Yang!"
#1.) Search function:
Code:
if (!LC_IsBrazil())
{
DWORD nTotalMoney = 0;
for (BYTE n = 0; n < bItemCount; ++n)
nTotalMoney += (pTable + n)->price;
if (GOLD_MAX - 1 <= nTotalMoney)
{
sys_err("[OVERFLOW_GOLD] Overflow (GOLD_MAX) id %u name %s", GetPlayerID(), GetName());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("20억 냥을 초과하여 상점을 열수가 없습니다"));
return;
}
}
Code:
#ifdef __OFFLINE_SHOP_FIX_OPEN
int64_t szTotalMoney = 0;
for (int n = 0; n < bItemCount; ++n)
{
szTotalMoney += static_cast<int64_t>((pTable+n)->price);
}
std::auto_ptr<SQLMsg> pMsg(DBManager::instance().DirectQuery("SELECT money FROM player.player WHERE id = %u", GetPlayerID()));
if (pMsg->Get()->uiNumRows == 0)
return;
DWORD dwCurrentMoney = 0;
MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
str_to_number(dwCurrentMoney, row[0]);
szTotalMoney += static_cast<int64_t>(dwCurrentMoney);
if (__OFFLINE_SHOP_VALUE_MAX <= szTotalMoney)
{
ChatPacket(CHAT_TYPE_INFO, __OFFLINE_SHOP_WARNING);
return;
}
#else
if (!LC_IsBrazil())
{
DWORD nTotalMoney = 0;
for (BYTE n = 0; n < bItemCount; ++n)
nTotalMoney += (pTable + n)->price;
if (GOLD_MAX - 1 <= nTotalMoney)
{
sys_err("[OVERFLOW_GOLD] Overflow (GOLD_MAX) id %u name %s", GetPlayerID(), GetName());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("20억 냥을 초과하여 상점을 열수가 없습니다"));
return;
}
}
#endif







