refactor(db): use std::unique_ptr for DirectQuery
This commit is contained in:
@@ -882,7 +882,7 @@ void config_init(const string& st_localeServiceName)
|
||||
char szQuery[512];
|
||||
snprintf(szQuery, sizeof(szQuery), "SELECT mKey, mValue FROM locale");
|
||||
|
||||
std::unique_ptr<SQLMsg> pMsg(AccountDB::instance().DirectQuery(szQuery));
|
||||
auto pMsg = AccountDB::instance().DirectQuery(szQuery);
|
||||
|
||||
if (pMsg->Get()->uiNumRows == 0)
|
||||
{
|
||||
@@ -950,7 +950,7 @@ void config_init(const string& st_localeServiceName)
|
||||
{
|
||||
char szQuery[256];
|
||||
snprintf(szQuery, sizeof(szQuery), "SELECT mValue FROM locale WHERE mKey='SKILL_POWER_BY_LEVEL'");
|
||||
std::unique_ptr<SQLMsg> pMsg(AccountDB::instance().DirectQuery(szQuery));
|
||||
auto pMsg = AccountDB::instance().DirectQuery(szQuery);
|
||||
|
||||
if (pMsg->Get()->uiNumRows == 0)
|
||||
{
|
||||
@@ -991,7 +991,7 @@ void config_init(const string& st_localeServiceName)
|
||||
for (int job = 0; job < JOB_MAX_NUM * 2; ++job)
|
||||
{
|
||||
snprintf(szQuery, sizeof(szQuery), "SELECT mValue from locale where mKey='SKILL_POWER_BY_LEVEL_TYPE%d' ORDER BY CAST(mValue AS unsigned)", job);
|
||||
std::unique_ptr<SQLMsg> pMsg(AccountDB::instance().DirectQuery(szQuery));
|
||||
auto pMsg = AccountDB::instance().DirectQuery(szQuery);
|
||||
|
||||
// 세팅이 안되어있으면 기본테이블을 사용한다.
|
||||
if (pMsg->Get()->uiNumRows == 0)
|
||||
|
||||
Reference in New Issue
Block a user