Merge branch 'main' into blockcountry-cleanup
This commit is contained in:
@@ -427,8 +427,7 @@ void CInputDB::PlayerLoad(LPDESC d, const char * data)
|
||||
|
||||
if (LC_IsYMIR() || LC_IsKorea() || LC_IsBrazil() || LC_IsJapan())
|
||||
{
|
||||
LogManager::instance().LoginLog(true,
|
||||
ch->GetDesc()->GetAccountTable().id, ch->GetPlayerID(), ch->GetLevel(), ch->GetJob(), ch->GetRealPoint(POINT_PLAYTIME));
|
||||
LogManager::instance().LoginLog(true, ch->GetDesc()->GetAccountTable().id, ch->GetPlayerID(), ch->GetLevel(), ch->GetJob(), ch->GetRealPoint(POINT_PLAYTIME));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1843,61 +1842,6 @@ void CInputDB::Notice(const char * c_pData)
|
||||
SendNotice(szBuf);
|
||||
}
|
||||
|
||||
void CInputDB::VCard(const char * c_pData)
|
||||
{
|
||||
TPacketGDVCard * p = (TPacketGDVCard *) c_pData;
|
||||
|
||||
sys_log(0, "VCARD: %u %s %s %s %s", p->dwID, p->szSellCharacter, p->szSellAccount, p->szBuyCharacter, p->szBuyAccount);
|
||||
|
||||
std::unique_ptr<SQLMsg> pmsg(DBManager::instance().DirectQuery("SELECT sell_account, buy_account, time FROM vcard WHERE id=%u", p->dwID));
|
||||
if (pmsg->Get()->uiNumRows != 1)
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: no data");
|
||||
return;
|
||||
}
|
||||
|
||||
MYSQL_ROW row = mysql_fetch_row(pmsg->Get()->pSQLResult);
|
||||
|
||||
if (strcmp(row[0], p->szSellAccount))
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: sell account differ %s", row[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!row[1] || *row[1])
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: buy account already exist");
|
||||
return;
|
||||
}
|
||||
|
||||
int time = 0;
|
||||
str_to_number(time, row[2]);
|
||||
|
||||
if (!row[2] || time < 0)
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: time null");
|
||||
return;
|
||||
}
|
||||
|
||||
std::unique_ptr<SQLMsg> pmsg1(DBManager::instance().DirectQuery("UPDATE GameTime SET LimitTime=LimitTime+%d WHERE UserID='%s'", time, p->szBuyAccount));
|
||||
|
||||
if (pmsg1->Get()->uiAffectedRows == 0 || pmsg1->Get()->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: cannot modify GameTime table");
|
||||
return;
|
||||
}
|
||||
|
||||
std::unique_ptr<SQLMsg> pmsg2(DBManager::instance().DirectQuery("UPDATE vcard,GameTime SET sell_pid='%s', buy_pid='%s', buy_account='%s', sell_time=NOW(), new_time=GameTime.LimitTime WHERE vcard.id=%u AND GameTime.UserID='%s'", p->szSellCharacter, p->szBuyCharacter, p->szBuyAccount, p->dwID, p->szBuyAccount));
|
||||
|
||||
if (pmsg2->Get()->uiAffectedRows == 0 || pmsg2->Get()->uiAffectedRows == (uint32_t)-1)
|
||||
{
|
||||
sys_log(0, "VCARD_FAIL: cannot modify vcard table");
|
||||
return;
|
||||
}
|
||||
|
||||
sys_log(0, "VCARD_SUCCESS: %s %s", p->szBuyAccount, p->szBuyCharacter);
|
||||
}
|
||||
|
||||
void CInputDB::GuildWarReserveAdd(TGuildWarReserve * p)
|
||||
{
|
||||
CGuildManager::instance().ReserveWarAdd(p);
|
||||
@@ -2228,10 +2172,6 @@ int CInputDB::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
||||
SetEventFlag(c_pData);
|
||||
break;
|
||||
|
||||
case HEADER_DG_VCARD:
|
||||
VCard(c_pData);
|
||||
break;
|
||||
|
||||
case HEADER_DG_CREATE_OBJECT:
|
||||
CreateObject(c_pData);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user