Removed database strings and automatic greeting
This commit is contained in:
parent
00c5634c09
commit
05a1406c7c
|
@ -5955,16 +5955,6 @@ void CHARACTER::SetGuild(CGuild* pGuild)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CHARACTER::SendGreetMessage()
|
|
||||||
{
|
|
||||||
typeof(DBManager::instance().GetGreetMessage()) v = DBManager::instance().GetGreetMessage();
|
|
||||||
|
|
||||||
for (itertype(v) it = v.begin(); it != v.end(); ++it)
|
|
||||||
{
|
|
||||||
ChatPacket(CHAT_TYPE_NOTICE, it->c_str());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void CHARACTER::BeginStateEmpty()
|
void CHARACTER::BeginStateEmpty()
|
||||||
{
|
{
|
||||||
MonsterLog("!");
|
MonsterLog("!");
|
||||||
|
|
|
@ -740,7 +740,6 @@ class CHARACTER : public CEntity, public CFSM, public CHorseRider
|
||||||
|
|
||||||
void ChatPacket(BYTE type, const char *format, ...);
|
void ChatPacket(BYTE type, const char *format, ...);
|
||||||
void MonsterChat(BYTE bMonsterChatType);
|
void MonsterChat(BYTE bMonsterChatType);
|
||||||
void SendGreetMessage();
|
|
||||||
|
|
||||||
void ResetPoint(int iLv);
|
void ResetPoint(int iLv);
|
||||||
|
|
||||||
|
|
|
@ -2099,11 +2099,6 @@ ACMD(do_reload)
|
||||||
db_clientdesc->DBPacket(HEADER_GD_RELOAD_PROTO, 0, NULL, 0);
|
db_clientdesc->DBPacket(HEADER_GD_RELOAD_PROTO, 0, NULL, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 's':
|
|
||||||
ch->ChatPacket(CHAT_TYPE_INFO, "Reloading notice string.");
|
|
||||||
DBManager::instance().LoadDBString();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'q':
|
case 'q':
|
||||||
ch->ChatPacket(CHAT_TYPE_INFO, "Reloading quest.");
|
ch->ChatPacket(CHAT_TYPE_INFO, "Reloading quest.");
|
||||||
quest::CQuestManager::instance().Reload();
|
quest::CQuestManager::instance().Reload();
|
||||||
|
@ -2133,9 +2128,6 @@ ACMD(do_reload)
|
||||||
|
|
||||||
ch->ChatPacket(CHAT_TYPE_INFO, "Reloading prototype tables,");
|
ch->ChatPacket(CHAT_TYPE_INFO, "Reloading prototype tables,");
|
||||||
db_clientdesc->DBPacket(HEADER_GD_RELOAD_PROTO, 0, NULL, 0);
|
db_clientdesc->DBPacket(HEADER_GD_RELOAD_PROTO, 0, NULL, 0);
|
||||||
|
|
||||||
ch->ChatPacket(CHAT_TYPE_INFO, "Reloading notice string.");
|
|
||||||
DBManager::instance().LoadDBString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,11 +38,6 @@ bool DBManager::Connect(const char * host, const int port, const char * user, co
|
||||||
if (!m_sql_direct.Setup(host, user, pwd, db, g_stLocale.c_str(), true, port))
|
if (!m_sql_direct.Setup(host, user, pwd, db, g_stLocale.c_str(), true, port))
|
||||||
SPDLOG_ERROR("cannot open direct sql connection to host {}", host);
|
SPDLOG_ERROR("cannot open direct sql connection to host {}", host);
|
||||||
|
|
||||||
if (m_bIsConnect && !g_bAuthServer)
|
|
||||||
{
|
|
||||||
LoadDBString();
|
|
||||||
}
|
|
||||||
|
|
||||||
return m_bIsConnect;
|
return m_bIsConnect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -946,34 +941,6 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case QID_DB_STRING:
|
|
||||||
{
|
|
||||||
m_map_dbstring.clear();
|
|
||||||
m_vec_GreetMessage.clear();
|
|
||||||
|
|
||||||
for (uint i = 0; i < pMsg->Get()->uiNumRows; ++i)
|
|
||||||
{
|
|
||||||
MYSQL_ROW row = mysql_fetch_row(pMsg->Get()->pSQLResult);
|
|
||||||
//ch->SetSafeboxSize(SAFEBOX_PAGE_SIZE * atoi(row[0]));
|
|
||||||
if (row[0] && row[1])
|
|
||||||
{
|
|
||||||
m_map_dbstring.insert(make_pair(std::string(row[0]), std::string(row[1])));
|
|
||||||
SPDLOG_DEBUG("DBSTR '{}' '{}'", row[0], row[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (m_map_dbstring.find("GREET") != m_map_dbstring.end())
|
|
||||||
{
|
|
||||||
std::istringstream is(m_map_dbstring["GREET"]);
|
|
||||||
while (!is.eof())
|
|
||||||
{
|
|
||||||
std::string str;
|
|
||||||
getline(is, str);
|
|
||||||
m_vec_GreetMessage.push_back(str);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case QID_LOTTO:
|
case QID_LOTTO:
|
||||||
{
|
{
|
||||||
LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(qi->dwIdent);
|
LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(qi->dwIdent);
|
||||||
|
@ -1137,25 +1104,6 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
|
||||||
M2_DELETE(qi);
|
M2_DELETE(qi);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DBManager::LoadDBString()
|
|
||||||
{
|
|
||||||
ReturnQuery(QID_DB_STRING, 0, NULL, "SELECT name, text FROM string%s", get_table_postfix());
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::string& DBManager::GetDBString(const std::string& key)
|
|
||||||
{
|
|
||||||
static std::string null_str = "";
|
|
||||||
itertype(m_map_dbstring) it = m_map_dbstring.find(key);
|
|
||||||
if (it == m_map_dbstring.end())
|
|
||||||
return null_str;
|
|
||||||
return it->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
const std::vector<std::string>& DBManager::GetGreetMessage()
|
|
||||||
{
|
|
||||||
return m_vec_GreetMessage;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DBManager::SendMoneyLog(BYTE type, DWORD vnum, int gold)
|
void DBManager::SendMoneyLog(BYTE type, DWORD vnum, int gold)
|
||||||
{
|
{
|
||||||
if (!gold)
|
if (!gold)
|
||||||
|
|
|
@ -14,7 +14,6 @@ enum
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
QID_SAFEBOX_SIZE,
|
QID_SAFEBOX_SIZE,
|
||||||
QID_DB_STRING,
|
|
||||||
QID_AUTH_LOGIN,
|
QID_AUTH_LOGIN,
|
||||||
QID_LOTTO,
|
QID_LOTTO,
|
||||||
QID_HIGHSCORE_REGISTER,
|
QID_HIGHSCORE_REGISTER,
|
||||||
|
@ -111,10 +110,6 @@ class DBManager : public singleton<DBManager>
|
||||||
DWORD CountQueryResult() { return m_sql.CountResult(); }
|
DWORD CountQueryResult() { return m_sql.CountResult(); }
|
||||||
void ResetQueryResult() { m_sql.ResetQueryFinished(); }
|
void ResetQueryResult() { m_sql.ResetQueryFinished(); }
|
||||||
|
|
||||||
void LoadDBString();
|
|
||||||
const std::string & GetDBString(const std::string& key);
|
|
||||||
const std::vector<std::string> & GetGreetMessage();
|
|
||||||
|
|
||||||
template<class Functor> void FuncQuery(Functor f, const char * c_pszFormat, ...); // 결과를 f인자로 호출함 (SQLMsg *) 알아서 해제됨
|
template<class Functor> void FuncQuery(Functor f, const char * c_pszFormat, ...); // 결과를 f인자로 호출함 (SQLMsg *) 알아서 해제됨
|
||||||
template<class Functor> void FuncAfterQuery(Functor f, const char * c_pszFormat, ...); // 끝나고 나면 f가 호출됨 void f(void) 형태
|
template<class Functor> void FuncAfterQuery(Functor f, const char * c_pszFormat, ...); // 끝나고 나면 f가 호출됨 void f(void) 형태
|
||||||
|
|
||||||
|
@ -127,8 +122,6 @@ class DBManager : public singleton<DBManager>
|
||||||
CAsyncSQL m_sql_direct;
|
CAsyncSQL m_sql_direct;
|
||||||
bool m_bIsConnect;
|
bool m_bIsConnect;
|
||||||
|
|
||||||
std::map<std::string, std::string> m_map_dbstring;
|
|
||||||
std::vector<std::string> m_vec_GreetMessage;
|
|
||||||
std::map<DWORD, CLoginData *> m_map_pkLoginData;
|
std::map<DWORD, CLoginData *> m_map_pkLoginData;
|
||||||
std::map<std::string, CLoginData *> mapLDBilling;
|
std::map<std::string, CLoginData *> mapLDBilling;
|
||||||
std::vector<TUseTime> m_vec_kUseTime;
|
std::vector<TUseTime> m_vec_kUseTime;
|
||||||
|
|
|
@ -435,7 +435,6 @@ int CInputHandshake::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
||||||
{
|
{
|
||||||
LoadStateUserCount();
|
LoadStateUserCount();
|
||||||
db_clientdesc->DBPacket(HEADER_GD_RELOAD_PROTO, 0, NULL, 0);
|
db_clientdesc->DBPacket(HEADER_GD_RELOAD_PROTO, 0, NULL, 0);
|
||||||
DBManager::instance().LoadDBString();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -451,10 +450,6 @@ int CInputHandshake::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
|
||||||
db_clientdesc->DBPacket(HEADER_GD_RELOAD_PROTO, 0, NULL, 0);
|
db_clientdesc->DBPacket(HEADER_GD_RELOAD_PROTO, 0, NULL, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 's':
|
|
||||||
DBManager::instance().LoadDBString();
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'q':
|
case 'q':
|
||||||
quest::CQuestManager::instance().Reload();
|
quest::CQuestManager::instance().Reload();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -607,8 +607,6 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
|
||||||
p2.channel = g_bChannel;
|
p2.channel = g_bChannel;
|
||||||
d->Packet(&p2, sizeof(p2));
|
d->Packet(&p2, sizeof(p2));
|
||||||
|
|
||||||
ch->SendGreetMessage();
|
|
||||||
|
|
||||||
_send_bonus_info(ch);
|
_send_bonus_info(ch);
|
||||||
|
|
||||||
for (int i = 0; i <= PREMIUM_MAX_NUM; ++i)
|
for (int i = 0; i <= PREMIUM_MAX_NUM; ++i)
|
||||||
|
|
Loading…
Reference in New Issue