Removed unused highscore Lua & DB functions

This commit is contained in:
2024-03-30 18:06:36 +02:00
parent 05a1406c7c
commit 0c86f802ca
11 changed files with 10 additions and 210 deletions

View File

@ -973,39 +973,6 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
}
break;
case QID_HIGHSCORE_REGISTER:
{
THighscoreRegisterQueryInfo * info = (THighscoreRegisterQueryInfo *) qi->pvData;
bool bQuery = true;
if (pMsg->Get()->uiNumRows)
{
MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
if (row && row[0])
{
int iCur = 0;
str_to_number(iCur, row[0]);
if ((info->bOrder && iCur >= info->iValue) ||
(!info->bOrder && iCur <= info->iValue))
bQuery = false;
}
}
if (bQuery)
Query("REPLACE INTO highscore%s VALUES('%s', %u, %d)",
get_table_postfix(), info->szBoard, info->dwPID, info->iValue);
M2_DELETE(info);
}
break;
case QID_HIGHSCORE_SHOW:
{
}
break;
// BLOCK_CHAT
case QID_BLOCK_CHAT_LIST:
{

View File

@ -16,8 +16,6 @@ enum
QID_SAFEBOX_SIZE,
QID_AUTH_LOGIN,
QID_LOTTO,
QID_HIGHSCORE_REGISTER,
QID_HIGHSCORE_SHOW,
QID_BILLING_GET_TIME,
QID_BILLING_CHECK,
@ -162,13 +160,6 @@ template <class Functor> void DBManager::FuncAfterQuery(Functor f, const char* c
}
////////////////////////////////////////////////////////////////
typedef struct SHighscoreRegisterQueryInfo
{
char szBoard[20+1];
DWORD dwPID;
int iValue;
bool bOrder;
} THighscoreRegisterQueryInfo;
extern void SendBillingExpire(const char * c_pszLogin, BYTE bBillType, int iSecs, CLoginData * pkLD);
extern void VCardUse(LPCHARACTER CardOwner, LPCHARACTER CardTaker, LPITEM item);

View File

@ -649,26 +649,6 @@ void Take(fishing_event_info* info, LPCHARACTER ch)
{
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<EFBFBD>̹<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>̴<EFBFBD> %.2fcm"), item->GetSocket(0)/100.f);
}
if (quest::CQuestManager::instance().GetEventFlag("fishevent") > 0 && (info->fish_id == 5 || info->fish_id == 6))
{
// <20>̺<EFBFBD>Ʈ <20><><EFBFBD>̹Ƿ<CCB9> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.
TPacketGDHighscore p;
p.dwPID = ch->GetPlayerID();
p.lValue = item->GetSocket(0);
if (info->fish_id == 5)
{
strlcpy(p.szBoard, LC_TEXT("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD>Ʈ<EFBFBD><EFBFBD>ô<EFBFBD>ؾ<EFBFBD>"), sizeof(p.szBoard));
}
else if (info->fish_id == 6)
{
strlcpy(p.szBoard, LC_TEXT("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̺<EFBFBD>Ʈ<EFBFBD>׾<EFBFBD>"), sizeof(p.szBoard));
}
db_clientdesc->DBPacket(HEADER_GD_HIGHSCORE_REGISTER, 0, &p, sizeof(TPacketGDHighscore));
}
}
int map_idx = ch->GetMapIndex();

View File

@ -200,35 +200,6 @@ namespace quest
}
}
int highscore_show(lua_State* L)
{
CQuestManager & q = CQuestManager::instance();
const char * pszBoardName = lua_tostring(L, 1);
DWORD mypid = q.GetCurrentCharacterPtr()->GetPlayerID();
bool bOrder = (int) lua_tonumber(L, 2) != 0 ? true : false;
DBManager::instance().ReturnQuery(QID_HIGHSCORE_SHOW, mypid, NULL,
"SELECT h.pid, p.name, h.value FROM highscore%s as h, player%s as p WHERE h.board = '%s' AND h.pid = p.id ORDER BY h.value %s LIMIT 10",
get_table_postfix(), get_table_postfix(), pszBoardName, bOrder ? "DESC" : "");
return 0;
}
int highscore_register(lua_State* L)
{
CQuestManager & q = CQuestManager::instance();
THighscoreRegisterQueryInfo * qi = M2_NEW THighscoreRegisterQueryInfo;
strlcpy(qi->szBoard, lua_tostring(L, 1), sizeof(qi->szBoard));
qi->dwPID = q.GetCurrentCharacterPtr()->GetPlayerID();
qi->iValue = (int) lua_tonumber(L, 2);
qi->bOrder = (int) lua_tonumber(L, 3);
DBManager::instance().ReturnQuery(QID_HIGHSCORE_REGISTER, qi->dwPID, qi,
"SELECT value FROM highscore%s WHERE board='%s' AND pid=%u", get_table_postfix(), qi->szBoard, qi->dwPID);
return 1;
}
//
// "member" Lua functions
//
@ -496,17 +467,6 @@ namespace quest
AddLuaFunctionTable("member", member_functions);
}
{
luaL_reg highscore_functions[] =
{
{ "register", highscore_register },
{ "show", highscore_show },
{ NULL, NULL }
};
AddLuaFunctionTable("highscore", highscore_functions);
}
{
luaL_reg mob_functions[] =
{