diff --git a/gamefiles/locale/english/quest/quest_functions b/gamefiles/locale/english/quest/quest_functions index b88a178..ebbea6f 100644 --- a/gamefiles/locale/english/quest/quest_functions +++ b/gamefiles/locale/english/quest/quest_functions @@ -174,8 +174,6 @@ guild.level guild.name guild.war_bet guild.war_enter -highscore.register -highscore.show horse.advance horse.feed horse.get_grade diff --git a/src/common/tables.h b/src/common/tables.h index f604719..fae5fb6 100644 --- a/src/common/tables.h +++ b/src/common/tables.h @@ -49,7 +49,6 @@ enum HEADER_GD_ADD_AFFECT = 32, HEADER_GD_REMOVE_AFFECT = 33, - HEADER_GD_HIGHSCORE_REGISTER = 34, HEADER_GD_ITEM_FLUSH = 35, HEADER_GD_PARTY_CREATE = 36, @@ -847,14 +846,6 @@ typedef struct SPacketGDRemoveAffect BYTE bApplyOn; } TPacketGDRemoveAffect; -typedef struct SPacketGDHighscore -{ - DWORD dwPID; - LONG lValue; - char cDir; - char szBoard[21]; -} TPacketGDHighscore; - typedef struct SPacketPartyCreate { DWORD dwLeaderPID; diff --git a/src/db/src/ClientManager.cpp b/src/db/src/ClientManager.cpp index 1d5e40a..c5a2697 100644 --- a/src/db/src/ClientManager.cpp +++ b/src/db/src/ClientManager.cpp @@ -2475,10 +2475,6 @@ void CClientManager::ProcessPackets(CPeer * peer) QUERY_REMOVE_AFFECT(peer, (TPacketGDRemoveAffect *) data); break; - case HEADER_GD_HIGHSCORE_REGISTER: - QUERY_HIGHSCORE_REGISTER(peer, (TPacketGDHighscore *) data); - break; - case HEADER_GD_PARTY_CREATE: QUERY_PARTY_CREATE(peer, (TPacketPartyCreate*) data); break; @@ -2922,11 +2918,6 @@ int CClientManager::AnalyzeQueryResult(SQLMsg * msg) RESULT_SAFEBOX_CHANGE_PASSWORD_SECOND(peer, msg); break; - case QID_HIGHSCORE_REGISTER: - SPDLOG_DEBUG("QUERY_RESULT: HEADER_GD_HIGHSCORE_REGISTER {}", (void*) msg); - RESULT_HIGHSCORE_REGISTER(peer, msg); - break; - case QID_SAFEBOX_SAVE: case QID_ITEM_SAVE: case QID_ITEM_DESTROY: diff --git a/src/db/src/ClientManager.h b/src/db/src/ClientManager.h index a13e11a..21c84bd 100644 --- a/src/db/src/ClientManager.h +++ b/src/db/src/ClientManager.h @@ -310,9 +310,6 @@ class CClientManager : public singleton void SendPartyOnSetup(CPeer * peer); - void QUERY_HIGHSCORE_REGISTER(CPeer * peer, TPacketGDHighscore* data); - void RESULT_HIGHSCORE_REGISTER(CPeer * pkPeer, SQLMsg * msg); - void QUERY_FLUSH_CACHE(CPeer * pkPeer, const char * c_pData); void QUERY_PARTY_CREATE(CPeer * peer, TPacketPartyCreate* p); diff --git a/src/db/src/ClientManagerPlayer.cpp b/src/db/src/ClientManagerPlayer.cpp index 16b7558..e534924 100644 --- a/src/db/src/ClientManagerPlayer.cpp +++ b/src/db/src/ClientManagerPlayer.cpp @@ -1200,76 +1200,6 @@ void CClientManager::QUERY_REMOVE_AFFECT(CPeer * peer, TPacketGDRemoveAffect * p CDBManager::instance().AsyncQuery(queryStr); } - -void CClientManager::QUERY_HIGHSCORE_REGISTER(CPeer* peer, TPacketGDHighscore * data) -{ - char szQuery[128]; - snprintf(szQuery, sizeof(szQuery), "SELECT value FROM highscore%s WHERE board='%s' AND pid = %u", GetTablePostfix(), data->szBoard, data->dwPID); - - SPDLOG_DEBUG("HEADER_GD_HIGHSCORE_REGISTER: PID {}", data->dwPID); - - ClientHandleInfo * pi = new ClientHandleInfo(0); - strlcpy(pi->login, data->szBoard, sizeof(pi->login)); - pi->account_id = (DWORD)data->lValue; - pi->player_id = data->dwPID; - pi->account_index = (data->cDir > 0); - - CDBManager::instance().ReturnQuery(szQuery, QID_HIGHSCORE_REGISTER, peer->GetHandle(), pi); -} - -void CClientManager::RESULT_HIGHSCORE_REGISTER(CPeer * pkPeer, SQLMsg * msg) -{ - CQueryInfo * qi = (CQueryInfo *) msg->pvUserData; - ClientHandleInfo * pi = (ClientHandleInfo *) qi->pvData; - //DWORD dwHandle = pi->dwHandle; - - char szBoard[21]; - strlcpy(szBoard, pi->login, sizeof(szBoard)); - int value = (int)pi->account_id; - - SQLResult * res = msg->Get(); - - if (res->uiNumRows == 0) - { - // »õ·Î¿î ÇÏÀ̽ºÄھ »ðÀÔ - char buf[256]; - snprintf(buf, sizeof(buf), "INSERT INTO highscore%s VALUES('%s', %u, %d)", GetTablePostfix(), szBoard, pi->player_id, value); - CDBManager::instance().AsyncQuery(buf); - } - else - { - if (!res->pSQLResult) - { - delete pi; - return; - } - - MYSQL_ROW row = mysql_fetch_row(res->pSQLResult); - if (row && row[0]) - { - int current_value = 0; str_to_number(current_value, row[0]); - if (pi->account_index && current_value >= value || !pi->account_index && current_value <= value) - { - value = current_value; - } - else - { - char buf[256]; - snprintf(buf, sizeof(buf), "REPLACE INTO highscore%s VALUES('%s', %u, %d)", GetTablePostfix(), szBoard, pi->player_id, value); - CDBManager::instance().AsyncQuery(buf); - } - } - else - { - char buf[256]; - snprintf(buf, sizeof(buf), "INSERT INTO highscore%s VALUES('%s', %u, %d)", GetTablePostfix(), szBoard, pi->player_id, value); - CDBManager::instance().AsyncQuery(buf); - } - } - // TODO: ÀÌ°÷¿¡¼­ ÇÏÀ̽ºÄھ ¾÷µ¥ÀÌÆ® µÇ¾ú´ÂÁö üũÇÏ¿© °øÁö¸¦ »Ñ·Á¾ßÇÑ´Ù. - delete pi; -} - void CClientManager::InsertLogoutPlayer(DWORD pid) { TLogoutPlayerMap::iterator it = m_map_logout.find(pid); diff --git a/src/db/src/QID.h b/src/db/src/QID.h index 230d2ef..b6d5339 100644 --- a/src/db/src/QID.h +++ b/src/db/src/QID.h @@ -20,19 +20,18 @@ enum QID QID_ITEM_DESTROY, // 11 QID_QUEST_SAVE, // 12 QID_PLAYER_SAVE, // 13 - QID_HIGHSCORE_REGISTER, // 14 - QID_PLAYER_DELETE, // 15 - QID_LOGIN_BY_KEY, // 16 - QID_PLAYER_INDEX_CREATE, // 17 - QID_ITEM_AWARD_LOAD, // 18 - QID_ITEM_AWARD_TAKEN, // 19 - QID_GUILD_RANKING, // 20 + QID_PLAYER_DELETE, // 14 + QID_LOGIN_BY_KEY, // 15 + QID_PLAYER_INDEX_CREATE, // 16 + QID_ITEM_AWARD_LOAD, // 17 + QID_ITEM_AWARD_TAKEN, // 18 + QID_GUILD_RANKING, // 19 // MYSHOP_PRICE_LIST - QID_ITEMPRICE_SAVE, ///< 21, ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ÀúÀå Äõ¸® - QID_ITEMPRICE_DESTROY, ///< 22, ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ »èÁ¦ Äõ¸® - QID_ITEMPRICE_LOAD_FOR_UPDATE, ///< 23, °¡°ÝÁ¤º¸ ¾÷µ¥ÀÌÆ®¸¦ À§ÇÑ ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ·Îµå Äõ¸® - QID_ITEMPRICE_LOAD, ///< 24, ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ·Îµå Äõ¸® + QID_ITEMPRICE_SAVE, ///< 20, ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ÀúÀå Äõ¸® + QID_ITEMPRICE_DESTROY, ///< 21, ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ »èÁ¦ Äõ¸® + QID_ITEMPRICE_LOAD_FOR_UPDATE, ///< 22, °¡°ÝÁ¤º¸ ¾÷µ¥ÀÌÆ®¸¦ À§ÇÑ ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ·Îµå Äõ¸® + QID_ITEMPRICE_LOAD, ///< 22, ¾ÆÀÌÅÛ °¡°ÝÁ¤º¸ ·Îµå Äõ¸® // END_OF_MYSHOP_PRICE_LIST }; diff --git a/src/game/src/db.cpp b/src/game/src/db.cpp index 1ab6808..925de5f 100644 --- a/src/game/src/db.cpp +++ b/src/game/src/db.cpp @@ -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: { diff --git a/src/game/src/db.h b/src/game/src/db.h index f2f68ec..99d0031 100644 --- a/src/game/src/db.h +++ b/src/game/src/db.h @@ -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 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); diff --git a/src/game/src/fishing.cpp b/src/game/src/fishing.cpp index c241ec5..4ae91b1 100644 --- a/src/game/src/fishing.cpp +++ b/src/game/src/fishing.cpp @@ -649,26 +649,6 @@ void Take(fishing_event_info* info, LPCHARACTER ch) { ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("À̹ø¿¡ ÀâÀº ¹°°í±âÀÇ ±æÀÌ´Â %.2fcm"), item->GetSocket(0)/100.f); } - - if (quest::CQuestManager::instance().GetEventFlag("fishevent") > 0 && (info->fish_id == 5 || info->fish_id == 6)) - { - // À̺¥Æ® ÁßÀ̹ǷΠ±â·ÏÇÑ´Ù. - - TPacketGDHighscore p; - p.dwPID = ch->GetPlayerID(); - p.lValue = item->GetSocket(0); - - if (info->fish_id == 5) - { - strlcpy(p.szBoard, LC_TEXT("³¬½ÃÀ̺¥Æ®¿ùôºØ¾î"), sizeof(p.szBoard)); - } - else if (info->fish_id == 6) - { - strlcpy(p.szBoard, LC_TEXT("³¬½ÃÀ̺¥Æ®À×¾î"), sizeof(p.szBoard)); - } - - db_clientdesc->DBPacket(HEADER_GD_HIGHSCORE_REGISTER, 0, &p, sizeof(TPacketGDHighscore)); - } } int map_idx = ch->GetMapIndex(); diff --git a/src/game/src/questlua.cpp b/src/game/src/questlua.cpp index 2b78367..7ee34d2 100644 --- a/src/game/src/questlua.cpp +++ b/src/game/src/questlua.cpp @@ -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[] = { diff --git a/src/quest/src/quest_functions b/src/quest/src/quest_functions index 2c1078c..6097758 100644 --- a/src/quest/src/quest_functions +++ b/src/quest/src/quest_functions @@ -228,8 +228,6 @@ guild.get_name guild.war_bet guild.is_bet guild.get_warp_war_list -highscore.register -highscore.show mob.spawn mob.spawn_group q.setstate @@ -335,8 +333,6 @@ guild.get_reserve_war_table guild.get_name guild.war_bet guild.is_bet -highscore.register -highscore.show mob.spawn mob.spawn_group q.setstate