refactor(db): use std::unique_ptr for DirectQuery

This commit is contained in:
Mitachi
2025-12-27 12:25:01 +01:00
parent 11ba72d2e2
commit 7844727cdc
24 changed files with 154 additions and 208 deletions

View File

@@ -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)