forked from metin2/server
1
0
Fork 0

Applied changes on the game executable.

This commit is contained in:
Exynox 2023-12-30 22:15:54 +02:00
parent 2c8cb0c857
commit 2f829ae2dc
144 changed files with 2547 additions and 3147 deletions

View File

@ -31,7 +31,7 @@ time_t UseBlueDragonSkill(LPCHARACTER pChar, unsigned int idx)
{ {
case 0: case 0:
{ {
sys_log(0, "BlueDragon: Using Skill Breath"); SPDLOG_DEBUG("BlueDragon: Using Skill Breath");
FSkillBreath f(pChar); FSkillBreath f(pChar);
@ -43,7 +43,7 @@ time_t UseBlueDragonSkill(LPCHARACTER pChar, unsigned int idx)
case 1: case 1:
{ {
sys_log(0, "BlueDragon: Using Skill Weak Breath"); SPDLOG_DEBUG("BlueDragon: Using Skill Weak Breath");
FSkillWeakBreath f(pChar); FSkillWeakBreath f(pChar);
@ -55,7 +55,7 @@ time_t UseBlueDragonSkill(LPCHARACTER pChar, unsigned int idx)
case 2: case 2:
{ {
sys_log(0, "BlueDragon: Using Skill EarthQuake"); SPDLOG_DEBUG("BlueDragon: Using Skill EarthQuake");
FSkillEarthQuake f(pChar); FSkillEarthQuake f(pChar);
@ -71,7 +71,7 @@ time_t UseBlueDragonSkill(LPCHARACTER pChar, unsigned int idx)
break; break;
default: default:
sys_err("BlueDragon: Wrong Skill Index: %d", idx); SPDLOG_ERROR("BlueDragon: Wrong Skill Index: {}", idx);
return 0; return 0;
} }

View File

@ -32,7 +32,7 @@ unsigned int BlueDragon_GetSkillFactor(const size_t cnt, ...)
{ {
va_end(vl); va_end(vl);
lua_settop( L, stack_top ); lua_settop( L, stack_top );
sys_err("BlueDragon: wrong key list"); SPDLOG_ERROR("BlueDragon: wrong key list");
return 0; return 0;
} }
@ -43,7 +43,7 @@ unsigned int BlueDragon_GetSkillFactor(const size_t cnt, ...)
{ {
va_end(vl); va_end(vl);
lua_settop( L, stack_top ); lua_settop( L, stack_top );
sys_err("BlueDragon: wrong key table %s", key); SPDLOG_ERROR("BlueDragon: wrong key table {}", key);
return 0; return 0;
} }
} }
@ -53,7 +53,7 @@ unsigned int BlueDragon_GetSkillFactor(const size_t cnt, ...)
if (false == lua_isnumber(L, -1)) if (false == lua_isnumber(L, -1))
{ {
lua_settop( L, stack_top ); lua_settop( L, stack_top );
sys_err("BlueDragon: Last key is not a number"); SPDLOG_ERROR("BlueDragon: Last key is not a number");
return 0; return 0;
} }
@ -86,7 +86,7 @@ unsigned int BlueDragon_GetRangeFactor(const char* key, const int val)
{ {
lua_settop( L, stack_top ); lua_settop( L, stack_top );
sys_err("BlueDragon: no required table %s", key); SPDLOG_ERROR("BlueDragon: no required table {}", key);
return 0; return 0;
} }
@ -100,7 +100,7 @@ unsigned int BlueDragon_GetRangeFactor(const char* key, const int val)
{ {
lua_settop( L, stack_top ); lua_settop( L, stack_top );
sys_err("BlueDragon: wrong table index %s %d", key, i); SPDLOG_ERROR("BlueDragon: wrong table index {} {}", key, i);
return 0; return 0;
} }
@ -111,7 +111,7 @@ unsigned int BlueDragon_GetRangeFactor(const char* key, const int val)
{ {
lua_settop( L, stack_top ); lua_settop( L, stack_top );
sys_err("BlueDragon: no min value set %s", key); SPDLOG_ERROR("BlueDragon: no min value set {}", key);
return 0; return 0;
} }
@ -126,7 +126,7 @@ unsigned int BlueDragon_GetRangeFactor(const char* key, const int val)
{ {
lua_settop( L, stack_top ); lua_settop( L, stack_top );
sys_err("BlueDragon: no max value set %s", key); SPDLOG_ERROR("BlueDragon: no max value set {}", key);
return 0; return 0;
} }
@ -143,7 +143,7 @@ unsigned int BlueDragon_GetRangeFactor(const char* key, const int val)
{ {
lua_settop( L, stack_top ); lua_settop( L, stack_top );
sys_err("BlueDragon: no pct value set %s", key); SPDLOG_ERROR("BlueDragon: no pct value set {}", key);
return 0; return 0;
} }
@ -184,7 +184,7 @@ unsigned int BlueDragon_GetIndexFactor(const char* container, const size_t idx,
{ {
lua_settop( L, stack_top ); lua_settop( L, stack_top );
sys_err("BlueDragon: no required table %s", key); SPDLOG_ERROR("BlueDragon: no required table {}", key);
return 0; return 0;
} }
@ -194,7 +194,7 @@ unsigned int BlueDragon_GetIndexFactor(const char* container, const size_t idx,
{ {
lua_settop( L, stack_top ); lua_settop( L, stack_top );
sys_err("BlueDragon: wrong table index %s %d", key, idx); SPDLOG_ERROR("BlueDragon: wrong table index {} {}", key, idx);
return 0; return 0;
} }
@ -205,7 +205,7 @@ unsigned int BlueDragon_GetIndexFactor(const char* container, const size_t idx,
{ {
lua_settop( L, stack_top ); lua_settop( L, stack_top );
sys_err("BlueDragon: no min value set %s", key); SPDLOG_ERROR("BlueDragon: no min value set {}", key);
return 0; return 0;
} }

View File

@ -30,7 +30,7 @@ struct FSkillBreath
if ((signed)BlueDragon_GetSkillFactor(2, "Skill0", "damage_area") < DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY())) if ((signed)BlueDragon_GetSkillFactor(2, "Skill0", "damage_area") < DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()))
{ {
sys_log(0, "BlueDragon: Breath too far (%d)", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) ); SPDLOG_DEBUG("BlueDragon: Breath too far ({})", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) );
return; return;
} }
@ -124,7 +124,7 @@ struct FSkillBreath
ch->Damage( pAttacker, dam, DAMAGE_TYPE_ICE ); ch->Damage( pAttacker, dam, DAMAGE_TYPE_ICE );
sys_log(0, "BlueDragon: Breath to %s pct(%d) dam(%d) overlap(%d)", ch->GetName(), pct, dam, overlapDamageCount); SPDLOG_DEBUG("BlueDragon: Breath to {} pct({}) dam({}) overlap({})", ch->GetName(), pct, dam, overlapDamageCount);
} }
} }
} }
@ -155,7 +155,7 @@ struct FSkillWeakBreath
if ((signed)BlueDragon_GetSkillFactor(2, "Skill1", "damage_area") < DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY())) if ((signed)BlueDragon_GetSkillFactor(2, "Skill1", "damage_area") < DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()))
{ {
sys_log(0, "BlueDragon: Breath too far (%d)", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) ); SPDLOG_DEBUG("BlueDragon: Breath too far ({})", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) );
return; return;
} }
@ -166,7 +166,7 @@ struct FSkillWeakBreath
ch->Damage( pAttacker, dam, DAMAGE_TYPE_ICE ); ch->Damage( pAttacker, dam, DAMAGE_TYPE_ICE );
sys_log(0, "BlueDragon: WeakBreath to %s addPct(%d) dam(%d)", ch->GetName(), addPct, dam); SPDLOG_DEBUG("BlueDragon: WeakBreath to {} addPct({}) dam({})", ch->GetName(), addPct, dam);
} }
} }
} }
@ -209,7 +209,7 @@ struct FSkillEarthQuake
if ((signed)BlueDragon_GetSkillFactor(2, "Skill2", "damage_area") < DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY())) if ((signed)BlueDragon_GetSkillFactor(2, "Skill2", "damage_area") < DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()))
{ {
sys_log(0, "BlueDragon: Breath too far (%d)", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) ); SPDLOG_DEBUG("BlueDragon: Breath too far ({})", DISTANCE_APPROX(pAttacker->GetX()-ch->GetX(), pAttacker->GetY()-ch->GetY()) );
return; return;
} }
@ -274,7 +274,7 @@ struct FSkillEarthQuake
SkillAttackAffect( ch, 1000, IMMUNE_STUN, AFFECT_STUN, POINT_NONE, 0, AFF_STUN, sec, "BDRAGON_STUN" ); SkillAttackAffect( ch, 1000, IMMUNE_STUN, AFFECT_STUN, POINT_NONE, 0, AFF_STUN, sec, "BDRAGON_STUN" );
sys_log(0, "BlueDragon: EarthQuake to %s addPct(%d) dam(%d) sec(%d)", ch->GetName(), addPct, dam, sec); SPDLOG_DEBUG("BlueDragon: EarthQuake to {} addPct({}) dam({}) sec({})", ch->GetName(), addPct, dam, sec);
VECTOR vec; VECTOR vec;

View File

@ -37,7 +37,7 @@ bool CClientPackageCryptInfo::LoadPackageCryptFile( const char* pCryptFile )
if (0 == iCryptKeySize) if (0 == iCryptKeySize)
{ {
sys_log(0, "[PackageCryptInfo] failed to load crypt key. (file: %s, key size: %d)", pCryptFile, iCryptKeySize); SPDLOG_WARN("[PackageCryptInfo] failed to load crypt key. (file: {}, key size: {})", pCryptFile, iCryptKeySize);
m_nCryptKeyPackageCnt -= iPackageCnt; m_nCryptKeyPackageCnt -= iPackageCnt;
} }
else else
@ -47,7 +47,7 @@ bool CClientPackageCryptInfo::LoadPackageCryptFile( const char* pCryptFile )
memcpy( &m_vecPackageCryptKeys[nCurKeySize], &iCryptKeySize, sizeof(int)); memcpy( &m_vecPackageCryptKeys[nCurKeySize], &iCryptKeySize, sizeof(int));
fread( &m_vecPackageCryptKeys[nCurKeySize + sizeof(int)], sizeof(BYTE), iCryptKeySize, fp ); fread( &m_vecPackageCryptKeys[nCurKeySize + sizeof(int)], sizeof(BYTE), iCryptKeySize, fp );
sys_log(0, "[PackageCryptInfo] %s loaded. (key size: %d, count: %d, total: %d)", pCryptFile, iCryptKeySize, iPackageCnt, m_nCryptKeyPackageCnt); SPDLOG_WARN("[PackageCryptInfo] {} loaded. (key size: {}, count: {}, total: {})", pCryptFile, iCryptKeySize, iPackageCnt, m_nCryptKeyPackageCnt);
} }
} }
@ -81,7 +81,7 @@ bool CClientPackageCryptInfo::LoadPackageCryptFile( const char* pCryptFile )
fread(&dwSDBFileCnt, sizeof(DWORD), 1, fp); fread(&dwSDBFileCnt, sizeof(DWORD), 1, fp);
sys_log(0, "[PackageCryptInfo] SDB Loaded. (Name Hash : %d, Stream Size: %d, File Count: %d)", dwPackageNameHash,dwPackageStreamSize, dwSDBFileCnt); SPDLOG_INFO("[PackageCryptInfo] SDB Loaded. (Name Hash : {}, Stream Size: {}, File Count: {})", dwPackageNameHash,dwPackageStreamSize, dwSDBFileCnt);
for( int j = 0; j < (int)dwSDBFileCnt; ++j ) for( int j = 0; j < (int)dwSDBFileCnt; ++j )
{ {
@ -91,7 +91,7 @@ bool CClientPackageCryptInfo::LoadPackageCryptFile( const char* pCryptFile )
strRelatedMapName.resize( dwMapNameSize ); strRelatedMapName.resize( dwMapNameSize );
fread(&strRelatedMapName[0], sizeof(BYTE), dwMapNameSize, fp); fread(&strRelatedMapName[0], sizeof(BYTE), dwMapNameSize, fp);
sys_log(0, "[PackageCryptInfo] \t SDB each file info loaded.(MapName: %s, NameHash: %X)", strRelatedMapName.c_str(), dwFileNameHash); SPDLOG_INFO("[PackageCryptInfo] \t SDB each file info loaded.(MapName: {}, NameHash: {})", strRelatedMapName.c_str(), dwFileNameHash);
BYTE bSDBStreamSize; BYTE bSDBStreamSize;
std::vector<BYTE> vecSDBStream; std::vector<BYTE> vecSDBStream;
@ -152,16 +152,16 @@ bool CClientPackageCryptInfo::LoadPackageCryptInfo( const char* pCryptInfoDir )
//if (strncmp( &(pDirEnt->d_name[0]), szPrefixCryptInfoFile, strlen(szPrefixCryptInfoFile)) ) //if (strncmp( &(pDirEnt->d_name[0]), szPrefixCryptInfoFile, strlen(szPrefixCryptInfoFile)) )
if (std::string::npos == std::string(pDirEnt->d_name).find(szPrefixCryptInfoFile)) if (std::string::npos == std::string(pDirEnt->d_name).find(szPrefixCryptInfoFile))
{ {
sys_log(0, "[PackageCryptInfo] %s is not crypt file. pass!", pDirEnt->d_name); SPDLOG_DEBUG("[PackageCryptInfo] {} is not crypt file. pass!", pDirEnt->d_name);
continue; continue;
} }
std::string strFullPathName = std::string(pCryptInfoDir) + std::string(pDirEnt->d_name); std::string strFullPathName = std::string(pCryptInfoDir) + std::string(pDirEnt->d_name);
sys_log(0, "[PackageCryptInfo] Try to load crypt file: %s", strFullPathName.c_str()); SPDLOG_DEBUG("[PackageCryptInfo] Try to load crypt file: {}", strFullPathName.c_str());
if (false == LoadPackageCryptFile( strFullPathName.c_str() )) if (false == LoadPackageCryptFile( strFullPathName.c_str() ))
sys_err("[PackageCryptInfo] Failed to load %s", strFullPathName.c_str()); SPDLOG_DEBUG("[PackageCryptInfo] Failed to load {}", strFullPathName.c_str());
} }
closedir(pDir); closedir(pDir);
@ -207,15 +207,13 @@ bool CClientPackageCryptInfo::GetRelatedMapSDBStreams(const char* pMapName, BYTE
TPackageSDBMap::iterator it = m_mapPackageSDB.find( strLowerMapName.c_str() ); TPackageSDBMap::iterator it = m_mapPackageSDB.find( strLowerMapName.c_str() );
if( it == m_mapPackageSDB.end() || it->second.vecSDBInfos.size() == 0 ) if( it == m_mapPackageSDB.end() || it->second.vecSDBInfos.size() == 0 )
{ {
//sys_err("GetRelatedMapSDBStreams Failed(%s)", strLowerMapName.c_str()); SPDLOG_ERROR("GetRelatedMapSDBStreams Failed({})", strLowerMapName.c_str());
return false; return false;
} }
*ppData = it->second.GetSerializedStream(); *ppData = it->second.GetSerializedStream();
iDataSize = it->second.GetSize(); iDataSize = it->second.GetSize();
//sys_log(0, "GetRelatedMapSDBStreams Size(%d)", iDataSize);
return true; return true;
} }

View File

@ -84,7 +84,7 @@ EVENTFUNC( DragonLair_Collapse_Event )
if ( pInfo == NULL ) if ( pInfo == NULL )
{ {
sys_err( "DragonLair_Collapse_Event> <Factor> Null pointer" ); SPDLOG_ERROR("DragonLair_Collapse_Event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -146,7 +146,7 @@ DWORD CDragonLair::GetEstimatedTime() const
void CDragonLair::OnDragonDead(LPCHARACTER pDragon) void CDragonLair::OnDragonDead(LPCHARACTER pDragon)
{ {
sys_log(0, "DragonLair: 도라곤이 죽어써효"); SPDLOG_DEBUG("DragonLair: 도라곤이 죽어써효");
LogManager::instance().DragonSlayLog( GuildID_, pDragon->GetMobTable().dwVnum, StartTime_, get_global_time() ); LogManager::instance().DragonSlayLog( GuildID_, pDragon->GetMobTable().dwVnum, StartTime_, get_global_time() );
} }
@ -174,7 +174,7 @@ bool CDragonLairManager::Start(int MapIndexFrom, int BaseMapIndex, DWORD GuildID
{ {
int instanceMapIndex = SECTREE_MANAGER::instance().CreatePrivateMap(BaseMapIndex); int instanceMapIndex = SECTREE_MANAGER::instance().CreatePrivateMap(BaseMapIndex);
if (instanceMapIndex == 0) { if (instanceMapIndex == 0) {
sys_err("CDragonLairManager::Start() : no private map index available"); SPDLOG_ERROR("CDragonLairManager::Start() : no private map index available");
return false; return false;
} }
@ -203,8 +203,6 @@ bool CDragonLairManager::Start(int MapIndexFrom, int BaseMapIndex, DWORD GuildID
strMapBasePath += "/" + pRegionInfo->strMapName + "/instance_regen.txt"; strMapBasePath += "/" + pRegionInfo->strMapName + "/instance_regen.txt";
sys_log(0, "%s", strMapBasePath.c_str());
regen_do(strMapBasePath.c_str(), instanceMapIndex, pTargetMap->m_setting.iBaseX, pTargetMap->m_setting.iBaseY, NULL, true); regen_do(strMapBasePath.c_str(), instanceMapIndex, pTargetMap->m_setting.iBaseX, pTargetMap->m_setting.iBaseY, NULL, true);
return true; return true;

View File

@ -147,7 +147,7 @@ bool DSManager::RefreshItemAttributes(LPITEM pDS)
{ {
if (!pDS->IsDragonSoul()) if (!pDS->IsDragonSoul())
{ {
sys_err ("This item(ID : %d) is not DragonSoul.", pDS->GetID()); SPDLOG_ERROR("This item(ID : {}) is not DragonSoul.", pDS->GetID());
return false; return false;
} }
@ -159,13 +159,13 @@ bool DSManager::RefreshItemAttributes(LPITEM pDS)
if (!m_pTable->GetBasicApplys(ds_type, vec_basic_applys)) if (!m_pTable->GetBasicApplys(ds_type, vec_basic_applys))
{ {
sys_err ("There is no BasicApply about %d type dragon soul.", ds_type); SPDLOG_ERROR("There is no BasicApply about {} type dragon soul.", ds_type);
return false; return false;
} }
if (!m_pTable->GetAdditionalApplys(ds_type, vec_addtional_applys)) if (!m_pTable->GetAdditionalApplys(ds_type, vec_addtional_applys))
{ {
sys_err ("There is no AdditionalApply about %d type dragon soul.", ds_type); SPDLOG_ERROR("There is no AdditionalApply about {} type dragon soul.", ds_type);
return false; return false;
} }
@ -173,7 +173,7 @@ bool DSManager::RefreshItemAttributes(LPITEM pDS)
int basic_apply_num, add_min, add_max; int basic_apply_num, add_min, add_max;
if (!m_pTable->GetApplyNumSettings(ds_type, grade_idx, basic_apply_num, add_min, add_max)) if (!m_pTable->GetApplyNumSettings(ds_type, grade_idx, basic_apply_num, add_min, add_max))
{ {
sys_err ("In ApplyNumSettings, INVALID VALUES Group type(%d), GRADE idx(%d)", ds_type, grade_idx); SPDLOG_ERROR("In ApplyNumSettings, INVALID VALUES Group type({}), GRADE idx({})", ds_type, grade_idx);
return false; return false;
} }
@ -217,7 +217,7 @@ bool DSManager::PutAttributes(LPITEM pDS)
{ {
if (!pDS->IsDragonSoul()) if (!pDS->IsDragonSoul())
{ {
sys_err ("This item(ID : %d) is not DragonSoul.", pDS->GetID()); SPDLOG_ERROR("This item(ID : {}) is not DragonSoul.", pDS->GetID());
return false; return false;
} }
@ -229,12 +229,12 @@ bool DSManager::PutAttributes(LPITEM pDS)
if (!m_pTable->GetBasicApplys(ds_type, vec_basic_applys)) if (!m_pTable->GetBasicApplys(ds_type, vec_basic_applys))
{ {
sys_err ("There is no BasicApply about %d type dragon soul.", ds_type); SPDLOG_ERROR("There is no BasicApply about {} type dragon soul.", ds_type);
return false; return false;
} }
if (!m_pTable->GetAdditionalApplys(ds_type, vec_addtional_applys)) if (!m_pTable->GetAdditionalApplys(ds_type, vec_addtional_applys))
{ {
sys_err ("There is no AdditionalApply about %d type dragon soul.", ds_type); SPDLOG_ERROR("There is no AdditionalApply about {} type dragon soul.", ds_type);
return false; return false;
} }
@ -242,7 +242,7 @@ bool DSManager::PutAttributes(LPITEM pDS)
int basic_apply_num, add_min, add_max; int basic_apply_num, add_min, add_max;
if (!m_pTable->GetApplyNumSettings(ds_type, grade_idx, basic_apply_num, add_min, add_max)) if (!m_pTable->GetApplyNumSettings(ds_type, grade_idx, basic_apply_num, add_min, add_max))
{ {
sys_err ("In ApplyNumSettings, INVALID VALUES Group type(%d), GRADE idx(%d)", ds_type, grade_idx); SPDLOG_ERROR("In ApplyNumSettings, INVALID VALUES Group type({}), GRADE idx({})", ds_type, grade_idx);
return false; return false;
} }
@ -276,7 +276,7 @@ bool DSManager::PutAttributes(LPITEM pDS)
} }
if (!MakeDistinctRandomNumberSet(list_probs, random_set)) if (!MakeDistinctRandomNumberSet(list_probs, random_set))
{ {
sys_err ("MakeDistinctRandomNumberSet error."); SPDLOG_ERROR("MakeDistinctRandomNumberSet error.");
return false; return false;
} }
@ -350,7 +350,7 @@ bool DSManager::ExtractDragonHeart(LPCHARACTER ch, LPITEM pItem, LPITEM pExtract
float sum = 0.f; float sum = 0.f;
if (-1 == idx) if (-1 == idx)
{ {
sys_err ("Gamble is failed. ds_type(%d), grade_idx(%d)", ds_type, grade_idx); SPDLOG_ERROR("Gamble is failed. ds_type({}), grade_idx({})", ds_type, grade_idx);
return false; return false;
} }
@ -375,8 +375,8 @@ bool DSManager::ExtractDragonHeart(LPCHARACTER ch, LPITEM pItem, LPITEM pExtract
if (NULL == pDH) if (NULL == pDH)
{ {
sys_err ("Cannot create DRAGON_HEART(%d).", DRAGON_HEART_VNUM); SPDLOG_ERROR("Cannot create DRAGON_HEART({}).", (int) DRAGON_HEART_VNUM);
return NULL; return false;
} }
pItem->SetCount(pItem->GetCount() - 1); pItem->SetCount(pItem->GetCount() - 1);
@ -402,7 +402,7 @@ bool DSManager::PullOut(LPCHARACTER ch, TItemPos DestCell, LPITEM& pItem, LPITEM
{ {
if (NULL == ch || NULL == pItem) if (NULL == ch || NULL == pItem)
{ {
sys_err ("NULL POINTER. ch(%p) or pItem(%p)", ch, pItem); SPDLOG_ERROR("NULL POINTER. ch({}) or pItem({})", (void*) ch, (void*) pItem);
return false; return false;
} }
@ -514,7 +514,7 @@ bool DSManager::DoRefineGrade(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL
if (!ch->DragonSoul_RefineWindow_CanRefine()) if (!ch->DragonSoul_RefineWindow_CanRefine())
{ {
sys_err ("%s do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName()); SPDLOG_ERROR("{} do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName());
ch->ChatPacket(CHAT_TYPE_INFO, "[SYSTEM ERROR]You cannot upgrade dragon soul without refine window."); ch->ChatPacket(CHAT_TYPE_INFO, "[SYSTEM ERROR]You cannot upgrade dragon soul without refine window.");
return false; return false;
} }
@ -595,7 +595,7 @@ bool DSManager::DoRefineGrade(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL
// 클라에서 한번 갯수 체크를 하기 때문에 count != need_count라면 invalid 클라일 가능성이 크다. // 클라에서 한번 갯수 체크를 하기 때문에 count != need_count라면 invalid 클라일 가능성이 크다.
if (count != need_count) if (count != need_count)
{ {
sys_err ("Possiblity of invalid client. Name %s", ch->GetName()); SPDLOG_ERROR("Possiblity of invalid client. Name {}", ch->GetName());
BYTE bSubHeader = count < need_count? DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MATERIAL : DS_SUB_HEADER_REFINE_FAIL_TOO_MUCH_MATERIAL; BYTE bSubHeader = count < need_count? DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MATERIAL : DS_SUB_HEADER_REFINE_FAIL_TOO_MUCH_MATERIAL;
SendRefineResultPacket(ch, bSubHeader, NPOS); SendRefineResultPacket(ch, bSubHeader, NPOS);
return false; return false;
@ -610,7 +610,7 @@ bool DSManager::DoRefineGrade(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL
if (-1 == (result_grade = Gamble(vec_probs))) if (-1 == (result_grade = Gamble(vec_probs)))
{ {
sys_err ("Gamble failed. See RefineGardeTables' probabilities"); SPDLOG_ERROR("Gamble failed. See RefineGardeTables' probabilities");
return false; return false;
} }
@ -618,7 +618,7 @@ bool DSManager::DoRefineGrade(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL
if (NULL == pResultItem) if (NULL == pResultItem)
{ {
sys_err ("INVALID DRAGON SOUL(%d)", MakeDragonSoulVnum(ds_type, (BYTE)result_grade, 0, 0)); SPDLOG_ERROR("INVALID DRAGON SOUL({})", MakeDragonSoulVnum(ds_type, (BYTE)result_grade, 0, 0));
return false; return false;
} }
@ -674,7 +674,7 @@ bool DSManager::DoRefineStep(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL_
if (!ch->DragonSoul_RefineWindow_CanRefine()) if (!ch->DragonSoul_RefineWindow_CanRefine())
{ {
sys_err ("%s do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName()); SPDLOG_ERROR("{} do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName());
ch->ChatPacket(CHAT_TYPE_INFO, "[SYSTEM ERROR]You cannot use dragon soul refine window."); ch->ChatPacket(CHAT_TYPE_INFO, "[SYSTEM ERROR]You cannot use dragon soul refine window.");
return false; return false;
} }
@ -747,7 +747,7 @@ bool DSManager::DoRefineStep(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL_
// 클라에서 한번 갯수 체크를 하기 때문에 count != need_count라면 invalid 클라일 가능성이 크다. // 클라에서 한번 갯수 체크를 하기 때문에 count != need_count라면 invalid 클라일 가능성이 크다.
if (count != need_count) if (count != need_count)
{ {
sys_err ("Possiblity of invalid client. Name %s", ch->GetName()); SPDLOG_ERROR("Possiblity of invalid client. Name {}", ch->GetName());
BYTE bSubHeader = count < need_count? DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MATERIAL : DS_SUB_HEADER_REFINE_FAIL_TOO_MUCH_MATERIAL; BYTE bSubHeader = count < need_count? DS_SUB_HEADER_REFINE_FAIL_NOT_ENOUGH_MATERIAL : DS_SUB_HEADER_REFINE_FAIL_TOO_MUCH_MATERIAL;
SendRefineResultPacket(ch, bSubHeader, NPOS); SendRefineResultPacket(ch, bSubHeader, NPOS);
return false; return false;
@ -764,7 +764,7 @@ bool DSManager::DoRefineStep(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL_
if (-1 == (result_step = Gamble(vec_probs))) if (-1 == (result_step = Gamble(vec_probs)))
{ {
sys_err ("Gamble failed. See RefineStepTables' probabilities"); SPDLOG_ERROR("Gamble failed. See RefineStepTables' probabilities");
return false; return false;
} }
@ -772,7 +772,7 @@ bool DSManager::DoRefineStep(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_SOUL_
if (NULL == pResultItem) if (NULL == pResultItem)
{ {
sys_err ("INVALID DRAGON SOUL(%d)", MakeDragonSoulVnum(ds_type, grade_idx, (BYTE)result_step, 0)); SPDLOG_ERROR("INVALID DRAGON SOUL({})", MakeDragonSoulVnum(ds_type, grade_idx, (BYTE)result_step, 0));
return false; return false;
} }
@ -835,7 +835,7 @@ bool DSManager::DoRefineStrength(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_S
if (!ch->DragonSoul_RefineWindow_CanRefine()) if (!ch->DragonSoul_RefineWindow_CanRefine())
{ {
sys_err ("%s do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName()); SPDLOG_ERROR("{} do not activate DragonSoulRefineWindow. But how can he come here?", ch->GetName());
ch->ChatPacket(CHAT_TYPE_INFO, "[SYSTEM ERROR]You cannot use dragon soul refine window."); ch->ChatPacket(CHAT_TYPE_INFO, "[SYSTEM ERROR]You cannot use dragon soul refine window.");
return false; return false;
} }
@ -953,7 +953,7 @@ bool DSManager::DoRefineStrength(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_S
pResult = ITEM_MANAGER::instance().CreateItem(MakeDragonSoulVnum(bType, bGrade, bStep, bStrength + 1)); pResult = ITEM_MANAGER::instance().CreateItem(MakeDragonSoulVnum(bType, bGrade, bStep, bStrength + 1));
if (NULL == pResult) if (NULL == pResult)
{ {
sys_err ("INVALID DRAGON SOUL(%d)", MakeDragonSoulVnum(bType, bGrade, bStep, bStrength + 1)); SPDLOG_ERROR("INVALID DRAGON SOUL({})", MakeDragonSoulVnum(bType, bGrade, bStep, bStrength + 1));
return false; return false;
} }
pDragonSoul->RemoveFromCharacter(); pDragonSoul->RemoveFromCharacter();
@ -978,7 +978,7 @@ bool DSManager::DoRefineStrength(LPCHARACTER ch, TItemPos (&aItemPoses)[DRAGON_S
pResult = ITEM_MANAGER::instance().CreateItem(MakeDragonSoulVnum(bType, bGrade, bStep, bStrength - 1)); pResult = ITEM_MANAGER::instance().CreateItem(MakeDragonSoulVnum(bType, bGrade, bStep, bStrength - 1));
if (NULL == pResult) if (NULL == pResult)
{ {
sys_err ("INVALID DRAGON SOUL(%d)", MakeDragonSoulVnum(bType, bGrade, bStep, bStrength - 1)); SPDLOG_ERROR("INVALID DRAGON SOUL({})", MakeDragonSoulVnum(bType, bGrade, bStep, bStrength - 1));
return false; return false;
} }
pDragonSoul->CopyAttributeTo(pResult); pDragonSoul->CopyAttributeTo(pResult);

View File

@ -14,7 +14,7 @@ static Pixel * LoadOldGuildMarkImageFile()
if (!fp) if (!fp)
{ {
sys_err("cannot open %s", OLD_MARK_INDEX_FILENAME); SPDLOG_ERROR("cannot open {}", OLD_MARK_INDEX_FILENAME);
return NULL; return NULL;
} }
@ -69,7 +69,7 @@ bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
pkImage->PutData(0, 0, 512, 512, oldImagePtr); pkImage->PutData(0, 0, 512, 512, oldImagePtr);
pkImage->Save("guild_mark_real.tga"); pkImage->Save("guild_mark_real.tga");
*/ */
sys_log(0, "Guild Mark Converting Start."); SPDLOG_INFO("Guild Mark Converting Start.");
char line[256]; char line[256];
DWORD guild_id; DWORD guild_id;
@ -82,7 +82,7 @@ bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
if (find(vecGuildID.begin(), vecGuildID.end(), guild_id) == vecGuildID.end()) if (find(vecGuildID.begin(), vecGuildID.end(), guild_id) == vecGuildID.end())
{ {
sys_log(0, " skipping guild ID %u", guild_id); SPDLOG_INFO(" skipping guild ID {}", guild_id);
continue; continue;
} }
@ -92,7 +92,7 @@ bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
if (row >= 42) if (row >= 42)
{ {
sys_err("invalid mark_id %u", mark_id); SPDLOG_ERROR("invalid mark_id {}", mark_id);
continue; continue;
} }
@ -128,7 +128,7 @@ bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
system("move /Y guild_mark.tga guild_mark.tga.removable"); system("move /Y guild_mark.tga guild_mark.tga.removable");
#endif #endif
sys_log(0, "Guild Mark Converting Complete."); SPDLOG_INFO("Guild Mark Converting Complete.");
return true; return true;
} }

View File

@ -56,7 +56,7 @@ bool CGuildMarkImage::Save(const char* c_szFileName)
bool CGuildMarkImage::Build(const char * c_szFileName) bool CGuildMarkImage::Build(const char * c_szFileName)
{ {
sys_log(0, "GuildMarkImage: creating new file %s", c_szFileName); SPDLOG_INFO("GuildMarkImage: creating new file {}", c_szFileName);
Destroy(); Destroy();
Create(); Create();
@ -70,7 +70,7 @@ bool CGuildMarkImage::Build(const char * c_szFileName)
if (!ilTexImage(WIDTH, HEIGHT, 1, 4, IL_BGRA, IL_UNSIGNED_BYTE, data)) if (!ilTexImage(WIDTH, HEIGHT, 1, 4, IL_BGRA, IL_UNSIGNED_BYTE, data))
{ {
sys_err("GuildMarkImage: cannot initialize image"); SPDLOG_ERROR("GuildMarkImage: cannot initialize image");
return false; return false;
} }
@ -95,19 +95,19 @@ bool CGuildMarkImage::Load(const char * c_szFileName)
if (!ilLoad(IL_TYPE_UNKNOWN, (const ILstring) c_szFileName)) if (!ilLoad(IL_TYPE_UNKNOWN, (const ILstring) c_szFileName))
{ {
sys_err("GuildMarkImage: %s cannot open file.", c_szFileName); SPDLOG_ERROR("GuildMarkImage: {} cannot open file.", c_szFileName);
return false; return false;
} }
if (ilGetInteger(IL_IMAGE_WIDTH) != WIDTH) if (ilGetInteger(IL_IMAGE_WIDTH) != WIDTH)
{ {
sys_err("GuildMarkImage: %s width must be %u", c_szFileName, WIDTH); SPDLOG_ERROR("GuildMarkImage: {} width must be {}", c_szFileName, (int) WIDTH);
return false; return false;
} }
if (ilGetInteger(IL_IMAGE_HEIGHT) != HEIGHT) if (ilGetInteger(IL_IMAGE_HEIGHT) != HEIGHT)
{ {
sys_err("GuildMarkImage: %s height must be %u", c_szFileName, HEIGHT); SPDLOG_ERROR("GuildMarkImage: {} height must be {}", c_szFileName, (int) HEIGHT);
return false; return false;
} }
@ -139,7 +139,7 @@ bool CGuildMarkImage::SaveMark(DWORD posMark, BYTE * pbImage)
{ {
if (posMark >= MARK_TOTAL_COUNT) if (posMark >= MARK_TOTAL_COUNT)
{ {
sys_err("GuildMarkImage::CopyMarkFromData: Invalid mark position %u", posMark); SPDLOG_ERROR("GuildMarkImage::CopyMarkFromData: Invalid mark position {}", posMark);
return false; return false;
} }
@ -178,13 +178,13 @@ bool CGuildMarkImage::SaveBlockFromCompressedData(DWORD posBlock, const BYTE * p
if (LZO_E_OK != lzo1x_decompress_safe(pbComp, dwCompSize, (BYTE *) apxBuf, &sizeBuf, CLZO::Instance().GetWorkMemory())) if (LZO_E_OK != lzo1x_decompress_safe(pbComp, dwCompSize, (BYTE *) apxBuf, &sizeBuf, CLZO::Instance().GetWorkMemory()))
{ {
sys_err("GuildMarkImage::CopyBlockFromCompressedData: cannot decompress, compressed size = %u", dwCompSize); SPDLOG_ERROR("GuildMarkImage::CopyBlockFromCompressedData: cannot decompress, compressed size = {}", dwCompSize);
return false; return false;
} }
if (sizeBuf != sizeof(apxBuf)) if (sizeBuf != sizeof(apxBuf))
{ {
sys_err("GuildMarkImage::CopyBlockFromCompressedData: image corrupted, decompressed size = %u", sizeBuf); SPDLOG_ERROR("GuildMarkImage::CopyBlockFromCompressedData: image corrupted, decompressed size = {}", sizeBuf);
return false; return false;
} }
@ -200,7 +200,7 @@ bool CGuildMarkImage::SaveBlockFromCompressedData(DWORD posBlock, const BYTE * p
void CGuildMarkImage::BuildAllBlocks() // À̹ÌÁö Àüü¸¦ ºí·°È­ void CGuildMarkImage::BuildAllBlocks() // À̹ÌÁö Àüü¸¦ ºí·°È­
{ {
Pixel apxBuf[SGuildMarkBlock::SIZE]; Pixel apxBuf[SGuildMarkBlock::SIZE];
sys_log(0, "GuildMarkImage::BuildAllBlocks"); SPDLOG_INFO("GuildMarkImage::BuildAllBlocks");
for (UINT row = 0; row < BLOCK_ROW_COUNT; ++row) for (UINT row = 0; row < BLOCK_ROW_COUNT; ++row)
for (UINT col = 0; col < BLOCK_COL_COUNT; ++col) for (UINT col = 0; col < BLOCK_COL_COUNT; ++col)
@ -290,10 +290,9 @@ void SGuildMarkBlock::Compress(const Pixel * pxBuf)
if (LZO_E_OK != lzo1x_1_compress((const BYTE *) pxBuf, sizeof(Pixel) * SGuildMarkBlock::SIZE, m_abCompBuf, &m_sizeCompBuf, CLZO::Instance().GetWorkMemory())) if (LZO_E_OK != lzo1x_1_compress((const BYTE *) pxBuf, sizeof(Pixel) * SGuildMarkBlock::SIZE, m_abCompBuf, &m_sizeCompBuf, CLZO::Instance().GetWorkMemory()))
{ {
sys_err("SGuildMarkBlock::Compress: Error! %u > %u", sizeof(Pixel) * SGuildMarkBlock::SIZE, m_sizeCompBuf); SPDLOG_ERROR("SGuildMarkBlock::Compress: Error! {} > {}", sizeof(Pixel) * SGuildMarkBlock::SIZE, m_sizeCompBuf);
return; return;
} }
//sys_log(0, "SGuildMarkBlock::Compress %u > %u", sizeof(Pixel) * SGuildMarkBlock::SIZE, m_sizeCompBuf);
m_crc = GetCRC32((const char *) pxBuf, sizeof(Pixel) * SGuildMarkBlock::SIZE); m_crc = GetCRC32((const char *) pxBuf, sizeof(Pixel) * SGuildMarkBlock::SIZE);
} }

View File

@ -80,7 +80,7 @@ bool CGuildMarkManager::SaveMarkIndex()
if (!fp) if (!fp)
{ {
sys_err("MarkManager::SaveMarkIndex: cannot open index file."); SPDLOG_ERROR("MarkManager::SaveMarkIndex: cannot open index file.");
return false; return false;
} }
@ -88,7 +88,7 @@ bool CGuildMarkManager::SaveMarkIndex()
fprintf(fp, "%u %u\n", it->first, it->second); fprintf(fp, "%u %u\n", it->first, it->second);
fclose(fp); fclose(fp);
sys_log(0, "MarkManager::SaveMarkIndex: index count %d", m_mapGID_MarkID.size()); SPDLOG_INFO("MarkManager::SaveMarkIndex: index count {}", m_mapGID_MarkID.size());
return true; return true;
} }
@ -116,7 +116,7 @@ void CGuildMarkManager::SaveMarkImage(DWORD imgIdx)
if (GetMarkImageFilename(imgIdx, path)) if (GetMarkImageFilename(imgIdx, path))
if (!__GetImage(imgIdx)->Save(path.c_str())) if (!__GetImage(imgIdx)->Save(path.c_str()))
sys_err("%s Save failed\n", path.c_str()); SPDLOG_ERROR("{} Save failed", path.c_str());
} }
CGuildMarkImage * CGuildMarkManager::__GetImage(DWORD imgIdx) CGuildMarkImage * CGuildMarkManager::__GetImage(DWORD imgIdx)
@ -152,7 +152,6 @@ bool CGuildMarkManager::AddMarkIDByGuildID(DWORD guildID, DWORD markID)
if (markID >= MAX_IMAGE_COUNT * CGuildMarkImage::MARK_TOTAL_COUNT) if (markID >= MAX_IMAGE_COUNT * CGuildMarkImage::MARK_TOTAL_COUNT)
return false; return false;
//sys_log(0, "MarkManager: guild_id=%d mark_id=%d", guildID, markID);
m_mapGID_MarkID.insert(std::map<DWORD, DWORD>::value_type(guildID, markID)); m_mapGID_MarkID.insert(std::map<DWORD, DWORD>::value_type(guildID, markID));
m_setFreeMarkID.erase(markID); m_setFreeMarkID.erase(markID);
return true; return true;
@ -217,14 +216,14 @@ DWORD CGuildMarkManager::SaveMark(DWORD guildID, BYTE * pbMarkImage)
{ {
if ((idMark = __AllocMarkID(guildID)) == INVALID_MARK_ID) if ((idMark = __AllocMarkID(guildID)) == INVALID_MARK_ID)
{ {
sys_err("CGuildMarkManager: cannot alloc mark id %u", guildID); SPDLOG_ERROR("CGuildMarkManager: cannot alloc mark id {}", guildID);
return false; return false;
} }
else else
sys_log(0, "SaveMark: mark id alloc %u", idMark); SPDLOG_INFO("SaveMark: mark id alloc {}", idMark);
} }
else else
sys_log(0, "SaveMark: mark id found %u", idMark); SPDLOG_INFO("SaveMark: mark id found {}", idMark);
DWORD imgIdx = (idMark / CGuildMarkImage::MARK_TOTAL_COUNT); DWORD imgIdx = (idMark / CGuildMarkImage::MARK_TOTAL_COUNT);
CGuildMarkImage * pkImage = __GetImage(imgIdx); CGuildMarkImage * pkImage = __GetImage(imgIdx);
@ -267,7 +266,7 @@ void CGuildMarkManager::GetDiffBlocks(DWORD imgIdx, const DWORD * crcList, std::
// 클라이언트에서 서버에 없는 이미지를 요청할 수는 없다. // 클라이언트에서 서버에 없는 이미지를 요청할 수는 없다.
if (m_mapIdx_Image.end() == m_mapIdx_Image.find(imgIdx)) if (m_mapIdx_Image.end() == m_mapIdx_Image.find(imgIdx))
{ {
sys_err("invalid idx %u", imgIdx); SPDLOG_ERROR("invalid idx {}", imgIdx);
return; return;
} }
@ -294,7 +293,7 @@ bool CGuildMarkManager::GetBlockCRCList(DWORD imgIdx, DWORD * crcList)
// 클라이언트에서 서버에 없는 이미지를 요청할 수는 없다. // 클라이언트에서 서버에 없는 이미지를 요청할 수는 없다.
if (m_mapIdx_Image.end() == m_mapIdx_Image.find(imgIdx)) if (m_mapIdx_Image.end() == m_mapIdx_Image.find(imgIdx))
{ {
sys_err("invalid idx %u", imgIdx); SPDLOG_ERROR("invalid idx {}", imgIdx);
return false; return false;
} }
@ -354,7 +353,7 @@ void CGuildMarkManager::SaveSymbol(const char* filename)
FILE* fp = fopen(filename, "wb"); FILE* fp = fopen(filename, "wb");
if (!fp) if (!fp)
{ {
sys_err("Cannot open Symbol file (name: %s)", filename); SPDLOG_ERROR("Cannot open Symbol file (name: {})", filename);
return; return;
} }
@ -375,7 +374,7 @@ void CGuildMarkManager::SaveSymbol(const char* filename)
void CGuildMarkManager::UploadSymbol(DWORD guildID, int iSize, const BYTE* pbyData) void CGuildMarkManager::UploadSymbol(DWORD guildID, int iSize, const BYTE* pbyData)
{ {
sys_log(0, "GuildSymbolUpload guildID %u Size %d", guildID, iSize); SPDLOG_INFO("GuildSymbolUpload guildID {} Size {}", guildID, iSize);
if (m_mapSymbol.find(guildID) == m_mapSymbol.end()) if (m_mapSymbol.find(guildID) == m_mapSymbol.end())
m_mapSymbol.insert(std::make_pair(guildID, TGuildSymbol())); m_mapSymbol.insert(std::make_pair(guildID, TGuildSymbol()));

View File

@ -90,7 +90,7 @@ bool COXEventManager::Enter(LPCHARACTER pkChar)
{ {
if (GetStatus() == OXEVENT_FINISH) if (GetStatus() == OXEVENT_FINISH)
{ {
sys_log(0, "OXEVENT : map finished. but char enter. %s", pkChar->GetName()); SPDLOG_WARN("OXEVENT : map finished. but char enter. {}", pkChar->GetName());
return false; return false;
} }
@ -106,7 +106,7 @@ bool COXEventManager::Enter(LPCHARACTER pkChar)
} }
else else
{ {
sys_log(0, "OXEVENT : wrong pos enter %d %d", pos.x, pos.y); SPDLOG_ERROR("OXEVENT : wrong pos enter {} {}", pos.x, pos.y);
return false; return false;
} }
@ -190,7 +190,7 @@ EVENTFUNC(oxevent_timer)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "oxevent_timer> <Factor> Null pointer" ); SPDLOG_ERROR("oxevent_timer> <Factor> Null pointer" );
return 0; return 0;
} }

View File

@ -30,7 +30,7 @@ EVENTFUNC(petsystem_update_event)
petsystem_event_info* info = dynamic_cast<petsystem_event_info*>( event->info ); petsystem_event_info* info = dynamic_cast<petsystem_event_info*>( event->info );
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "check_speedhack_event> <Factor> Null pointer" ); SPDLOG_ERROR("check_speedhack_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -166,7 +166,7 @@ DWORD CPetActor::Summon(const char* petName, LPITEM pSummonItem, bool bSpawnFar)
if (0 == m_pkChar) if (0 == m_pkChar)
{ {
sys_err("[CPetSystem::Summon] Failed to summon the pet. (vnum: %d)", m_dwVnum); SPDLOG_ERROR("[CPetSystem::Summon] Failed to summon the pet. (vnum: {})", m_dwVnum);
return 0; return 0;
} }
@ -223,7 +223,7 @@ bool CPetActor::_UpdateFollowAI()
{ {
if (0 == m_pkChar->m_pkMobData) if (0 == m_pkChar->m_pkMobData)
{ {
//sys_err("[CPetActor::_UpdateFollowAI] m_pkChar->m_pkMobData is NULL"); SPDLOG_ERROR("[CPetActor::_UpdateFollowAI] m_pkChar->m_pkMobData is NULL");
return false; return false;
} }
@ -480,14 +480,14 @@ void CPetSystem::DeletePet(DWORD mobVnum)
if (m_petActorMap.end() == iter) if (m_petActorMap.end() == iter)
{ {
sys_err("[CPetSystem::DeletePet] Can't find pet on my list (VNUM: %d)", mobVnum); SPDLOG_ERROR("[CPetSystem::DeletePet] Can't find pet on my list (VNUM: {})", mobVnum);
return; return;
} }
CPetActor* petActor = iter->second; CPetActor* petActor = iter->second;
if (0 == petActor) if (0 == petActor)
sys_err("[CPetSystem::DeletePet] Null Pointer (petActor)"); SPDLOG_ERROR("[CPetSystem::DeletePet] Null Pointer (petActor)");
else else
delete petActor; delete petActor;
@ -508,7 +508,7 @@ void CPetSystem::DeletePet(CPetActor* petActor)
} }
} }
sys_err("[CPetSystem::DeletePet] Can't find petActor(0x%x) on my list(size: %d) ", petActor, m_petActorMap.size()); SPDLOG_ERROR("[CPetSystem::DeletePet] Can't find petActor({}) on my list(size: {}) ", (void*) petActor, m_petActorMap.size());
} }
void CPetSystem::Unsummon(DWORD vnum, bool bDeleteFromList) void CPetSystem::Unsummon(DWORD vnum, bool bDeleteFromList)
@ -517,7 +517,7 @@ void CPetSystem::Unsummon(DWORD vnum, bool bDeleteFromList)
if (0 == actor) if (0 == actor)
{ {
sys_err("[CPetSystem::GetByVnum(%d)] Null Pointer (petActor)", vnum); SPDLOG_ERROR("[CPetSystem::GetByVnum({})] Null Pointer (petActor)", vnum);
return; return;
} }
actor->Unsummon(); actor->Unsummon();
@ -576,7 +576,7 @@ CPetActor* CPetSystem::GetByVID(DWORD vid) const
if (0 == petActor) if (0 == petActor)
{ {
sys_err("[CPetSystem::GetByVID(%d)] Null Pointer (petActor)", vid); SPDLOG_ERROR("[CPetSystem::GetByVID({})] Null Pointer (petActor)", vid);
continue; continue;
} }

View File

@ -26,10 +26,10 @@ bool CSpeedServerManager::Initialize()
{ {
for (int i = 1; i < EMPIRE_MAX_NUM; i++) for (int i = 1; i < EMPIRE_MAX_NUM; i++)
{ {
sys_log (0,"speed manager init"); SPDLOG_DEBUG("speed manager init");
if(!Empire[i].Initialize (i)) if(!Empire[i].Initialize (i))
{ {
sys_err ("EMPIRE %d Exp Bonus Manager Init fail",i); SPDLOG_ERROR("EMPIRE {} Exp Bonus Manager Init fail",i);
return false; return false;
} }
} }
@ -39,7 +39,7 @@ bool CSpeedServerManager::Initialize()
bool CSpeedServerEmpireExp::Initialize (BYTE e) bool CSpeedServerEmpireExp::Initialize (BYTE e)
{ {
empire = e; empire = e;
sys_log (0, "empire exp init %d", empire); SPDLOG_DEBUG("empire exp init {}", empire);
snprintf (file_name, sizeof(file_name), "%s/exp_bonus_table_%d.txt", LocaleService_GetBasePath().c_str(), empire); snprintf (file_name, sizeof(file_name), "%s/exp_bonus_table_%d.txt", LocaleService_GetBasePath().c_str(), empire);
for (int i = 1; i < 6; i++) for (int i = 1; i < 6; i++)
@ -66,7 +66,7 @@ bool CSpeedServerEmpireExp::LoadWdayExpTable(int wday, char *str)
char *t; char *t;
char *h, *m, *e; char *h, *m, *e;
int hour, min, exp; int hour, min, exp;
sys_log (0, "str %s", str); SPDLOG_DEBUG("str {}", str);
strtok (str, delim); strtok (str, delim);
p = strtok (NULL, ";"); p = strtok (NULL, ";");
n = strtok (NULL, ";"); n = strtok (NULL, ";");
@ -78,11 +78,11 @@ bool CSpeedServerEmpireExp::LoadWdayExpTable(int wday, char *str)
m = strtok (NULL, delim); m = strtok (NULL, delim);
if (!str_to_number (hour, h) || !str_to_number (min, m) || !str_to_number (exp, e)) if (!str_to_number (hour, h) || !str_to_number (min, m) || !str_to_number (exp, e))
{ {
sys_log (0, "h m e : %s %s %s",h, m, e); SPDLOG_DEBUG("h m e : {} {} {}",h, m, e);
sys_err ("Invalid argument. Please insert hh:mm exp"); SPDLOG_ERROR("Invalid argument. Please insert hh:mm exp");
return false; return false;
} }
sys_log (0, "h m e : %s %s %s",h, m, e); SPDLOG_DEBUG("h m e : {} {} {}",h, m, e);
lst.push_back (HME (hour, min, exp)); lst.push_back (HME (hour, min, exp));
p = strtok (n, ";"); p = strtok (n, ";");
@ -100,7 +100,7 @@ bool CSpeedServerEmpireExp::WriteExpTable()
{ {
FILE *fp; FILE *fp;
sys_log (0, "write"); SPDLOG_DEBUG("write");
if (0==file_name || 0==file_name[0]) if (0==file_name || 0==file_name[0])
return false; return false;
@ -140,7 +140,7 @@ bool CSpeedServerEmpireExp::LoadExpTable()
char temp[256]; char temp[256];
const char *delim = " \t\r\n"; const char *delim = " \t\r\n";
sys_log (0, "load"); SPDLOG_DEBUG("load");
if (0==file_name || 0==file_name[0]) if (0==file_name || 0==file_name[0])
return false; return false;
@ -198,7 +198,7 @@ bool CSpeedServerEmpireExp::LoadExpTable()
v = strtok (temp, delim); v = strtok (temp, delim);
v = strtok (NULL, delim); v = strtok (NULL, delim);
sys_log (0, "holiday %s", v); SPDLOG_DEBUG("holiday {}", v);
p = strtok (NULL, ";"); p = strtok (NULL, ";");
n = strtok (NULL, ";"); n = strtok (NULL, ";");
@ -210,11 +210,11 @@ bool CSpeedServerEmpireExp::LoadExpTable()
m = strtok (NULL, delim); m = strtok (NULL, delim);
if (!str_to_number (hour, h) || !str_to_number (min, m) || !str_to_number (exp, e)) if (!str_to_number (hour, h) || !str_to_number (min, m) || !str_to_number (exp, e))
{ {
sys_log (0, "h m e : %s %s %s",h, m, e); SPDLOG_DEBUG("h m e : {} {} {}",h, m, e);
sys_err ("Invalid argument. Please insert hh:mm exp"); SPDLOG_ERROR("Invalid argument. Please insert hh:mm exp");
return false; return false;
} }
sys_log (0, "h m e : %s %s %s",h, m, e); SPDLOG_DEBUG("h m e : {} {} {}",h, m, e);
lst.push_back (HME (hour, min, exp)); lst.push_back (HME (hour, min, exp));
p = strtok (n, ";"); p = strtok (n, ";");
@ -225,11 +225,11 @@ bool CSpeedServerEmpireExp::LoadExpTable()
|| !str_to_number ( mon, strtok (NULL, ".")) || !str_to_number ( mon, strtok (NULL, "."))
|| !str_to_number ( day, strtok (NULL, "."))) || !str_to_number ( day, strtok (NULL, ".")))
{ {
sys_err ("Invalid Date"); SPDLOG_ERROR("Invalid Date");
return false; return false;
} }
sys_log (0, "y m d %d %d %d",year, mon, day); SPDLOG_DEBUG("y m d {} {} {}",year, mon, day);
holiday_map.insert (std::pair <Date, std::list <HME> > (Date (year - 1900, mon - 1, day), lst)); holiday_map.insert (std::pair <Date, std::list <HME> > (Date (year - 1900, mon - 1, day), lst));
} }
@ -265,7 +265,7 @@ void CSpeedServerManager::InitWdayExpTableOfEmpire (BYTE empire, int wday)
{ {
if (empire > EMPIRE_MAX_NUM) if (empire > EMPIRE_MAX_NUM)
{ {
sys_err ("invalid empire"); SPDLOG_ERROR("invalid empire");
return; return;
} }
@ -294,7 +294,7 @@ std::list <HME>& CSpeedServerEmpireExp::GetHolidayExpTable(Date date, bool &is_e
else else
{ {
is_exist = false; is_exist = false;
sys_err ("Cannot find Holiday %d %d %d",date.year, date.mon, date.day); SPDLOG_ERROR("Cannot find Holiday {} {} {}",date.year, date.mon, date.day);
} }
return it->second; return it->second;
} }
@ -318,7 +318,7 @@ void CSpeedServerManager::InitHolidayExpTableOfEmpire (BYTE empire, Date date)
{ {
if (empire > EMPIRE_MAX_NUM) if (empire > EMPIRE_MAX_NUM)
{ {
sys_err ("invalid empire"); SPDLOG_ERROR("invalid empire");
return; return;
} }
@ -327,7 +327,7 @@ void CSpeedServerManager::InitHolidayExpTableOfEmpire (BYTE empire, Date date)
void CSpeedServerEmpireExp::InitHolidayExpTable(Date date) void CSpeedServerEmpireExp::InitHolidayExpTable(Date date)
{ {
sys_log (0, "init holiday"); SPDLOG_DEBUG("init holiday");
std::map <Date, std::list <HME> >::iterator it = holiday_map.find(date); std::map <Date, std::list <HME> >::iterator it = holiday_map.find(date);
if (it == holiday_map.end()) if (it == holiday_map.end())
{ {

View File

@ -11,7 +11,6 @@
#include "char.h" #include "char.h"
#include "item.h" #include "item.h"
#include "ani.h" #include "ani.h"
#include "dev_log.h"
const char* FN_race_name(int race) const char* FN_race_name(int race)
{ {
@ -141,7 +140,7 @@ bool ANI::load()
{ {
if (false == load_one_race(race, dir_name[race])) if (false == load_one_race(race, dir_name[race]))
{ {
sys_err("ANI directory = %s", dir_name[race]); SPDLOG_ERROR("ANI directory = {}", dir_name[race]);
return false; return false;
} }
} }
@ -200,7 +199,7 @@ bool ANI::load_one_race(int race, const char *dir_name)
for (int weapon = WEAPON_SWORD; weapon < WEAPON_NUM_TYPES; ++weapon) for (int weapon = WEAPON_SWORD; weapon < WEAPON_NUM_TYPES; ++weapon)
{ {
dev_log(LOG_DEB0, "ANI (%s,%s)", FN_race_name(race), FN_weapon_type(weapon)); SPDLOG_TRACE("ANI ({},{})", FN_race_name(race), FN_weapon_type(weapon));
for (BYTE combo = 1; combo <= 8; ++combo) for (BYTE combo = 1; combo <= 8; ++combo)
{ {
@ -212,11 +211,11 @@ bool ANI::load_one_race(int race, const char *dir_name)
m_speed[race][1][weapon][combo] = load_one_weapon(dir_name, weapon, combo, true); m_speed[race][1][weapon][combo] = load_one_weapon(dir_name, weapon, combo, true);
m_speed[race][1][weapon][0] = std::min(m_speed[race][1][weapon][0], m_speed[race][1][weapon][combo]); // ÃÖ¼Ò°ª m_speed[race][1][weapon][0] = std::min(m_speed[race][1][weapon][0], m_speed[race][1][weapon][combo]); // ÃÖ¼Ò°ª
dev_log(LOG_DEB0, "combo%02d speed=%d horse=%d", SPDLOG_TRACE("combo{:02} speed={} horse={}",
combo, m_speed[race][0][weapon][combo], m_speed[race][1][weapon][combo]); combo, m_speed[race][0][weapon][combo], m_speed[race][1][weapon][combo]);
} }
dev_log(LOG_DEB0, "minspeed=%u", m_speed[race][0][weapon][0]); SPDLOG_TRACE("minspeed={}", m_speed[race][0][weapon][0]);
} }
return true; return true;
@ -331,7 +330,7 @@ DWORD ani_attack_speed(LPCHARACTER ch)
int weapon = item->GetSubType(); int weapon = item->GetSubType();
/* /*
dev_log(LOG_DEB0, "%s : (race,weapon) = (%s,%s) POINT_ATT_SPEED = %d", SPDLOG_TRACE("{} : (race,weapon) = ({},{}) POINT_ATT_SPEED = {}",
ch->GetName(), ch->GetName(),
FN_race_name(race), FN_race_name(race),
FN_weapon_type(weapon), FN_weapon_type(weapon),

View File

@ -67,7 +67,7 @@ bool CArenaManager::AddArena(DWORD mapIdx, WORD startA_X, WORD startA_Y, WORD st
if (pArenaMap->AddArena(mapIdx, startA_X, startA_Y, startB_X, startB_Y) == false) if (pArenaMap->AddArena(mapIdx, startA_X, startA_Y, startB_X, startB_Y) == false)
{ {
sys_log(0, "CArenaManager::AddArena - AddMap Error MapID: %d", mapIdx); SPDLOG_ERROR("CArenaManager::AddArena - AddMap Error MapID: {}", mapIdx);
return false; return false;
} }
@ -80,7 +80,7 @@ bool CArenaMap::AddArena(DWORD mapIdx, WORD startA_X, WORD startA_Y, WORD startB
{ {
if (iter->CheckArea(startA_X, startA_Y, startB_X, startB_Y) == false) if (iter->CheckArea(startA_X, startA_Y, startB_X, startB_Y) == false)
{ {
sys_log(0, "CArenaMap::AddArena - Same Start Position set. stA(%d, %d) stB(%d, %d)", startA_X, startA_Y, startB_X, startB_Y); SPDLOG_ERROR("CArenaMap::AddArena - Same Start Position set. stA({}, {}) stB({}, {})", startA_X, startA_Y, startB_X, startB_Y);
return false; return false;
} }
} }
@ -111,7 +111,7 @@ void CArenaMap::Destroy()
{ {
itertype(m_listArena) iter = m_listArena.begin(); itertype(m_listArena) iter = m_listArena.begin();
sys_log(0, "ARENA: ArenaMap will be destroy. mapIndex(%d)", m_dwMapIndex); SPDLOG_DEBUG("ARENA: ArenaMap will be destroy. mapIndex({})", m_dwMapIndex);
for (; iter != m_listArena.end(); iter++) for (; iter != m_listArena.end(); iter++)
{ {
@ -212,7 +212,7 @@ EVENTFUNC(ready_to_start_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "ready_to_start_event> <Factor> Null pointer" ); SPDLOG_ERROR("ready_to_start_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -220,7 +220,7 @@ EVENTFUNC(ready_to_start_event)
if (pArena == NULL) if (pArena == NULL)
{ {
sys_err("ARENA: Arena start event info is null."); SPDLOG_ERROR("ARENA: Arena start event info is null.");
return 0; return 0;
} }
@ -229,18 +229,18 @@ EVENTFUNC(ready_to_start_event)
if (chA == NULL || chB == NULL) if (chA == NULL || chB == NULL)
{ {
sys_err("ARENA: Player err in event func ready_start_event"); SPDLOG_ERROR("ARENA: Player err in event func ready_start_event");
if (chA != NULL) if (chA != NULL)
{ {
chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다.")); chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
sys_log(0, "ARENA: Oppernent is disappered. MyPID(%d) OppPID(%d)", pArena->GetPlayerAPID(), pArena->GetPlayerBPID()); SPDLOG_DEBUG("ARENA: Oppernent is disappered. MyPID({}) OppPID({})", pArena->GetPlayerAPID(), pArena->GetPlayerBPID());
} }
if (chB != NULL) if (chB != NULL)
{ {
chB->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다.")); chB->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
sys_log(0, "ARENA: Oppernent is disappered. MyPID(%d) OppPID(%d)", pArena->GetPlayerBPID(), pArena->GetPlayerAPID()); SPDLOG_DEBUG("ARENA: Oppernent is disappered. MyPID({}) OppPID({})", pArena->GetPlayerBPID(), pArena->GetPlayerAPID());
} }
pArena->SendChatPacketToObserver(CHAT_TYPE_NOTICE, LC_TEXT("대련 상대가 사라져 대련을 종료합니다.")); pArena->SendChatPacketToObserver(CHAT_TYPE_NOTICE, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
@ -370,7 +370,7 @@ EVENTFUNC(ready_to_start_event)
chB->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련장 문제로 인하여 대련을 종료합니다.")); chB->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련장 문제로 인하여 대련을 종료합니다."));
pArena->SendChatPacketToObserver(CHAT_TYPE_INFO, LC_TEXT("대련장 문제로 인하여 대련을 종료합니다.")); pArena->SendChatPacketToObserver(CHAT_TYPE_INFO, LC_TEXT("대련장 문제로 인하여 대련을 종료합니다."));
sys_log(0, "ARENA: Something wrong in event func. info->state(%d)", info->state); SPDLOG_DEBUG("ARENA: Something wrong in event func. info->state({})", info->state);
pArena->EndDuel(); pArena->EndDuel();
@ -388,7 +388,7 @@ EVENTFUNC(duel_time_out)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "duel_time_out> <Factor> Null pointer" ); SPDLOG_ERROR("duel_time_out> <Factor> Null pointer" );
return 0; return 0;
} }
@ -396,7 +396,7 @@ EVENTFUNC(duel_time_out)
if (pArena == NULL) if (pArena == NULL)
{ {
sys_err("ARENA: Time out event error"); SPDLOG_ERROR("ARENA: Time out event error");
return 0; return 0;
} }
@ -408,13 +408,13 @@ EVENTFUNC(duel_time_out)
if (chA != NULL) if (chA != NULL)
{ {
chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다.")); chA->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
sys_log(0, "ARENA: Oppernent is disappered. MyPID(%d) OppPID(%d)", pArena->GetPlayerAPID(), pArena->GetPlayerBPID()); SPDLOG_DEBUG("ARENA: Oppernent is disappered. MyPID({}) OppPID({})", pArena->GetPlayerAPID(), pArena->GetPlayerBPID());
} }
if (chB != NULL) if (chB != NULL)
{ {
chB->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다.")); chB->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
sys_log(0, "ARENA: Oppernent is disappered. MyPID(%d) OppPID(%d)", pArena->GetPlayerBPID(), pArena->GetPlayerAPID()); SPDLOG_DEBUG("ARENA: Oppernent is disappered. MyPID({}) OppPID({})", pArena->GetPlayerBPID(), pArena->GetPlayerAPID());
} }
pArena->SendChatPacketToObserver(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다.")); pArena->SendChatPacketToObserver(CHAT_TYPE_INFO, LC_TEXT("대련 상대가 사라져 대련을 종료합니다."));
@ -445,7 +445,7 @@ EVENTFUNC(duel_time_out)
info->state++; info->state++;
sys_log(0, "ARENA: Because of time over, duel is end. PIDA(%d) vs PIDB(%d)", pArena->GetPlayerAPID(), pArena->GetPlayerBPID()); SPDLOG_DEBUG("ARENA: Because of time over, duel is end. PIDA({}) vs PIDB({})", pArena->GetPlayerAPID(), pArena->GetPlayerBPID());
return PASSES_PER_SEC(10); return PASSES_PER_SEC(10);
break; break;
@ -496,7 +496,7 @@ bool CArena::StartDuel(LPCHARACTER pCharFrom, LPCHARACTER pCharTo, int nSetPoint
pCharTo->PointChange(POINT_HP, pCharTo->GetMaxHP() - pCharTo->GetHP()); pCharTo->PointChange(POINT_HP, pCharTo->GetMaxHP() - pCharTo->GetHP());
pCharTo->PointChange(POINT_SP, pCharTo->GetMaxSP() - pCharTo->GetSP()); pCharTo->PointChange(POINT_SP, pCharTo->GetMaxSP() - pCharTo->GetSP());
sys_log(0, "ARENA: Start Duel with PID_A(%d) vs PID_B(%d)", GetPlayerAPID(), GetPlayerBPID()); SPDLOG_DEBUG("ARENA: Start Duel with PID_A({}) vs PID_B({})", GetPlayerAPID(), GetPlayerBPID());
return true; return true;
} }
@ -577,7 +577,7 @@ void CArena::EndDuel()
m_mapObserver.clear(); m_mapObserver.clear();
sys_log(0, "ARENA: End Duel PID_A(%d) vs PID_B(%d)", GetPlayerAPID(), GetPlayerBPID()); SPDLOG_DEBUG("ARENA: End Duel PID_A({}) vs PID_B({})", GetPlayerAPID(), GetPlayerBPID());
Clear(); Clear();
} }
@ -756,7 +756,7 @@ bool CArena::OnDead(DWORD dwPIDA, DWORD dwPIDB)
pCharB->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharA->GetName()); pCharB->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharA->GetName());
SendChatPacketToObserver(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharA->GetName()); SendChatPacketToObserver(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharA->GetName());
sys_log(0, "ARENA: Duel is end. Winner %s(%d) Loser %s(%d)", SPDLOG_DEBUG("ARENA: Duel is end. Winner {}({}) Loser {}({})",
pCharA->GetName(), GetPlayerAPID(), pCharB->GetName(), GetPlayerBPID()); pCharA->GetName(), GetPlayerAPID(), pCharB->GetName(), GetPlayerBPID());
} }
else else
@ -770,7 +770,7 @@ bool CArena::OnDead(DWORD dwPIDA, DWORD dwPIDB)
SendChatPacketToObserver(CHAT_TYPE_NOTICE, "%s %d : %d %s", pCharA->GetName(), m_dwSetPointOfA, m_dwSetPointOfB, pCharB->GetName()); SendChatPacketToObserver(CHAT_TYPE_NOTICE, "%s %d : %d %s", pCharA->GetName(), m_dwSetPointOfA, m_dwSetPointOfB, pCharB->GetName());
sys_log(0, "ARENA: %s(%d) won a round vs %s(%d)", SPDLOG_DEBUG("ARENA: {}({}) won a round vs {}({})",
pCharA->GetName(), GetPlayerAPID(), pCharB->GetName(), GetPlayerBPID()); pCharA->GetName(), GetPlayerAPID(), pCharB->GetName(), GetPlayerBPID());
} }
} }
@ -783,7 +783,7 @@ bool CArena::OnDead(DWORD dwPIDA, DWORD dwPIDB)
pCharB->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharB->GetName()); pCharB->ChatPacket(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharB->GetName());
SendChatPacketToObserver(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharB->GetName()); SendChatPacketToObserver(CHAT_TYPE_NOTICE, LC_TEXT("%s 님이 대련에서 승리하였습니다."), pCharB->GetName());
sys_log(0, "ARENA: Duel is end. Winner(%d) Loser(%d)", GetPlayerBPID(), GetPlayerAPID()); SPDLOG_DEBUG("ARENA: Duel is end. Winner({}) Loser({})", GetPlayerBPID(), GetPlayerAPID());
} }
else else
{ {
@ -796,13 +796,13 @@ bool CArena::OnDead(DWORD dwPIDA, DWORD dwPIDB)
SendChatPacketToObserver(CHAT_TYPE_NOTICE, "%s %d : %d %s", pCharA->GetName(), m_dwSetPointOfA, m_dwSetPointOfB, pCharB->GetName()); SendChatPacketToObserver(CHAT_TYPE_NOTICE, "%s %d : %d %s", pCharA->GetName(), m_dwSetPointOfA, m_dwSetPointOfB, pCharB->GetName());
sys_log(0, "ARENA : PID(%d) won a round. Opp(%d)", GetPlayerBPID(), GetPlayerAPID()); SPDLOG_DEBUG("ARENA : PID({}) won a round. Opp({})", GetPlayerBPID(), GetPlayerAPID());
} }
} }
else else
{ {
// wtf // wtf
sys_log(0, "ARENA : OnDead Error (%d, %d) (%d, %d)", m_dwPIDA, m_dwPIDB, dwPIDA, dwPIDB); SPDLOG_WARN("ARENA : OnDead Error ({}, {}) ({}, {})", m_dwPIDA, m_dwPIDB, dwPIDA, dwPIDB);
} }
int potion = quest::CQuestManager::instance().GetEventFlag("arena_potion_limit_count"); int potion = quest::CQuestManager::instance().GetEventFlag("arena_potion_limit_count");
@ -951,7 +951,7 @@ void CArena::OnDisconnect(DWORD pid)
if (GetPlayerB() != NULL) if (GetPlayerB() != NULL)
GetPlayerB()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방 캐릭터가 접속을 종료하여 대련을 중지합니다.")); GetPlayerB()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방 캐릭터가 접속을 종료하여 대련을 중지합니다."));
sys_log(0, "ARENA : Duel is end because of Opp(%d) is disconnect. MyPID(%d)", GetPlayerAPID(), GetPlayerBPID()); SPDLOG_DEBUG("ARENA : Duel is end because of Opp({}) is disconnect. MyPID({})", GetPlayerAPID(), GetPlayerBPID());
EndDuel(); EndDuel();
} }
else if (m_dwPIDB == pid) else if (m_dwPIDB == pid)
@ -959,7 +959,7 @@ void CArena::OnDisconnect(DWORD pid)
if (GetPlayerA() != NULL) if (GetPlayerA() != NULL)
GetPlayerA()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방 캐릭터가 접속을 종료하여 대련을 중지합니다.")); GetPlayerA()->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방 캐릭터가 접속을 종료하여 대련을 중지합니다."));
sys_log(0, "ARENA : Duel is end because of Opp(%d) is disconnect. MyPID(%d)", GetPlayerBPID(), GetPlayerAPID()); SPDLOG_DEBUG("ARENA : Duel is end because of Opp({}) is disconnect. MyPID({})", GetPlayerBPID(), GetPlayerAPID());
EndDuel(); EndDuel();
} }
} }
@ -1057,7 +1057,7 @@ bool CArenaManager::RegisterObserverPtr(LPCHARACTER pChar, DWORD mapIdx, WORD Ob
if (iter == m_mapArenaMap.end()) if (iter == m_mapArenaMap.end())
{ {
sys_log(0, "ARENA : Cannot find ArenaMap. %d %d %d", mapIdx, ObserverX, ObserverY); SPDLOG_ERROR("ARENA : Cannot find ArenaMap. {} {} {}", mapIdx, ObserverX, ObserverY);
return false; return false;
} }
@ -1089,7 +1089,7 @@ bool CArena::RegisterObserverPtr(LPCHARACTER pChar)
if (iter == m_mapObserver.end()) if (iter == m_mapObserver.end())
{ {
sys_log(0, "ARENA : not in ob list"); SPDLOG_ERROR("ARENA : not in ob list");
return false; return false;
} }

View File

@ -576,7 +576,7 @@ void AuctionManager::Boot (const char* &data, WORD size)
{ {
if (decode_2bytes(data) != sizeof(TPlayerItem)) if (decode_2bytes(data) != sizeof(TPlayerItem))
{ {
sys_err("TPlayerItem table size error"); SPDLOG_ERROR("TPlayerItem table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -597,7 +597,7 @@ void AuctionManager::Boot (const char* &data, WORD size)
} }
if (decode_2bytes(data) != sizeof(TAuctionItemInfo)) if (decode_2bytes(data) != sizeof(TAuctionItemInfo))
{ {
sys_err("TAuctionItemInfo table size error"); SPDLOG_ERROR("TAuctionItemInfo table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -617,7 +617,7 @@ void AuctionManager::Boot (const char* &data, WORD size)
} }
if (decode_2bytes(data) != sizeof(TSaleItemInfo)) if (decode_2bytes(data) != sizeof(TSaleItemInfo))
{ {
sys_err("TSaleItemInfo table size error"); SPDLOG_ERROR("TSaleItemInfo table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -638,7 +638,7 @@ void AuctionManager::Boot (const char* &data, WORD size)
if (decode_2bytes(data) != sizeof(TWishItemInfo)) if (decode_2bytes(data) != sizeof(TWishItemInfo))
{ {
sys_err("TWishItemInfo table size error"); SPDLOG_ERROR("TWishItemInfo table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -659,7 +659,7 @@ void AuctionManager::Boot (const char* &data, WORD size)
if (decode_2bytes(data) != (sizeof(DWORD) + sizeof(DWORD) + sizeof(int))) if (decode_2bytes(data) != (sizeof(DWORD) + sizeof(DWORD) + sizeof(int)))
{ {
sys_err("my_bid table size error"); SPDLOG_ERROR("my_bid table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -702,7 +702,7 @@ bool AuctionManager::InsertItem (TPlayerItem* player_item)
if (!item) if (!item)
{ {
sys_err("cannot create item vnum %d id %u",player_item->vnum, player_item->id); SPDLOG_ERROR("cannot create item vnum {} id {}",player_item->vnum, player_item->id);
return false; return false;
} }
@ -756,7 +756,7 @@ bool AuctionManager::DeleteItem (DWORD item_id)
// return false; // return false;
// if (it->second + changing_amount < 0) // if (it->second + changing_amount < 0)
// { // {
// sys_err ("Cannot have money under 0."); // SPDLOG_ERROR("Cannot have money under 0.");
// return false; // return false;
// } // }
// //
@ -876,7 +876,7 @@ void AuctionManager::enroll_auction (LPCHARACTER ch, LPITEM item, BYTE empire, i
{ {
if (ch != item->GetOwner()) if (ch != item->GetOwner())
{ {
sys_err ("Item %d's owner is %s, not %s",ch->GetName(), item->GetOwner()->GetName()); SPDLOG_ERROR("Item {}'s owner is {}, not {}", ch->GetName(), item->GetOwner()->GetName());
return; return;
} }
if (item->IsEquipped()) if (item->IsEquipped())
@ -887,14 +887,14 @@ void AuctionManager::enroll_auction (LPCHARACTER ch, LPITEM item, BYTE empire, i
if (GetAuctionItemInfo (item->GetID())) if (GetAuctionItemInfo (item->GetID()))
{ {
sys_err ("Item %d is already in auction.", item->GetID()); SPDLOG_ERROR("Item {} is already in auction.", item->GetID());
ch->ChatPacket(CHAT_TYPE_INFO, "이미 등록한 거야. 도대체 뭐지?"); ch->ChatPacket(CHAT_TYPE_INFO, "이미 등록한 거야. 도대체 뭐지?");
return; return;
} }
if (item->GetWindow() == AUCTION) if (item->GetWindow() == AUCTION)
{ {
sys_err ("Item %d is already in auction.", item->GetID()); SPDLOG_ERROR("Item {} is already in auction.", item->GetID());
ch->ChatPacket(CHAT_TYPE_INFO, "얜 또 뭐냐.."); ch->ChatPacket(CHAT_TYPE_INFO, "얜 또 뭐냐..");
return; return;
} }
@ -913,7 +913,7 @@ void AuctionManager::enroll_sale (LPCHARACTER ch, LPITEM item, DWORD wisher_id,
{ {
if (ch != item->GetOwner()) if (ch != item->GetOwner())
{ {
sys_err ("Item %d's owner is %s, not %s",ch->GetName(), item->GetOwner()->GetName()); SPDLOG_ERROR("Item {}'s owner is {}, not {}", ch->GetName(), item->GetOwner()->GetName());
return; return;
} }
if (item->IsEquipped()) if (item->IsEquipped())
@ -924,14 +924,14 @@ void AuctionManager::enroll_sale (LPCHARACTER ch, LPITEM item, DWORD wisher_id,
if (GetSaleItemInfo (item->GetID())) if (GetSaleItemInfo (item->GetID()))
{ {
sys_err ("Item %d is already in auction.", item->GetID()); SPDLOG_ERROR("Item {} is already in auction.", item->GetID());
ch->ChatPacket(CHAT_TYPE_INFO, "이미 등록한 거야. 도대체 뭐지?"); ch->ChatPacket(CHAT_TYPE_INFO, "이미 등록한 거야. 도대체 뭐지?");
return; return;
} }
if (item->GetWindow() == AUCTION) if (item->GetWindow() == AUCTION)
{ {
sys_err ("Item %d is already in auction.", item->GetID()); SPDLOG_ERROR("Item {} is already in auction.", item->GetID());
ch->ChatPacket(CHAT_TYPE_INFO, "얜 또 뭐냐.."); ch->ChatPacket(CHAT_TYPE_INFO, "얜 또 뭐냐..");
return; return;
} }
@ -982,7 +982,7 @@ void AuctionManager::immediate_purchase (LPCHARACTER ch, DWORD item_id)
if (item_info == NULL) if (item_info == NULL)
{ {
sys_err ("Invild item id : %d", item_id); SPDLOG_ERROR("Invild item id : {}", item_id);
return; return;
} }
@ -1063,7 +1063,7 @@ void AuctionManager::rebid (LPCHARACTER ch, DWORD item_id, int bid_price)
bool lock = mb.second; bool lock = mb.second;
if (money == -1) if (money == -1)
{ {
sys_err ("Do bid first. How can you rebid? pid %d, item_id %d",ch->GetPlayerID(), item_id); SPDLOG_ERROR("Do bid first. How can you rebid? pid {}, item_id {}", ch->GetPlayerID(), item_id);
return; return;
} }
@ -1095,7 +1095,7 @@ void AuctionManager::bid_cancel (LPCHARACTER ch, DWORD item_id)
bool lock = mb.second; bool lock = mb.second;
if (money == -1) if (money == -1)
{ {
sys_err ("Do bid first. How can you bid cancel? pid %d, item_id %d",ch->GetPlayerID(), item_id); SPDLOG_ERROR("Do bid first. How can you bid cancel? pid {}, item_id {}",ch->GetPlayerID(), item_id);
return; return;
} }
@ -1303,7 +1303,7 @@ void AuctionManager::recv_result_auction (DWORD commander_id, TPacketDGResultAuc
if (!GetInventoryItem(player_item->id)) if (!GetInventoryItem(player_item->id))
{ {
sys_err ("AUCTION_CMD %d : invalid item_id %d", cmd, item_id); SPDLOG_ERROR("AUCTION_CMD {} : invalid item_id {}", cmd, item_id);
break; break;
} }
@ -1333,7 +1333,7 @@ void AuctionManager::recv_result_auction (DWORD commander_id, TPacketDGResultAuc
{ {
if (!Wish.DeleteItemInfo (commander_id, cmd_result->target)) if (!Wish.DeleteItemInfo (commander_id, cmd_result->target))
{ {
sys_err ("Cannot cancel wish, invalid player_id : %d, item_num : %d", commander_id, cmd_result->target); SPDLOG_ERROR("Cannot cancel wish, invalid player_id : {}, item_num : {}", commander_id, cmd_result->target);
} }
else if (ch != NULL) else if (ch != NULL)
{ {

View File

@ -105,19 +105,19 @@ bool battle_is_attackable(LPCHARACTER ch, LPCHARACTER victim)
int battle_melee_attack(LPCHARACTER ch, LPCHARACTER victim) int battle_melee_attack(LPCHARACTER ch, LPCHARACTER victim)
{ {
if (test_server&&ch->IsPC()) if (test_server&&ch->IsPC())
sys_log(0, "battle_melee_attack : [%s] attack to [%s]", ch->GetName(), victim->GetName()); SPDLOG_TRACE("battle_melee_attack : [{}] attack to [{}]", ch->GetName(), victim->GetName());
if (!victim || ch == victim) if (!victim || ch == victim)
return BATTLE_NONE; return BATTLE_NONE;
if (test_server&&ch->IsPC()) if (test_server&&ch->IsPC())
sys_log(0, "battle_melee_attack : [%s] attack to [%s]", ch->GetName(), victim->GetName()); SPDLOG_TRACE("battle_melee_attack : [{}] attack to [{}]", ch->GetName(), victim->GetName());
if (!battle_is_attackable(ch, victim)) if (!battle_is_attackable(ch, victim))
return BATTLE_NONE; return BATTLE_NONE;
if (test_server&&ch->IsPC()) if (test_server&&ch->IsPC())
sys_log(0, "battle_melee_attack : [%s] attack to [%s]", ch->GetName(), victim->GetName()); SPDLOG_TRACE("battle_melee_attack : [{}] attack to [{}]", ch->GetName(), victim->GetName());
// °Å¸® üũ // °Å¸® üũ
int distance = DISTANCE_APPROX(ch->GetX() - victim->GetX(), ch->GetY() - victim->GetY()); int distance = DISTANCE_APPROX(ch->GetX() - victim->GetX(), ch->GetY() - victim->GetY());
@ -140,8 +140,7 @@ int battle_melee_attack(LPCHARACTER ch, LPCHARACTER victim)
if (distance > max) if (distance > max)
{ {
if (test_server) SPDLOG_TRACE("VICTIM_FAR: {} distance: {} max: {}", ch->GetName(), distance, max);
sys_log(0, "VICTIM_FAR: %s distance: %d max: %d", ch->GetName(), distance, max);
return BATTLE_NONE; return BATTLE_NONE;
} }
@ -367,7 +366,7 @@ void Item_GetDamage(LPITEM pkItem, int* pdamMin, int* pdamMax)
} }
if (pkItem->GetType() != ITEM_WEAPON) if (pkItem->GetType() != ITEM_WEAPON)
sys_err("Item_GetDamage - !ITEM_WEAPON vnum=%d, type=%d", pkItem->GetOriginalVnum(), pkItem->GetType()); SPDLOG_ERROR("Item_GetDamage - !ITEM_WEAPON vnum={}, type={}", pkItem->GetOriginalVnum(), pkItem->GetType());
*pdamMin = pkItem->GetValue(3); *pdamMin = pkItem->GetValue(3);
*pdamMax = pkItem->GetValue(4); *pdamMax = pkItem->GetValue(4);
@ -394,7 +393,7 @@ int CalcMeleeDamage(LPCHARACTER pkAttacker, LPCHARACTER pkVictim, bool bIgnoreDe
break; break;
case WEAPON_BOW: case WEAPON_BOW:
sys_err("CalcMeleeDamage should not handle bows (name: %s)", pkAttacker->GetName()); SPDLOG_ERROR("CalcMeleeDamage should not handle bows (name: {})", pkAttacker->GetName());
return 0; return 0;
default: default:
@ -677,8 +676,7 @@ int battle_hit(LPCHARACTER pkAttacker, LPCHARACTER pkVictim)
iDam = attMul * tempIDam + 0.5f; iDam = attMul * tempIDam + 0.5f;
//PROF_UNIT puHit("Hit"); //PROF_UNIT puHit("Hit");
if (test_server) SPDLOG_TRACE("battle_hit : [{}] attack to [{}] : dam: {}", pkAttacker->GetName(), pkVictim->GetName(), iDam);
sys_log(0, "battle_hit : [%s] attack to [%s] : dam: %d", pkAttacker->GetName(), pkVictim->GetName(), iDam);
//PROF_UNIT puDam("Dam"); //PROF_UNIT puDam("Dam");
if (pkVictim->Damage(pkAttacker, iDam, DAMAGE_TYPE_NORMAL)) if (pkVictim->Damage(pkAttacker, iDam, DAMAGE_TYPE_NORMAL))
@ -740,7 +738,7 @@ void SET_ATTACKED_TIME(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time) bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
{ {
// 2013 09 11 CYH debugging log // 2013 09 11 CYH debugging log
/*sys_log(0, "%s attack test log! time (delta, limit)=(%u, %u). ch->m_kAttackLog.dwvID(%u) victim->GetVID(%u)", /*SPDLOG_DEBUG("{} attack test log! time (delta, limit)=({}, {}). ch->m_kAttackLog.dwvID({}) victim->GetVID({})",
ch->GetName(), ch->GetName(),
current_time - ch->m_kAttackLog.dwTime, current_time - ch->m_kAttackLog.dwTime,
GET_ATTACK_SPEED(ch), GET_ATTACK_SPEED(ch),
@ -748,7 +746,7 @@ bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
victim->GetVID() victim->GetVID()
); );
sys_log(0, "%s attack test log! time (delta, limit)=(%u, %u). victim->m_AttackedLog.dwPID(%u) ch->GetPlayerID(%u)", SPDLOG_DEBUG("{} attack test log! time (delta, limit)=({}, {}). victim->m_AttackedLog.dwPID({}) ch->GetPlayerID({})",
ch->GetName(), ch->GetName(),
current_time - victim->m_AttackedLog.dwAttackedTime, current_time - victim->m_AttackedLog.dwAttackedTime,
GET_ATTACK_SPEED(ch), GET_ATTACK_SPEED(ch),
@ -764,7 +762,7 @@ bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
if (test_server) if (test_server)
{ {
sys_log(0, "%s attack hack! time (delta, limit)=(%u, %u) hack_count %d", SPDLOG_TRACE("{} attack hack! time (delta, limit)=({}, {}) hack_count {}",
ch->GetName(), ch->GetName(),
current_time - ch->m_kAttackLog.dwTime, current_time - ch->m_kAttackLog.dwTime,
GET_ATTACK_SPEED(ch), GET_ATTACK_SPEED(ch),
@ -793,7 +791,7 @@ bool IS_SPEED_HACK(LPCHARACTER ch, LPCHARACTER victim, DWORD current_time)
if (test_server) if (test_server)
{ {
sys_log(0, "%s Attack Speed HACK! time (delta, limit)=(%u, %u), hack_count = %d", SPDLOG_TRACE("{} Attack Speed HACK! time (delta, limit)=({}, {}), hack_count = {}",
ch->GetName(), ch->GetName(),
current_time - victim->m_AttackedLog.dwAttackedTime, current_time - victim->m_AttackedLog.dwAttackedTime,
GET_ATTACK_SPEED(ch), GET_ATTACK_SPEED(ch),

View File

@ -27,7 +27,7 @@ public:
if (level >= _countof(beltGradeByLevelTable)) if (level >= _countof(beltGradeByLevelTable))
{ {
sys_err("CBeltInventoryHelper::GetBeltGradeByRefineLevel - Overflow level (%d", level); SPDLOG_ERROR("CBeltInventoryHelper::GetBeltGradeByRefineLevel - Overflow level ({})", level);
return 0; return 0;
} }

View File

@ -10,7 +10,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "constants.h" #include "constants.h"
#include "log.h" #include "log.h"
#include "dev_log.h"
#include "locale_service.h" #include "locale_service.h"
#include "item.h" #include "item.h"
#include "blend_item.h" #include "blend_item.h"
@ -37,7 +36,7 @@ bool Blend_Item_init()
char file_name[256]; char file_name[256];
snprintf (file_name, sizeof(file_name), "%s/blend.txt", LocaleService_GetBasePath().c_str()); snprintf (file_name, sizeof(file_name), "%s/blend.txt", LocaleService_GetBasePath().c_str());
sys_log(0, "Blend_Item_init %s ", file_name); SPDLOG_INFO("Blend_Item_init {} ", file_name);
DO_ALL_BLEND_INFO(iter) DO_ALL_BLEND_INFO(iter)
{ {
@ -48,7 +47,7 @@ bool Blend_Item_init()
if (false==Blend_Item_load(file_name)) if (false==Blend_Item_load(file_name))
{ {
sys_err("<Blend_Item_init> fail"); SPDLOG_ERROR("<Blend_Item_init> fail");
return false; return false;
} }
return true; return true;
@ -108,7 +107,7 @@ bool Blend_Item_load(char *file)
if (0 == (blend_item_info->apply_type = FN_get_apply_type(v))) if (0 == (blend_item_info->apply_type = FN_get_apply_type(v)))
{ {
sys_err ("Invalid apply_type(%s)", v); SPDLOG_ERROR("Invalid apply_type({})", v);
return false; return false;
} }
} }
@ -222,7 +221,7 @@ bool Blend_Item_set_value(LPITEM item)
apply_value = blend_info->apply_value [FN_random_index()]; apply_value = blend_info->apply_value [FN_random_index()];
apply_duration = blend_info->apply_duration [FN_random_index()]; apply_duration = blend_info->apply_duration [FN_random_index()];
} }
sys_log (0, "blend_item : type : %d, value : %d, du : %d", apply_type, apply_value, apply_duration); SPDLOG_DEBUG("blend_item : type : {}, value : {}, du : {}", apply_type, apply_value, apply_duration);
item->SetSocket(0, apply_type); item->SetSocket(0, apply_type);
item->SetSocket(1, apply_value); item->SetSocket(1, apply_value);
item->SetSocket(2, apply_duration); item->SetSocket(2, apply_duration);

View File

@ -10,7 +10,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "constants.h" #include "constants.h"
#include "block_country.h" #include "block_country.h"
#include "dev_log.h"
#define DEC_ITER(iter) std::vector<T_BLOCK_IP*>::iterator iter #define DEC_ITER(iter) std::vector<T_BLOCK_IP*>::iterator iter
#define DO_ALL_BLOCKED_IP(iter) for ((iter)=s_blocked_ip.begin(); (iter)!=s_blocked_ip.end(); ++(iter)) #define DO_ALL_BLOCKED_IP(iter) for ((iter)=s_blocked_ip.begin(); (iter)!=s_blocked_ip.end(); ++(iter))
@ -36,7 +35,7 @@ std::set<std::string> s_block_exception;
// static functions // static functions
static void __add_block_exception(const char *login) static void __add_block_exception(const char *login)
{ {
dev_log(LOG_DEB0, "BLOCK_EXCEPTION_ADD : %s", login); SPDLOG_TRACE("BLOCK_EXCEPTION_ADD : {}", login);
DEC_EXCEPTION_ITER(iter); DEC_EXCEPTION_ITER(iter);
std::string string_login(login); std::string string_login(login);
@ -52,7 +51,7 @@ dev_log(LOG_DEB0, "BLOCK_EXCEPTION_ADD : %s", login);
static void __del_block_exception(const char *login) static void __del_block_exception(const char *login)
{ {
dev_log(LOG_DEB0, "BLOCK_EXCEPTION_DEL : %s", login); SPDLOG_TRACE("BLOCK_EXCEPTION_DEL : {}", login);
DEC_EXCEPTION_ITER(iter); DEC_EXCEPTION_ITER(iter);
std::string string_login(login); std::string string_login(login);
@ -80,7 +79,7 @@ void add_blocked_country_ip(TPacketBlockCountryIp *data)
s_blocked_ip.push_back(block_ip); s_blocked_ip.push_back(block_ip);
dev_log(LOG_DEB0, "BLOCKED_IP = %u - %u", block_ip->ip_from, block_ip->ip_to); SPDLOG_TRACE("BLOCKED_IP = {} - {}", block_ip->ip_from, block_ip->ip_to);
} }
@ -119,7 +118,7 @@ bool is_blocked_country_ip(const char *user_ip)
if (INADDR_NONE == in_address) if (INADDR_NONE == in_address)
#endif #endif
{ {
dev_log(LOG_INFO, "BLOCKED_COUNTRY_IP (%s) : YES", user_ip); SPDLOG_INFO("BLOCKED_COUNTRY_IP ({}) : YES", user_ip);
return true; // 아이피가 괴상하니 일단 블럭처리 return true; // 아이피가 괴상하니 일단 블럭처리
} }
ip_number = htonl(st_addr.s_addr); ip_number = htonl(st_addr.s_addr);
@ -129,12 +128,12 @@ bool is_blocked_country_ip(const char *user_ip)
block_ip = *iter; block_ip = *iter;
if ( block_ip->ip_from <= ip_number && ip_number <= block_ip->ip_to ) if ( block_ip->ip_from <= ip_number && ip_number <= block_ip->ip_to )
{ {
dev_log(LOG_INFO, "BLOCKED_COUNTRY_IP (%s) : YES", user_ip); SPDLOG_INFO("BLOCKED_COUNTRY_IP ({}) : YES", user_ip);
return true; return true;
} }
} }
dev_log(LOG_INFO, "BLOCKED_COUNTRY_IP (%s) : NO", user_ip); SPDLOG_DEBUG("BLOCKED_COUNTRY_IP ({}) : NO", user_ip);
return false; return false;
} }

View File

@ -51,7 +51,7 @@ void CBuffOnAttributes::RemoveBuffFromItem(LPITEM pItem)
} }
else else
{ {
sys_err ("Buff ERROR(type %d). This item(%d) attr_type(%d) was not in buff pool", m_bPointType, pItem->GetVnum(), attr.bType); SPDLOG_ERROR("Buff ERROR(type {}). This item({}) attr_type({}) was not in buff pool", m_bPointType, pItem->GetVnum(), attr.bType);
return; return;
} }
} }

View File

@ -96,7 +96,7 @@ void CObject::EncodeInsertPacket(LPENTITY entity)
if (!(d = entity->GetDesc())) if (!(d = entity->GetDesc()))
return; return;
sys_log(0, "ObjectInsertPacket vid %u vnum %u rot %f %f %f", SPDLOG_DEBUG("ObjectInsertPacket vid {} vnum {} rot {} {} {}",
m_dwVID, m_data.dwVnum, m_data.xRot, m_data.yRot, m_data.zRot); m_dwVID, m_data.dwVnum, m_data.xRot, m_data.yRot, m_data.zRot);
TPacketGCCharacterAdd pack; TPacketGCCharacterAdd pack;
@ -132,7 +132,7 @@ void CObject::EncodeRemovePacket(LPENTITY entity)
if (!(d = entity->GetDesc())) if (!(d = entity->GetDesc()))
return; return;
sys_log(0, "ObjectRemovePacket vid %u", m_dwVID); SPDLOG_DEBUG("ObjectRemovePacket vid {}", m_dwVID);
TPacketGCCharacterDelete pack; TPacketGCCharacterDelete pack;
@ -153,7 +153,7 @@ bool CObject::Show(int lMapIndex, int x, int y)
if (!tree) if (!tree)
{ {
sys_err("cannot find sectree by %dx%d mapindex %d", x, y, lMapIndex); SPDLOG_ERROR("cannot find sectree by {}x{} mapindex {}", x, y, lMapIndex);
return false; return false;
} }
@ -292,7 +292,7 @@ void CObject::RegenNPC()
if (!m_chNPC) if (!m_chNPC)
{ {
sys_err("Cannot create guild npc"); SPDLOG_ERROR("Cannot create guild npc");
return; return;
} }
@ -461,7 +461,7 @@ void CLand::DeleteObject(DWORD dwID)
if (!(pkObj = FindObject(dwID))) if (!(pkObj = FindObject(dwID)))
return; return;
sys_log(0, "Land::DeleteObject %u", dwID); SPDLOG_DEBUG("Land::DeleteObject {}", dwID);
CManager::instance().UnregisterObject(pkObj); CManager::instance().UnregisterObject(pkObj);
M2_DESTROY_CHARACTER (pkObj->GetNPC()); M2_DESTROY_CHARACTER (pkObj->GetNPC());
@ -506,14 +506,14 @@ bool CLand::RequestCreateObject(DWORD dwVnum, int lMapIndex, int x, int y, float
if (!pkProto) if (!pkProto)
{ {
sys_err("Invalid Object vnum %u", dwVnum); SPDLOG_ERROR("Invalid Object vnum {}", dwVnum);
return false; return false;
} }
const TMapRegion * r = rkSecTreeMgr.GetMapRegion(lMapIndex); const TMapRegion * r = rkSecTreeMgr.GetMapRegion(lMapIndex);
if (!r) if (!r)
return false; return false;
sys_log(0, "RequestCreateObject(vnum=%u, map=%d, pos=(%d,%d), rot=(%.1f,%.1f,%.1f) region(%d,%d ~ %d,%d)", SPDLOG_DEBUG("RequestCreateObject(vnum={}, map={}, pos=({},{}), rot=({:.1f},{:.1f},{:.1f}) region({},{} ~ {},{})",
dwVnum, lMapIndex, x, y, xRot, yRot, zRot, r->sx, r->sy, r->ex, r->ey); dwVnum, lMapIndex, x, y, xRot, yRot, zRot, r->sx, r->sy, r->ex, r->ey);
x += r->sx; x += r->sx;
@ -539,7 +539,7 @@ bool CLand::RequestCreateObject(DWORD dwVnum, int lMapIndex, int x, int y, float
if (tsx < sx || tex > ex || tsy < sy || tey > ey) if (tsx < sx || tex > ex || tsy < sy || tey > ey)
{ {
sys_err("invalid position: object is outside of land region\nLAND: %d %d ~ %d %d\nOBJ: %d %d ~ %d %d", sx, sy, ex, ey, osx, osy, oex, oey); SPDLOG_ERROR("invalid position: object is outside of land region\nLAND: {} {} ~ {} {}\nOBJ: {} {} ~ {} {}", sx, sy, ex, ey, osx, osy, oex, oey);
return false; return false;
} }
@ -548,7 +548,7 @@ bool CLand::RequestCreateObject(DWORD dwVnum, int lMapIndex, int x, int y, float
{ {
if (rkSecTreeMgr.ForAttrRegion(lMapIndex, osx, osy, oex, oey, (int)zRot, ATTR_OBJECT, ATTR_REGION_MODE_CHECK)) if (rkSecTreeMgr.ForAttrRegion(lMapIndex, osx, osy, oex, oey, (int)zRot, ATTR_OBJECT, ATTR_REGION_MODE_CHECK))
{ {
sys_err("another object already exist"); SPDLOG_ERROR("another object already exist");
return false; return false;
} }
FIsIn f (osx, osy, oex, oey); FIsIn f (osx, osy, oex, oey);
@ -556,7 +556,7 @@ bool CLand::RequestCreateObject(DWORD dwVnum, int lMapIndex, int x, int y, float
if (f.bIn) if (f.bIn)
{ {
sys_err("another object already exist"); SPDLOG_ERROR("another object already exist");
return false; return false;
} }
} }
@ -581,12 +581,12 @@ void CLand::RequestDeleteObject(DWORD dwID)
{ {
if (!FindObject(dwID)) if (!FindObject(dwID))
{ {
sys_err("no object by id %u", dwID); SPDLOG_ERROR("no object by id {}", dwID);
return; return;
} }
db_clientdesc->DBPacket(HEADER_GD_DELETE_OBJECT, 0, &dwID, sizeof(DWORD)); db_clientdesc->DBPacket(HEADER_GD_DELETE_OBJECT, 0, &dwID, sizeof(DWORD));
sys_log(0, "RequestDeleteObject id %u", dwID); SPDLOG_DEBUG("RequestDeleteObject id {}", dwID);
} }
void CLand::RequestDeleteObjectByVID(DWORD dwVID) void CLand::RequestDeleteObjectByVID(DWORD dwVID)
@ -595,13 +595,13 @@ void CLand::RequestDeleteObjectByVID(DWORD dwVID)
if (!(pkObj = FindObjectByVID(dwVID))) if (!(pkObj = FindObjectByVID(dwVID)))
{ {
sys_err("no object by vid %u", dwVID); SPDLOG_ERROR("no object by vid {}", dwVID);
return; return;
} }
DWORD dwID = pkObj->GetID(); DWORD dwID = pkObj->GetID();
db_clientdesc->DBPacket(HEADER_GD_DELETE_OBJECT, 0, &dwID, sizeof(DWORD)); db_clientdesc->DBPacket(HEADER_GD_DELETE_OBJECT, 0, &dwID, sizeof(DWORD));
sys_log(0, "RequestDeleteObject vid %u id %u", dwVID, dwID); SPDLOG_DEBUG("RequestDeleteObject vid {} id {}", dwVID, dwID);
} }
void CLand::SetOwner(DWORD dwGuild) void CLand::SetOwner(DWORD dwGuild)
@ -621,7 +621,7 @@ void CLand::RequestUpdate(DWORD dwGuild)
a[1] = dwGuild; a[1] = dwGuild;
db_clientdesc->DBPacket(HEADER_GD_UPDATE_LAND, 0, &a[0], sizeof(DWORD) * 2); db_clientdesc->DBPacket(HEADER_GD_UPDATE_LAND, 0, &a[0], sizeof(DWORD) * 2);
sys_log(0, "RequestUpdate id %u guild %u", a[0], a[1]); SPDLOG_DEBUG("RequestUpdate id {} guild {}", a[0], a[1]);
} }
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
@ -654,7 +654,7 @@ bool CManager::LoadObjectProto(const TObjectProto * pProto, int size) // from DB
TObjectProto & r = m_vec_kObjectProto[i]; TObjectProto & r = m_vec_kObjectProto[i];
// BUILDING_NPC // BUILDING_NPC
sys_log(0, "ObjectProto %u price %u upgrade %u upg_limit %u life %d NPC %u", SPDLOG_DEBUG("ObjectProto {} price {} upgrade {} upg_limit {} life {} NPC {}",
r.dwVnum, r.dwPrice, r.dwUpgradeVnum, r.dwUpgradeLimitTime, r.lLife, r.dwNPCVnum); r.dwVnum, r.dwPrice, r.dwUpgradeVnum, r.dwUpgradeLimitTime, r.lLife, r.dwNPCVnum);
// END_OF_BUILDING_NPC // END_OF_BUILDING_NPC
@ -665,11 +665,11 @@ bool CManager::LoadObjectProto(const TObjectProto * pProto, int size) // from DB
if (NULL == ITEM_MANAGER::instance().GetTable(r.kMaterials[j].dwItemVnum)) if (NULL == ITEM_MANAGER::instance().GetTable(r.kMaterials[j].dwItemVnum))
{ {
sys_err(" mat: ERROR!! no item by vnum %u", r.kMaterials[j].dwItemVnum); SPDLOG_ERROR(" mat: ERROR!! no item by vnum {}", r.kMaterials[j].dwItemVnum);
return false; return false;
} }
sys_log(0, " mat: %u %u", r.kMaterials[j].dwItemVnum, r.kMaterials[j].dwCount); SPDLOG_TRACE(" mat: {} {}", r.kMaterials[j].dwItemVnum, r.kMaterials[j].dwCount);
} }
m_map_pkObjectProto.insert(std::make_pair(r.dwVnum, &m_vec_kObjectProto[i])); m_map_pkObjectProto.insert(std::make_pair(r.dwVnum, &m_vec_kObjectProto[i]));
@ -700,7 +700,7 @@ bool CManager::LoadLand(TLand * pTable) // from DB
CLand * pkLand = M2_NEW CLand(pTable); CLand * pkLand = M2_NEW CLand(pTable);
m_map_pkLand.insert(std::make_pair(pkLand->GetID(), pkLand)); m_map_pkLand.insert(std::make_pair(pkLand->GetID(), pkLand));
sys_log(0, "LAND: %u map %d %dx%d w %u h %u", SPDLOG_INFO("LAND: {} map {} {}x{} w {} h {}",
pTable->dwID, pTable->lMapIndex, pTable->x, pTable->y, pTable->width, pTable->height); pTable->dwID, pTable->lMapIndex, pTable->x, pTable->y, pTable->width, pTable->height);
return true; return true;
@ -712,7 +712,7 @@ void CManager::UpdateLand(TLand * pTable)
if (!pkLand) if (!pkLand)
{ {
sys_err("cannot find land by id %u", pTable->dwID); SPDLOG_ERROR("cannot find land by id {}", pTable->dwID);
return; return;
} }
@ -736,7 +736,7 @@ void CManager::UpdateLand(TLand * pTable)
e.height = pTable->height; e.height = pTable->height;
e.dwGuildID = pTable->dwGuildID; e.dwGuildID = pTable->dwGuildID;
sys_log(0, "BUILDING: UpdateLand %u pos %dx%d guild %u", e.dwID, e.x, e.y, e.dwGuildID); SPDLOG_INFO("BUILDING: UpdateLand {} pos {}x{} guild {}", e.dwID, e.x, e.y, e.dwGuildID);
CGuild *guild = CGuildManager::instance().FindGuild(pTable->dwGuildID); CGuild *guild = CGuildManager::instance().FindGuild(pTable->dwGuildID);
while (it != cont.end()) while (it != cont.end())
@ -766,7 +766,7 @@ CLand * CManager::FindLand(DWORD dwID)
CLand * CManager::FindLand(int lMapIndex, int x, int y) CLand * CManager::FindLand(int lMapIndex, int x, int y)
{ {
sys_log(0, "BUILDING: FindLand %d %d %d", lMapIndex, x, y); SPDLOG_DEBUG("BUILDING: FindLand {} {} {}", lMapIndex, x, y);
const TMapRegion * r = SECTREE_MANAGER::instance().GetMapRegion(lMapIndex); const TMapRegion * r = SECTREE_MANAGER::instance().GetMapRegion(lMapIndex);
@ -819,7 +819,7 @@ bool CManager::LoadObject(TObject * pTable, bool isBoot) // from DB
if (!pkLand) if (!pkLand)
{ {
sys_log(0, "Cannot find land by id %u", pTable->dwLandID); SPDLOG_ERROR("Cannot find land by id {}", pTable->dwLandID);
return false; return false;
} }
@ -827,11 +827,11 @@ bool CManager::LoadObject(TObject * pTable, bool isBoot) // from DB
if (!pkProto) if (!pkProto)
{ {
sys_err("Cannot find object %u in prototype (id %u)", pTable->dwVnum, pTable->dwID); SPDLOG_ERROR("Cannot find object {} in prototype (id {})", pTable->dwVnum, pTable->dwID);
return false; return false;
} }
sys_log(0, "OBJ: id %u vnum %u map %d pos %dx%d", pTable->dwID, pTable->dwVnum, pTable->lMapIndex, pTable->x, pTable->y); SPDLOG_DEBUG("OBJ: id {} vnum {} map {} pos {}x{}", pTable->dwID, pTable->dwVnum, pTable->lMapIndex, pTable->x, pTable->y);
LPOBJECT pkObj = M2_NEW CObject(pTable, pkProto); LPOBJECT pkObj = M2_NEW CObject(pTable, pkProto);
@ -880,7 +880,7 @@ void CManager::FinalizeBoot()
} }
// BUILDING_NPC // BUILDING_NPC
sys_log(0, "FinalizeBoot"); SPDLOG_DEBUG("FinalizeBoot");
// END_OF_BUILDING_NPC // END_OF_BUILDING_NPC
itertype(m_map_pkLand) it2 = m_map_pkLand.begin(); itertype(m_map_pkLand) it2 = m_map_pkLand.begin();
@ -892,7 +892,7 @@ void CManager::FinalizeBoot()
const TLand & r = pkLand->GetData(); const TLand & r = pkLand->GetData();
// LAND_MASTER_LOG // LAND_MASTER_LOG
sys_log(0, "LandMaster map_index=%d pos=(%d, %d)", r.lMapIndex, r.x, r.y); SPDLOG_DEBUG("LandMaster map_index={} pos=({}, {})", r.lMapIndex, r.x, r.y);
// END_OF_LAND_MASTER_LOG // END_OF_LAND_MASTER_LOG
if (r.dwGuildID != 0) if (r.dwGuildID != 0)
@ -911,7 +911,7 @@ void CManager::FinalizeBoot()
void CManager::DeleteObject(DWORD dwID) // from DB void CManager::DeleteObject(DWORD dwID) // from DB
{ {
sys_log(0, "OBJ_DEL: %u", dwID); SPDLOG_DEBUG("OBJ_DEL: {}", dwID);
itertype(m_map_pkObjByID) it = m_map_pkObjByID.find(dwID); itertype(m_map_pkObjByID) it = m_map_pkObjByID.find(dwID);
@ -975,7 +975,7 @@ void CManager::SendLandList(LPDESC d, int lMapIndex)
++wCount; ++wCount;
} }
sys_log(0, "SendLandList map %d count %u elem_size: %d", lMapIndex, wCount, buf.size()); SPDLOG_DEBUG("SendLandList map {} count {} elem_size: {}", lMapIndex, wCount, buf.size());
if (wCount != 0) if (wCount != 0)
{ {
@ -996,13 +996,13 @@ void CManager::ClearLand(DWORD dwLandID)
if ( pLand == NULL ) if ( pLand == NULL )
{ {
sys_log(0, "LAND_CLEAR: there is no LAND id like %d", dwLandID); SPDLOG_WARN("LAND_CLEAR: there is no LAND id like {}", dwLandID);
return; return;
} }
pLand->ClearLand(); pLand->ClearLand();
sys_log(0, "LAND_CLEAR: request Land Clear. LandID: %d", pLand->GetID()); SPDLOG_DEBUG("LAND_CLEAR: request Land Clear. LandID: {}", pLand->GetID());
} }
void CManager::ClearLandByGuildID(DWORD dwGuildID) void CManager::ClearLandByGuildID(DWORD dwGuildID)
@ -1011,13 +1011,13 @@ void CManager::ClearLandByGuildID(DWORD dwGuildID)
if ( pLand == NULL ) if ( pLand == NULL )
{ {
sys_log(0, "LAND_CLEAR: there is no GUILD id like %d", dwGuildID); SPDLOG_WARN("LAND_CLEAR: there is no GUILD id like {}", dwGuildID);
return; return;
} }
pLand->ClearLand(); pLand->ClearLand();
sys_log(0, "LAND_CLEAR: request Land Clear. LandID: %d", pLand->GetID()); SPDLOG_DEBUG("LAND_CLEAR: request Land Clear. LandID: {}", pLand->GetID());
} }
void CLand::ClearLand() void CLand::ClearLand()

View File

@ -241,7 +241,7 @@ EVENTFUNC(castle_siege_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "castle_siege_event> <Factor> Null pointer" ); SPDLOG_ERROR("castle_siege_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -320,7 +320,7 @@ EVENTFUNC(castle_stone_event)
if (info == NULL) if (info == NULL)
{ {
sys_err( "castle_stone_event> <Factor> Null pointer" ); SPDLOG_ERROR("castle_stone_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -470,7 +470,7 @@ bool castle_boot()
else else
{ {
fclose(fp); fclose(fp);
sys_err("wrong empire number is null"); SPDLOG_ERROR("wrong empire number is null");
return false; return false;
} }
} }
@ -526,7 +526,7 @@ void castle_save()
if (NULL == fp) if (NULL == fp)
{ {
sys_err("<FAIL> fopen(%s)", castle_file); SPDLOG_ERROR("<FAIL> fopen({})", castle_file);
return; return;
} }

File diff suppressed because it is too large Load Diff

View File

@ -71,7 +71,7 @@ EVENTFUNC(affect_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "affect_event> <Factor> Null pointer" ); SPDLOG_ERROR("affect_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -174,7 +174,7 @@ void CHARACTER::StartAffectEvent()
char_event_info* info = AllocEventInfo<char_event_info>(); char_event_info* info = AllocEventInfo<char_event_info>();
info->ch = this; info->ch = this;
m_pkAffectEvent = event_create(affect_event, info, passes_per_sec); m_pkAffectEvent = event_create(affect_event, info, passes_per_sec);
sys_log(1, "StartAffectEvent %s %p %p", GetName(), this, get_pointer(m_pkAffectEvent)); SPDLOG_DEBUG("StartAffectEvent {} {} {}", GetName(), (void*) this, (void*) get_pointer(m_pkAffectEvent));
} }
void CHARACTER::ClearAffect(bool bSave) void CHARACTER::ClearAffect(bool bSave)
@ -357,7 +357,7 @@ void CHARACTER::SaveAffect()
if (IS_NO_SAVE_AFFECT(pkAff->dwType)) if (IS_NO_SAVE_AFFECT(pkAff->dwType))
continue; continue;
sys_log(1, "AFFECT_SAVE: %u %u %d %d", pkAff->dwType, pkAff->bApplyOn, pkAff->lApplyValue, pkAff->lDuration); SPDLOG_DEBUG("AFFECT_SAVE: {} {} {} {}", pkAff->dwType, pkAff->bApplyOn, pkAff->lApplyValue, pkAff->lDuration);
p.dwPID = GetPlayerID(); p.dwPID = GetPlayerID();
p.elem.dwType = pkAff->dwType; p.elem.dwType = pkAff->dwType;
@ -390,7 +390,7 @@ EVENTFUNC(load_affect_login_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "load_affect_login_event_info> <Factor> Null pointer" ); SPDLOG_ERROR("load_affect_login_event_info> <Factor> Null pointer" );
return 0; return 0;
} }
@ -426,14 +426,14 @@ EVENTFUNC(load_affect_login_event)
} }
else if (d->IsPhase(PHASE_GAME)) else if (d->IsPhase(PHASE_GAME))
{ {
sys_log(1, "Affect Load by Event"); SPDLOG_DEBUG("Affect Load by Event");
ch->LoadAffect(info->count, (TPacketAffectElement*)info->data); ch->LoadAffect(info->count, (TPacketAffectElement*)info->data);
M2_DELETE_ARRAY(info->data); M2_DELETE_ARRAY(info->data);
return 0; return 0;
} }
else else
{ {
sys_err("input_db.cpp:quest_login_event INVALID PHASE pid %d", ch->GetPlayerID()); SPDLOG_ERROR("input_db.cpp:quest_login_event INVALID PHASE pid {}", ch->GetPlayerID());
M2_DELETE_ARRAY(info->data); M2_DELETE_ARRAY(info->data);
return 0; return 0;
} }
@ -445,8 +445,7 @@ void CHARACTER::LoadAffect(DWORD dwCount, TPacketAffectElement * pElements)
if (!GetDesc()->IsPhase(PHASE_GAME)) if (!GetDesc()->IsPhase(PHASE_GAME))
{ {
if (test_server) SPDLOG_TRACE("LOAD_AFFECT: Creating Event", GetName(), dwCount);
sys_log(0, "LOAD_AFFECT: Creating Event", GetName(), dwCount);
load_affect_login_event_info* info = AllocEventInfo<load_affect_login_event_info>(); load_affect_login_event_info* info = AllocEventInfo<load_affect_login_event_info>();
@ -462,8 +461,7 @@ void CHARACTER::LoadAffect(DWORD dwCount, TPacketAffectElement * pElements)
ClearAffect(true); ClearAffect(true);
if (test_server) SPDLOG_TRACE("LOAD_AFFECT: {} count {}", GetName(), dwCount);
sys_log(0, "LOAD_AFFECT: %s count %d", GetName(), dwCount);
TAffectFlag afOld = m_afAffectFlag; TAffectFlag afOld = m_afAffectFlag;
@ -488,15 +486,12 @@ void CHARACTER::LoadAffect(DWORD dwCount, TPacketAffectElement * pElements)
if (pElements->bApplyOn >= POINT_MAX_NUM) if (pElements->bApplyOn >= POINT_MAX_NUM)
{ {
sys_err("invalid affect data %s ApplyOn %u ApplyValue %d", SPDLOG_ERROR("invalid affect data {} ApplyOn {} ApplyValue {}",
GetName(), pElements->bApplyOn, pElements->lApplyValue); GetName(), pElements->bApplyOn, pElements->lApplyValue);
continue; continue;
} }
if (test_server) SPDLOG_TRACE("Load Affect : Affect {} {} {}", GetName(), pElements->dwType, pElements->bApplyOn );
{
sys_log(0, "Load Affect : Affect %s %d %d", GetName(), pElements->dwType, pElements->bApplyOn );
}
CAffect* pkAff = CAffect::Acquire(); CAffect* pkAff = CAffect::Acquire();
m_list_pkAffect.push_back(pkAff); m_list_pkAffect.push_back(pkAff);
@ -544,7 +539,7 @@ bool CHARACTER::AddAffect(DWORD dwType, BYTE bApplyOn, int lApplyValue, DWORD dw
if (lDuration == 0) if (lDuration == 0)
{ {
sys_err("Character::AddAffect lDuration == 0 type %d", lDuration, dwType); SPDLOG_ERROR("Character::AddAffect lDuration == 0 type {}", lDuration, dwType);
lDuration = 1; lDuration = 1;
} }
@ -587,8 +582,7 @@ bool CHARACTER::AddAffect(DWORD dwType, BYTE bApplyOn, int lApplyValue, DWORD dw
} }
sys_log(1, "AddAffect %s type %d apply %d %d flag %u duration %d", GetName(), dwType, bApplyOn, lApplyValue, dwFlag, lDuration); SPDLOG_DEBUG("AddAffect {} type {} apply {} {} flag {} duration {}", GetName(), dwType, bApplyOn, lApplyValue, dwFlag, lDuration);
sys_log(0, "AddAffect %s type %d apply %d %d flag %u duration %d", GetName(), dwType, bApplyOn, lApplyValue, dwFlag, lDuration);
pkAff->dwType = dwType; pkAff->dwType = dwType;
pkAff->bApplyOn = bApplyOn; pkAff->bApplyOn = bApplyOn;
@ -703,8 +697,7 @@ bool CHARACTER::RemoveAffect(CAffect * pkAff)
} }
CheckMaximumPoints(); CheckMaximumPoints();
if (test_server) SPDLOG_TRACE("AFFECT_REMOVE: {} (flag {} apply: {})", GetName(), pkAff->dwFlag, pkAff->bApplyOn);
sys_log(0, "AFFECT_REMOVE: %s (flag %u apply: %u)", GetName(), pkAff->dwFlag, pkAff->bApplyOn);
if (IsPC()) if (IsPC())
{ {
@ -801,7 +794,7 @@ bool CHARACTER::IsGoodAffect(BYTE bAffectType) const
void CHARACTER::RemoveBadAffect() void CHARACTER::RemoveBadAffect()
{ {
sys_log(0, "RemoveBadAffect %s", GetName()); SPDLOG_DEBUG("RemoveBadAffect {}", GetName());
// µ¶ // µ¶
RemovePoison(); RemovePoison();
RemoveFire(); RemoveFire();

View File

@ -26,7 +26,6 @@
#include "exchange.h" #include "exchange.h"
#include "shop_manager.h" #include "shop_manager.h"
#include "castle.h" #include "castle.h"
#include "dev_log.h"
#include "ani.h" #include "ani.h"
#include "BattleArena.h" #include "BattleArena.h"
#include "packet.h" #include "packet.h"
@ -179,8 +178,7 @@ void CHARACTER::DistributeSP(LPCHARACTER pkKiller, int iMethod)
bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType) bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)
{ {
if (test_server) SPDLOG_TRACE("[TEST_SERVER] Attack : {} type {}, MobBattleType {}", GetName(), bType, !GetMobBattleType() ? 0 : GetMobAttackRange());
sys_log(0, "[TEST_SERVER] Attack : %s type %d, MobBattleType %d", GetName(), bType, !GetMobBattleType() ? 0 : GetMobAttackRange());
//PROF_UNIT puAttack("Attack"); //PROF_UNIT puAttack("Attack");
if (!CanMove()) if (!CanMove())
return false; return false;
@ -238,7 +236,7 @@ bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)
break; break;
default: default:
sys_err("Unhandled battle type %d", GetMobBattleType()); SPDLOG_ERROR("Unhandled battle type {}", GetMobBattleType());
iRet = BATTLE_NONE; iRet = BATTLE_NONE;
break; break;
} }
@ -249,18 +247,16 @@ bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)
{ {
if (dwCurrentTime - m_dwLastSkillTime > 1500) if (dwCurrentTime - m_dwLastSkillTime > 1500)
{ {
sys_log(1, "HACK: Too long skill using term. Name(%s) PID(%u) delta(%u)", SPDLOG_DEBUG("HACK: Too long skill using term. Name({}) PID({}) delta({})",
GetName(), GetPlayerID(), (dwCurrentTime - m_dwLastSkillTime)); GetName(), GetPlayerID(), (dwCurrentTime - m_dwLastSkillTime));
return false; return false;
} }
} }
sys_log(1, "Attack call ComputeSkill %d %s", bType, pkVictim?pkVictim->GetName():""); SPDLOG_DEBUG("Attack call ComputeSkill {} {}", bType, pkVictim?pkVictim->GetName():"");
iRet = ComputeSkill(bType, pkVictim); iRet = ComputeSkill(bType, pkVictim);
} }
//if (test_server && IsPC())
// sys_log(0, "%s Attack %s type %u ret %d", GetName(), pkVictim->GetName(), bType, iRet);
if (iRet == BATTLE_DAMAGE || iRet == BATTLE_DEAD) if (iRet == BATTLE_DAMAGE || iRet == BATTLE_DEAD)
{ {
OnMove(true); OnMove(true);
@ -278,7 +274,7 @@ bool CHARACTER::Attack(LPCHARACTER pkVictim, BYTE bType)
void CHARACTER::DeathPenalty(BYTE bTown) void CHARACTER::DeathPenalty(BYTE bTown)
{ {
sys_log(1, "DEATH_PERNALY_CHECK(%s) town(%d)", GetName(), bTown); SPDLOG_DEBUG("DEATH_PERNALY_CHECK({}) town({})", GetName(), bTown);
Cube_close(this); Cube_close(this);
@ -289,14 +285,14 @@ void CHARACTER::DeathPenalty(BYTE bTown)
if (GetLevel() < 10) if (GetLevel() < 10)
{ {
sys_log(0, "NO_DEATH_PENALTY_LESS_LV10(%s)", GetName()); SPDLOG_DEBUG("NO_DEATH_PENALTY_LESS_LV10({})", GetName());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다.")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다."));
return; return;
} }
if (Random::get(0, 2)) if (Random::get(0, 2))
{ {
sys_log(0, "NO_DEATH_PENALTY_LUCK(%s)", GetName()); SPDLOG_DEBUG("NO_DEATH_PENALTY_LUCK({})", GetName());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다.")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다."));
return; return;
} }
@ -310,7 +306,7 @@ void CHARACTER::DeathPenalty(BYTE bTown)
{ {
if (FindAffect(AFFECT_NO_DEATH_PENALTY)) if (FindAffect(AFFECT_NO_DEATH_PENALTY))
{ {
sys_log(0, "NO_DEATH_PENALTY_AFFECT(%s)", GetName()); SPDLOG_DEBUG("NO_DEATH_PENALTY_AFFECT({})", GetName());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다.")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다."));
RemoveAffect(AFFECT_NO_DEATH_PENALTY); RemoveAffect(AFFECT_NO_DEATH_PENALTY);
return; return;
@ -320,7 +316,7 @@ void CHARACTER::DeathPenalty(BYTE bTown)
{ {
if (FindAffect(AFFECT_NO_DEATH_PENALTY)) if (FindAffect(AFFECT_NO_DEATH_PENALTY))
{ {
sys_log(0, "NO_DEATH_PENALTY_AFFECT(%s)", GetName()); SPDLOG_DEBUG("NO_DEATH_PENALTY_AFFECT({})", GetName());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다.")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("용신의 가호로 경험치가 떨어지지 않았습니다."));
RemoveAffect(AFFECT_NO_DEATH_PENALTY); RemoveAffect(AFFECT_NO_DEATH_PENALTY);
return; return;
@ -361,7 +357,7 @@ void CHARACTER::DeathPenalty(BYTE bTown)
if (IsEquipUniqueItem(UNIQUE_ITEM_TEARDROP_OF_GODNESS)) if (IsEquipUniqueItem(UNIQUE_ITEM_TEARDROP_OF_GODNESS))
iLoss /= 2; iLoss /= 2;
sys_log(0, "DEATH_PENALTY(%s) EXP_LOSS: %d percent %d%%", GetName(), iLoss, aiExpLossPercents[std::min(gPlayerMaxLevel, GetLevel())]); SPDLOG_DEBUG("DEATH_PENALTY({}) EXP_LOSS: {} percent {}%", GetName(), iLoss, aiExpLossPercents[std::min(gPlayerMaxLevel, GetLevel())]);
PointChange(POINT_EXP, -iLoss, true); PointChange(POINT_EXP, -iLoss, true);
} }
@ -381,7 +377,7 @@ EVENTFUNC(StunEvent)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "StunEvent> <Factor> Null pointer" ); SPDLOG_ERROR("StunEvent> <Factor> Null pointer" );
return 0; return 0;
} }
@ -408,7 +404,7 @@ void CHARACTER::Stun()
m_pkParty->SendMessage(this, PM_ATTACKED_BY, 0, 0); m_pkParty->SendMessage(this, PM_ATTACKED_BY, 0, 0);
} }
sys_log(1, "%s: Stun %p", GetName(), this); SPDLOG_DEBUG("{}: Stun {}", GetName(), (void*) this);
PointChange(POINT_HP_RECOVERY, -GetPoint(POINT_HP_RECOVERY)); PointChange(POINT_HP_RECOVERY, -GetPoint(POINT_HP_RECOVERY));
PointChange(POINT_SP_RECOVERY, -GetPoint(POINT_SP_RECOVERY)); PointChange(POINT_SP_RECOVERY, -GetPoint(POINT_SP_RECOVERY));
@ -452,7 +448,7 @@ EVENTFUNC(dead_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "dead_event> <Factor> Null pointer" ); SPDLOG_ERROR("dead_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -469,7 +465,7 @@ EVENTFUNC(dead_event)
if (NULL == ch) if (NULL == ch)
{ {
sys_err("DEAD_EVENT: cannot find char pointer with %s id(%d)", info->isPC ? "PC" : "MOB", info->dwID ); SPDLOG_ERROR("DEAD_EVENT: cannot find char pointer with {} id({})", info->isPC ? "PC" : "MOB", info->dwID );
return 0; return 0;
} }
@ -487,7 +483,7 @@ EVENTFUNC(dead_event)
ch->WarpSet(pos.x, pos.y); ch->WarpSet(pos.x, pos.y);
else else
{ {
sys_err("cannot find spawn position (name %s)", ch->GetName()); SPDLOG_ERROR("cannot find spawn position (name {})", ch->GetName());
ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire())); ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
} }
@ -619,8 +615,7 @@ void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
for (int i = 0; i < iSplitCount; ++i) for (int i = 0; i < iSplitCount; ++i)
{ {
int iGold = Random::get(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount; int iGold = Random::get(GetMobTable().dwGoldMin, GetMobTable().dwGoldMax) / iSplitCount;
if (test_server) SPDLOG_TRACE("iGold {}", iGold);
sys_log(0, "iGold %d", iGold);
iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100; iGold = iGold * CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker) / 100;
iGold *= iGoldMultipler; iGold *= iGoldMultipler;
@ -629,11 +624,8 @@ void CHARACTER::RewardGold(LPCHARACTER pkAttacker)
continue ; continue ;
} }
if (test_server) SPDLOG_TRACE("Drop Moeny MobGoldAmountRate {} {}", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
{ SPDLOG_TRACE("Drop Money gold {} GoldMin {} GoldMax {}", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
sys_log(0, "Drop Moeny MobGoldAmountRate %d %d", CHARACTER_MANAGER::instance().GetMobGoldAmountRate(pkAttacker), iGoldMultipler);
sys_log(0, "Drop Money gold %d GoldMin %d GoldMax %d", iGold, GetMobTable().dwGoldMax, GetMobTable().dwGoldMax);
}
// NOTE: 돈 폭탄은 제 3의 손 처리를 하지 않음 // NOTE: 돈 폭탄은 제 3의 손 처리를 하지 않음
if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold))) if ((item = ITEM_MANAGER::instance().CreateItem(1, iGold)))
@ -741,7 +733,7 @@ void CHARACTER::Reward(bool bItemDrop)
iGold *= GetGoldMultipler(); iGold *= GetGoldMultipler();
int iSplitCount = Random::get(25, 35); int iSplitCount = Random::get(25, 35);
sys_log(0, "WAEGU Dead gold %d split %d", iGold, iSplitCount); SPDLOG_TRACE("WAEGU Dead gold {} split {}", iGold, iSplitCount);
for (int i = 1; i <= iSplitCount; ++i) for (int i = 1; i <= iSplitCount; ++i)
{ {
@ -818,8 +810,7 @@ void CHARACTER::Reward(bool bItemDrop)
// 돈 드롭 // 돈 드롭
// //
//PROF_UNIT pu2("r2"); //PROF_UNIT pu2("r2");
if (test_server) SPDLOG_TRACE("Drop money : Attacker {}", pkAttacker->GetName());
sys_log(0, "Drop money : Attacker %s", pkAttacker->GetName());
RewardGold(pkAttacker); RewardGold(pkAttacker);
//pu2.Pop(); //pu2.Pop();
@ -852,7 +843,7 @@ void CHARACTER::Reward(bool bItemDrop)
pos.x += GetX(); pos.x += GetX();
pos.y += GetY(); pos.y += GetY();
sys_log(0, "DROP_ITEM: %s %d %d from %s", item->GetName(), pos.x, pos.y, GetName()); SPDLOG_DEBUG("DROP_ITEM: {} {} {} from {}", item->GetName(), pos.x, pos.y, GetName());
} }
else else
{ {
@ -894,7 +885,7 @@ void CHARACTER::Reward(bool bItemDrop)
if (!item) if (!item)
{ {
sys_err("item null in vector idx %d", iItemIdx + 1); SPDLOG_ERROR("item null in vector idx {}", iItemIdx + 1);
continue; continue;
} }
@ -908,7 +899,7 @@ void CHARACTER::Reward(bool bItemDrop)
pos.x += GetX(); pos.x += GetX();
pos.y += GetY(); pos.y += GetY();
sys_log(0, "DROP_ITEM: %s %d %d by %s", item->GetName(), pos.x, pos.y, GetName()); SPDLOG_DEBUG("DROP_ITEM: {} {} {} by {}", item->GetName(), pos.x, pos.y, GetName());
} }
} }
else else
@ -922,7 +913,7 @@ void CHARACTER::Reward(bool bItemDrop)
if (!item) if (!item)
{ {
sys_err("item null in vector idx %d", iItemIdx + 1); SPDLOG_ERROR("item null in vector idx {}", iItemIdx + 1);
continue; continue;
} }
@ -950,7 +941,7 @@ void CHARACTER::Reward(bool bItemDrop)
pos.x += GetX(); pos.x += GetX();
pos.y += GetY(); pos.y += GetY();
sys_log(0, "DROP_ITEM: %s %d %d by %s", item->GetName(), pos.x, pos.y, GetName()); SPDLOG_DEBUG("DROP_ITEM: {} {} {} by {}", item->GetName(), pos.x, pos.y, GetName());
} }
} }
} }
@ -1029,7 +1020,7 @@ void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller)
bool isDropAllEquipments = false; bool isDropAllEquipments = false;
TItemDropPenalty & r = table[iAlignIndex]; TItemDropPenalty & r = table[iAlignIndex];
sys_log(0, "%s align %d inven_pct %d equip_pct %d", GetName(), iAlignIndex, r.iInventoryPct, r.iEquipmentPct); SPDLOG_DEBUG("{} align {} inven_pct {} equip_pct {}", GetName(), iAlignIndex, r.iInventoryPct, r.iEquipmentPct);
bool bDropInventory = r.iInventoryPct >= Random::get(1, 1000); bool bDropInventory = r.iInventoryPct >= Random::get(1, 1000);
bool bDropEquipment = r.iEquipmentPct >= Random::get(1, 100); bool bDropEquipment = r.iEquipmentPct >= Random::get(1, 100);
@ -1144,7 +1135,7 @@ void CHARACTER::ItemDropPenalty(LPCHARACTER pkKiller)
item->AddToGround(GetMapIndex(), pos); item->AddToGround(GetMapIndex(), pos);
item->StartDestroyEvent(); item->StartDestroyEvent();
sys_log(0, "DROP_ITEM_PK: %s %d %d from %s", item->GetName(), pos.x, pos.y, GetName()); SPDLOG_DEBUG("DROP_ITEM_PK: {} {} {} from {}", item->GetName(), pos.x, pos.y, GetName());
LogManager::instance().ItemLog(this, item, "DEAD_DROP", (window == INVENTORY) ? "INVENTORY" : ((window == EQUIPMENT) ? "EQUIPMENT" : "")); LogManager::instance().ItemLog(this, item, "DEAD_DROP", (window == INVENTORY) ? "INVENTORY" : ((window == EQUIPMENT) ? "EQUIPMENT" : ""));
pos.x = GetX() + Random::get(-7, 7) * 20; pos.x = GetX() + Random::get(-7, 7) * 20;
@ -1294,14 +1285,14 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
{ {
if (!isForked) if (!isForked)
{ {
sys_log(1, "DEAD: %s %p WITH PENALTY", GetName(), this); SPDLOG_DEBUG("DEAD: {} {} WITH PENALTY", GetName(), (void*) this);
SET_BIT(m_pointsInstant.instant_flag, INSTANT_FLAG_DEATH_PENALTY); SET_BIT(m_pointsInstant.instant_flag, INSTANT_FLAG_DEATH_PENALTY);
LogManager::instance().CharLog(this, pkKiller->GetRaceNum(), "DEAD_BY_NPC", pkKiller->GetName()); LogManager::instance().CharLog(this, pkKiller->GetRaceNum(), "DEAD_BY_NPC", pkKiller->GetName());
} }
} }
else else
{ {
sys_log(1, "DEAD_BY_PC: %s %p KILLER %s %p", GetName(), this, pkKiller->GetName(), get_pointer(pkKiller)); SPDLOG_DEBUG("DEAD_BY_PC: {} {} KILLER {} {}", GetName(), (void*) this, pkKiller->GetName(), (void*) get_pointer(pkKiller));
REMOVE_BIT(m_pointsInstant.instant_flag, INSTANT_FLAG_DEATH_PENALTY); REMOVE_BIT(m_pointsInstant.instant_flag, INSTANT_FLAG_DEATH_PENALTY);
if (GetEmpire() != pkKiller->GetEmpire()) if (GetEmpire() != pkKiller->GetEmpire())
@ -1351,7 +1342,7 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
pkKiller->UpdateAlignment(-20000); pkKiller->UpdateAlignment(-20000);
else else
{ {
sys_log(0, "ALIGNMENT PARTY count %d amount %d", f.m_iCount, f.m_iAmount); SPDLOG_DEBUG("ALIGNMENT PARTY count {} amount {}", f.m_iCount, f.m_iAmount);
f.m_iStep = 1; f.m_iStep = 1;
pkKiller->GetParty()->ForEachOnlineMember(f); pkKiller->GetParty()->ForEachOnlineMember(f);
@ -1374,13 +1365,12 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
} }
else else
{ {
sys_log(1, "DEAD: %s %p", GetName(), this); SPDLOG_DEBUG("DEAD: {} {}", GetName(), (void*) this);
REMOVE_BIT(m_pointsInstant.instant_flag, INSTANT_FLAG_DEATH_PENALTY); REMOVE_BIT(m_pointsInstant.instant_flag, INSTANT_FLAG_DEATH_PENALTY);
} }
ClearSync(); ClearSync();
//sys_log(1, "stun cancel %s[%d]", GetName(), (DWORD)GetVID());
event_cancel(&m_pkStunEvent); // 기절 이벤트는 죽인다. event_cancel(&m_pkStunEvent); // 기절 이벤트는 죽인다.
if (IsPC()) if (IsPC())
@ -1469,7 +1459,7 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
{ {
if (m_pkDeadEvent) if (m_pkDeadEvent)
{ {
sys_log(1, "DEAD_EVENT_CANCEL: %s %p %p", GetName(), this, get_pointer(m_pkDeadEvent)); SPDLOG_DEBUG("DEAD_EVENT_CANCEL: {} {} {}", GetName(), (void*) this, (void*) get_pointer(m_pkDeadEvent));
event_cancel(&m_pkDeadEvent); event_cancel(&m_pkDeadEvent);
} }
@ -1505,7 +1495,7 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
} }
} }
sys_log(1, "DEAD_EVENT_CREATE: %s %p %p", GetName(), this, get_pointer(m_pkDeadEvent)); SPDLOG_DEBUG("DEAD_EVENT_CREATE: {} {} {}", GetName(), (void*) this, (void*) get_pointer(m_pkDeadEvent));
} }
if (m_pkExchange != NULL) if (m_pkExchange != NULL)
@ -1530,7 +1520,7 @@ void CHARACTER::Dead(LPCHARACTER pkKiller, bool bImmediateDead)
} }
else else
{ {
sys_err("DragonLair: Dragon killed by nobody"); SPDLOG_ERROR("DragonLair: Dragon killed by nobody");
} }
} }
} }
@ -1641,7 +1631,7 @@ bool CHARACTER::Damage(LPCHARACTER pAttacker, int dam, EDamageType type) // retu
DWORD dwGold = 1000; DWORD dwGold = 1000;
int iSplitCount = Random::get(10, 13); int iSplitCount = Random::get(10, 13);
sys_log(0, "WAEGU DropGoldOnHit %d times", GetMaxSP()); SPDLOG_TRACE("WAEGU DropGoldOnHit {} times", GetMaxSP());
for (int i = 1; i <= iSplitCount; ++i) for (int i = 1; i <= iSplitCount; ++i)
{ {
@ -2471,14 +2461,12 @@ static void GiveExp(LPCHARACTER from, LPCHARACTER to, int iExp)
} }
*/ */
if (test_server)
{ SPDLOG_TRACE("Bonus Exp : Ramadan Candy: {} MallExp: {} PointExp: {}",
sys_log(0, "Bonus Exp : Ramadan Candy: %d MallExp: %d PointExp: %d", to->GetPoint(POINT_RAMADAN_CANDY_BONUS_EXP),
to->GetPoint(POINT_RAMADAN_CANDY_BONUS_EXP), to->GetPoint(POINT_MALL_EXPBONUS),
to->GetPoint(POINT_MALL_EXPBONUS), to->GetPoint(POINT_EXP)
to->GetPoint(POINT_EXP) );
);
}
// 기획측 조정값 2005.04.21 현재 85% // 기획측 조정값 2005.04.21 현재 85%
iExp = iExp * CHARACTER_MANAGER::instance().GetMobExpRate(to) / 100; iExp = iExp * CHARACTER_MANAGER::instance().GetMobExpRate(to) / 100;
@ -2581,7 +2569,7 @@ namespace NPartyExpDistribute
break; break;
default: default:
sys_err("Unknown party exp distribution mode %d", m_iMode); SPDLOG_ERROR("Unknown party exp distribution mode {}", m_iMode);
return; return;
} }
@ -2705,8 +2693,6 @@ LPCHARACTER CHARACTER::DistributeExp()
di.pAttacker = pAttacker; di.pAttacker = pAttacker;
di.pParty = NULL; di.pParty = NULL;
//sys_log(0, "__ pq_damage %s %d", pAttacker->GetName(), iDam);
//pq_damage.push(di);
damage_info_table.push_back(di); damage_info_table.push_back(di);
} }
} }
@ -2714,7 +2700,6 @@ LPCHARACTER CHARACTER::DistributeExp()
for (std::map<LPPARTY, TDamageInfo>::iterator it = map_party_damage.begin(); it != map_party_damage.end(); ++it) for (std::map<LPPARTY, TDamageInfo>::iterator it = map_party_damage.begin(); it != map_party_damage.end(); ++it)
{ {
damage_info_table.push_back(it->second); damage_info_table.push_back(it->second);
//sys_log(0, "__ pq_damage_party [%u] %d", it->second.pParty->GetLeaderPID(), it->second.iDam);
} }
SetExp(0); SetExp(0);
@ -2725,16 +2710,13 @@ LPCHARACTER CHARACTER::DistributeExp()
if (m_pkChrStone) // 돌이 있을 경우 경험치의 반을 돌에게 넘긴다. if (m_pkChrStone) // 돌이 있을 경우 경험치의 반을 돌에게 넘긴다.
{ {
//sys_log(0, "__ Give half to Stone : %d", iExpToDistribute>>1);
int iExp = iExpToDistribute >> 1; int iExp = iExpToDistribute >> 1;
m_pkChrStone->SetExp(m_pkChrStone->GetExp() + iExp); m_pkChrStone->SetExp(m_pkChrStone->GetExp() + iExp);
iExpToDistribute -= iExp; iExpToDistribute -= iExp;
} }
sys_log(1, "%s total exp: %d, damage_info_table.size() == %d, TotalDam %d", SPDLOG_DEBUG("{} total exp: {}, damage_info_table.size() == {}, TotalDam {}",
GetName(), iExpToDistribute, damage_info_table.size(), iTotalDam); GetName(), iExpToDistribute, damage_info_table.size(), iTotalDam);
//sys_log(1, "%s total exp: %d, pq_damage.size() == %d, TotalDam %d",
//GetName(), iExpToDistribute, pq_damage.size(), iTotalDam);
if (damage_info_table.empty()) if (damage_info_table.empty())
return NULL; return NULL;
@ -2762,14 +2744,12 @@ LPCHARACTER CHARACTER::DistributeExp()
if (fPercent > 1.0f) if (fPercent > 1.0f)
{ {
sys_err("DistributeExp percent over 1.0 (fPercent %f name %s)", fPercent, di->pAttacker->GetName()); SPDLOG_ERROR("DistributeExp percent over 1.0 (fPercent {} name {})", fPercent, di->pAttacker->GetName());
fPercent = 1.0f; fPercent = 1.0f;
} }
iExp += (int) (iExpToDistribute * fPercent); iExp += (int) (iExpToDistribute * fPercent);
//sys_log(0, "%s given exp percent %.1f + 20 dam %d", GetName(), fPercent * 100.0f, di.iDam);
di->Distribute(this, iExp); di->Distribute(this, iExp);
// 100% 다 먹었으면 리턴한다. // 100% 다 먹었으면 리턴한다.
@ -2791,11 +2771,10 @@ LPCHARACTER CHARACTER::DistributeExp()
if (fPercent > 1.0f) if (fPercent > 1.0f)
{ {
sys_err("DistributeExp percent over 1.0 (fPercent %f name %s)", fPercent, di.pAttacker->GetName()); SPDLOG_ERROR("DistributeExp percent over 1.0 (fPercent {} name {})", fPercent, di.pAttacker->GetName());
fPercent = 1.0f; fPercent = 1.0f;
} }
//sys_log(0, "%s given exp percent %.1f dam %d", GetName(), fPercent * 100.0f, di.iDam);
di.Distribute(this, (int) (iExpToDistribute * fPercent)); di.Distribute(this, (int) (iExpToDistribute * fPercent));
} }
} }
@ -2840,7 +2819,7 @@ void CHARACTER::UseArrow(LPITEM pkArrow, DWORD dwArrowCount)
{ {
LPITEM pkNewArrow = FindSpecifyItem(dwVnum); LPITEM pkNewArrow = FindSpecifyItem(dwVnum);
sys_log(0, "UseArrow : FindSpecifyItem %u %p", dwVnum, get_pointer(pkNewArrow)); SPDLOG_DEBUG("UseArrow : FindSpecifyItem {} {}", dwVnum, (void*) get_pointer(pkNewArrow));
if (pkNewArrow) if (pkNewArrow)
EquipItem(pkNewArrow); EquipItem(pkNewArrow);
@ -2926,8 +2905,6 @@ class CFuncShoot
// 데미지 계산 // 데미지 계산
iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_BOW)) / 100; iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_BOW)) / 100;
//sys_log(0, "%s arrow %s dam %d", m_me->GetName(), pkVictim->GetName(), iDam);
m_me->OnMove(true); m_me->OnMove(true);
pkVictim->OnMove(); pkVictim->OnMove();
@ -2953,8 +2930,6 @@ class CFuncShoot
// 데미지 계산 // 데미지 계산
iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_MAGIC)) / 100; iDam = iDam * (100 - pkVictim->GetPoint(POINT_RESIST_MAGIC)) / 100;
//sys_log(0, "%s arrow %s dam %d", m_me->GetName(), pkVictim->GetName(), iDam);
m_me->OnMove(true); m_me->OnMove(true);
pkVictim->OnMove(); pkVictim->OnMove();
@ -3007,7 +2982,7 @@ class CFuncShoot
if (pkVictim->CanBeginFight()) if (pkVictim->CanBeginFight())
pkVictim->BeginFight(m_me); pkVictim->BeginFight(m_me);
sys_log(0, "%s kwankeyok %s", m_me->GetName(), pkVictim->GetName()); SPDLOG_DEBUG("{} kwankeyok {}", m_me->GetName(), pkVictim->GetName());
m_me->ComputeSkill(m_bType, pkVictim); m_me->ComputeSkill(m_bType, pkVictim);
m_me->UseArrow(pkArrow, iUseArrow); m_me->UseArrow(pkArrow, iUseArrow);
} }
@ -3025,7 +3000,7 @@ class CFuncShoot
if (pkVictim->CanBeginFight()) if (pkVictim->CanBeginFight())
pkVictim->BeginFight(m_me); pkVictim->BeginFight(m_me);
sys_log(0, "%s gigung %s", m_me->GetName(), pkVictim->GetName()); SPDLOG_DEBUG("{} gigung {}", m_me->GetName(), pkVictim->GetName());
m_me->ComputeSkill(m_bType, pkVictim); m_me->ComputeSkill(m_bType, pkVictim);
m_me->UseArrow(pkArrow, iUseArrow); m_me->UseArrow(pkArrow, iUseArrow);
} }
@ -3043,7 +3018,7 @@ class CFuncShoot
if (pkVictim->CanBeginFight()) if (pkVictim->CanBeginFight())
pkVictim->BeginFight(m_me); pkVictim->BeginFight(m_me);
sys_log(0, "%s hwajo %s", m_me->GetName(), pkVictim->GetName()); SPDLOG_DEBUG("{} hwajo {}", m_me->GetName(), pkVictim->GetName());
m_me->ComputeSkill(m_bType, pkVictim); m_me->ComputeSkill(m_bType, pkVictim);
m_me->UseArrow(pkArrow, iUseArrow); m_me->UseArrow(pkArrow, iUseArrow);
} }
@ -3062,7 +3037,7 @@ class CFuncShoot
if (pkVictim->CanBeginFight()) if (pkVictim->CanBeginFight())
pkVictim->BeginFight(m_me); pkVictim->BeginFight(m_me);
sys_log(0, "%s horse_wildattack %s", m_me->GetName(), pkVictim->GetName()); SPDLOG_DEBUG("{} horse_wildattack {}", m_me->GetName(), pkVictim->GetName());
m_me->ComputeSkill(m_bType, pkVictim); m_me->ComputeSkill(m_bType, pkVictim);
m_me->UseArrow(pkArrow, iUseArrow); m_me->UseArrow(pkArrow, iUseArrow);
} }
@ -3087,7 +3062,7 @@ class CFuncShoot
if (pkVictim->CanBeginFight()) if (pkVictim->CanBeginFight())
pkVictim->BeginFight(m_me); pkVictim->BeginFight(m_me);
sys_log(0, "%s - Skill %d -> %s", m_me->GetName(), m_bType, pkVictim->GetName()); SPDLOG_DEBUG("{} - Skill {} -> {}", m_me->GetName(), m_bType, pkVictim->GetName());
m_me->ComputeSkill(m_bType, pkVictim); m_me->ComputeSkill(m_bType, pkVictim);
} }
break; break;
@ -3100,7 +3075,7 @@ class CFuncShoot
if (pkVictim->CanBeginFight()) if (pkVictim->CanBeginFight())
pkVictim->BeginFight(m_me); pkVictim->BeginFight(m_me);
sys_log(0, "%s - Skill %d -> %s", m_me->GetName(), m_bType, pkVictim->GetName()); SPDLOG_DEBUG("{} - Skill {} -> {}", m_me->GetName(), m_bType, pkVictim->GetName());
m_me->ComputeSkill(m_bType, pkVictim); m_me->ComputeSkill(m_bType, pkVictim);
// TODO 여러명에게 슉 슉 슉 하기 // TODO 여러명에게 슉 슉 슉 하기
@ -3128,7 +3103,7 @@ class CFuncShoot
break;*/ break;*/
default: default:
sys_err("CFuncShoot: I don't know this type [%d] of range attack.", (int) m_bType); SPDLOG_ERROR("CFuncShoot: I don't know this type [{}] of range attack.", (int) m_bType);
break; break;
} }
@ -3138,7 +3113,7 @@ class CFuncShoot
bool CHARACTER::Shoot(BYTE bType) bool CHARACTER::Shoot(BYTE bType)
{ {
sys_log(1, "Shoot %s type %u flyTargets.size %zu", GetName(), bType, m_vec_dwFlyTargets.size()); SPDLOG_DEBUG("Shoot {} type {} flyTargets.size {}", GetName(), bType, m_vec_dwFlyTargets.size());
if (!CanMove()) if (!CanMove())
{ {
@ -3186,7 +3161,7 @@ void CHARACTER::FlyTarget(DWORD dwTargetVID, int x, int y, BYTE bHeader)
pack.y = y; pack.y = y;
} }
sys_log(1, "FlyTarget %s vid %d x %d y %d", GetName(), pack.dwTargetVID, pack.x, pack.y); SPDLOG_DEBUG("FlyTarget {} vid {} x {} y {}", GetName(), pack.dwTargetVID, pack.x, pack.y);
PacketAround(&pack, sizeof(pack), this); PacketAround(&pack, sizeof(pack), this);
} }
@ -3326,7 +3301,7 @@ void CHARACTER::SetKillerMode(bool isOn)
m_iKillerModePulse = thecore_pulse(); m_iKillerModePulse = thecore_pulse();
UpdatePacket(); UpdatePacket();
sys_log(0, "SetKillerMode Update %s[%d]", GetName(), GetPlayerID()); SPDLOG_DEBUG("SetKillerMode Update {}[{}]", GetName(), GetPlayerID());
} }
bool CHARACTER::IsKillerMode() const bool CHARACTER::IsKillerMode() const
@ -3359,7 +3334,7 @@ void CHARACTER::SetPKMode(BYTE bPKMode)
m_bPKMode = bPKMode; m_bPKMode = bPKMode;
UpdatePacket(); UpdatePacket();
sys_log(0, "PK_MODE: %s %d", GetName(), m_bPKMode); SPDLOG_DEBUG("PK_MODE: {} {}", GetName(), m_bPKMode);
} }
BYTE CHARACTER::GetPKMode() const BYTE CHARACTER::GetPKMode() const
@ -3562,7 +3537,6 @@ void CHARACTER::UpdateAggrPointEx(LPCHARACTER pAttacker, EDamageType type, int d
if (info.iAggro < 0) if (info.iAggro < 0)
info.iAggro = 0; info.iAggro = 0;
//sys_log(0, "UpdateAggrPointEx for %s by %s dam %d total %d", GetName(), pAttacker->GetName(), dam, total);
if (GetParty() && dam > 0 && type != DAMAGE_TYPE_SPECIAL) if (GetParty() && dam > 0 && type != DAMAGE_TYPE_SPECIAL)
{ {
LPPARTY pParty = GetParty(); LPPARTY pParty = GetParty();

View File

@ -125,7 +125,7 @@ bool CHARACTER::DragonSoul_RefineWindow_Open(LPENTITY pEntity)
if (NULL == d) if (NULL == d)
{ {
sys_err ("User(%s)'s DESC is NULL POINT.", GetName()); SPDLOG_ERROR("User({})'s DESC is NULL POINT.", GetName());
return false; return false;
} }

View File

@ -62,8 +62,7 @@ bool CHARACTER::StartRiding()
MountVnum(dwMountVnum); MountVnum(dwMountVnum);
if(test_server) SPDLOG_TRACE("Ride Horse : {} ", GetName());
sys_log(0, "Ride Horse : %s ", GetName());
return true; return true;
} }
@ -106,7 +105,7 @@ EVENTFUNC(horse_dead_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "horse_dead_event> <Factor> Null pointer" ); SPDLOG_ERROR("horse_dead_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -151,7 +150,7 @@ void CHARACTER::HorseSummon(bool bSummon, bool bFromFar, DWORD dwVnum, const cha
if (IsRiding()) if (IsRiding())
return; return;
sys_log(0, "HorseSummon : %s lv:%d bSummon:%d fromFar:%d", GetName(), GetLevel(), bSummon, bFromFar); SPDLOG_DEBUG("HorseSummon : {} lv:{} bSummon:{} fromFar:{}", GetName(), GetLevel(), bSummon, bFromFar);
int x = GetX(); int x = GetX();
int y = GetY(); int y = GetY();
@ -210,7 +209,7 @@ void CHARACTER::HorseSummon(bool bSummon, bool bFromFar, DWORD dwVnum, const cha
if (!m_chHorse->Show(GetMapIndex(), x, y, GetZ())) if (!m_chHorse->Show(GetMapIndex(), x, y, GetZ()))
{ {
M2_DESTROY_CHARACTER(m_chHorse); M2_DESTROY_CHARACTER(m_chHorse);
sys_err("cannot show monster"); SPDLOG_ERROR("cannot show monster");
m_chHorse = NULL; m_chHorse = NULL;
return; return;
} }

View File

@ -34,7 +34,6 @@
#include "castle.h" #include "castle.h"
#include "BattleArena.h" #include "BattleArena.h"
#include "arena.h" #include "arena.h"
#include "dev_log.h"
#include "pcbang.h" #include "pcbang.h"
#include "threeway_war.h" #include "threeway_war.h"
@ -246,14 +245,14 @@ LPITEM CHARACTER::GetItem(TItemPos Cell) const
case EQUIPMENT: case EQUIPMENT:
if (wCell >= INVENTORY_AND_EQUIP_SLOT_MAX) if (wCell >= INVENTORY_AND_EQUIP_SLOT_MAX)
{ {
sys_err("CHARACTER::GetInventoryItem: invalid item cell %d", wCell); SPDLOG_ERROR("CHARACTER::GetInventoryItem: invalid item cell {}", wCell);
return NULL; return NULL;
} }
return m_pointsInstant.pItems[wCell]; return m_pointsInstant.pItems[wCell];
case DRAGON_SOUL_INVENTORY: case DRAGON_SOUL_INVENTORY:
if (wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM) if (wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
{ {
sys_err("CHARACTER::GetInventoryItem: invalid DS item cell %d", wCell); SPDLOG_ERROR("CHARACTER::GetInventoryItem: invalid DS item cell {}", wCell);
return NULL; return NULL;
} }
return m_pointsInstant.pDSItems[wCell]; return m_pointsInstant.pDSItems[wCell];
@ -270,7 +269,7 @@ void CHARACTER::SetItem(TItemPos Cell, LPITEM pItem)
BYTE window_type = Cell.window_type; BYTE window_type = Cell.window_type;
if ((unsigned long)((CItem*)pItem) == 0xff || (unsigned long)((CItem*)pItem) == 0xffffffff) if ((unsigned long)((CItem*)pItem) == 0xff || (unsigned long)((CItem*)pItem) == 0xffffffff)
{ {
sys_err("!!! FATAL ERROR !!! item == 0xff (char: %s cell: %u)", GetName(), wCell); SPDLOG_ERROR("!!! FATAL ERROR !!! item == 0xff (char: {} cell: {})", GetName(), wCell);
core_dump(); core_dump();
return; return;
} }
@ -288,7 +287,7 @@ void CHARACTER::SetItem(TItemPos Cell, LPITEM pItem)
{ {
if (wCell >= INVENTORY_AND_EQUIP_SLOT_MAX) if (wCell >= INVENTORY_AND_EQUIP_SLOT_MAX)
{ {
sys_err("CHARACTER::SetItem: invalid item cell %d", wCell); SPDLOG_ERROR("CHARACTER::SetItem: invalid item cell {}", wCell);
return; return;
} }
@ -368,7 +367,7 @@ void CHARACTER::SetItem(TItemPos Cell, LPITEM pItem)
{ {
if (wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM) if (wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
{ {
sys_err("CHARACTER::SetItem: invalid DS item cell %d", wCell); SPDLOG_ERROR("CHARACTER::SetItem: invalid DS item cell {}", wCell);
return; return;
} }
@ -394,7 +393,7 @@ void CHARACTER::SetItem(TItemPos Cell, LPITEM pItem)
} }
break; break;
default: default:
sys_err ("Invalid Inventory type %d", window_type); SPDLOG_ERROR("Invalid Inventory type {}", window_type);
return; return;
} }
@ -457,7 +456,7 @@ LPITEM CHARACTER::GetWear(BYTE bCell) const
// > WEAR_MAX_NUM : 용혼석 슬롯들. // > WEAR_MAX_NUM : 용혼석 슬롯들.
if (bCell >= WEAR_MAX_NUM + DRAGON_SOUL_DECK_MAX_NUM * DS_SLOT_MAX) if (bCell >= WEAR_MAX_NUM + DRAGON_SOUL_DECK_MAX_NUM * DS_SLOT_MAX)
{ {
sys_err("CHARACTER::GetWear: invalid wear cell %d", bCell); SPDLOG_ERROR("CHARACTER::GetWear: invalid wear cell {}", bCell);
return NULL; return NULL;
} }
@ -469,7 +468,7 @@ void CHARACTER::SetWear(BYTE bCell, LPITEM item)
// > WEAR_MAX_NUM : 용혼석 슬롯들. // > WEAR_MAX_NUM : 용혼석 슬롯들.
if (bCell >= WEAR_MAX_NUM + DRAGON_SOUL_DECK_MAX_NUM * DS_SLOT_MAX) if (bCell >= WEAR_MAX_NUM + DRAGON_SOUL_DECK_MAX_NUM * DS_SLOT_MAX)
{ {
sys_err("CHARACTER::SetItem: invalid item cell %d", bCell); SPDLOG_ERROR("CHARACTER::SetItem: invalid item cell {}", bCell);
return; return;
} }
@ -815,7 +814,7 @@ bool CHARACTER::DoRefine(LPITEM item, bool bMoneyOnly)
{ {
if (get_global_time() < quest::CQuestManager::instance().GetEventFlag("update_refine_time") + (60 * 5)) if (get_global_time() < quest::CQuestManager::instance().GetEventFlag("update_refine_time") + (60 * 5))
{ {
sys_log(0, "can't refine %d %s", GetPlayerID(), GetName()); SPDLOG_DEBUG("can't refine {} {}", GetPlayerID(), GetName());
return false; return false;
} }
} }
@ -858,7 +857,7 @@ bool CHARACTER::DoRefine(LPITEM item, bool bMoneyOnly)
if (!pProto) if (!pProto)
{ {
sys_err("DoRefine NOT GET ITEM PROTO %d", item->GetRefinedVnum()); SPDLOG_ERROR("DoRefine NOT GET ITEM PROTO {}", item->GetRefinedVnum());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다.")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다."));
return false; return false;
} }
@ -937,18 +936,18 @@ bool CHARACTER::DoRefine(LPITEM item, bool bMoneyOnly)
pkNewItem->AddToCharacter(this, TItemPos(INVENTORY, bCell)); pkNewItem->AddToCharacter(this, TItemPos(INVENTORY, bCell));
ITEM_MANAGER::instance().FlushDelayedSave(pkNewItem); ITEM_MANAGER::instance().FlushDelayedSave(pkNewItem);
sys_log(0, "Refine Success %d", cost); SPDLOG_DEBUG("Refine Success {}", cost);
pkNewItem->AttrLog(); pkNewItem->AttrLog();
//PointChange(POINT_GOLD, -cost); //PointChange(POINT_GOLD, -cost);
sys_log(0, "PayPee %d", cost); SPDLOG_DEBUG("PayPee {}", cost);
PayRefineFee(cost); PayRefineFee(cost);
sys_log(0, "PayPee End %d", cost); SPDLOG_DEBUG("PayPee End {}", cost);
} }
else else
{ {
// DETAIL_REFINE_LOG // DETAIL_REFINE_LOG
// 아이템 생성에 실패 -> 개량 실패로 간주 // 아이템 생성에 실패 -> 개량 실패로 간주
sys_err("cannot create item %u", result_vnum); SPDLOG_ERROR("cannot create item {}", result_vnum);
NotifyRefineFail(this, item, IsRefineThroughGuild() ? "GUILD" : "POWER"); NotifyRefineFail(this, item, IsRefineThroughGuild() ? "GUILD" : "POWER");
// END_OF_DETAIL_REFINE_LOG // END_OF_DETAIL_REFINE_LOG
} }
@ -995,7 +994,7 @@ bool CHARACTER::DoRefineWithScroll(LPITEM item)
{ {
if (get_global_time() < quest::CQuestManager::instance().GetEventFlag("update_refine_time") + (60 * 5)) if (get_global_time() < quest::CQuestManager::instance().GetEventFlag("update_refine_time") + (60 * 5))
{ {
sys_log(0, "can't refine %d %s", GetPlayerID(), GetName()); SPDLOG_DEBUG("can't refine {} {}", GetPlayerID(), GetName());
return false; return false;
} }
} }
@ -1063,7 +1062,7 @@ bool CHARACTER::DoRefineWithScroll(LPITEM item)
if (!pProto) if (!pProto)
{ {
sys_err("DoRefineWithScroll NOT GET ITEM PROTO %d", item->GetRefinedVnum()); SPDLOG_ERROR("DoRefineWithScroll NOT GET ITEM PROTO {}", item->GetRefinedVnum());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다.")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다."));
return false; return false;
} }
@ -1142,7 +1141,7 @@ bool CHARACTER::DoRefineWithScroll(LPITEM item)
} }
else else
{ {
sys_err("REFINE : Unknown refine scroll item. Value0: %d", pkItemScroll->GetValue(0)); SPDLOG_ERROR("REFINE : Unknown refine scroll item. Value0: {}", pkItemScroll->GetValue(0));
} }
if (test_server) if (test_server)
@ -1214,7 +1213,7 @@ bool CHARACTER::DoRefineWithScroll(LPITEM item)
else else
{ {
// 아이템 생성에 실패 -> 개량 실패로 간주 // 아이템 생성에 실패 -> 개량 실패로 간주
sys_err("cannot create item %u", result_vnum); SPDLOG_ERROR("cannot create item {}", result_vnum);
NotifyRefineFail(this, item, szRefineType); NotifyRefineFail(this, item, szRefineType);
} }
} }
@ -1245,7 +1244,7 @@ bool CHARACTER::DoRefineWithScroll(LPITEM item)
else else
{ {
// 아이템 생성에 실패 -> 개량 실패로 간주 // 아이템 생성에 실패 -> 개량 실패로 간주
sys_err("cannot create item %u", result_fail_vnum); SPDLOG_ERROR("cannot create item {}", result_fail_vnum);
NotifyRefineFail(this, item, szRefineType); NotifyRefineFail(this, item, szRefineType);
} }
} }
@ -1287,7 +1286,7 @@ bool CHARACTER::RefineInformation(BYTE bCell, BYTE bType, int iAdditionalCell)
if (p.result_vnum == 0) if (p.result_vnum == 0)
{ {
sys_err("RefineInformation p.result_vnum == 0"); SPDLOG_ERROR("RefineInformation p.result_vnum == 0");
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다.")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다."));
return false; return false;
} }
@ -1317,7 +1316,7 @@ bool CHARACTER::RefineInformation(BYTE bCell, BYTE bType, int iAdditionalCell)
if (!prt) if (!prt)
{ {
sys_err("RefineInformation NOT GET REFINE SET %d", item->GetRefineSet()); SPDLOG_ERROR("RefineInformation NOT GET REFINE SET {}", item->GetRefineSet());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다.")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("이 아이템은 개량할 수 없습니다."));
return false; return false;
} }
@ -1433,7 +1432,7 @@ EVENTFUNC(kill_campfire_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "kill_campfire_event> <Factor> Null pointer" ); SPDLOG_ERROR("kill_campfire_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -1550,7 +1549,7 @@ void CHARACTER::ProcessRecallItem(LPITEM item)
} }
else else
{ {
sys_log(1, "Recall: %s %d %d -> %d %d", GetName(), GetX(), GetY(), item->GetSocket(0), item->GetSocket(1)); SPDLOG_DEBUG("Recall: {} {} {} -> {} {}", GetName(), GetX(), GetY(), item->GetSocket(0), item->GetSocket(1));
WarpSet(item->GetSocket(0), item->GetSocket(1)); WarpSet(item->GetSocket(0), item->GetSocket(1));
item->SetCount(item->GetCount() - 1); item->SetCount(item->GetCount() - 1);
} }
@ -1578,7 +1577,7 @@ void CHARACTER::SendMyShopPriceListCmd(DWORD dwItemVnum, DWORD dwItemPrice)
char szLine[256]; char szLine[256];
snprintf(szLine, sizeof(szLine), "MyShopPriceList %u %u", dwItemVnum, dwItemPrice); snprintf(szLine, sizeof(szLine), "MyShopPriceList %u %u", dwItemVnum, dwItemPrice);
ChatPacket(CHAT_TYPE_COMMAND, szLine); ChatPacket(CHAT_TYPE_COMMAND, szLine);
sys_log(0, szLine); SPDLOG_DEBUG(szLine);
} }
// //
@ -1696,10 +1695,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
} }
} }
if (test_server) SPDLOG_TRACE("USE_ITEM {}, Inven {}, Cell {}, ItemType {}, SubType {}", item->GetName(), bDestInven, wDestCell, item->GetType(), item->GetSubType());
{
sys_log(0, "USE_ITEM %s, Inven %d, Cell %d, ItemType %d, SubType %d", item->GetName(), bDestInven, wDestCell, item->GetType(), item->GetSubType());
}
if ( CArenaManager::instance().IsLimitedItem( GetMapIndex(), item->GetVnum() ) == true ) if ( CArenaManager::instance().IsLimitedItem( GetMapIndex(), item->GetVnum() ) == true )
{ {
@ -1854,7 +1850,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
{ {
if (item->GetSubType() == USE_SPECIAL) if (item->GetSubType() == USE_SPECIAL)
{ {
sys_log(0, "ITEM_UNIQUE: USE_SPECIAL %u", item->GetVnum()); SPDLOG_DEBUG("ITEM_UNIQUE: USE_SPECIAL {}", item->GetVnum());
switch (item->GetVnum()) switch (item->GetVnum())
{ {
@ -2166,8 +2162,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
{ {
if (item->GetVnum() > 50800 && item->GetVnum() <= 50820) if (item->GetVnum() > 50800 && item->GetVnum() <= 50820)
{ {
if (test_server) SPDLOG_TRACE("ADD addtional effect : vnum({}) subtype({})", item->GetOriginalVnum(), item->GetSubType());
sys_log (0, "ADD addtional effect : vnum(%d) subtype(%d)", item->GetOriginalVnum(), item->GetSubType());
int affect_type = AFFECT_EXP_BONUS_EURO_FREE; int affect_type = AFFECT_EXP_BONUS_EURO_FREE;
int apply_type = aApplyInfo[item->GetValue(0)].bPointType; int apply_type = aApplyInfo[item->GetValue(0)].bPointType;
@ -2355,10 +2350,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
} }
} }
if (test_server) SPDLOG_TRACE("USE_ITEM {} Type {} SubType {} vnum {}", item->GetName(), item->GetType(), item->GetSubType(), item->GetOriginalVnum());
{
sys_log (0, "USE_ITEM %s Type %d SubType %d vnum %d", item->GetName(), item->GetType(), item->GetSubType(), item->GetOriginalVnum());
}
switch (item->GetSubType()) switch (item->GetSubType())
{ {
@ -3408,7 +3400,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
int delta = std::min(-GetAlignment(), item->GetValue(0)); int delta = std::min(-GetAlignment(), item->GetValue(0));
sys_log(0, "%s ALIGNMENT ITEM %d", GetName(), delta); SPDLOG_DEBUG("{} ALIGNMENT ITEM {}", GetName(), delta);
UpdateAlignment(delta); UpdateAlignment(delta);
item->SetCount(item->GetCount() - 1); item->SetCount(item->GetCount() - 1);
@ -4387,7 +4379,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
} }
else else
{ {
sys_err("CHARACTER::UseItem : cannot find spawn position (name %s, %d x %d)", GetName(), GetX(), GetY()); SPDLOG_ERROR("CHARACTER::UseItem : cannot find spawn position (name {}, {} x {})", GetName(), GetX(), GetY());
} }
} }
else else
@ -4758,7 +4750,7 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
else else
{ {
// wtf ?! // wtf ?!
sys_err("ADD_ATTRIBUTE2 : Item has wrong AttributeCount(%d)", item2->GetAttributeCount()); SPDLOG_ERROR("ADD_ATTRIBUTE2 : Item has wrong AttributeCount({})", item2->GetAttributeCount());
} }
break; break;
@ -5081,13 +5073,13 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
case ITEM_BLEND: case ITEM_BLEND:
// 새로운 약초들 // 새로운 약초들
sys_log(0,"ITEM_BLEND!!"); SPDLOG_DEBUG("ITEM_BLEND!!");
if (Blend_Item_find(item->GetVnum())) if (Blend_Item_find(item->GetVnum()))
{ {
int affect_type = AFFECT_BLEND; int affect_type = AFFECT_BLEND;
if (item->GetSocket(0) >= _countof(aApplyInfo)) if (item->GetSocket(0) >= _countof(aApplyInfo))
{ {
sys_err ("INVALID BLEND ITEM(id : %d, vnum : %d). APPLY TYPE IS %d.", item->GetID(), item->GetVnum(), item->GetSocket(0)); SPDLOG_ERROR("INVALID BLEND ITEM(id : {}, vnum : {}). APPLY TYPE IS {}.", item->GetID(), item->GetVnum(), item->GetSocket(0));
return false; return false;
} }
int apply_type = aApplyInfo[item->GetSocket(0)].bPointType; int apply_type = aApplyInfo[item->GetSocket(0)].bPointType;
@ -5140,11 +5132,11 @@ bool CHARACTER::UseItemEx(LPITEM item, TItemPos DestCell)
break; break;
case ITEM_NONE: case ITEM_NONE:
sys_err("Item type NONE %s", item->GetName()); SPDLOG_ERROR("Item type NONE {}", item->GetName());
break; break;
default: default:
sys_log(0, "UseItemEx: Unknown type %s %d", item->GetName(), item->GetType()); SPDLOG_WARN("UseItemEx: Unknown type {} {}", item->GetName(), item->GetType());
return false; return false;
} }
@ -5167,7 +5159,7 @@ bool CHARACTER::UseItem(TItemPos Cell, TItemPos DestCell)
if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell))) if (!IsValidItemPosition(Cell) || !(item = GetItem(Cell)))
return false; return false;
sys_log(0, "%s: USE_ITEM %s (inven %d, cell: %d)", GetName(), item->GetName(), window_type, wCell); SPDLOG_DEBUG("{}: USE_ITEM {} (inven {}, cell: {})", GetName(), item->GetName(), window_type, wCell);
if (item->IsExchanging()) if (item->IsExchanging())
return false; return false;
@ -5391,8 +5383,7 @@ bool CHARACTER::DropItem(TItemPos Cell, BYTE bCount)
{ {
if (bCount == 0) if (bCount == 0)
{ {
if (test_server) SPDLOG_TRACE("[DROP_ITEM] drop item count == 0");
sys_log(0, "[DROP_ITEM] drop item count == 0");
return false; return false;
} }
@ -5594,7 +5585,7 @@ bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, BYTE count)
if (count == 0) if (count == 0)
count = item->GetCount(); count = item->GetCount();
sys_log(0, "%s: ITEM_STACK %s (window: %d, cell : %d) -> (window:%d, cell %d) count %d", GetName(), item->GetName(), Cell.window_type, Cell.cell, SPDLOG_DEBUG("{}: ITEM_STACK {} (window: {}, cell : {}) -> (window:{}, cell {}) count {}", GetName(), item->GetName(), Cell.window_type, Cell.cell,
DestCell.window_type, DestCell.cell, count); DestCell.window_type, DestCell.cell, count);
count = std::min<BYTE>(200 - item2->GetCount(), count); count = std::min<BYTE>(200 - item2->GetCount(), count);
@ -5609,7 +5600,7 @@ bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, BYTE count)
if (count == 0 || count >= item->GetCount() || !item->IsStackable() || IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_STACK)) if (count == 0 || count >= item->GetCount() || !item->IsStackable() || IS_SET(item->GetAntiFlag(), ITEM_ANTIFLAG_STACK))
{ {
sys_log(0, "%s: ITEM_MOVE %s (window: %d, cell : %d) -> (window:%d, cell %d) count %d", GetName(), item->GetName(), Cell.window_type, Cell.cell, SPDLOG_DEBUG("{}: ITEM_MOVE {} (window: {}, cell : {}) -> (window:{}, cell {}) count {}", GetName(), item->GetName(), Cell.window_type, Cell.cell,
DestCell.window_type, DestCell.cell, count); DestCell.window_type, DestCell.cell, count);
item->RemoveFromCharacter(); item->RemoveFromCharacter();
@ -5629,7 +5620,7 @@ bool CHARACTER::MoveItem(TItemPos Cell, TItemPos DestCell, BYTE count)
// } // }
//} //}
sys_log(0, "%s: ITEM_SPLIT %s (window: %d, cell : %d) -> (window:%d, cell %d) count %d", GetName(), item->GetName(), Cell.window_type, Cell.cell, SPDLOG_DEBUG("{}: ITEM_SPLIT {} (window: {}, cell : {}) -> (window:{}, cell {}) count {}", GetName(), item->GetName(), Cell.window_type, Cell.cell,
DestCell.window_type, DestCell.cell, count); DestCell.window_type, DestCell.cell, count);
item->SetCount(item->GetCount() - count); item->SetCount(item->GetCount() - count);
@ -5716,7 +5707,7 @@ void CHARACTER::GiveGold(int iAmount)
if (iAmount <= 0) if (iAmount <= 0)
return; return;
sys_log(0, "GIVE_GOLD: %s %d", GetName(), iAmount); SPDLOG_DEBUG("GIVE_GOLD: {} {}", GetName(), iAmount);
if (GetParty()) if (GetParty())
{ {
@ -5839,7 +5830,7 @@ bool CHARACTER::PickupItem(DWORD dwVID)
{ {
if ((iEmptyCell = GetEmptyDragonSoulInventory(item)) == -1) if ((iEmptyCell = GetEmptyDragonSoulInventory(item)) == -1)
{ {
sys_log(0, "No empty ds inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID()); SPDLOG_DEBUG("No empty ds inventory pid {} size {}d itemid {}", GetPlayerID(), item->GetSize(), item->GetID());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지하고 있는 아이템이 너무 많습니다.")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지하고 있는 아이템이 너무 많습니다."));
return false; return false;
} }
@ -5848,7 +5839,7 @@ bool CHARACTER::PickupItem(DWORD dwVID)
{ {
if ((iEmptyCell = GetEmptyInventory(item->GetSize())) == -1) if ((iEmptyCell = GetEmptyInventory(item->GetSize())) == -1)
{ {
sys_log(0, "No empty inventory pid %u size %ud itemid %u", GetPlayerID(), item->GetSize(), item->GetID()); SPDLOG_DEBUG("No empty inventory pid {} size {}d itemid {}", GetPlayerID(), item->GetSize(), item->GetID());
ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지하고 있는 아이템이 너무 많습니다.")); ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소지하고 있는 아이템이 너무 많습니다."));
return false; return false;
} }
@ -5980,7 +5971,7 @@ bool CHARACTER::SwapItem(BYTE bCell, BYTE bDestCell)
if (item1 == item2) if (item1 == item2)
{ {
sys_log(0, "[WARNING][WARNING][HACK USER!] : %s %d %d", m_stName.c_str(), bCell, bDestCell); SPDLOG_WARN("[WARNING][WARNING][HACK USER!] : {} {} {}", m_stName.c_str(), bCell, bDestCell);
return false; return false;
} }
@ -6006,7 +5997,7 @@ bool CHARACTER::SwapItem(BYTE bCell, BYTE bDestCell)
if (item1->EquipTo(this, bEquipCell)) if (item1->EquipTo(this, bEquipCell))
item2->AddToCharacter(this, TItemPos(INVENTORY, bInvenCell)); item2->AddToCharacter(this, TItemPos(INVENTORY, bInvenCell));
else else
sys_err("SwapItem cannot equip %s! item1 %s", item2->GetName(), item1->GetName()); SPDLOG_ERROR("SwapItem cannot equip {}! item1 {}", item2->GetName(), item1->GetName());
} }
else else
{ {
@ -6401,7 +6392,7 @@ void CHARACTER::RemoveSpecifyItem(DWORD vnum, DWORD count)
// 예외처리가 약하다. // 예외처리가 약하다.
if (count) if (count)
sys_log(0, "CHARACTER::RemoveSpecifyItem cannot remove enough item vnum %u, still remain %d", vnum, count); SPDLOG_WARN("CHARACTER::RemoveSpecifyItem cannot remove enough item vnum {}, still remain {}", vnum, count);
} }
int CHARACTER::CountSpecifyTypeItem(BYTE type) const int CHARACTER::CountSpecifyTypeItem(BYTE type) const
@ -6461,12 +6452,12 @@ void CHARACTER::AutoGiveItem(LPITEM item, bool longOwnerShip)
{ {
if (NULL == item) if (NULL == item)
{ {
sys_err ("NULL point."); SPDLOG_ERROR("NULL point.");
return; return;
} }
if (item->GetOwner()) if (item->GetOwner())
{ {
sys_err ("item %d 's owner exists!",item->GetID()); SPDLOG_ERROR("item {} 's owner exists!",item->GetID());
return; return;
} }
@ -6561,7 +6552,7 @@ LPITEM CHARACTER::AutoGiveItem(DWORD dwItemVnum, BYTE bCount, int iRarePct, bool
if (!item) if (!item)
{ {
sys_err("cannot create item by vnum %u (name: %s)", dwItemVnum, GetName()); SPDLOG_ERROR("cannot create item by vnum {} (name: {})", dwItemVnum, GetName());
return NULL; return NULL;
} }
@ -6636,8 +6627,6 @@ LPITEM CHARACTER::AutoGiveItem(DWORD dwItemVnum, BYTE bCount, int iRarePct, bool
LogManager::instance().ItemLog(this, item, "SYSTEM_DROP", item->GetName()); LogManager::instance().ItemLog(this, item, "SYSTEM_DROP", item->GetName());
} }
sys_log(0,
"7: %d %d", dwItemVnum, bCount);
return item; return item;
} }
@ -6910,7 +6899,7 @@ void CHARACTER::ReceiveItem(LPCHARACTER from, LPITEM item)
break; break;
default: default:
sys_log(0, "TakeItem %s %d %s", from->GetName(), GetRaceNum(), item->GetName()); SPDLOG_DEBUG("TakeItem {} {} {}", from->GetName(), GetRaceNum(), item->GetName());
from->SetQuestNPCID(GetVID()); from->SetQuestNPCID(GetVID());
quest::CQuestManager::instance().TakeItem(from->GetPlayerID(), GetRaceNum(), item); quest::CQuestManager::instance().TakeItem(from->GetPlayerID(), GetRaceNum(), item);
break; break;
@ -6980,7 +6969,7 @@ bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD
if (!pGroup) if (!pGroup)
{ {
sys_err("cannot find special item group %d", dwGroupNum); SPDLOG_ERROR("cannot find special item group {}", dwGroupNum);
return false; return false;
} }
@ -7016,7 +7005,7 @@ bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD
case CSpecialItemGroup::MOB: case CSpecialItemGroup::MOB:
{ {
sys_log(0, "CSpecialItemGroup::MOB %d", dwCount); SPDLOG_DEBUG("CSpecialItemGroup::MOB {}", dwCount);
int x = GetX() + Random::get(-500, 500); int x = GetX() + Random::get(-500, 500);
int y = GetY() + Random::get(-500, 500); int y = GetY() + Random::get(-500, 500);
@ -7028,7 +7017,7 @@ bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD
break; break;
case CSpecialItemGroup::SLOW: case CSpecialItemGroup::SLOW:
{ {
sys_log(0, "CSpecialItemGroup::SLOW %d", -(int)dwCount); SPDLOG_DEBUG("CSpecialItemGroup::SLOW {}", -(int)dwCount);
AddAffect(AFFECT_SLOW, POINT_MOV_SPEED, -(int)dwCount, AFF_SLOW, 300, 0, true); AddAffect(AFFECT_SLOW, POINT_MOV_SPEED, -(int)dwCount, AFF_SLOW, 300, 0, true);
bSuccess = true; bSuccess = true;
} }
@ -7036,9 +7025,9 @@ bool CHARACTER::GiveItemFromSpecialItemGroup(DWORD dwGroupNum, std::vector<DWORD
case CSpecialItemGroup::DRAIN_HP: case CSpecialItemGroup::DRAIN_HP:
{ {
int iDropHP = GetMaxHP()*dwCount/100; int iDropHP = GetMaxHP()*dwCount/100;
sys_log(0, "CSpecialItemGroup::DRAIN_HP %d", -iDropHP); SPDLOG_DEBUG("CSpecialItemGroup::DRAIN_HP {}", -iDropHP);
iDropHP = std::min(iDropHP, GetHP()-1); iDropHP = std::min(iDropHP, GetHP()-1);
sys_log(0, "CSpecialItemGroup::DRAIN_HP %d", -iDropHP); SPDLOG_DEBUG("CSpecialItemGroup::DRAIN_HP {}", -iDropHP);
PointChange(POINT_HP, -iDropHP); PointChange(POINT_HP, -iDropHP);
bSuccess = true; bSuccess = true;
} }
@ -7180,7 +7169,7 @@ bool CHARACTER::ItemProcess_Polymorph(LPITEM item)
case 71093 : case 71093 :
{ {
// 둔갑구 처리 // 둔갑구 처리
sys_log(0, "USE_POLYMORPH_BALL PID(%d) vnum(%d)", GetPlayerID(), dwVnum); SPDLOG_DEBUG("USE_POLYMORPH_BALL PID({}) vnum({})", GetPlayerID(), dwVnum);
// 레벨 제한 체크 // 레벨 제한 체크
int iPolymorphLevelLimit = std::max(0, 20 - GetLevel() * 3 / 10); int iPolymorphLevelLimit = std::max(0, 20 - GetLevel() * 3 / 10);
@ -7218,7 +7207,7 @@ bool CHARACTER::ItemProcess_Polymorph(LPITEM item)
// 둔갑서 처리 // 둔갑서 처리
// 소켓0 소켓1 소켓2 // 소켓0 소켓1 소켓2
// 둔갑할 몬스터 번호 수련정도 둔갑서 레벨 // 둔갑할 몬스터 번호 수련정도 둔갑서 레벨
sys_log(0, "USE_POLYMORPH_BOOK: %s(%u) vnum(%u)", GetName(), GetPlayerID(), dwVnum); SPDLOG_DEBUG("USE_POLYMORPH_BOOK: {}({}) vnum({})", GetName(), GetPlayerID(), dwVnum);
if (CPolymorphUtils::instance().PolymorphCharacter(this, item, pMob) == true) if (CPolymorphUtils::instance().PolymorphCharacter(this, item, pMob) == true)
{ {
@ -7231,7 +7220,7 @@ bool CHARACTER::ItemProcess_Polymorph(LPITEM item)
break; break;
default : default :
sys_err("POLYMORPH invalid item passed PID(%d) vnum(%d)", GetPlayerID(), item->GetOriginalVnum()); SPDLOG_ERROR("POLYMORPH invalid item passed PID({}) vnum({})", GetPlayerID(), item->GetOriginalVnum());
return false; return false;
} }

View File

@ -110,7 +110,7 @@ void CHARACTER_MANAGER::DestroyCharacter(LPCHARACTER ch, const char* file, size_
// <Factor> Check whether it has been already deleted or not. // <Factor> Check whether it has been already deleted or not.
itertype(m_map_pkChrByVID) it = m_map_pkChrByVID.find(ch->GetVID()); itertype(m_map_pkChrByVID) it = m_map_pkChrByVID.find(ch->GetVID());
if (it == m_map_pkChrByVID.end()) { if (it == m_map_pkChrByVID.end()) {
sys_err("[CHARACTER_MANAGER::DestroyCharacter] <Factor> %d not found", (int)(ch->GetVID())); SPDLOG_ERROR("[CHARACTER_MANAGER::DestroyCharacter] <Factor> {} not found", (int)(ch->GetVID()));
return; // prevent duplicated destrunction return; // prevent duplicated destrunction
} }
@ -178,7 +178,7 @@ LPCHARACTER CHARACTER_MANAGER::Find(DWORD dwVID)
// <Factor> Added sanity check // <Factor> Added sanity check
LPCHARACTER found = it->second; LPCHARACTER found = it->second;
if (found != NULL && dwVID != (DWORD)found->GetVID()) { if (found != NULL && dwVID != (DWORD)found->GetVID()) {
sys_err("[CHARACTER_MANAGER::Find] <Factor> %u != %u", dwVID, (DWORD)found->GetVID()); SPDLOG_ERROR("[CHARACTER_MANAGER::Find] <Factor> {} != {}", dwVID, (DWORD)found->GetVID());
return NULL; return NULL;
} }
return found; return found;
@ -204,7 +204,7 @@ LPCHARACTER CHARACTER_MANAGER::FindByPID(DWORD dwPID)
// <Factor> Added sanity check // <Factor> Added sanity check
LPCHARACTER found = it->second; LPCHARACTER found = it->second;
if (found != NULL && dwPID != found->GetPlayerID()) { if (found != NULL && dwPID != found->GetPlayerID()) {
sys_err("[CHARACTER_MANAGER::FindByPID] <Factor> %u != %u", dwPID, found->GetPlayerID()); SPDLOG_ERROR("[CHARACTER_MANAGER::FindByPID] <Factor> {} != {}", dwPID, found->GetPlayerID());
return NULL; return NULL;
} }
return found; return found;
@ -222,7 +222,7 @@ LPCHARACTER CHARACTER_MANAGER::FindPC(const char * name)
// <Factor> Added sanity check // <Factor> Added sanity check
LPCHARACTER found = it->second; LPCHARACTER found = it->second;
if (found != NULL && strncasecmp(szName, found->GetName(), CHARACTER_NAME_MAX_LEN) != 0) { if (found != NULL && strncasecmp(szName, found->GetName(), CHARACTER_NAME_MAX_LEN) != 0) {
sys_err("[CHARACTER_MANAGER::FindPC] <Factor> %s != %s", name, found->GetName()); SPDLOG_ERROR("[CHARACTER_MANAGER::FindPC] <Factor> {} != {}", name, found->GetName());
return NULL; return NULL;
} }
return found; return found;
@ -234,7 +234,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
{ {
if (dwVnum == 5001 && !quest::CQuestManager::instance().GetEventFlag("japan_regen")) if (dwVnum == 5001 && !quest::CQuestManager::instance().GetEventFlag("japan_regen"))
{ {
sys_log(1, "WAEGU[5001] regen disabled."); SPDLOG_TRACE("WAEGU[5001] regen disabled.");
return NULL; return NULL;
} }
} }
@ -243,7 +243,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
{ {
if (dwVnum == 5002 && !quest::CQuestManager::instance().GetEventFlag("newyear_mob")) if (dwVnum == 5002 && !quest::CQuestManager::instance().GetEventFlag("newyear_mob"))
{ {
sys_log(1, "HAETAE (new-year-mob) [5002] regen disabled."); SPDLOG_TRACE("HAETAE (new-year-mob) [5002] regen disabled.");
return NULL; return NULL;
} }
} }
@ -252,7 +252,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
{ {
if (dwVnum == 5004 && !quest::CQuestManager::instance().GetEventFlag("independence_day")) if (dwVnum == 5004 && !quest::CQuestManager::instance().GetEventFlag("independence_day"))
{ {
sys_log(1, "INDEPENDECE DAY [5004] regen disabled."); SPDLOG_TRACE("INDEPENDECE DAY [5004] regen disabled.");
return NULL; return NULL;
} }
} }
@ -261,13 +261,13 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
if (!pkMob) if (!pkMob)
{ {
sys_err("no mob data for vnum %u", dwVnum); SPDLOG_ERROR("no mob data for vnum {}", dwVnum);
return NULL; return NULL;
} }
if (!map_allow_find(lMapIndex)) if (!map_allow_find(lMapIndex))
{ {
sys_err("not allowed map %u", lMapIndex); SPDLOG_ERROR("not allowed map {}", lMapIndex);
return NULL; return NULL;
} }
@ -301,7 +301,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
if (i == 2000) if (i == 2000)
{ {
sys_err("cannot find valid location"); SPDLOG_ERROR("cannot find valid location");
return NULL; return NULL;
} }
@ -309,7 +309,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
if (!sectree) if (!sectree)
{ {
sys_log(0, "SpawnMobRandomPosition: cannot create monster at non-exist sectree %d x %d (map %d)", x, y, lMapIndex); SPDLOG_ERROR("SpawnMobRandomPosition: cannot create monster at non-exist sectree {} x {} (map {})", x, y, lMapIndex);
return NULL; return NULL;
} }
@ -317,7 +317,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
if (!ch) if (!ch)
{ {
sys_log(0, "SpawnMobRandomPosition: cannot create new character"); SPDLOG_ERROR("SpawnMobRandomPosition: cannot create new character");
return NULL; return NULL;
} }
@ -333,7 +333,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
if (!ch->Show(lMapIndex, x, y, 0, false)) if (!ch->Show(lMapIndex, x, y, 0, false))
{ {
M2_DESTROY_CHARACTER(ch); M2_DESTROY_CHARACTER(ch);
sys_err(0, "SpawnMobRandomPosition: cannot show monster"); SPDLOG_ERROR("SpawnMobRandomPosition: cannot show monster");
return NULL; return NULL;
} }
@ -345,7 +345,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRandomPosition(DWORD dwVnum, int lMapInde
if (test_server) if (test_server)
SendNotice(buf); SendNotice(buf);
sys_log(0, buf); SPDLOG_DEBUG(buf);
return (ch); return (ch);
} }
@ -354,7 +354,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
const CMob * pkMob = CMobManager::instance().Get(dwVnum); const CMob * pkMob = CMobManager::instance().Get(dwVnum);
if (!pkMob) if (!pkMob)
{ {
sys_err("SpawnMob: no mob data for vnum %u", dwVnum); SPDLOG_ERROR("SpawnMob: no mob data for vnum {}", dwVnum);
return NULL; return NULL;
} }
@ -364,7 +364,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
if (!tree) if (!tree)
{ {
sys_log(0, "no sectree for spawn at %d %d mobvnum %d mapindex %d", x, y, dwVnum, lMapIndex); SPDLOG_ERROR("no sectree for spawn at {} {} mobvnum {} mapindex {}", x, y, dwVnum, lMapIndex);
return NULL; return NULL;
} }
@ -391,14 +391,14 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
} }
if (s_isLog) if (s_isLog)
sys_log(0, "SpawnMob: BLOCKED position for spawn %s %u at %d %d (attr %u)", pkMob->m_table.szName, dwVnum, x, y, dwAttr); SPDLOG_DEBUG("SpawnMob: BLOCKED position for spawn {} {} at {} {} (attr {})", pkMob->m_table.szName, dwVnum, x, y, dwAttr);
// END_OF_SPAWN_BLOCK_LOG // END_OF_SPAWN_BLOCK_LOG
return NULL; return NULL;
} }
if (IS_SET(dwAttr, ATTR_BANPK)) if (IS_SET(dwAttr, ATTR_BANPK))
{ {
sys_log(0, "SpawnMob: BAN_PK position for mob spawn %s %u at %d %d", pkMob->m_table.szName, dwVnum, x, y); SPDLOG_DEBUG("SpawnMob: BAN_PK position for mob spawn {} {} at {} {}", pkMob->m_table.szName, dwVnum, x, y);
return NULL; return NULL;
} }
} }
@ -407,7 +407,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
if (!sectree) if (!sectree)
{ {
sys_log(0, "SpawnMob: cannot create monster at non-exist sectree %d x %d (map %d)", x, y, lMapIndex); SPDLOG_ERROR("SpawnMob: cannot create monster at non-exist sectree {} x {} (map {})", x, y, lMapIndex);
return NULL; return NULL;
} }
@ -415,7 +415,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
if (!ch) if (!ch)
{ {
sys_log(0, "SpawnMob: cannot create new character"); SPDLOG_ERROR("SpawnMob: cannot create new character");
return NULL; return NULL;
} }
@ -434,7 +434,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMob(DWORD dwVnum, int lMapIndex, int x, int
if (bShow && !ch->Show(lMapIndex, x, y, z, bSpawnMotion)) if (bShow && !ch->Show(lMapIndex, x, y, z, bSpawnMotion))
{ {
M2_DESTROY_CHARACTER(ch); M2_DESTROY_CHARACTER(ch);
sys_log(0, "SpawnMob: cannot show monster"); SPDLOG_ERROR("SpawnMob: cannot show monster");
return NULL; return NULL;
} }
@ -466,7 +466,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnMobRange(DWORD dwVnum, int lMapIndex, int sx
if (ch) if (ch)
{ {
sys_log(1, "MOB_SPAWN: %s(%d) %dx%d", ch->GetName(), (DWORD) ch->GetVID(), ch->GetX(), ch->GetY()); SPDLOG_TRACE("MOB_SPAWN: {}({}) {}x{}", ch->GetName(), (DWORD) ch->GetVID(), ch->GetX(), ch->GetY());
if ( bAggressive ) if ( bAggressive )
ch->SetAggressive(); ch->SetAggressive();
return (ch); return (ch);
@ -487,7 +487,7 @@ bool CHARACTER_MANAGER::SpawnMoveGroup(DWORD dwVnum, int lMapIndex, int sx, int
if (!pkGroup) if (!pkGroup)
{ {
sys_err("NOT_EXIST_GROUP_VNUM(%u) Map(%u) ", dwVnum, lMapIndex); SPDLOG_ERROR("NOT_EXIST_GROUP_VNUM({}) Map({}) ", dwVnum, lMapIndex);
return false; return false;
} }
@ -557,7 +557,7 @@ bool CHARACTER_MANAGER::SpawnGroupGroup(DWORD dwVnum, int lMapIndex, int sx, int
} }
else else
{ {
sys_err( "NOT_EXIST_GROUP_GROUP_VNUM(%u) MAP(%ld)", dwVnum, lMapIndex ); SPDLOG_ERROR("NOT_EXIST_GROUP_GROUP_VNUM({}) MAP({})", dwVnum, lMapIndex );
return false; return false;
} }
} }
@ -568,7 +568,7 @@ LPCHARACTER CHARACTER_MANAGER::SpawnGroup(DWORD dwVnum, int lMapIndex, int sx, i
if (!pkGroup) if (!pkGroup)
{ {
sys_err("NOT_EXIST_GROUP_VNUM(%u) Map(%u) ", dwVnum, lMapIndex); SPDLOG_ERROR("NOT_EXIST_GROUP_VNUM({}) Map({}) ", dwVnum, lMapIndex);
return NULL; return NULL;
} }
@ -717,7 +717,7 @@ void CHARACTER_MANAGER::Update(int iPulse)
// 테스트 서버에서는 60초마다 캐릭터 개수를 센다 // 테스트 서버에서는 60초마다 캐릭터 개수를 센다
if (test_server && 0 == (iPulse % PASSES_PER_SEC(60))) if (test_server && 0 == (iPulse % PASSES_PER_SEC(60)))
sys_log(0, "CHARACTER COUNT vid %zu pid %zu", m_map_pkChrByVID.size(), m_map_pkChrByPID.size()); SPDLOG_TRACE("CHARACTER COUNT vid {} pid {}", m_map_pkChrByVID.size(), m_map_pkChrByPID.size());
// 지연된 DestroyCharacter 하기 // 지연된 DestroyCharacter 하기
FlushPendingDestroy(); FlushPendingDestroy();
@ -757,7 +757,6 @@ void CHARACTER_MANAGER::RemoveFromStateList(LPCHARACTER ch)
if (it != m_set_pkChrState.end()) if (it != m_set_pkChrState.end())
{ {
//sys_log(0, "RemoveFromStateList %p", ch);
m_set_pkChrState.erase(it); m_set_pkChrState.erase(it);
} }
} }
@ -838,7 +837,7 @@ void CHARACTER_MANAGER::RegisterRaceNumMap(LPCHARACTER ch)
if (m_set_dwRegisteredRaceNum.find(dwVnum) != m_set_dwRegisteredRaceNum.end()) // 등록된 번호 이면 if (m_set_dwRegisteredRaceNum.find(dwVnum) != m_set_dwRegisteredRaceNum.end()) // 등록된 번호 이면
{ {
sys_log(0, "RegisterRaceNumMap %s %u", ch->GetName(), dwVnum); SPDLOG_TRACE("RegisterRaceNumMap {} {}", ch->GetName(), dwVnum);
m_map_pkChrByRaceNum[dwVnum].insert(ch); m_map_pkChrByRaceNum[dwVnum].insert(ch);
} }
} }
@ -1074,7 +1073,7 @@ void CHARACTER_MANAGER::FlushPendingDestroy()
if (!m_set_pkChrPendingDestroy.empty()) if (!m_set_pkChrPendingDestroy.empty())
{ {
sys_log(0, "FlushPendingDestroy size %d", m_set_pkChrPendingDestroy.size()); SPDLOG_DEBUG("FlushPendingDestroy size {}", m_set_pkChrPendingDestroy.size());
CHARACTER_SET::iterator it = m_set_pkChrPendingDestroy.begin(), CHARACTER_SET::iterator it = m_set_pkChrPendingDestroy.begin(),
end = m_set_pkChrPendingDestroy.end(); end = m_set_pkChrPendingDestroy.end();

View File

@ -50,7 +50,7 @@ EVENTFUNC(poison_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "poison_event> <Factor> Null pointer" ); SPDLOG_ERROR("poison_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -103,7 +103,7 @@ EVENTFUNC(fire_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "fire_event> <Factor> Null pointer" ); SPDLOG_ERROR("fire_event> <Factor> Null pointer" );
return 0; return 0;
} }

View File

@ -47,7 +47,7 @@ time_t CHARACTER::GetSkillNextReadTime(DWORD dwVnum) const
{ {
if (dwVnum >= SKILL_MAX_NUM) if (dwVnum >= SKILL_MAX_NUM)
{ {
sys_err("vnum overflow (vnum: %u)", dwVnum); SPDLOG_ERROR("vnum overflow (vnum: {})", dwVnum);
return 0; return 0;
} }
@ -66,24 +66,24 @@ bool TSkillUseInfo::HitOnce(DWORD dwVnum)
if (!bUsed) if (!bUsed)
return false; return false;
sys_log(1, "__HitOnce NextUse %u current %u count %d scount %d", dwNextSkillUsableTime, get_dword_time(), iHitCount, iSplashCount); SPDLOG_DEBUG("__HitOnce NextUse {} current {} count {} scount {}", dwNextSkillUsableTime, get_dword_time(), iHitCount, iSplashCount);
if (dwNextSkillUsableTime && dwNextSkillUsableTime<get_dword_time() && dwVnum != SKILL_MUYEONG && dwVnum != SKILL_HORSE_WILDATTACK) if (dwNextSkillUsableTime && dwNextSkillUsableTime<get_dword_time() && dwVnum != SKILL_MUYEONG && dwVnum != SKILL_HORSE_WILDATTACK)
{ {
sys_log(1, "__HitOnce can't hit"); SPDLOG_DEBUG("__HitOnce can't hit");
return false; return false;
} }
if (iHitCount == -1) if (iHitCount == -1)
{ {
sys_log(1, "__HitOnce OK %d %d %d", dwNextSkillUsableTime, get_dword_time(), iHitCount); SPDLOG_DEBUG("__HitOnce OK {} {} {}", dwNextSkillUsableTime, get_dword_time(), iHitCount);
return true; return true;
} }
if (iHitCount) if (iHitCount)
{ {
sys_log(1, "__HitOnce OK %d %d %d", dwNextSkillUsableTime, get_dword_time(), iHitCount); SPDLOG_DEBUG("__HitOnce OK {} {} {}", dwNextSkillUsableTime, get_dword_time(), iHitCount);
iHitCount--; iHitCount--;
return true; return true;
} }
@ -100,7 +100,7 @@ bool TSkillUseInfo::UseSkill(bool isGrandMaster, DWORD vid, DWORD dwCooltime, in
// 아직 쿨타임이 끝나지 않았다. // 아직 쿨타임이 끝나지 않았다.
if (bUsed && dwNextSkillUsableTime > dwCur) if (bUsed && dwNextSkillUsableTime > dwCur)
{ {
sys_log(0, "cooltime is not over delta %u", dwNextSkillUsableTime - dwCur); SPDLOG_DEBUG("cooltime is not over delta {}", dwNextSkillUsableTime - dwCur);
iHitCount = 0; iHitCount = 0;
return false; return false;
} }
@ -115,8 +115,7 @@ bool TSkillUseInfo::UseSkill(bool isGrandMaster, DWORD vid, DWORD dwCooltime, in
iRange = range; iRange = range;
iMaxHitCount = iHitCount = hitcount; iMaxHitCount = iHitCount = hitcount;
if (test_server) SPDLOG_TRACE("UseSkill NextUse {} current {} cooltime {} hitcount {}/{}", dwNextSkillUsableTime, dwCur, dwCooltime, iHitCount, iMaxHitCount);
sys_log(0, "UseSkill NextUse %u current %u cooltime %d hitcount %d/%d", dwNextSkillUsableTime, dwCur, dwCooltime, iHitCount, iMaxHitCount);
dwVID = vid; dwVID = vid;
iSplashCount = splashcount; iSplashCount = splashcount;
@ -174,7 +173,7 @@ void CHARACTER::SetSkillLevel(DWORD dwVnum, BYTE bLev)
if (dwVnum >= SKILL_MAX_NUM) if (dwVnum >= SKILL_MAX_NUM)
{ {
sys_err("vnum overflow (vnum %u)", dwVnum); SPDLOG_ERROR("vnum overflow (vnum {})", dwVnum);
return; return;
} }
@ -272,7 +271,7 @@ bool CHARACTER::LearnGrandMasterSkill(DWORD dwSkillVnum)
return false; return false;
} }
sys_log(0, "learn grand master skill[%d] cur %d, next %d", dwSkillVnum, get_global_time(), GetSkillNextReadTime(dwSkillVnum)); SPDLOG_DEBUG("learn grand master skill[{}] cur {}, next {}", dwSkillVnum, get_global_time(), GetSkillNextReadTime(dwSkillVnum));
/* /*
if (get_global_time() < GetSkillNextReadTime(dwSkillVnum)) if (get_global_time() < GetSkillNextReadTime(dwSkillVnum))
@ -322,7 +321,7 @@ bool CHARACTER::LearnGrandMasterSkill(DWORD dwSkillVnum)
int idx = std::min(9, GetSkillLevel(dwSkillVnum) - 30); int idx = std::min(9, GetSkillLevel(dwSkillVnum) - 30);
sys_log(0, "LearnGrandMasterSkill %s table idx %d value %d", GetName(), idx, aiGrandMasterSkillBookCountForLevelUp[idx]); SPDLOG_DEBUG("LearnGrandMasterSkill {} table idx {} value {}", GetName(), idx, aiGrandMasterSkillBookCountForLevelUp[idx]);
int iTotalReadCount = GetQuestFlag(strTrainSkill) + 1; int iTotalReadCount = GetQuestFlag(strTrainSkill) + 1;
SetQuestFlag(strTrainSkill, iTotalReadCount); SetQuestFlag(strTrainSkill, iTotalReadCount);
@ -365,11 +364,11 @@ bool CHARACTER::LearnGrandMasterSkill(DWORD dwSkillVnum)
} }
int n = Random::get(1, iBookCount); int n = Random::get(1, iBookCount);
sys_log(0, "Number(%d)", n); SPDLOG_TRACE("Number({})", n);
DWORD nextTime = get_global_time() + Random::get(28800, 43200); DWORD nextTime = get_global_time() + Random::get(28800, 43200);
sys_log(0, "GrandMaster SkillBookCount min %d cur %d max %d (next_time=%d)", iMinReadCount, iTotalReadCount, iMaxReadCount, nextTime); SPDLOG_DEBUG("GrandMaster SkillBookCount min {} cur {} max {} (next_time={})", iMinReadCount, iTotalReadCount, iMaxReadCount, nextTime);
bool bSuccess = n == 2; bool bSuccess = n == 2;
@ -483,26 +482,24 @@ bool CHARACTER::LearnSkillByBook(DWORD dwSkillVnum, BYTE bProb)
} }
// END_OF_SKILL_BOOK_BONUS // END_OF_SKILL_BOOK_BONUS
sys_log(0, "LearnSkillByBook Pct %u prob %d", dwSkillVnum, bProb); SPDLOG_DEBUG("LearnSkillByBook Pct {} prob {}", dwSkillVnum, bProb);
if (Random::get(1, 100) <= bProb) if (Random::get(1, 100) <= bProb)
{ {
if (test_server) SPDLOG_TRACE("LearnSkillByBook {} SUCC", dwSkillVnum);
sys_log(0, "LearnSkillByBook %u SUCC", dwSkillVnum);
SkillLevelUp(dwSkillVnum, SKILL_UP_BY_BOOK); SkillLevelUp(dwSkillVnum, SKILL_UP_BY_BOOK);
} }
else else
{ {
if (test_server) SPDLOG_TRACE("LearnSkillByBook {} FAIL", dwSkillVnum);
sys_log(0, "LearnSkillByBook %u FAIL", dwSkillVnum);
} }
} }
else else
{ {
int idx = std::min(9, GetSkillLevel(dwSkillVnum) - 20); int idx = std::min(9, GetSkillLevel(dwSkillVnum) - 20);
sys_log(0, "LearnSkillByBook %s table idx %d value %d", GetName(), idx, aiSkillBookCountForLevelUp[idx]); SPDLOG_DEBUG("LearnSkillByBook {} table idx {} value {}", GetName(), idx, aiSkillBookCountForLevelUp[idx]);
if (!LC_IsYMIR()) if (!LC_IsYMIR())
{ {
@ -635,7 +632,7 @@ bool CHARACTER::SkillLevelDown(DWORD dwVnum)
if (!pkSk) if (!pkSk)
{ {
sys_err("There is no such skill by number %u", dwVnum); SPDLOG_ERROR("There is no such skill by number {}", dwVnum);
return false; return false;
} }
@ -671,7 +668,7 @@ bool CHARACTER::SkillLevelDown(DWORD dwVnum)
idx = POINT_HORSE_SKILL; idx = POINT_HORSE_SKILL;
break; break;
default: default:
sys_err("Wrong skill type %d skill vnum %d", pkSk->dwType, pkSk->dwVnum); SPDLOG_ERROR("Wrong skill type {} skill vnum {}", pkSk->dwType, pkSk->dwVnum);
return false; return false;
} }
@ -679,7 +676,7 @@ bool CHARACTER::SkillLevelDown(DWORD dwVnum)
PointChange(idx, +1); PointChange(idx, +1);
SetSkillLevel(pkSk->dwVnum, m_pSkillLevels[pkSk->dwVnum].bLevel - 1); SetSkillLevel(pkSk->dwVnum, m_pSkillLevels[pkSk->dwVnum].bLevel - 1);
sys_log(0, "SkillDown: %s %u %u %u type %u", GetName(), pkSk->dwVnum, m_pSkillLevels[pkSk->dwVnum].bMasterType, m_pSkillLevels[pkSk->dwVnum].bLevel, pkSk->dwType); SPDLOG_DEBUG("SkillDown: {} {} {} {} type {}", GetName(), pkSk->dwVnum, m_pSkillLevels[pkSk->dwVnum].bMasterType, m_pSkillLevels[pkSk->dwVnum].bLevel, pkSk->dwType);
Save(); Save();
ComputePoints(); ComputePoints();
@ -711,13 +708,13 @@ void CHARACTER::SkillLevelUp(DWORD dwVnum, BYTE bMethod)
if (!pkSk) if (!pkSk)
{ {
sys_err("There is no such skill by number (vnum %u)", dwVnum); SPDLOG_ERROR("There is no such skill by number (vnum {})", dwVnum);
return; return;
} }
if (pkSk->dwVnum >= SKILL_MAX_NUM) if (pkSk->dwVnum >= SKILL_MAX_NUM)
{ {
sys_err("Skill Vnum overflow (vnum %u)", dwVnum); SPDLOG_ERROR("Skill Vnum overflow (vnum {})", dwVnum);
return; return;
} }
@ -789,7 +786,7 @@ void CHARACTER::SkillLevelUp(DWORD dwVnum, BYTE bMethod)
break; break;
default: default:
sys_err("Wrong skill type %d skill vnum %d", pkSk->dwType, pkSk->dwVnum); SPDLOG_ERROR("Wrong skill type {} skill vnum {}", pkSk->dwType, pkSk->dwVnum);
return; return;
} }
@ -846,7 +843,7 @@ void CHARACTER::SkillLevelUp(DWORD dwVnum, BYTE bMethod)
snprintf(szSkillUp, sizeof(szSkillUp), "SkillUp: %s %u %d %d[Before:%d] type %u", snprintf(szSkillUp, sizeof(szSkillUp), "SkillUp: %s %u %d %d[Before:%d] type %u",
GetName(), pkSk->dwVnum, m_pSkillLevels[pkSk->dwVnum].bMasterType, m_pSkillLevels[pkSk->dwVnum].bLevel, SkillPointBefore, pkSk->dwType); GetName(), pkSk->dwVnum, m_pSkillLevels[pkSk->dwVnum].bMasterType, m_pSkillLevels[pkSk->dwVnum].bLevel, SkillPointBefore, pkSk->dwType);
sys_log(0, "%s", szSkillUp); SPDLOG_DEBUG("{}", szSkillUp);
LogManager::instance().CharLog(this, pkSk->dwVnum, "SKILLUP", szSkillUp); LogManager::instance().CharLog(this, pkSk->dwVnum, "SKILLUP", szSkillUp);
Save(); Save();
@ -904,7 +901,7 @@ void CHARACTER::ComputePassiveSkill(DWORD dwVnum)
pkSk->SetPointVar("k", GetSkillLevel(dwVnum)); pkSk->SetPointVar("k", GetSkillLevel(dwVnum));
int iAmount = (int) pkSk->kPointPoly.Eval(); int iAmount = (int) pkSk->kPointPoly.Eval();
sys_log(2, "%s passive #%d on %d amount %d", GetName(), dwVnum, pkSk->bPointOn, iAmount); SPDLOG_TRACE("{} passive #{} on {} amount {}", GetName(), dwVnum, pkSk->bPointOn, iAmount);
PointChange(pkSk->bPointOn, iAmount); PointChange(pkSk->bPointOn, iAmount);
} }
@ -991,11 +988,11 @@ EVENTFUNC(ChainLightningEvent)
if (!pkChr || !pkChrVictim) if (!pkChr || !pkChrVictim)
{ {
sys_log(1, "use chainlighting, but no character"); SPDLOG_DEBUG("use chainlighting, but no character");
return 0; return 0;
} }
sys_log(1, "chainlighting event %s", pkChr->GetName()); SPDLOG_DEBUG("chainlighting event {}", pkChr->GetName());
if (pkChrVictim->GetParty()) // 파티 먼저 if (pkChrVictim->GetParty()) // 파티 먼저
{ {
@ -1025,7 +1022,7 @@ EVENTFUNC(ChainLightningEvent)
} }
else else
{ {
sys_log(1, "%s use chainlighting, but find victim failed near %s", pkChr->GetName(), pkChrVictim->GetName()); SPDLOG_DEBUG("{} use chainlighting, but find victim failed near {}", pkChr->GetName(), pkChrVictim->GetName());
} }
return 0; return 0;
@ -1075,7 +1072,6 @@ struct FuncSplashDamage
{ {
if (!ent->IsType(ENTITY_CHARACTER)) if (!ent->IsType(ENTITY_CHARACTER))
{ {
//if (m_pkSk->dwVnum == SKILL_CHAIN) sys_log(0, "CHAIN target not character %s", m_pkChr->GetName());
return; return;
} }
@ -1083,15 +1079,13 @@ struct FuncSplashDamage
if (DISTANCE_APPROX(m_x - pkChrVictim->GetX(), m_y - pkChrVictim->GetY()) > m_pkSk->iSplashRange) if (DISTANCE_APPROX(m_x - pkChrVictim->GetX(), m_y - pkChrVictim->GetY()) > m_pkSk->iSplashRange)
{ {
if(test_server) SPDLOG_TRACE("XXX target too far {}", m_pkChr->GetName());
sys_log(0, "XXX target too far %s", m_pkChr->GetName());
return; return;
} }
if (!battle_is_attackable(m_pkChr, pkChrVictim)) if (!battle_is_attackable(m_pkChr, pkChrVictim))
{ {
if(test_server) SPDLOG_TRACE("XXX target not attackable {}", m_pkChr->GetName());
sys_log(0, "XXX target not attackable %s", m_pkChr->GetName());
return; return;
} }
@ -1100,8 +1094,7 @@ struct FuncSplashDamage
if (!(m_pkSk->dwVnum >= GUILD_SKILL_START && m_pkSk->dwVnum <= GUILD_SKILL_END)) if (!(m_pkSk->dwVnum >= GUILD_SKILL_START && m_pkSk->dwVnum <= GUILD_SKILL_END))
if (!m_bDisableCooltime && m_pInfo && !m_pInfo->HitOnce(m_pkSk->dwVnum) && m_pkSk->dwVnum != SKILL_MUYEONG) if (!m_bDisableCooltime && m_pInfo && !m_pInfo->HitOnce(m_pkSk->dwVnum) && m_pkSk->dwVnum != SKILL_MUYEONG)
{ {
if(test_server) SPDLOG_TRACE("check guild skill {}", m_pkChr->GetName());
sys_log(0, "check guild skill %s", m_pkChr->GetName());
return; return;
} }
@ -1243,7 +1236,6 @@ struct FuncSplashDamage
iAmount = (int) (iAmount * adjust); iAmount = (int) (iAmount * adjust);
} }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
//sys_log(0, "name: %s skill: %s amount %d to %s", m_pkChr->GetName(), m_pkSk->szName, iAmount, pkChrVictim->GetName());
iDam = CalcBattleDamage(iAmount, m_pkChr->GetLevel(), pkChrVictim->GetLevel()); iDam = CalcBattleDamage(iAmount, m_pkChr->GetLevel(), pkChrVictim->GetLevel());
@ -1317,7 +1309,7 @@ struct FuncSplashDamage
break; break;
default: default:
sys_err("Unknown skill attr type %u vnum %u", m_pkSk->bSkillAttrType, m_pkSk->dwVnum); SPDLOG_ERROR("Unknown skill attr type {} vnum {}", m_pkSk->bSkillAttrType, m_pkSk->dwVnum);
break; break;
} }
@ -1355,7 +1347,7 @@ struct FuncSplashDamage
pkChrVictim->BeginFight(m_pkChr); pkChrVictim->BeginFight(m_pkChr);
if (m_pkSk->dwVnum == SKILL_CHAIN) if (m_pkSk->dwVnum == SKILL_CHAIN)
sys_log(0, "%s CHAIN INDEX %d DAM %d DT %d", m_pkChr->GetName(), m_pkChr->GetChainLightningIndex() - 1, iDam, dt); SPDLOG_DEBUG("{} CHAIN INDEX {} DAM {} DT {}", m_pkChr->GetName(), m_pkChr->GetChainLightningIndex() - 1, iDam, (int) dt);
{ {
BYTE AntiSkillID = 0; BYTE AntiSkillID = 0;
@ -1381,7 +1373,7 @@ struct FuncSplashDamage
CSkillProto* pkSk = CSkillManager::instance().Get(AntiSkillID); CSkillProto* pkSk = CSkillManager::instance().Get(AntiSkillID);
if (!pkSk) if (!pkSk)
{ {
sys_err ("There is no anti skill(%d) in skill proto", AntiSkillID); SPDLOG_ERROR("There is no anti skill({}) in skill proto", AntiSkillID);
} }
else else
{ {
@ -1389,7 +1381,7 @@ struct FuncSplashDamage
double ResistAmount = pkSk->kPointPoly.Eval(); double ResistAmount = pkSk->kPointPoly.Eval();
sys_log(0, "ANTI_SKILL: Resist(%lf) Orig(%d) Reduce(%d)", ResistAmount, iDam, int(iDam * (ResistAmount/100.0))); SPDLOG_DEBUG("ANTI_SKILL: Resist({}) Orig({}) Reduce({})", ResistAmount, iDam, int(iDam * (ResistAmount/100.0)));
iDam -= iDam * (ResistAmount/100.0); iDam -= iDam * (ResistAmount/100.0);
} }
@ -1478,7 +1470,7 @@ struct FuncSplashDamage
} }
GetDeltaByDegree(degree, fCrushSlidingLength, &fx, &fy); GetDeltaByDegree(degree, fCrushSlidingLength, &fx, &fy);
sys_log(0, "CRUSH! %s -> %s (%d %d) -> (%d %d)", m_pkChr->GetName(), pkChrVictim->GetName(), pkChrVictim->GetX(), pkChrVictim->GetY(), (int)(pkChrVictim->GetX()+fx), (int)(pkChrVictim->GetY()+fy)); SPDLOG_TRACE("CRUSH! {} -> {} ({} {}) -> ({} {})", m_pkChr->GetName(), pkChrVictim->GetName(), pkChrVictim->GetX(), pkChrVictim->GetY(), (int)(pkChrVictim->GetX()+fx), (int)(pkChrVictim->GetY()+fy));
int tx = (int)(pkChrVictim->GetX()+fx); int tx = (int)(pkChrVictim->GetX()+fx);
int ty = (int)(pkChrVictim->GetY()+fy); int ty = (int)(pkChrVictim->GetY()+fy);
@ -1522,8 +1514,7 @@ struct FuncSplashDamage
event_create(ChainLightningEvent, info, passes_per_sec / 5); event_create(ChainLightningEvent, info, passes_per_sec / 5);
} }
if(test_server) SPDLOG_TRACE("FuncSplashDamage End :{} ", m_pkChr->GetName());
sys_log(0, "FuncSplashDamage End :%s ", m_pkChr->GetName());
} }
int m_x; int m_x;
@ -1568,12 +1559,10 @@ struct FuncSplashAffect
{ {
LPCHARACTER pkChr = (LPCHARACTER) ent; LPCHARACTER pkChr = (LPCHARACTER) ent;
if (test_server) SPDLOG_TRACE("FuncSplashAffect step 1 : name:{} vnum:{} iDur:{}", pkChr->GetName(), m_dwVnum, m_iDuration);
sys_log(0, "FuncSplashAffect step 1 : name:%s vnum:%d iDur:%d", pkChr->GetName(), m_dwVnum, m_iDuration);
if (DISTANCE_APPROX(m_x - pkChr->GetX(), m_y - pkChr->GetY()) < m_iDist) if (DISTANCE_APPROX(m_x - pkChr->GetX(), m_y - pkChr->GetY()) < m_iDist)
{ {
if (test_server) SPDLOG_TRACE("FuncSplashAffect step 2 : name:{} vnum:{} iDur:{}", pkChr->GetName(), m_dwVnum, m_iDuration);
sys_log(0, "FuncSplashAffect step 2 : name:%s vnum:%d iDur:%d", pkChr->GetName(), m_dwVnum, m_iDuration);
if (m_dwVnum == SKILL_TUSOK) if (m_dwVnum == SKILL_TUSOK)
if (pkChr->CanBeginFight()) if (pkChr->CanBeginFight())
pkChr->BeginFight(m_pkChrAttacker); pkChr->BeginFight(m_pkChrAttacker);
@ -1621,7 +1610,7 @@ EVENTFUNC(skill_gwihwan_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "skill_gwihwan_event> <Factor> Null pointer" ); SPDLOG_ERROR("skill_gwihwan_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -1641,12 +1630,12 @@ EVENTFUNC(skill_gwihwan_event)
// 성공 // 성공
if (SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos)) if (SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos))
{ {
sys_log(1, "Recall: %s %d %d -> %d %d", ch->GetName(), ch->GetX(), ch->GetY(), pos.x, pos.y); SPDLOG_DEBUG("Recall: {} {} {} -> {} {}", ch->GetName(), ch->GetX(), ch->GetY(), pos.x, pos.y);
ch->WarpSet(pos.x, pos.y); ch->WarpSet(pos.x, pos.y);
} }
else else
{ {
sys_err("CHARACTER::UseItem : cannot find spawn position (name %s, %d x %d)", ch->GetName(), ch->GetX(), ch->GetY()); SPDLOG_ERROR("CHARACTER::UseItem : cannot find spawn position (name {}, {} x {})", ch->GetName(), ch->GetX(), ch->GetY());
ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire())); ch->WarpSet(EMPIRE_START_X(ch->GetEmpire()), EMPIRE_START_Y(ch->GetEmpire()));
} }
} }
@ -1674,11 +1663,8 @@ int CHARACTER::ComputeSkillAtPosition(DWORD dwVnum, const PIXEL_POSITION& posTar
if (!pkSk) if (!pkSk)
return BATTLE_NONE; return BATTLE_NONE;
if (test_server) SPDLOG_TRACE("ComputeSkillAtPosition {} vnum {} x {} y {} level {}",
{ GetName(), dwVnum, posTarget.x, posTarget.y, bSkillLevel);
sys_log(0, "ComputeSkillAtPosition %s vnum %d x %d y %d level %d",
GetName(), dwVnum, posTarget.x, posTarget.y, bSkillLevel);
}
// 나에게 쓰는 스킬은 내 위치를 쓴다. // 나에게 쓰는 스킬은 내 위치를 쓴다.
//if (IS_SET(pkSk->dwFlag, SKILL_FLAG_SELFONLY)) //if (IS_SET(pkSk->dwFlag, SKILL_FLAG_SELFONLY))
@ -1800,20 +1786,17 @@ int CHARACTER::ComputeSkillAtPosition(DWORD dwVnum, const PIXEL_POSITION& posTar
} }
else else
{ {
//if (dwVnum == SKILL_CHAIN) sys_log(0, "CHAIN skill call FuncSplashDamage %s", GetName());
f(this); f(this);
} }
} }
else else
{ {
//if (dwVnum == SKILL_CHAIN) sys_log(0, "CHAIN skill no damage %d %s", iAmount, GetName());
int iDur = (int) pkSk->kDurationPoly.Eval(); int iDur = (int) pkSk->kDurationPoly.Eval();
if (IsPC()) if (IsPC())
if (!(dwVnum >= GUILD_SKILL_START && dwVnum <= GUILD_SKILL_END)) // 길드 스킬은 쿨타임 처리를 하지 않는다. if (!(dwVnum >= GUILD_SKILL_START && dwVnum <= GUILD_SKILL_END)) // 길드 스킬은 쿨타임 처리를 하지 않는다.
if (!m_bDisableCooltime && !m_SkillUseInfo[dwVnum].HitOnce(dwVnum) && dwVnum != SKILL_MUYEONG) if (!m_bDisableCooltime && !m_SkillUseInfo[dwVnum].HitOnce(dwVnum) && dwVnum != SKILL_MUYEONG)
{ {
//if (dwVnum == SKILL_CHAIN) sys_log(0, "CHAIN skill cannot hit %s", GetName());
return BATTLE_NONE; return BATTLE_NONE;
} }
@ -1840,7 +1823,7 @@ int CHARACTER::ComputeSkillAtPosition(DWORD dwVnum, const PIXEL_POSITION& posTar
{ {
int iDur = (int) pkSk->kDurationPoly2.Eval(); int iDur = (int) pkSk->kDurationPoly2.Eval();
sys_log(1, "try second %u %d %d", pkSk->dwVnum, pkSk->bPointOn2, iDur); SPDLOG_DEBUG("try second {} {} {}", pkSk->dwVnum, pkSk->bPointOn2, iDur);
if (iDur > 0) if (iDur > 0)
{ {
@ -1990,21 +1973,19 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
if (!pkVictim) if (!pkVictim)
{ {
if (test_server) SPDLOG_TRACE("ComputeSkill: {} Victim == null, skill {}", GetName(), dwVnum);
sys_log(0, "ComputeSkill: %s Victim == null, skill %d", GetName(), dwVnum);
return BATTLE_NONE; return BATTLE_NONE;
} }
if (pkSk->dwTargetRange && DISTANCE_SQRT(GetX() - pkVictim->GetX(), GetY() - pkVictim->GetY()) >= pkSk->dwTargetRange + 50) if (pkSk->dwTargetRange && DISTANCE_SQRT(GetX() - pkVictim->GetX(), GetY() - pkVictim->GetY()) >= pkSk->dwTargetRange + 50)
{ {
if (test_server) SPDLOG_TRACE("ComputeSkill: Victim too far, skill {} : {} to {} (distance {} limit {})",
sys_log(0, "ComputeSkill: Victim too far, skill %d : %s to %s (distance %u limit %u)", dwVnum,
dwVnum, GetName(),
GetName(), pkVictim->GetName(),
pkVictim->GetName(), (int)DISTANCE_SQRT(GetX() - pkVictim->GetX(), GetY() - pkVictim->GetY()),
(int)DISTANCE_SQRT(GetX() - pkVictim->GetX(), GetY() - pkVictim->GetY()), pkSk->dwTargetRange);
pkSk->dwTargetRange);
return BATTLE_NONE; return BATTLE_NONE;
} }
@ -2013,8 +1994,7 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
{ {
if ((bSkillLevel = GetSkillLevel(pkSk->dwVnum)) == 0) if ((bSkillLevel = GetSkillLevel(pkSk->dwVnum)) == 0)
{ {
if (test_server) SPDLOG_TRACE("ComputeSkill : name:{} vnum:{} skillLevelBySkill : {} ", GetName(), pkSk->dwVnum, bSkillLevel);
sys_log(0, "ComputeSkill : name:%s vnum:%d skillLevelBySkill : %d ", GetName(), pkSk->dwVnum, bSkillLevel);
return BATTLE_NONE; return BATTLE_NONE;
} }
} }
@ -2095,7 +2075,7 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
int iAmount3 = (int) pkSk->kPointPoly3.Eval(); int iAmount3 = (int) pkSk->kPointPoly3.Eval();
if (test_server && IsPC()) if (test_server && IsPC())
sys_log(0, "iAmount: %d %d %d , atk:%f skLevel:%f k:%f GetSkillPower(%d) MaxLevel:%d Per:%f", SPDLOG_TRACE("iAmount: {} {} {} , atk:{} skLevel:{} k:{} GetSkillPower({}) MaxLevel:{} Per:{}",
iAmount, iAmount2, iAmount3, iAmount, iAmount2, iAmount3,
pkSk->kPointPoly.GetVar("atk"), pkSk->kPointPoly.GetVar("atk"),
pkSk->kPointPoly.GetVar("k"), pkSk->kPointPoly.GetVar("k"),
@ -2117,8 +2097,6 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
} }
// END_OF_ADD_GRANDMASTER_SKILL // END_OF_ADD_GRANDMASTER_SKILL
//sys_log(0, "XXX SKILL Calc %d Amount %d", dwVnum, iAmount);
// REMOVE_BAD_AFFECT_BUG_FIX // REMOVE_BAD_AFFECT_BUG_FIX
if (IS_SET(pkSk->dwFlag, SKILL_FLAG_REMOVE_BAD_AFFECT)) if (IS_SET(pkSk->dwFlag, SKILL_FLAG_REMOVE_BAD_AFFECT))
{ {
@ -2281,13 +2259,12 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
if (iDur2 > 0) if (iDur2 > 0)
{ {
if (test_server) SPDLOG_TRACE("SKILL_AFFECT: {} {} Dur:{} To:{} Amount:{}",
sys_log(0, "SKILL_AFFECT: %s %s Dur:%d To:%d Amount:%d", GetName(),
GetName(), pkSk->szName,
pkSk->szName, iDur2,
iDur2, pkSk->bPointOn2,
pkSk->bPointOn2, iAmount2);
iAmount2);
iDur2 += GetPoint(POINT_PARTY_BUFFER_BONUS); iDur2 += GetPoint(POINT_PARTY_BUFFER_BONUS);
pkVictim->AddAffect(pkSk->dwVnum, pkSk->bPointOn2, iAmount2, pkSk->dwAffectFlag2, iDur2, 0, false); pkVictim->AddAffect(pkSk->dwVnum, pkSk->bPointOn2, iAmount2, pkSk->dwAffectFlag2, iDur2, 0, false);
@ -2323,13 +2300,12 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
} }
else else
{ {
if (test_server) SPDLOG_TRACE("SKILL_AFFECT: {} {} Dur:{} To:{} Amount:{}",
sys_log(0, "SKILL_AFFECT: %s %s Dur:%d To:%d Amount:%d", GetName(),
GetName(), pkSk->szName,
pkSk->szName, iDur,
iDur, pkSk->bPointOn,
pkSk->bPointOn, iAmount);
iAmount);
pkVictim->AddAffect(pkSk->dwVnum, pkVictim->AddAffect(pkSk->dwVnum,
pkSk->bPointOn, pkSk->bPointOn,
@ -2379,7 +2355,7 @@ int CHARACTER::ComputeSkill(DWORD dwVnum, LPCHARACTER pkVictim, BYTE bSkillLevel
pkSk->kDurationPoly3.SetVar("k", k/*bSkillLevel*/); pkSk->kDurationPoly3.SetVar("k", k/*bSkillLevel*/);
int iDur = (int) pkSk->kDurationPoly3.Eval(); int iDur = (int) pkSk->kDurationPoly3.Eval();
sys_log(0, "try third %u %d %d %d 1894", pkSk->dwVnum, pkSk->bPointOn3, iDur, iAmount3); SPDLOG_DEBUG("try third {} {} {} {} 1894", pkSk->dwVnum, pkSk->bPointOn3, iDur, iAmount3);
if (iDur > 0) if (iDur > 0)
{ {
@ -2457,7 +2433,7 @@ bool CHARACTER::UseSkill(DWORD dwVnum, LPCHARACTER pkVictim, bool bUseGrandMaste
return false; return false;
CSkillProto * pkSk = CSkillManager::instance().Get(dwVnum); CSkillProto * pkSk = CSkillManager::instance().Get(dwVnum);
sys_log(0, "%s: USE_SKILL: %d pkVictim %p", GetName(), dwVnum, get_pointer(pkVictim)); SPDLOG_DEBUG("{}: USE_SKILL: {} pkVictim {}", GetName(), dwVnum, (void*) get_pointer(pkVictim));
if (!pkSk) if (!pkSk)
return false; return false;
@ -2541,7 +2517,7 @@ bool CHARACTER::UseSkill(DWORD dwVnum, LPCHARACTER pkVictim, bool bUseGrandMaste
if (dwVnum == SKILL_TERROR && m_SkillUseInfo[dwVnum].bUsed && m_SkillUseInfo[dwVnum].dwNextSkillUsableTime > dwCur ) if (dwVnum == SKILL_TERROR && m_SkillUseInfo[dwVnum].bUsed && m_SkillUseInfo[dwVnum].dwNextSkillUsableTime > dwCur )
{ {
sys_log(0, " SKILL_TERROR's Cooltime is not delta over %u", m_SkillUseInfo[dwVnum].dwNextSkillUsableTime - dwCur ); SPDLOG_DEBUG(" SKILL_TERROR's Cooltime is not delta over {}", m_SkillUseInfo[dwVnum].dwNextSkillUsableTime - dwCur );
return false; return false;
} }
@ -2658,7 +2634,7 @@ int CHARACTER::GetSkillMasterType(DWORD dwVnum) const
if (dwVnum >= SKILL_MAX_NUM) if (dwVnum >= SKILL_MAX_NUM)
{ {
sys_err("%s skill vnum overflow %u", GetName(), dwVnum); SPDLOG_ERROR("{} skill vnum overflow {}", GetName(), dwVnum);
return 0; return 0;
} }
@ -2690,7 +2666,7 @@ int CHARACTER::GetSkillPower(DWORD dwVnum, BYTE bLevel) const
if (dwVnum >= SKILL_MAX_NUM) if (dwVnum >= SKILL_MAX_NUM)
{ {
sys_err("%s skill vnum overflow %u", GetName(), dwVnum); SPDLOG_ERROR("{} skill vnum overflow {}", GetName(), dwVnum);
return 0; return 0;
} }
@ -2703,8 +2679,7 @@ int CHARACTER::GetSkillLevel(DWORD dwVnum) const
{ {
if (dwVnum >= SKILL_MAX_NUM) if (dwVnum >= SKILL_MAX_NUM)
{ {
sys_err("%s skill vnum overflow %u", GetName(), dwVnum); SPDLOG_ERROR("{} skill vnum overflow {}", GetName(), dwVnum);
sys_log(0, "%s skill vnum overflow %u", GetName(), dwVnum);
return 0; return 0;
} }
@ -2717,7 +2692,7 @@ EVENTFUNC(skill_muyoung_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "skill_muyoung_event> <Factor> Null pointer" ); SPDLOG_ERROR("skill_muyoung_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -2896,7 +2871,7 @@ EVENTFUNC(mob_skill_hit_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "mob_skill_event_info> <Factor> Null pointer" ); SPDLOG_ERROR("mob_skill_event_info> <Factor> Null pointer" );
return 0; return 0;
} }
@ -2935,11 +2910,11 @@ bool CHARACTER::UseMobSkill(unsigned int idx)
m_adwMobSkillCooltime[idx] = get_dword_time() + iCooltime; m_adwMobSkillCooltime[idx] = get_dword_time() + iCooltime;
sys_log(0, "USE_MOB_SKILL: %s idx %d vnum %u cooltime %d", GetName(), idx, dwVnum, iCooltime); SPDLOG_DEBUG("USE_MOB_SKILL: {} idx {} vnum {} cooltime {}", GetName(), idx, dwVnum, iCooltime);
if (m_pkMobData->m_mobSkillInfo[idx].vecSplashAttack.empty()) if (m_pkMobData->m_mobSkillInfo[idx].vecSplashAttack.empty())
{ {
sys_err("No skill hit data for mob %s index %d", GetName(), idx); SPDLOG_ERROR("No skill hit data for mob {} index {}", GetName(), idx);
return false; return false;
} }
@ -2958,8 +2933,7 @@ bool CHARACTER::UseMobSkill(unsigned int idx)
if (rInfo.dwTiming) if (rInfo.dwTiming)
{ {
if (test_server) SPDLOG_TRACE(" timing {}ms", rInfo.dwTiming);
sys_log(0, " timing %ums", rInfo.dwTiming);
mob_skill_event_info* info = AllocEventInfo<mob_skill_event_info>(); mob_skill_event_info* info = AllocEventInfo<mob_skill_event_info>();
@ -3350,7 +3324,7 @@ bool CHARACTER::IsUsableSkillMotion(DWORD dwMotionIndex) const
if (dwMotionIndex >= MOTION_MAX_NUM) if (dwMotionIndex >= MOTION_MAX_NUM)
{ {
sys_err("OUT_OF_MOTION_VNUM: name=%s, motion=%d/%d", GetName(), dwMotionIndex, MOTION_MAX_NUM); SPDLOG_ERROR("OUT_OF_MOTION_VNUM: name={}, motion={}/{}", GetName(), dwMotionIndex, MOTION_MAX_NUM);
return false; return false;
} }
@ -3359,7 +3333,7 @@ bool CHARACTER::IsUsableSkillMotion(DWORD dwMotionIndex) const
DWORD skillCount = *skillVNums++; DWORD skillCount = *skillVNums++;
if (skillCount >= SKILL_LIST_MAX_COUNT) if (skillCount >= SKILL_LIST_MAX_COUNT)
{ {
sys_err("OUT_OF_SKILL_LIST: name=%s, count=%d/%d", GetName(), skillCount, SKILL_LIST_MAX_COUNT); SPDLOG_ERROR("OUT_OF_SKILL_LIST: name={}, count={}/{}", GetName(), skillCount, SKILL_LIST_MAX_COUNT);
return false; return false;
} }
@ -3367,7 +3341,7 @@ bool CHARACTER::IsUsableSkillMotion(DWORD dwMotionIndex) const
{ {
if (skillIndex >= SKILL_MAX_NUM) if (skillIndex >= SKILL_MAX_NUM)
{ {
sys_err("OUT_OF_SKILL_VNUM: name=%s, skill=%d/%d", GetName(), skillIndex, SKILL_MAX_NUM); SPDLOG_ERROR("OUT_OF_SKILL_VNUM: name={}, skill={}/{}", GetName(), skillIndex, (int) SKILL_MAX_NUM);
return false; return false;
} }
@ -3418,7 +3392,7 @@ void CHARACTER::ClearSubSkill()
if (m_pSkillLevels == NULL) if (m_pSkillLevels == NULL)
{ {
sys_err("m_pSkillLevels nil (name: %s)", GetName()); SPDLOG_ERROR("m_pSkillLevels nil (name: {})", GetName());
return; return;
} }
@ -3443,13 +3417,13 @@ bool CHARACTER::ResetOneSkill(DWORD dwVnum)
{ {
if (NULL == m_pSkillLevels) if (NULL == m_pSkillLevels)
{ {
sys_err("m_pSkillLevels nil (name %s, vnum %u)", GetName(), dwVnum); SPDLOG_ERROR("m_pSkillLevels nil (name {}, vnum {})", GetName(), dwVnum);
return false; return false;
} }
if (dwVnum >= SKILL_MAX_NUM) if (dwVnum >= SKILL_MAX_NUM)
{ {
sys_err("vnum overflow (name %s, vnum %u)", GetName(), dwVnum); SPDLOG_ERROR("vnum overflow (name {}, vnum {})", GetName(), dwVnum);
return false; return false;
} }
@ -3534,7 +3508,7 @@ bool CHARACTER::CheckSkillHitCount(const BYTE SkillID, const VID TargetVID)
if (iter == m_SkillUseInfo.end()) if (iter == m_SkillUseInfo.end())
{ {
sys_log(0, "SkillHack: Skill(%u) is not in container", SkillID); SPDLOG_WARN("SkillHack: Skill({}) is not in container", SkillID);
return false; return false;
} }
@ -3542,7 +3516,7 @@ bool CHARACTER::CheckSkillHitCount(const BYTE SkillID, const VID TargetVID)
if (false == rSkillUseInfo.bUsed) if (false == rSkillUseInfo.bUsed)
{ {
sys_log(0, "SkillHack: not used skill(%u)", SkillID); SPDLOG_WARN("SkillHack: not used skill({})", SkillID);
return false; return false;
} }
@ -3552,7 +3526,7 @@ bool CHARACTER::CheckSkillHitCount(const BYTE SkillID, const VID TargetVID)
case SKILL_HWAYEOMPOK: case SKILL_HWAYEOMPOK:
case SKILL_DAEJINGAK: case SKILL_DAEJINGAK:
case SKILL_PAERYONG: case SKILL_PAERYONG:
sys_log(0, "SkillHack: cannot use attack packet for skill(%u)", SkillID); SPDLOG_WARN("SkillHack: cannot use attack packet for skill({})", SkillID);
return false; return false;
} }
@ -3584,7 +3558,7 @@ bool CHARACTER::CheckSkillHitCount(const BYTE SkillID, const VID TargetVID)
if (iterTargetMap->second >= MaxAttackCountPerTarget) if (iterTargetMap->second >= MaxAttackCountPerTarget)
{ {
sys_log(0, "SkillHack: Too Many Hit count from SkillID(%u) count(%u)", SkillID, iterTargetMap->second); SPDLOG_WARN("SkillHack: Too Many Hit count from SkillID({}) count({})", SkillID, iterTargetMap->second);
return false; return false;
} }

View File

@ -128,8 +128,8 @@ namespace
{ {
CAffect * pkAff = pkChr->FindAffect(AFFECT_WAR_FLAG); CAffect * pkAff = pkChr->FindAffect(AFFECT_WAR_FLAG);
sys_log(0, "FlagBase %s dist %d aff %p flag gid %d chr gid %u", SPDLOG_DEBUG("FlagBase {} dist {} aff {} flag gid {} chr gid {}",
pkChr->GetName(), iDist, pkAff, m_pkChr->GetPoint(POINT_STAT), pkChr->GetName(), iDist, (void*) pkAff, m_pkChr->GetPoint(POINT_STAT),
pkChr->GetGuild()->GetID()); pkChr->GetGuild()->GetID());
if (pkAff) if (pkAff)
@ -313,7 +313,7 @@ void CHARACTER::CowardEscape()
if (Goto(iDestX, iDestY)) if (Goto(iDestX, iDestY))
SendMovePacket(FUNC_WAIT, 0, 0, 0, 0); SendMovePacket(FUNC_WAIT, 0, 0, 0, 0);
sys_log(0, "WAEGU move to %d %d (far)", iDestX, iDestY); SPDLOG_TRACE("WAEGU move to {} {} (far)", iDestX, iDestY);
return; return;
} }
} }
@ -877,7 +877,7 @@ void CHARACTER::StateMove()
{ {
if (IsPC()) if (IsPC())
{ {
sys_log(1, "µµÂø %s %d %d", GetName(), x, y); SPDLOG_DEBUG("µµÂø {} {} {}", GetName(), x, y);
GotoState(m_stateIdle); GotoState(m_stateIdle);
StopStaminaConsume(); StopStaminaConsume();
} }
@ -910,7 +910,7 @@ void CHARACTER::StateBattle()
{ {
if (IsStone()) if (IsStone())
{ {
sys_err("Stone must not use battle state (name %s)", GetName()); SPDLOG_ERROR("Stone must not use battle state (name {})", GetName());
return; return;
} }
@ -982,7 +982,7 @@ void CHARACTER::StateBattle()
if (Goto((int) dx, (int) dy)) if (Goto((int) dx, (int) dy))
{ {
sys_log(0, "KILL_AND_GO: %s distance %.1f", GetName(), fDist); SPDLOG_DEBUG("KILL_AND_GO: {} distance {:.1f}", GetName(), fDist);
SendMovePacket(FUNC_WAIT, 0, 0, 0, 0); SendMovePacket(FUNC_WAIT, 0, 0, 0, 0);
} }
} }
@ -1101,8 +1101,7 @@ void CHARACTER::StateBattle()
float fDuration = CMotionManager::instance().GetMotionDuration(GetRaceNum(), MAKE_MOTION_KEY(MOTION_MODE_GENERAL, MOTION_SPECIAL_1 + iSkillIdx)); float fDuration = CMotionManager::instance().GetMotionDuration(GetRaceNum(), MAKE_MOTION_KEY(MOTION_MODE_GENERAL, MOTION_SPECIAL_1 + iSkillIdx));
m_dwStateDuration = (DWORD) (fDuration == 0.0f ? PASSES_PER_SEC(2) : PASSES_PER_SEC(fDuration)); m_dwStateDuration = (DWORD) (fDuration == 0.0f ? PASSES_PER_SEC(2) : PASSES_PER_SEC(fDuration));
if (test_server) SPDLOG_TRACE("USE_MOB_SKILL: {} idx {} motion {} duration {:.0f}", GetName(), iSkillIdx, MOTION_SPECIAL_1 + iSkillIdx, fDuration);
sys_log(0, "USE_MOB_SKILL: %s idx %u motion %u duration %.0f", GetName(), iSkillIdx, MOTION_SPECIAL_1 + iSkillIdx, fDuration);
return; return;
} }

View File

@ -598,7 +598,7 @@ void interpreter_set_privilege(const char *cmd, int lvl)
if (!str_cmp(cmd, cmd_info[i].command)) if (!str_cmp(cmd, cmd_info[i].command))
{ {
cmd_info[i].gm_level = lvl; cmd_info[i].gm_level = lvl;
sys_log(0, "Setting command privilege: %s -> %d", cmd, lvl); SPDLOG_INFO("Setting command privilege: {} -> {}", cmd, lvl);
break; break;
} }
} }
@ -640,7 +640,7 @@ void interpret_command(LPCHARACTER ch, const char * argument, size_t len)
{ {
if (NULL == ch) if (NULL == ch)
{ {
sys_err ("NULL CHRACTER"); SPDLOG_ERROR("NULL CHRACTER");
return ; return ;
} }
@ -694,7 +694,7 @@ void interpret_command(LPCHARACTER ch, const char * argument, size_t len)
break; break;
*/ */
default: default:
sys_err("unknown position %d", ch->GetPosition()); SPDLOG_ERROR("unknown position {}", ch->GetPosition());
break; break;
} }
@ -714,7 +714,7 @@ void interpret_command(LPCHARACTER ch, const char * argument, size_t len)
} }
if (strncmp("phase", cmd_info[icmd].command, 5) != 0) // 히든 명령어 처리 if (strncmp("phase", cmd_info[icmd].command, 5) != 0) // 히든 명령어 처리
sys_log(0, "COMMAND: %s: %s", ch->GetName(), cmd_info[icmd].command); SPDLOG_DEBUG("COMMAND: {}: {}", ch->GetName(), cmd_info[icmd].command);
((*cmd_info[icmd].command_pointer) (ch, line, icmd, cmd_info[icmd].subcmd)); ((*cmd_info[icmd].command_pointer) (ch, line, icmd, cmd_info[icmd].subcmd));

View File

@ -144,7 +144,7 @@ ACMD(do_emotion)
if (*emotion_types[i].command == '\n') if (*emotion_types[i].command == '\n')
{ {
sys_err("cannot find emotion"); SPDLOG_ERROR("cannot find emotion");
return; return;
} }
@ -260,8 +260,8 @@ ACMD(do_emotion)
ch->PacketAround(buf.read_peek(), buf.size()); ch->PacketAround(buf.read_peek(), buf.size());
if (victim) if (victim)
sys_log(1, "ACTION: %s TO %s", emotion_types[i].command, victim->GetName()); SPDLOG_DEBUG("ACTION: {} TO {}", emotion_types[i].command, victim->GetName());
else else
sys_log(1, "ACTION: %s", emotion_types[i].command); SPDLOG_DEBUG("ACTION: {}", emotion_types[i].command);
} }

View File

@ -21,7 +21,6 @@
#include "item_manager.h" #include "item_manager.h"
#include "monarch.h" #include "monarch.h"
#include "mob_manager.h" #include "mob_manager.h"
#include "dev_log.h"
#include "item.h" #include "item.h"
#include "arena.h" #include "arena.h"
#include "buffer_manager.h" #include "buffer_manager.h"
@ -178,7 +177,7 @@ EVENTFUNC(shutdown_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "shutdown_event> <Factor> Null pointer" ); SPDLOG_ERROR("shutdown_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -186,7 +185,7 @@ EVENTFUNC(shutdown_event)
if (*pSec < 0) if (*pSec < 0)
{ {
sys_log(0, "shutdown_event sec %d", *pSec); SPDLOG_INFO("shutdown_event sec {}", *pSec);
if (--*pSec == -10) if (--*pSec == -10)
{ {
@ -243,7 +242,7 @@ ACMD(do_shutdown)
{ {
if (NULL == ch) if (NULL == ch)
{ {
sys_err("Accept shutdown command from %s.", ch->GetName()); SPDLOG_ERROR("Accept shutdown command from {}.", ch->GetName());
} }
TPacketGGShutdown p; TPacketGGShutdown p;
p.bHeader = HEADER_GG_SHUTDOWN; p.bHeader = HEADER_GG_SHUTDOWN;
@ -258,7 +257,7 @@ EVENTFUNC(timed_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "timed_event> <Factor> Null pointer" ); SPDLOG_ERROR("timed_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -589,7 +588,7 @@ ACMD(do_restart)
switch (subcmd) switch (subcmd)
{ {
case SCMD_RESTART_TOWN: case SCMD_RESTART_TOWN:
sys_log(0, "do_restart: restart town"); SPDLOG_DEBUG("do_restart: restart town");
PIXEL_POSITION pos; PIXEL_POSITION pos;
if (CWarMapManager::instance().GetStartPosition(ch->GetMapIndex(), ch->GetGuild()->GetID() < dwGuildOpponent ? 0 : 1, pos)) if (CWarMapManager::instance().GetStartPosition(ch->GetMapIndex(), ch->GetGuild()->GetID() < dwGuildOpponent ? 0 : 1, pos))
@ -603,7 +602,7 @@ ACMD(do_restart)
break; break;
case SCMD_RESTART_HERE: case SCMD_RESTART_HERE:
sys_log(0, "do_restart: restart here"); SPDLOG_DEBUG("do_restart: restart here");
ch->RestartAtSamePos(); ch->RestartAtSamePos();
//ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY()); //ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY());
ch->PointChange(POINT_HP, ch->GetMaxHP() - ch->GetHP()); ch->PointChange(POINT_HP, ch->GetMaxHP() - ch->GetHP());
@ -619,7 +618,7 @@ ACMD(do_restart)
switch (subcmd) switch (subcmd)
{ {
case SCMD_RESTART_TOWN: case SCMD_RESTART_TOWN:
sys_log(0, "do_restart: restart town"); SPDLOG_DEBUG("do_restart: restart town");
PIXEL_POSITION pos; PIXEL_POSITION pos;
if (SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos)) if (SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos))
@ -632,7 +631,7 @@ ACMD(do_restart)
break; break;
case SCMD_RESTART_HERE: case SCMD_RESTART_HERE:
sys_log(0, "do_restart: restart here"); SPDLOG_DEBUG("do_restart: restart here");
ch->RestartAtSamePos(); ch->RestartAtSamePos();
//ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY()); //ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY());
ch->PointChange(POINT_HP, 50 - ch->GetHP()); ch->PointChange(POINT_HP, 50 - ch->GetHP());
@ -1144,16 +1143,16 @@ ACMD(do_war)
if (g->GetLadderPoint() == 0) if (g->GetLadderPoint() == 0)
{ {
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 레더 점수가 모자라서 길드전을 할 수 없습니다.")); ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 레더 점수가 모자라서 길드전을 할 수 없습니다."));
sys_log(0, "GuildWar.StartError.NEED_LADDER_POINT"); SPDLOG_DEBUG("GuildWar.StartError.NEED_LADDER_POINT");
} }
else if (g->GetMemberCount() < GUILD_WAR_MIN_MEMBER_COUNT) else if (g->GetMemberCount() < GUILD_WAR_MIN_MEMBER_COUNT)
{ {
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 길드전을 하기 위해선 최소한 %d명이 있어야 합니다."), GUILD_WAR_MIN_MEMBER_COUNT); ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("<길드> 길드전을 하기 위해선 최소한 %d명이 있어야 합니다."), GUILD_WAR_MIN_MEMBER_COUNT);
sys_log(0, "GuildWar.StartError.NEED_MINIMUM_MEMBER[%d]", GUILD_WAR_MIN_MEMBER_COUNT); SPDLOG_DEBUG("GuildWar.StartError.NEED_MINIMUM_MEMBER[{}]", (int) GUILD_WAR_MIN_MEMBER_COUNT);
} }
else else
{ {
sys_log(0, "GuildWar.StartError.UNKNOWN_ERROR"); SPDLOG_DEBUG("GuildWar.StartError.UNKNOWN_ERROR");
} }
return; return;
} }
@ -2161,7 +2160,7 @@ ACMD(do_cube)
if (!ch->CanDoCube()) if (!ch->CanDoCube())
return; return;
dev_log(LOG_DEB0, "CUBE COMMAND <%s>: %s", ch->GetName(), argument); SPDLOG_TRACE("CUBE COMMAND <{}>: {}", ch->GetName(), argument);
int cube_index = 0, inven_index = 0; int cube_index = 0, inven_index = 0;
const char *line; const char *line;
@ -2254,7 +2253,7 @@ ACMD(do_cube)
if (0 != arg2[0]) if (0 != arg2[0])
{ {
while (true == Cube_make(ch)) while (true == Cube_make(ch))
dev_log (LOG_DEB0, "cube make success"); SPDLOG_TRACE("cube make success");
} }
else else
Cube_make(ch); Cube_make(ch);
@ -2392,7 +2391,7 @@ ACMD(do_click_mall)
ACMD(do_ride) ACMD(do_ride)
{ {
dev_log(LOG_DEB0, "[DO_RIDE] start"); SPDLOG_TRACE("[DO_RIDE] start");
if (ch->IsDead() || ch->IsStun()) if (ch->IsDead() || ch->IsStun())
return; return;
@ -2400,14 +2399,14 @@ ACMD(do_ride)
{ {
if (ch->IsHorseRiding()) if (ch->IsHorseRiding())
{ {
dev_log(LOG_DEB0, "[DO_RIDE] stop riding"); SPDLOG_TRACE("[DO_RIDE] stop riding");
ch->StopRiding(); ch->StopRiding();
return; return;
} }
if (ch->GetMountVnum()) if (ch->GetMountVnum())
{ {
dev_log(LOG_DEB0, "[DO_RIDE] unmount"); SPDLOG_TRACE("[DO_RIDE] unmount");
do_unmount(ch, NULL, 0, 0); do_unmount(ch, NULL, 0, 0);
return; return;
} }
@ -2417,7 +2416,7 @@ ACMD(do_ride)
{ {
if (ch->GetHorse() != NULL) if (ch->GetHorse() != NULL)
{ {
dev_log(LOG_DEB0, "[DO_RIDE] start riding"); SPDLOG_TRACE("[DO_RIDE] start riding");
ch->StartRiding(); ch->StartRiding();
return; return;
} }
@ -2433,7 +2432,7 @@ ACMD(do_ride)
{ {
if (NULL==ch->GetWear(WEAR_UNIQUE1) || NULL==ch->GetWear(WEAR_UNIQUE2)) if (NULL==ch->GetWear(WEAR_UNIQUE1) || NULL==ch->GetWear(WEAR_UNIQUE2))
{ {
dev_log(LOG_DEB0, "[DO_RIDE] USE UNIQUE ITEM"); SPDLOG_TRACE("[DO_RIDE] USE UNIQUE ITEM");
//ch->EquipItem(item); //ch->EquipItem(item);
ch->UseItem(TItemPos (INVENTORY, i)); ch->UseItem(TItemPos (INVENTORY, i));
return; return;
@ -2448,14 +2447,14 @@ ACMD(do_ride)
case 71116: // 산견신이용권 case 71116: // 산견신이용권
case 71118: // 투지범이용권 case 71118: // 투지범이용권
case 71120: // 사자왕이용권 case 71120: // 사자왕이용권
dev_log(LOG_DEB0, "[DO_RIDE] USE QUEST ITEM"); SPDLOG_TRACE("[DO_RIDE] USE QUEST ITEM");
ch->UseItem(TItemPos (INVENTORY, i)); ch->UseItem(TItemPos (INVENTORY, i));
return; return;
} }
// GF mantis #113524, 52001~52090 번 탈것 // GF mantis #113524, 52001~52090 번 탈것
if( (item->GetVnum() > 52000) && (item->GetVnum() < 52091) ) { if( (item->GetVnum() > 52000) && (item->GetVnum() < 52091) ) {
dev_log(LOG_DEB0, "[DO_RIDE] USE QUEST ITEM"); SPDLOG_TRACE("[DO_RIDE] USE QUEST ITEM");
ch->UseItem(TItemPos (INVENTORY, i)); ch->UseItem(TItemPos (INVENTORY, i));
return; return;
} }

View File

@ -51,7 +51,7 @@ void Command_ApplyAffect(LPCHARACTER ch, const char* argument, const char* affec
char arg1[256]; char arg1[256];
one_argument(argument, arg1, sizeof(arg1)); one_argument(argument, arg1, sizeof(arg1));
sys_log(0, arg1); SPDLOG_DEBUG(arg1);
if (!*arg1) if (!*arg1)
{ {
@ -76,7 +76,7 @@ void Command_ApplyAffect(LPCHARACTER ch, const char* argument, const char* affec
break; break;
} }
sys_log(0, "%s %s", arg1, affectName); SPDLOG_DEBUG("{} {}", arg1, affectName);
ch->ChatPacket(CHAT_TYPE_INFO, "%s %s", arg1, affectName); ch->ChatPacket(CHAT_TYPE_INFO, "%s %s", arg1, affectName);
} }
@ -175,7 +175,7 @@ ACMD(do_transfer)
else else
{ {
ch->ChatPacket(CHAT_TYPE_INFO, "There is no character(%s) by that name", arg1); ch->ChatPacket(CHAT_TYPE_INFO, "There is no character(%s) by that name", arg1);
sys_log(0, "There is no character(%s) by that name", arg1); SPDLOG_DEBUG("There is no character({}) by that name", arg1);
} }
return; return;
@ -240,7 +240,7 @@ void CHARACTER_AddGotoInfo(const std::string& c_st_name, BYTE empire, int mapInd
newGotoInfo.y = y; newGotoInfo.y = y;
gs_vec_gotoInfo.push_back(newGotoInfo); gs_vec_gotoInfo.push_back(newGotoInfo);
sys_log(0, "AddGotoInfo(name=%s, empire=%d, mapIndex=%d, pos=(%d, %d))", c_st_name.c_str(), empire, mapIndex, x, y); SPDLOG_DEBUG("AddGotoInfo(name={}, empire={}, mapIndex={}, pos=({}, {}))", c_st_name.c_str(), empire, mapIndex, x, y);
} }
bool FindInString(const char * c_pszFind, const char * c_pszIn) bool FindInString(const char * c_pszFind, const char * c_pszIn)
@ -605,8 +605,7 @@ ACMD(do_group)
DWORD dwVnum = 0; DWORD dwVnum = 0;
str_to_number(dwVnum, arg1); str_to_number(dwVnum, arg1);
if (test_server) SPDLOG_TRACE("COMMAND GROUP SPAWN {} at {} {} {}", dwVnum, ch->GetMapIndex(), ch->GetX(), ch->GetY());
sys_log(0, "COMMAND GROUP SPAWN %u at %u %u %u", dwVnum, ch->GetMapIndex(), ch->GetX(), ch->GetY());
CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, ch->GetMapIndex(), ch->GetX() - 500, ch->GetY() - 500, ch->GetX() + 500, ch->GetY() + 500); CHARACTER_MANAGER::instance().SpawnGroup(dwVnum, ch->GetMapIndex(), ch->GetX() - 500, ch->GetY() - 500, ch->GetX() + 500, ch->GetY() + 500);
} }
@ -892,7 +891,7 @@ struct FuncPurge
if (!m_bAll && iDist >= 1000) // 10미터 이상에 있는 것들은 purge 하지 않는다. if (!m_bAll && iDist >= 1000) // 10미터 이상에 있는 것들은 purge 하지 않는다.
return; return;
sys_log(0, "PURGE: %s %d", pkChr->GetName(), iDist); SPDLOG_DEBUG("PURGE: {} {}", pkChr->GetName(), iDist);
if (pkChr->IsNPC() && !pkChr->IsPet() && pkChr->GetRider() == NULL) if (pkChr->IsNPC() && !pkChr->IsPet() && pkChr->GetRider() == NULL)
{ {
@ -915,7 +914,7 @@ ACMD(do_purge)
if (sectree) // #431 if (sectree) // #431
sectree->ForEachAround(func); sectree->ForEachAround(func);
else else
sys_err("PURGE_ERROR.NULL_SECTREE(mapIndex=%d, pos=(%d, %d)", ch->GetMapIndex(), ch->GetX(), ch->GetY()); SPDLOG_ERROR("PURGE_ERROR.NULL_SECTREE(mapIndex={}, pos=({}, {})", ch->GetMapIndex(), ch->GetX(), ch->GetY());
} }
ACMD(do_item_purge) ACMD(do_item_purge)
@ -1735,7 +1734,7 @@ ACMD(do_event_flag)
//quest::CQuestManager::instance().SetEventFlag(arg1, atoi(arg2)); //quest::CQuestManager::instance().SetEventFlag(arg1, atoi(arg2));
quest::CQuestManager::instance().RequestSetEventFlag(arg1, value); quest::CQuestManager::instance().RequestSetEventFlag(arg1, value);
ch->ChatPacket(CHAT_TYPE_INFO, "RequestSetEventFlag %s %d", arg1, value); ch->ChatPacket(CHAT_TYPE_INFO, "RequestSetEventFlag %s %d", arg1, value);
sys_log(0, "RequestSetEventFlag %s %d", arg1, value); SPDLOG_DEBUG("RequestSetEventFlag {} {}", arg1, value);
} }
ACMD(do_get_event_flag) ACMD(do_get_event_flag)
@ -2118,7 +2117,7 @@ ACMD(do_reload)
case 'a': case 'a':
ch->ChatPacket(CHAT_TYPE_INFO, "Reloading Admin infomation."); ch->ChatPacket(CHAT_TYPE_INFO, "Reloading Admin infomation.");
db_clientdesc->DBPacket(HEADER_GD_RELOAD_ADMIN, 0, NULL, 0); db_clientdesc->DBPacket(HEADER_GD_RELOAD_ADMIN, 0, NULL, 0);
sys_log(0, "Reloading admin infomation."); SPDLOG_INFO("Reloading admin infomation.");
break; break;
//END_RELOAD_ADMIN //END_RELOAD_ADMIN
case 'c': // cube case 'c': // cube
@ -2531,7 +2530,7 @@ ACMD(do_priv_empire)
// 시간 단위로 변경 // 시간 단위로 변경
duration = duration * (60*60); duration = duration * (60*60);
sys_log(0, "_give_empire_privileage(empire=%d, type=%d, value=%d, duration=%d) by command", SPDLOG_DEBUG("_give_empire_privileage(empire={}, type={}, value={}, duration={}) by command",
empire, type, value, duration); empire, type, value, duration);
CPrivManager::instance().RequestGiveEmpirePriv(empire, type, value, duration); CPrivManager::instance().RequestGiveEmpirePriv(empire, type, value, duration);
return; return;
@ -2659,7 +2658,7 @@ ACMD(do_vote_block_chat)
const char* name = arg1; const char* name = arg1;
int lBlockDuration = 10; int lBlockDuration = 10;
sys_log(0, "vote_block_chat %s %d", name, lBlockDuration); SPDLOG_DEBUG("vote_block_chat {} {}", name, lBlockDuration);
LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(name); LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(name);
@ -2729,7 +2728,7 @@ ACMD(do_block_chat)
return; return;
} }
sys_log(0, "BLOCK CHAT %s %d", name, lBlockDuration); SPDLOG_DEBUG("BLOCK CHAT {} {}", name, lBlockDuration);
LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(name); LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(name);
@ -2781,7 +2780,7 @@ ACMD(do_build)
// 메세지를 전송하지 않고 에러를 출력한다. // 메세지를 전송하지 않고 에러를 출력한다.
if (!pkLand) if (!pkLand)
{ {
sys_err("%s trying to build on not buildable area.", ch->GetName()); SPDLOG_ERROR("{} trying to build on not buildable area.", ch->GetName());
return; return;
} }
@ -2797,14 +2796,14 @@ ACMD(do_build)
// 플레이어가 집을 지을 때는 땅이 내껀지 확인해야 한다. // 플레이어가 집을 지을 때는 땅이 내껀지 확인해야 한다.
if ((!ch->GetGuild() || ch->GetGuild()->GetID() != pkLand->GetOwner())) if ((!ch->GetGuild() || ch->GetGuild()->GetID() != pkLand->GetOwner()))
{ {
sys_err("%s trying to build on not owned land.", ch->GetName()); SPDLOG_ERROR("{} trying to build on not owned land.", ch->GetName());
return; return;
} }
// 내가 길마인가? // 내가 길마인가?
if (ch->GetGuild()->GetMasterPID() != ch->GetPlayerID()) if (ch->GetGuild()->GetMasterPID() != ch->GetPlayerID())
{ {
sys_err("%s trying to build while not the guild master.", ch->GetName()); SPDLOG_ERROR("{} trying to build while not the guild master.", ch->GetName());
return; return;
} }
} }
@ -2946,7 +2945,7 @@ ACMD(do_build)
if (dwItemVnum == 0) if (dwItemVnum == 0)
break; break;
sys_log(0, "BUILD: material %d %u %u", i, dwItemVnum, dwItemCount); SPDLOG_DEBUG("BUILD: material {} {} {}", i, dwItemVnum, dwItemCount);
ch->RemoveSpecifyItem(dwItemVnum, dwItemCount); ch->RemoveSpecifyItem(dwItemVnum, dwItemCount);
} }
} }
@ -2981,7 +2980,7 @@ ACMD(do_build)
one_argument(line, arg1, sizeof(arg1)); one_argument(line, arg1, sizeof(arg1));
sys_log(0, "guild.wall.build map[%d] direction[%s]", mapIndex, arg1); SPDLOG_DEBUG("guild.wall.build map[{}] direction[{}]", mapIndex, arg1);
switch (arg1[0]) switch (arg1[0])
{ {
@ -2999,7 +2998,7 @@ ACMD(do_build)
break; break;
default: default:
ch->ChatPacket(CHAT_TYPE_INFO, "guild.wall.build unknown_direction[%s]", arg1); ch->ChatPacket(CHAT_TYPE_INFO, "guild.wall.build unknown_direction[%s]", arg1);
sys_err("guild.wall.build unknown_direction[%s]", arg1); SPDLOG_ERROR("guild.wall.build unknown_direction[{}]", arg1);
break; break;
} }
@ -3030,7 +3029,7 @@ ACMD(do_build)
if (setID != 14105 && setID != 14115 && setID != 14125) if (setID != 14105 && setID != 14115 && setID != 14125)
{ {
sys_log(0, "BUILD_WALL: wrong wall set id %d", setID); SPDLOG_WARN("BUILD_WALL: wrong wall set id {}", setID);
break; break;
} }
else else

View File

@ -15,7 +15,6 @@
#include "war_map.h" #include "war_map.h"
#include "locale_service.h" #include "locale_service.h"
#include "config.h" #include "config.h"
#include "dev_log.h"
#include "db.h" #include "db.h"
#include "skill_power.h" #include "skill_power.h"
@ -161,24 +160,24 @@ void map_allow_log()
std::set<int>::iterator i; std::set<int>::iterator i;
for (i = s_set_map_allows.begin(); i != s_set_map_allows.end(); ++i) for (i = s_set_map_allows.begin(); i != s_set_map_allows.end(); ++i)
sys_log(0, "MAP_ALLOW: %d", *i); SPDLOG_INFO("MAP_ALLOW: {}", *i);
} }
void map_allow_add(int index) void map_allow_add(int index)
{ {
if (map_allow_find(index) == true) if (map_allow_find(index) == true)
{ {
fprintf(stdout, "!!! FATAL ERROR !!! multiple MAP_ALLOW setting!!\n"); SPDLOG_CRITICAL("!!! FATAL ERROR !!! multiple MAP_ALLOW setting!!");
exit(1); exit(EXIT_FAILURE);
} }
if (s_set_map_allows.size() >= MAP_ALLOW_MAX_LEN) if (s_set_map_allows.size() >= MAP_ALLOW_MAX_LEN)
{ {
fprintf(stdout, "Fatal error: maximum allowed maps reached!\n"); SPDLOG_CRITICAL("Fatal error: maximum allowed maps reached!");
exit(1); exit(EXIT_FAILURE);
} }
fprintf(stdout, "MAP ALLOW %d\n", index); SPDLOG_INFO("MAP ALLOW {}", index);
s_set_map_allows.insert(index); s_set_map_allows.insert(index);
} }
@ -214,11 +213,11 @@ static void FN_log_adminpage()
while (iter != g_stAdminPageIP.end()) while (iter != g_stAdminPageIP.end())
{ {
dev_log(LOG_DEB0, "ADMIN_PAGE_IP = %s", (*iter).c_str()); SPDLOG_TRACE("ADMIN_PAGE_IP = {}", (*iter).c_str());
++iter; ++iter;
} }
dev_log(LOG_DEB0, "ADMIN_PAGE_PASSWORD = %s", g_stAdminPagePassword.c_str()); SPDLOG_TRACE("ADMIN_PAGE_PASSWORD = {}", g_stAdminPagePassword.c_str());
} }
/** /**
@ -308,14 +307,14 @@ void config_init(const string& st_localeServiceName)
if (!(fp = fopen(st_configFileName.c_str(), "r"))) if (!(fp = fopen(st_configFileName.c_str(), "r")))
{ {
fprintf(stderr, "Can not open [%s]\n", st_configFileName.c_str()); SPDLOG_CRITICAL("Can not open [{}]", st_configFileName);
exit(1); exit(EXIT_FAILURE);
} }
if (!GetIPInfo()) if (!GetIPInfo())
{ {
fprintf(stderr, "Failure in retrieving IP address information!\n"); SPDLOG_CRITICAL("Failure in retrieving IP address information!");
exit(1); exit(EXIT_FAILURE);
} }
char db_host[2][64], db_user[2][64], db_pwd[2][64], db_db[2][64]; char db_host[2][64], db_user[2][64], db_pwd[2][64], db_db[2][64];
@ -351,8 +350,8 @@ void config_init(const string& st_localeServiceName)
if (!(fpOnlyForDB = fopen(st_configFileName.c_str(), "r"))) if (!(fpOnlyForDB = fopen(st_configFileName.c_str(), "r")))
{ {
fprintf(stderr, "Can not open [%s]\n", st_configFileName.c_str()); SPDLOG_CRITICAL("Can not open [{}]", st_configFileName);
exit(1); exit(EXIT_FAILURE);
} }
while (fgets(buf, 256, fpOnlyForDB)) while (fgets(buf, 256, fpOnlyForDB))
@ -420,8 +419,8 @@ void config_init(const string& st_localeServiceName)
if (!*db_host[0] || !*db_user[0] || !*db_pwd[0] || !*db_db[0]) if (!*db_host[0] || !*db_user[0] || !*db_pwd[0] || !*db_db[0])
{ {
fprintf(stderr, "PLAYER_SQL syntax: logsql <host user password db>\n"); SPDLOG_CRITICAL("PLAYER_SQL syntax: logsql <host user password db>");
exit(1); exit(EXIT_FAILURE);
} }
char buf[1024]; char buf[1024];
@ -444,8 +443,8 @@ void config_init(const string& st_localeServiceName)
if (!*db_host[1] || !*db_user[1] || !*db_pwd[1] || !*db_db[1]) if (!*db_host[1] || !*db_user[1] || !*db_pwd[1] || !*db_db[1])
{ {
fprintf(stderr, "COMMON_SQL syntax: logsql <host user password db>\n"); SPDLOG_CRITICAL("COMMON_SQL syntax: logsql <host user password db>");
exit(1); exit(EXIT_FAILURE);
} }
char buf[1024]; char buf[1024];
@ -468,8 +467,8 @@ void config_init(const string& st_localeServiceName)
if (!*log_host || !*log_user || !*log_pwd || !*log_db) if (!*log_host || !*log_user || !*log_pwd || !*log_db)
{ {
fprintf(stderr, "LOG_SQL syntax: logsql <host user password db>\n"); SPDLOG_CRITICAL("LOG_SQL syntax: logsql <host user password db>");
exit(1); exit(EXIT_FAILURE);
} }
char buf[1024]; char buf[1024];
@ -490,7 +489,7 @@ void config_init(const string& st_localeServiceName)
puts("------------------------------------------------"); puts("------------------------------------------------");
puts("COMMON_SQL: HOST USER PASSWORD DATABASE"); puts("COMMON_SQL: HOST USER PASSWORD DATABASE");
puts(""); puts("");
exit(1); exit(EXIT_FAILURE);
} }
if (!isPlayerSQL) if (!isPlayerSQL)
@ -501,7 +500,7 @@ void config_init(const string& st_localeServiceName)
puts("------------------------------------------------"); puts("------------------------------------------------");
puts("PLAYER_SQL: HOST USER PASSWORD DATABASE"); puts("PLAYER_SQL: HOST USER PASSWORD DATABASE");
puts(""); puts("");
exit(1); exit(EXIT_FAILURE);
} }
// Common DB 가 Locale 정보를 가지고 있기 때문에 가장 먼저 접속해야 한다. // Common DB 가 Locale 정보를 가지고 있기 때문에 가장 먼저 접속해야 한다.
@ -525,8 +524,8 @@ void config_init(const string& st_localeServiceName)
if (pMsg->Get()->uiNumRows == 0) if (pMsg->Get()->uiNumRows == 0)
{ {
fprintf(stderr, "COMMON_SQL: DirectQuery failed : %s\n", szQuery); SPDLOG_CRITICAL("COMMON_SQL: DirectQuery failed: {}", szQuery);
exit(1); exit(EXIT_FAILURE);
} }
MYSQL_ROW row; MYSQL_ROW row;
@ -538,8 +537,8 @@ void config_init(const string& st_localeServiceName)
{ {
if (LocaleService_Init(row[1]) == false) if (LocaleService_Init(row[1]) == false)
{ {
fprintf(stderr, "COMMON_SQL: invalid locale key %s\n", row[1]); SPDLOG_CRITICAL("COMMON_SQL: invalid locale key {}", row[1]);
exit(1); exit(EXIT_FAILURE);
} }
} }
} }
@ -547,7 +546,7 @@ void config_init(const string& st_localeServiceName)
// 로케일 정보를 COMMON SQL에 세팅해준다. // 로케일 정보를 COMMON SQL에 세팅해준다.
// 참고로 g_stLocale 정보는 LocaleService_Init() 내부에서 세팅된다. // 참고로 g_stLocale 정보는 LocaleService_Init() 내부에서 세팅된다.
fprintf(stdout, "Setting DB to locale %s\n", g_stLocale.c_str()); SPDLOG_INFO("Setting DB to locale {}", g_stLocale.c_str());
AccountDB::instance().SetLocale(g_stLocale); AccountDB::instance().SetLocale(g_stLocale);
@ -558,11 +557,11 @@ void config_init(const string& st_localeServiceName)
if (!DBManager::instance().IsConnected()) if (!DBManager::instance().IsConnected())
{ {
fprintf(stderr, "PlayerSQL.ConnectError\n"); SPDLOG_CRITICAL("PlayerSQL.ConnectError");
exit(1); exit(EXIT_FAILURE);
} }
fprintf(stdout, "PlayerSQL connected\n"); SPDLOG_INFO("PlayerSQL connected");
if (false == g_bAuthServer) // 인증 서버가 아닐 경우 if (false == g_bAuthServer) // 인증 서버가 아닐 경우
{ {
@ -571,11 +570,11 @@ void config_init(const string& st_localeServiceName)
if (!LogManager::instance().IsConnected()) if (!LogManager::instance().IsConnected())
{ {
fprintf(stderr, "LogSQL.ConnectError\n"); SPDLOG_CRITICAL("LogSQL.ConnectError");
exit(1); exit(EXIT_FAILURE);
} }
fprintf(stdout, "LogSQL connected\n"); SPDLOG_INFO("LogSQL connected");
LogManager::instance().BootLog(g_stHostname.c_str(), g_bChannel); LogManager::instance().BootLog(g_stHostname.c_str(), g_bChannel);
} }
@ -590,8 +589,8 @@ void config_init(const string& st_localeServiceName)
if (pMsg->Get()->uiNumRows == 0) if (pMsg->Get()->uiNumRows == 0)
{ {
fprintf(stderr, "[SKILL_PERCENT] Query failed: %s", szQuery); SPDLOG_CRITICAL("[SKILL_PERCENT] Query failed: {}", szQuery);
exit(1); exit(EXIT_FAILURE);
} }
MYSQL_ROW row; MYSQL_ROW row;
@ -603,22 +602,21 @@ void config_init(const string& st_localeServiceName)
char num[128]; char num[128];
int aiBaseSkillPowerByLevelTable[SKILL_MAX_LEVEL+1]; int aiBaseSkillPowerByLevelTable[SKILL_MAX_LEVEL+1];
fprintf(stdout, "SKILL_POWER_BY_LEVEL %s\n", p); SPDLOG_INFO("SKILL_POWER_BY_LEVEL {}", p);
while (*p != '\0' && cnt < (SKILL_MAX_LEVEL + 1)) while (*p != '\0' && cnt < (SKILL_MAX_LEVEL + 1))
{ {
p = one_argument(p, num, sizeof(num)); p = one_argument(p, num, sizeof(num));
aiBaseSkillPowerByLevelTable[cnt++] = atoi(num); aiBaseSkillPowerByLevelTable[cnt++] = atoi(num);
//fprintf(stdout, "%d %d\n", cnt - 1, aiBaseSkillPowerByLevelTable[cnt - 1]);
if (*p == '\0') if (*p == '\0')
{ {
if (cnt != (SKILL_MAX_LEVEL + 1)) if (cnt != (SKILL_MAX_LEVEL + 1))
{ {
fprintf(stderr, "[SKILL_PERCENT] locale table has not enough skill information! (count: %d query: %s)", cnt, szQuery); SPDLOG_CRITICAL("[SKILL_PERCENT] locale table has not enough skill information! (count: {} query: {})", cnt, szQuery);
exit(1); exit(EXIT_FAILURE);
} }
fprintf(stdout, "SKILL_POWER_BY_LEVEL: Done! (count %d)\n", cnt); SPDLOG_INFO("SKILL_POWER_BY_LEVEL: Done! (count {})", cnt);
break; break;
} }
} }
@ -641,22 +639,21 @@ void config_init(const string& st_localeServiceName)
p = row[0]; p = row[0];
int aiSkillTable[SKILL_MAX_LEVEL + 1]; int aiSkillTable[SKILL_MAX_LEVEL + 1];
fprintf(stdout, "SKILL_POWER_BY_JOB %d %s\n", job, p); SPDLOG_INFO("SKILL_POWER_BY_JOB {} {}", job, p);
while (*p != '\0' && cnt < (SKILL_MAX_LEVEL + 1)) while (*p != '\0' && cnt < (SKILL_MAX_LEVEL + 1))
{ {
p = one_argument(p, num, sizeof(num)); p = one_argument(p, num, sizeof(num));
aiSkillTable[cnt++] = atoi(num); aiSkillTable[cnt++] = atoi(num);
//fprintf(stdout, "%d %d\n", cnt - 1, aiBaseSkillPowerByLevelTable[cnt - 1]);
if (*p == '\0') if (*p == '\0')
{ {
if (cnt != (SKILL_MAX_LEVEL + 1)) if (cnt != (SKILL_MAX_LEVEL + 1))
{ {
fprintf(stderr, "[SKILL_PERCENT] locale table has not enough skill information! (count: %d query: %s)", cnt, szQuery); SPDLOG_CRITICAL("[SKILL_PERCENT] locale table has not enough skill information! (count: {} query: {})", cnt, szQuery);
exit(1); exit(EXIT_FAILURE);
} }
fprintf(stdout, "SKILL_POWER_BY_JOB: Done! (job: %d count: %d)\n", job, cnt); SPDLOG_INFO("SKILL_POWER_BY_JOB: Done! (job: {} count: {})", job, cnt);
break; break;
} }
} }
@ -902,20 +899,20 @@ void config_init(const string& st_localeServiceName)
if (!*szIP || (!*szPort && strcasecmp(szIP, "master"))) if (!*szIP || (!*szPort && strcasecmp(szIP, "master")))
{ {
fprintf(stderr, "AUTH_SERVER: syntax error: <ip|master> <port>\n"); SPDLOG_CRITICAL("AUTH_SERVER: syntax error: <ip|master> <port>");
exit(1); exit(EXIT_FAILURE);
} }
g_bAuthServer = true; g_bAuthServer = true;
if (!strcasecmp(szIP, "master")) if (!strcasecmp(szIP, "master"))
fprintf(stdout, "AUTH_SERVER: I am the master\n"); SPDLOG_INFO("AUTH_SERVER: I am the master");
else else
{ {
g_stAuthMasterIP = szIP; g_stAuthMasterIP = szIP;
str_to_number(g_wAuthMasterPort, szPort); str_to_number(g_wAuthMasterPort, szPort);
fprintf(stdout, "AUTH_SERVER: master %s %u\n", g_stAuthMasterIP.c_str(), g_wAuthMasterPort); SPDLOG_INFO("AUTH_SERVER: master {} {}", g_stAuthMasterIP.c_str(), g_wAuthMasterPort);
} }
continue; continue;
} }
@ -927,7 +924,7 @@ void config_init(const string& st_localeServiceName)
TOKEN("quest_dir") TOKEN("quest_dir")
{ {
sys_log(0, "QUEST_DIR SETTING : %s", value_string); SPDLOG_INFO("QUEST_DIR SETTING : {}", value_string);
g_stQuestDir = value_string; g_stQuestDir = value_string;
} }
@ -935,7 +932,7 @@ void config_init(const string& st_localeServiceName)
{ {
//g_stQuestObjectDir = value_string; //g_stQuestObjectDir = value_string;
std::istringstream is(value_string); std::istringstream is(value_string);
sys_log(0, "QUEST_OBJECT_DIR SETTING : %s", value_string); SPDLOG_INFO("QUEST_OBJECT_DIR SETTING : {}", value_string);
string dir; string dir;
while (!is.eof()) while (!is.eof())
{ {
@ -943,7 +940,7 @@ void config_init(const string& st_localeServiceName)
if (is.fail()) if (is.fail())
break; break;
g_setQuestObjectDir.insert(dir); g_setQuestObjectDir.insert(dir);
sys_log(0, "QUEST_OBJECT_DIR INSERT : %s", dir .c_str()); SPDLOG_INFO("QUEST_OBJECT_DIR INSERT : {}", dir .c_str());
} }
} }
@ -1033,7 +1030,7 @@ void config_init(const string& st_localeServiceName)
TOKEN("pk_protect_level") TOKEN("pk_protect_level")
{ {
str_to_number(PK_PROTECT_LEVEL, value_string); str_to_number(PK_PROTECT_LEVEL, value_string);
fprintf(stderr, "PK_PROTECT_LEVEL: %d", PK_PROTECT_LEVEL); SPDLOG_INFO("PK_PROTECT_LEVEL: {}", PK_PROTECT_LEVEL);
} }
TOKEN("max_level") TOKEN("max_level")
@ -1042,7 +1039,7 @@ void config_init(const string& st_localeServiceName)
gPlayerMaxLevel = std::clamp<int>(gPlayerMaxLevel, 1, PLAYER_MAX_LEVEL_CONST); gPlayerMaxLevel = std::clamp<int>(gPlayerMaxLevel, 1, PLAYER_MAX_LEVEL_CONST);
fprintf(stderr, "PLAYER_MAX_LEVEL: %d\n", gPlayerMaxLevel); SPDLOG_INFO("PLAYER_MAX_LEVEL: {}", gPlayerMaxLevel);
} }
TOKEN("block_char_creation") TOKEN("block_char_creation")
@ -1065,20 +1062,20 @@ void config_init(const string& st_localeServiceName)
if (0 == db_port) if (0 == db_port)
{ {
fprintf(stderr, "DB_PORT not configured\n"); SPDLOG_CRITICAL("DB_PORT not configured");
exit(1); exit(EXIT_FAILURE);
} }
if (0 == g_bChannel) if (0 == g_bChannel)
{ {
fprintf(stderr, "CHANNEL not configured\n"); SPDLOG_CRITICAL("CHANNEL not configured");
exit(1); exit(EXIT_FAILURE);
} }
if (g_stHostname.empty()) if (g_stHostname.empty())
{ {
fprintf(stderr, "HOSTNAME must be configured.\n"); SPDLOG_CRITICAL("HOSTNAME must be configured.");
exit(1); exit(EXIT_FAILURE);
} }
// LOCALE_SERVICE // LOCALE_SERVICE
@ -1100,8 +1097,8 @@ void config_init(const string& st_localeServiceName)
if (!*cmd || !*levelname) if (!*cmd || !*levelname)
{ {
fprintf(stderr, "CMD syntax error: <cmd> <DISABLE | LOW_WIZARD | WIZARD | HIGH_WIZARD | GOD>\n"); SPDLOG_CRITICAL("CMD syntax error: <cmd> <DISABLE | LOW_WIZARD | WIZARD | HIGH_WIZARD | GOD>");
exit(1); exit(EXIT_FAILURE);
} }
if (!strcasecmp(levelname, "LOW_WIZARD")) if (!strcasecmp(levelname, "LOW_WIZARD"))
@ -1118,8 +1115,8 @@ void config_init(const string& st_localeServiceName)
level = GM_IMPLEMENTOR + 1; level = GM_IMPLEMENTOR + 1;
else else
{ {
fprintf(stderr, "CMD syntax error: <cmd> <DISABLE | LOW_WIZARD | WIZARD | HIGH_WIZARD | GOD>\n"); SPDLOG_CRITICAL("CMD syntax error: <cmd> <DISABLE | LOW_WIZARD | WIZARD | HIGH_WIZARD | GOD>");
exit(1); exit(EXIT_FAILURE);
} }
interpreter_set_privilege(cmd, level); interpreter_set_privilege(cmd, level);
@ -1164,7 +1161,7 @@ void LoadValidCRCList()
s_set_dwProcessCRC.insert(dwValidClientProcessCRC); s_set_dwProcessCRC.insert(dwValidClientProcessCRC);
s_set_dwFileCRC.insert(dwValidClientFileCRC); s_set_dwFileCRC.insert(dwValidClientFileCRC);
fprintf(stderr, "CLIENT_CRC: %u %u\n", dwValidClientProcessCRC, dwValidClientFileCRC); SPDLOG_INFO("CLIENT_CRC: {} {}", dwValidClientProcessCRC, dwValidClientFileCRC);
} }
fclose(fp); fclose(fp);
@ -1184,7 +1181,7 @@ bool LoadClientVersion()
char * p = strchr(buf, '\n'); char * p = strchr(buf, '\n');
if (p) *p = '\0'; if (p) *p = '\0';
fprintf(stderr, "VERSION: \"%s\"\n", buf); SPDLOG_INFO("VERSION: \"{}\"", buf);
g_stClientVersion = buf; g_stClientVersion = buf;
fclose(fp); fclose(fp);

View File

@ -12,7 +12,6 @@
#include "utils.h" #include "utils.h"
#include "log.h" #include "log.h"
#include "char.h" #include "char.h"
#include "dev_log.h"
#include "locale_service.h" #include "locale_service.h"
#include "item.h" #include "item.h"
#include "item_manager.h" #include "item_manager.h"
@ -297,17 +296,13 @@ void Cube_open (LPCHARACTER ch)
npc = ch->GetQuestNPC(); npc = ch->GetQuestNPC();
if (NULL==npc) if (NULL==npc)
{ {
if (test_server) SPDLOG_TRACE("cube_npc is NULL");
dev_log(LOG_DEB0, "cube_npc is NULL");
return; return;
} }
if ( FN_check_valid_npc(npc->GetRaceNum()) == false ) if ( FN_check_valid_npc(npc->GetRaceNum()) == false )
{ {
if ( test_server == true ) SPDLOG_TRACE("cube not valid NPC");
{
dev_log(LOG_DEB0, "cube not valid NPC");
}
return; return;
} }
@ -326,7 +321,7 @@ void Cube_open (LPCHARACTER ch)
if (distance >= CUBE_MAX_DISTANCE) if (distance >= CUBE_MAX_DISTANCE)
{ {
sys_log(1, "CUBE: TOO_FAR: %s distance %d", ch->GetName(), distance); SPDLOG_DEBUG("CUBE: TOO_FAR: {} distance {}", ch->GetName(), distance);
return; return;
} }
@ -343,7 +338,7 @@ void Cube_close (LPCHARACTER ch)
Cube_clean_item(ch); Cube_clean_item(ch);
ch->SetCubeNpc(NULL); ch->SetCubeNpc(NULL);
ch->ChatPacket(CHAT_TYPE_COMMAND, "cube close"); ch->ChatPacket(CHAT_TYPE_COMMAND, "cube close");
dev_log(LOG_DEB0, "<CUBE> close (%s)", ch->GetName()); SPDLOG_TRACE("<CUBE> close ({})", ch->GetName());
} }
void Cube_init() void Cube_init()
@ -354,7 +349,7 @@ void Cube_init()
char file_name[256+1]; char file_name[256+1];
snprintf(file_name, sizeof(file_name), "%s/cube.txt", LocaleService_GetBasePath().c_str()); snprintf(file_name, sizeof(file_name), "%s/cube.txt", LocaleService_GetBasePath().c_str());
sys_log(0, "Cube_Init %s", file_name); SPDLOG_INFO("Cube_Init {}", file_name);
for (iter = s_cube_proto.begin(); iter!=s_cube_proto.end(); iter++) for (iter = s_cube_proto.begin(); iter!=s_cube_proto.end(); iter++)
{ {
@ -365,7 +360,7 @@ void Cube_init()
s_cube_proto.clear(); s_cube_proto.clear();
if (false == Cube_load(file_name)) if (false == Cube_load(file_name))
sys_err("Cube_Init failed"); SPDLOG_ERROR("Cube_Init failed");
} }
bool Cube_load (const char *file) bool Cube_load (const char *file)
@ -439,7 +434,7 @@ bool Cube_load (const char *file)
// TODO : check cube data // TODO : check cube data
if (false == FN_check_cube_data(cube_data)) if (false == FN_check_cube_data(cube_data))
{ {
dev_log(LOG_DEB0, "something wrong"); SPDLOG_TRACE("something wrong");
M2_DELETE(cube_data); M2_DELETE(cube_data);
continue; continue;
} }
@ -454,23 +449,23 @@ bool Cube_load (const char *file)
static void FN_cube_print (CUBE_DATA *data, DWORD index) static void FN_cube_print (CUBE_DATA *data, DWORD index)
{ {
DWORD i; DWORD i;
dev_log(LOG_DEB0, "--------------------------------"); SPDLOG_TRACE("--------------------------------");
dev_log(LOG_DEB0, "CUBE_DATA[%d]", index); SPDLOG_TRACE("CUBE_DATA[{}]", index);
for (i=0; i<data->npc_vnum.size(); ++i) for (i=0; i<data->npc_vnum.size(); ++i)
{ {
dev_log(LOG_DEB0, "\tNPC_VNUM[%d] = %d", i, data->npc_vnum[i]); SPDLOG_TRACE("\tNPC_VNUM[{}] = {}", i, data->npc_vnum[i]);
} }
for (i=0; i<data->item.size(); ++i) for (i=0; i<data->item.size(); ++i)
{ {
dev_log(LOG_DEB0, "\tITEM[%d] = (%d, %d)", i, data->item[i].vnum, data->item[i].count); SPDLOG_TRACE("\tITEM[{}] = ({}, {})", i, data->item[i].vnum, data->item[i].count);
} }
for (i=0; i<data->reward.size(); ++i) for (i=0; i<data->reward.size(); ++i)
{ {
dev_log(LOG_DEB0, "\tREWARD[%d] = (%d, %d)", i, data->reward[i].vnum, data->reward[i].count); SPDLOG_TRACE("\tREWARD[{}] = ({}, {})", i, data->reward[i].vnum, data->reward[i].count);
} }
dev_log(LOG_DEB0, "\tPERCENT = %d", data->percent); SPDLOG_TRACE("\tPERCENT = {}", data->percent);
dev_log(LOG_DEB0, "--------------------------------"); SPDLOG_TRACE("--------------------------------");
} }
void Cube_print () void Cube_print ()
@ -772,9 +767,7 @@ void Cube_MakeCubeInformationText()
sprintf(temp, "%d", materialInfo.gold); sprintf(temp, "%d", materialInfo.gold);
infoText += std::string("/") + temp; infoText += std::string("/") + temp;
} }
} // for resultList
//sys_err("\t\tNPC: %d, Reward: %d(%s)\n\t\t\tInfo: %s", npcVNUM, materialInfo.reward.vnum, ITEM_MANAGER::Instance().GetTable(materialInfo.reward.vnum)->szName, materialInfo.infoText.c_str());
} // for resultList
} // for npc } // for npc
} }
@ -789,12 +782,12 @@ bool Cube_InformationInitialize()
// 하드코딩 ㅈㅅ // 하드코딩 ㅈㅅ
if (1 != rewards.size()) if (1 != rewards.size())
{ {
sys_err("[CubeInfo] WARNING! Does not support multiple rewards (count: %d)", rewards.size()); SPDLOG_ERROR("[CubeInfo] WARNING! Does not support multiple rewards (count: {})", rewards.size());
continue; continue;
} }
//if (1 != cubeData->npc_vnum.size()) //if (1 != cubeData->npc_vnum.size())
//{ //{
// sys_err("[CubeInfo] WARNING! Does not support multiple NPC (count: %d)", cubeData->npc_vnum.size()); // SPDLOG_ERROR("[CubeInfo] WARNING! Does not support multiple NPC (count: {})", cubeData->npc_vnum.size());
// continue; // continue;
//} //}
@ -828,7 +821,7 @@ bool Cube_InformationInitialize()
TItemTable* existMaterialProto = ITEM_MANAGER::Instance().GetTable(existMaterialIter->vnum); TItemTable* existMaterialProto = ITEM_MANAGER::Instance().GetTable(existMaterialIter->vnum);
if (NULL == existMaterialProto) if (NULL == existMaterialProto)
{ {
sys_err("There is no item(%u)", existMaterialIter->vnum); SPDLOG_ERROR("There is no item({})", existMaterialIter->vnum);
return false; return false;
} }
SItemNameAndLevel existItemInfo = SplitItemNameAndLevelFromName(existMaterialProto->szName); SItemNameAndLevel existItemInfo = SplitItemNameAndLevelFromName(existMaterialProto->szName);
@ -908,7 +901,7 @@ void Cube_request_result_list(LPCHARACTER ch)
// 채팅 패킷의 한계를 넘어가면 에러 남김... 기획자 분들 께 조정해달라고 요청하거나, 나중에 다른 방식으로 바꾸거나... // 채팅 패킷의 한계를 넘어가면 에러 남김... 기획자 분들 께 조정해달라고 요청하거나, 나중에 다른 방식으로 바꾸거나...
if (resultText.size() - 20 >= CHAT_MAX_LEN) if (resultText.size() - 20 >= CHAT_MAX_LEN)
{ {
sys_err("[CubeInfo] Too long cube result list text. (NPC: %d, length: %d)", npcVNUM, resultText.size()); SPDLOG_ERROR("[CubeInfo] Too long cube result list text. (NPC: {}, length: {})", npcVNUM, resultText.size());
resultText.clear(); resultText.clear();
resultCount = 0; resultCount = 0;
} }
@ -958,7 +951,7 @@ void Cube_request_material_info(LPCHARACTER ch, int requestStartIndex, int reque
if (false == bCatchInfo) if (false == bCatchInfo)
{ {
sys_err("[CubeInfo] Can't find matched material info (NPC: %d, index: %d, request count: %d)", npcVNUM, requestStartIndex, requestCount); SPDLOG_ERROR("[CubeInfo] Can't find matched material info (NPC: {}, index: {}, request count: {})", npcVNUM, requestStartIndex, requestCount);
return; return;
} }
@ -968,7 +961,7 @@ void Cube_request_material_info(LPCHARACTER ch, int requestStartIndex, int reque
// (Server -> Client) /cube m_info start_index count 125,1|126,2|127,2|123,5&555,5&555,4/120000 // (Server -> Client) /cube m_info start_index count 125,1|126,2|127,2|123,5&555,5&555,4/120000
if (materialInfoText.size() - 20 >= CHAT_MAX_LEN) if (materialInfoText.size() - 20 >= CHAT_MAX_LEN)
{ {
sys_err("[CubeInfo] Too long material info. (NPC: %d, requestStart: %d, requestCount: %d, length: %d)", npcVNUM, requestStartIndex, requestCount, materialInfoText.size()); SPDLOG_ERROR("[CubeInfo] Too long material info. (NPC: {}, requestStart: {}, requestCount: {}, length: {})", npcVNUM, requestStartIndex, requestCount, materialInfoText.size());
} }
ch->ChatPacket(CHAT_TYPE_COMMAND, "cube m_info %d %d %s", requestStartIndex, requestCount, materialInfoText.c_str()); ch->ChatPacket(CHAT_TYPE_COMMAND, "cube m_info %d %d %s", requestStartIndex, requestCount, materialInfoText.c_str());

View File

@ -36,7 +36,7 @@ bool DBManager::Connect(const char * host, const int port, const char * user, co
m_bIsConnect = true; m_bIsConnect = true;
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))
sys_err("cannot open direct sql connection to host %s", host); SPDLOG_ERROR("cannot open direct sql connection to host {}", host);
if (m_bIsConnect && !g_bAuthServer) if (m_bIsConnect && !g_bAuthServer)
{ {
@ -77,7 +77,6 @@ bool DBManager::IsConnected()
void DBManager::ReturnQuery(int iType, DWORD dwIdent, void * pvData, const char * c_pszFormat, ...) void DBManager::ReturnQuery(int iType, DWORD dwIdent, void * pvData, const char * c_pszFormat, ...)
{ {
//sys_log(0, "ReturnQuery %s", c_pszQuery);
char szQuery[4096]; char szQuery[4096];
va_list args; va_list args;
@ -163,7 +162,7 @@ void DBManager::DeleteLoginData(CLoginData * pkLD)
if (it == m_map_pkLoginData.end()) if (it == m_map_pkLoginData.end())
return; return;
sys_log(0, "DeleteLoginData %s %p", pkLD->GetLogin(), pkLD); SPDLOG_DEBUG("DeleteLoginData {} {}", pkLD->GetLogin(), (void*) pkLD);
mapLDBilling.erase(pkLD->GetLogin()); mapLDBilling.erase(pkLD->GetLogin());
@ -177,7 +176,7 @@ void DBManager::SetBilling(DWORD dwKey, bool bOn, bool bSkipPush)
if (it == m_map_pkLoginData.end()) if (it == m_map_pkLoginData.end())
{ {
sys_err("cannot find login key %u", dwKey); SPDLOG_ERROR("cannot find login key {}", dwKey);
return; return;
} }
@ -214,7 +213,7 @@ void DBManager::PushBilling(CLoginData * pkLD)
t.dwLoginKey = pkLD->GetKey(); t.dwLoginKey = pkLD->GetKey();
t.bBillType = pkLD->GetBillType(); t.bBillType = pkLD->GetBillType();
sys_log(0, "BILLING: PUSH %s %u type %u", pkLD->GetLogin(), t.dwUseSec, t.bBillType); SPDLOG_DEBUG("BILLING: PUSH {} {} type {}", pkLD->GetLogin(), t.dwUseSec, t.bBillType);
if (t.bBillType == BILLING_IP_FREE || t.bBillType == BILLING_IP_TIME || t.bBillType == BILLING_IP_DAY) if (t.bBillType == BILLING_IP_FREE || t.bBillType == BILLING_IP_TIME || t.bBillType == BILLING_IP_DAY)
snprintf(t.szLogin, sizeof(t.szLogin), "%u", pkLD->GetBillID()); snprintf(t.szLogin, sizeof(t.szLogin), "%u", pkLD->GetBillID());
@ -335,7 +334,7 @@ void DBManager::FlushBilling(bool bForce)
else else
m_vec_kUseTime.clear(); m_vec_kUseTime.clear();
sys_log(0, "FLUSH_USE_TIME: count %u", dwCount); SPDLOG_DEBUG("FLUSH_USE_TIME: count {}", dwCount);
} }
if (m_vec_kUseTime.size() < 10240) if (m_vec_kUseTime.size() < 10240)
@ -374,7 +373,7 @@ void DBManager::FlushBilling(bool bForce)
if (dwSecsConnected >= 60) // 60 second cycle if (dwSecsConnected >= 60) // 60 second cycle
{ {
sys_log(0, "BILLING 1 %s remain %d connected secs %u", SPDLOG_DEBUG("BILLING 1 {} remain {} connected secs {}",
pkLD->GetLogin(), pkLD->GetRemainSecs(), dwSecsConnected); pkLD->GetLogin(), pkLD->GetRemainSecs(), dwSecsConnected);
PushBilling(pkLD); PushBilling(pkLD);
} }
@ -385,7 +384,7 @@ void DBManager::FlushBilling(bool bForce)
if (dwSecsConnected > (DWORD) (pkLD->GetRemainSecs() - 600) || dwSecsConnected >= 600) if (dwSecsConnected > (DWORD) (pkLD->GetRemainSecs() - 600) || dwSecsConnected >= 600)
{ {
sys_log(0, "BILLING 2 %s remain %d connected secs %u", SPDLOG_DEBUG("BILLING 2 {} remain {} connected secs {}",
pkLD->GetLogin(), pkLD->GetRemainSecs(), dwSecsConnected); pkLD->GetLogin(), pkLD->GetRemainSecs(), dwSecsConnected);
PushBilling(pkLD); PushBilling(pkLD);
} }
@ -402,8 +401,6 @@ void DBManager::CheckBilling()
std::vector<DWORD> vec; std::vector<DWORD> vec;
vec.push_back(0); // 카운트를 위해 미리 비워둔다. vec.push_back(0); // 카운트를 위해 미리 비워둔다.
//sys_log(0, "CheckBilling: map size %d", m_map_pkLoginData.size());
itertype(m_map_pkLoginData) it = m_map_pkLoginData.begin(); itertype(m_map_pkLoginData) it = m_map_pkLoginData.begin();
while (it != m_map_pkLoginData.end()) while (it != m_map_pkLoginData.end())
@ -412,7 +409,7 @@ void DBManager::CheckBilling()
if (pkLD->IsBilling()) if (pkLD->IsBilling())
{ {
sys_log(0, "BILLING: CHECK %u", pkLD->GetKey()); SPDLOG_DEBUG("BILLING: CHECK {}", pkLD->GetKey());
vec.push_back(pkLD->GetKey()); vec.push_back(pkLD->GetKey());
} }
} }
@ -460,7 +457,7 @@ void DBManager::SendAuthLogin(LPDESC d)
memcpy(&ptod.adwClientKey, pkLD->GetClientKey(), sizeof(DWORD) * 4); memcpy(&ptod.adwClientKey, pkLD->GetClientKey(), sizeof(DWORD) * 4);
db_clientdesc->DBPacket(HEADER_GD_AUTH_LOGIN, d->GetHandle(), &ptod, sizeof(TPacketGDAuthLogin)); db_clientdesc->DBPacket(HEADER_GD_AUTH_LOGIN, d->GetHandle(), &ptod, sizeof(TPacketGDAuthLogin));
sys_log(0, "SendAuthLogin %s key %u", ptod.szLogin, ptod.dwID); SPDLOG_DEBUG("SendAuthLogin {} key {}", ptod.szLogin, ptod.dwID);
SendLoginPing(r.login); SendLoginPing(r.login);
} }
@ -499,7 +496,7 @@ void DBManager::LoginPrepare(BYTE bBillType, DWORD dwBillID, int lRemainSecs, LP
d->Packet(&pm, sizeof(TPacketGCMatrixCard)); d->Packet(&pm, sizeof(TPacketGCMatrixCard));
sys_log(0, "MATRIX_QUERY: %s %c%d %c%d %c%d %c%d %s", SPDLOG_DEBUG("MATRIX_QUERY: {} {}{} {}{} {}{} {}{} {}",
r.login, r.login,
MATRIX_CARD_ROW(rows, 0) + 'A', MATRIX_CARD_ROW(rows, 0) + 'A',
MATRIX_CARD_COL(cols, 0) + 1, MATRIX_CARD_COL(cols, 0) + 1,
@ -581,7 +578,7 @@ bool GetGameTime(MYSQL_RES * pRes, BYTE & bBillType, int & seconds)
return true; return true;
MYSQL_ROW row = mysql_fetch_row(pRes); MYSQL_ROW row = mysql_fetch_row(pRes);
sys_log(1, "GetGameTime %p %p %p", row[0], row[1], row[2]); SPDLOG_DEBUG("GetGameTime {} {} {}", row[0], row[1], row[2]);
int type = 0; int type = 0;
str_to_number(type, row[0]); str_to_number(type, row[0]);
@ -616,7 +613,7 @@ void SendBillingExpire(const char * c_pszLogin, BYTE bBillType, int iSecs, CLogi
ptod.bBillType = bBillType; ptod.bBillType = bBillType;
ptod.dwRemainSeconds = std::max(0, iSecs); ptod.dwRemainSeconds = std::max(0, iSecs);
db_clientdesc->DBPacket(HEADER_GD_BILLING_EXPIRE, 0, &ptod, sizeof(TPacketBillingExpire)); db_clientdesc->DBPacket(HEADER_GD_BILLING_EXPIRE, 0, &ptod, sizeof(TPacketBillingExpire));
sys_log(0, "BILLING: EXPIRE %s type %d sec %d ptr %p", c_pszLogin, bBillType, iSecs, pkLD); SPDLOG_DEBUG("BILLING: EXPIRE {} type {} sec {} ptr {}", c_pszLogin, bBillType, iSecs, (void*) pkLD);
} }
void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg) void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
@ -638,11 +635,11 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
//위치 변경 - By SeMinZ //위치 변경 - By SeMinZ
d->SetLogin(pinfo->login); d->SetLogin(pinfo->login);
sys_log(0, "QID_AUTH_LOGIN: START %u %p", qi->dwIdent, get_pointer(d)); SPDLOG_DEBUG("QID_AUTH_LOGIN: START {} {}", qi->dwIdent, (void*) get_pointer(d));
if (pMsg->Get()->uiNumRows == 0) if (pMsg->Get()->uiNumRows == 0)
{ {
sys_log(0, " NOID"); SPDLOG_DEBUG(" NOID");
LoginFailure(d, "NOID"); LoginFailure(d, "NOID");
M2_DELETE(pinfo); M2_DELETE(pinfo);
} }
@ -661,7 +658,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (!row[col]) if (!row[col])
{ {
sys_err("error column %d", col); SPDLOG_ERROR("error column {}", col);
M2_DELETE(pinfo); M2_DELETE(pinfo);
break; break;
} }
@ -670,7 +667,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (!row[col]) if (!row[col])
{ {
sys_err("error column %d", col); SPDLOG_ERROR("error column {}", col);
M2_DELETE(pinfo); M2_DELETE(pinfo);
break; break;
} }
@ -689,7 +686,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (!row[col]) if (!row[col])
{ {
sys_err("error column %d", col); SPDLOG_ERROR("error column {}", col);
M2_DELETE(pinfo); M2_DELETE(pinfo);
break; break;
} }
@ -698,7 +695,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (!row[col]) if (!row[col])
{ {
sys_err("error column %d", col); SPDLOG_ERROR("error column {}", col);
M2_DELETE(pinfo); M2_DELETE(pinfo);
break; break;
} }
@ -707,7 +704,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (!row[col]) if (!row[col])
{ {
sys_err("error column %d", col); SPDLOG_ERROR("error column {}", col);
M2_DELETE(pinfo); M2_DELETE(pinfo);
break; break;
} }
@ -752,8 +749,8 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
tm1 = localtime(&create_time); tm1 = localtime(&create_time);
strftime(szCreateDate, 255, "%Y%m%d", tm1); strftime(szCreateDate, 255, "%Y%m%d", tm1);
sys_log(0, "Create_Time %d %s", retValue, szCreateDate); SPDLOG_DEBUG("Create_Time {} {}", retValue, szCreateDate);
sys_log(0, "Block Time %d ", strncmp(szCreateDate, g_stBlockDate.c_str(), 8)); SPDLOG_DEBUG("Block Time {} ", strncmp(szCreateDate, g_stBlockDate.c_str(), 8));
} }
} }
@ -767,25 +764,25 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (nPasswordDiff) if (nPasswordDiff)
{ {
LoginFailure(d, "WRONGPWD"); LoginFailure(d, "WRONGPWD");
sys_log(0, " WRONGPWD"); SPDLOG_DEBUG(" WRONGPWD");
M2_DELETE(pinfo); M2_DELETE(pinfo);
} }
else if (bNotAvail) else if (bNotAvail)
{ {
LoginFailure(d, "NOTAVAIL"); LoginFailure(d, "NOTAVAIL");
sys_log(0, " NOTAVAIL"); SPDLOG_DEBUG(" NOTAVAIL");
M2_DELETE(pinfo); M2_DELETE(pinfo);
} }
else if (DESC_MANAGER::instance().FindByLoginName(pinfo->login)) else if (DESC_MANAGER::instance().FindByLoginName(pinfo->login))
{ {
LoginFailure(d, "ALREADY"); LoginFailure(d, "ALREADY");
sys_log(0, " ALREADY"); SPDLOG_DEBUG(" ALREADY");
M2_DELETE(pinfo); M2_DELETE(pinfo);
} }
else if (strcmp(szStatus, "OK")) else if (strcmp(szStatus, "OK"))
{ {
LoginFailure(d, szStatus); LoginFailure(d, szStatus);
sys_log(0, " STATUS: %s", szStatus); SPDLOG_DEBUG(" STATUS: {}", szStatus);
M2_DELETE(pinfo); M2_DELETE(pinfo);
} }
else else
@ -796,7 +793,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (strncmp(szCreateDate, g_stBlockDate.c_str(), 8) >= 0) if (strncmp(szCreateDate, g_stBlockDate.c_str(), 8) >= 0)
{ {
LoginFailure(d, "BLKLOGIN"); LoginFailure(d, "BLKLOGIN");
sys_log(0, " BLKLOGIN"); SPDLOG_DEBUG(" BLKLOGIN");
M2_DELETE(pinfo); M2_DELETE(pinfo);
break; break;
} }
@ -824,7 +821,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
break; break;
} }
sys_log(0, "QID_AUTH_LOGIN: SUCCESS %s", pinfo->login); SPDLOG_DEBUG("QID_AUTH_LOGIN: SUCCESS {}", pinfo->login);
} }
} }
} }
@ -835,7 +832,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
TPacketCGLogin3 * pinfo = (TPacketCGLogin3 *) qi->pvData; TPacketCGLogin3 * pinfo = (TPacketCGLogin3 *) qi->pvData;
LPDESC d = DESC_MANAGER::instance().FindByLoginKey(qi->dwIdent); LPDESC d = DESC_MANAGER::instance().FindByLoginKey(qi->dwIdent);
sys_log(0, "QID_BILLING_GET_TIME: START ident %u d %p", qi->dwIdent, get_pointer(d)); SPDLOG_DEBUG("QID_BILLING_GET_TIME: START ident {} d {}", qi->dwIdent, (void*) get_pointer(d));
if (d) if (d)
{ {
@ -853,18 +850,18 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (!GetGameTime(pMsg->Get()->pSQLResult, bBillType, seconds)) if (!GetGameTime(pMsg->Get()->pSQLResult, bBillType, seconds))
{ {
sys_log(0, "QID_BILLING_GET_TIME: BLOCK"); SPDLOG_DEBUG("QID_BILLING_GET_TIME: BLOCK");
LoginFailure(d, "BLOCK"); LoginFailure(d, "BLOCK");
} }
else if (bBillType == BILLING_NONE) else if (bBillType == BILLING_NONE)
{ {
LoginFailure(d, "NOBILL"); LoginFailure(d, "NOBILL");
sys_log(0, "QID_BILLING_GET_TIME: NO TIME"); SPDLOG_DEBUG("QID_BILLING_GET_TIME: NO TIME");
} }
else else
{ {
LoginPrepare(bBillType, 0, seconds, d, pinfo->adwClientKey); LoginPrepare(bBillType, 0, seconds, d, pinfo->adwClientKey);
sys_log(0, "QID_BILLING_GET_TIME: SUCCESS"); SPDLOG_DEBUG("QID_BILLING_GET_TIME: SUCCESS");
} }
} }
} }
@ -961,7 +958,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (row[0] && row[1]) if (row[0] && row[1])
{ {
m_map_dbstring.insert(make_pair(std::string(row[0]), std::string(row[1]))); m_map_dbstring.insert(make_pair(std::string(row[0]), std::string(row[1])));
sys_log(0, "DBSTR '%s' '%s'", row[0], row[1]); SPDLOG_DEBUG("DBSTR '{}' '{}'", row[0], row[1]);
} }
} }
if (m_map_dbstring.find("GREET") != m_map_dbstring.end()) if (m_map_dbstring.find("GREET") != m_map_dbstring.end())
@ -986,7 +983,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
{ {
if (pMsg->Get()->uiAffectedRows == 0 || pMsg->Get()->uiAffectedRows == (uint32_t)-1) if (pMsg->Get()->uiAffectedRows == 0 || pMsg->Get()->uiAffectedRows == (uint32_t)-1)
{ {
sys_log(0, "GIVE LOTTO FAIL TO pid %u", ch->GetPlayerID()); SPDLOG_DEBUG("GIVE LOTTO FAIL TO pid {}", ch->GetPlayerID());
} }
else else
{ {
@ -994,14 +991,14 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (pkItem) if (pkItem)
{ {
sys_log(0, "GIVE LOTTO SUCCESS TO %s (pid %u)", ch->GetName(), qi->dwIdent); SPDLOG_DEBUG("GIVE LOTTO SUCCESS TO {} (pid {})", ch->GetName(), qi->dwIdent);
//ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아이템 획득: %s"), pkItem->GetName()); //ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("아이템 획득: %s"), pkItem->GetName());
pkItem->SetSocket(0, pMsg->Get()->uiInsertID); pkItem->SetSocket(0, pMsg->Get()->uiInsertID);
pkItem->SetSocket(1, pdw[2]); pkItem->SetSocket(1, pdw[2]);
} }
else else
sys_log(0, "GIVE LOTTO FAIL2 TO pid %u", ch->GetPlayerID()); SPDLOG_DEBUG("GIVE LOTTO FAIL2 TO pid {}", ch->GetPlayerID());
} }
} }
@ -1080,8 +1077,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
const char* c_szName = row[0]; const char* c_szName = row[0];
const char* c_szUpdateTime = row[12]; const char* c_szUpdateTime = row[12];
if (test_server) SPDLOG_TRACE("{}:{}", c_szName, c_szUpdateTime);
sys_log(0, "%s:%s", c_szName, c_szUpdateTime);
if (PCBANG_IP_TABLE_NAME == c_szName) if (PCBANG_IP_TABLE_NAME == c_szName)
{ {
@ -1091,12 +1087,12 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (s_stLastTime != c_szUpdateTime) if (s_stLastTime != c_szUpdateTime)
{ {
s_stLastTime = c_szUpdateTime; s_stLastTime = c_szUpdateTime;
sys_log(0, "'%s' mysql table is UPDATED(%s)", PCBANG_IP_TABLE_NAME.c_str(), c_szUpdateTime); SPDLOG_DEBUG("'{}' mysql table is UPDATED({})", PCBANG_IP_TABLE_NAME, c_szUpdateTime);
ReturnQuery(QID_PCBANG_IP_LIST_SELECT, 0, NULL, "SELECT pcbang_id, ip FROM %s;", PCBANG_IP_TABLE_NAME.c_str()); ReturnQuery(QID_PCBANG_IP_LIST_SELECT, 0, NULL, "SELECT pcbang_id, ip FROM %s;", PCBANG_IP_TABLE_NAME.c_str());
} }
else else
{ {
sys_log(0, "'%s' mysql table is NOT updated(%s)", PCBANG_IP_TABLE_NAME.c_str(), c_szUpdateTime); SPDLOG_DEBUG("'{}' mysql table is NOT updated({})", PCBANG_IP_TABLE_NAME, c_szUpdateTime);
} }
break; break;
} }
@ -1104,12 +1100,12 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
if (!isFinded) if (!isFinded)
{ {
sys_err(0, "'%s' mysql table CANNOT FIND", PCBANG_IP_TABLE_NAME.c_str()); SPDLOG_ERROR("'{}' mysql table CANNOT FIND", PCBANG_IP_TABLE_NAME);
} }
} }
else if (test_server) else if (test_server)
{ {
sys_err(0, "'%s' mysql table is NOT EXIST", PCBANG_IP_TABLE_NAME.c_str()); SPDLOG_ERROR("'{}' mysql table is NOT EXIST", PCBANG_IP_TABLE_NAME);
} }
} }
break; break;
@ -1125,10 +1121,8 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
CPCBangManager::instance().InsertIP(row[0], row[1]); CPCBangManager::instance().InsertIP(row[0], row[1]);
} }
} }
else if (test_server) else
{ SPDLOG_TRACE("PCBANG_IP_LIST is EMPTY");
sys_log(0, "PCBANG_IP_LIST is EMPTY");
}
} }
break; break;
@ -1136,7 +1130,7 @@ void DBManager::AnalyzeReturnQuery(SQLMsg * pMsg)
// END_OF_PCBANG_IP_LIST // END_OF_PCBANG_IP_LIST
default: default:
sys_err("FATAL ERROR!!! Unhandled return query id %d", qi->iType); SPDLOG_ERROR("FATAL ERROR!!! Unhandled return query id {}", qi->iType);
break; break;
} }
@ -1193,7 +1187,7 @@ void VCardUse(LPCHARACTER CardOwner, LPCHARACTER CardTaker, LPITEM item)
ITEM_MANAGER::instance().RemoveItem(item); ITEM_MANAGER::instance().RemoveItem(item);
sys_log(0, "VCARD_TAKE: %u %s -> %s", p.dwID, CardOwner->GetName(), CardTaker->GetName()); SPDLOG_DEBUG("VCARD_TAKE: {} {} -> {}", p.dwID, CardOwner->GetName(), CardTaker->GetName());
} }
void DBManager::StopAllBilling() void DBManager::StopAllBilling()

View File

@ -29,9 +29,6 @@ void DescReadHandler(bufferevent *bev, void *ctx) {
{ {
int size = d->ProcessInput(); int size = d->ProcessInput();
if (size)
sys_log(1, "DB_BYTES_READ: %d", size);
if (size < 0) if (size < 0)
{ {
d->SetPhase(PHASE_CLOSE); d->SetPhase(PHASE_CLOSE);
@ -50,15 +47,11 @@ void DescWriteHandler(bufferevent *bev, void *ctx) {
{ {
evbuffer *output = bufferevent_get_output(bev); evbuffer *output = bufferevent_get_output(bev);
size_t buf_size = evbuffer_get_length(output); size_t buf_size = evbuffer_get_length(output);
if (buf_size)
sys_log(1, "DB_BYTES_WRITE: size %d", buf_size);
} }
else if (g_TeenDesc==d) else if (g_TeenDesc==d)
{ {
evbuffer *output = bufferevent_get_output(bev); evbuffer *output = bufferevent_get_output(bev);
size_t buf_size = evbuffer_get_length(output); size_t buf_size = evbuffer_get_length(output);
if (buf_size)
sys_log(0, "TEEN::Send(size %d)", buf_size);
} }
} }
@ -66,10 +59,10 @@ void DescEventHandler(bufferevent *bev, short events, void *ctx) {
auto* d = (LPDESC) ctx; auto* d = (LPDESC) ctx;
if (events & BEV_EVENT_ERROR) if (events & BEV_EVENT_ERROR)
sys_err("DESC libevent error, handle: %d", d->GetHandle()); SPDLOG_ERROR("DESC libevent error, handle: {}", d->GetHandle());
if (events & BEV_EVENT_EOF) if (events & BEV_EVENT_EOF)
sys_log(0, "DESC disconnected: handle %d", d->GetHandle()); SPDLOG_DEBUG("DESC disconnected: handle {}", d->GetHandle());
// Either the socket was closed or an error occured, therefore we can disconnect this peer. // Either the socket was closed or an error occured, therefore we can disconnect this peer.
if (events & (BEV_EVENT_EOF | BEV_EVENT_ERROR)) if (events & (BEV_EVENT_EOF | BEV_EVENT_ERROR))
@ -108,8 +101,6 @@ void DESC::Initialize()
m_lpCharacter = NULL; m_lpCharacter = NULL;
memset( &m_accountTable, 0, sizeof(m_accountTable) ); memset( &m_accountTable, 0, sizeof(m_accountTable) );
m_pLogFile = NULL;
m_wP2PPort = 0; m_wP2PPort = 0;
m_bP2PChannel = 0; m_bP2PChannel = 0;
@ -154,12 +145,6 @@ void DESC::Destroy()
if (GetAccountTable().id) if (GetAccountTable().id)
DESC_MANAGER::instance().DisconnectAccount(GetAccountTable().login); DESC_MANAGER::instance().DisconnectAccount(GetAccountTable().login);
if (m_pLogFile)
{
fclose(m_pLogFile);
m_pLogFile = NULL;
}
if (m_lpCharacter) if (m_lpCharacter)
{ {
m_lpCharacter->Disconnect("DESC::~DESC"); m_lpCharacter->Disconnect("DESC::~DESC");
@ -184,8 +169,7 @@ void DESC::Destroy()
if (m_bufevent != nullptr) if (m_bufevent != nullptr)
{ {
sys_log(0, "SYSTEM: closing socket."); SPDLOG_DEBUG("SYSTEM: closing socket.");
Log("SYSTEM: closing socket.");
bufferevent_free(m_bufevent); bufferevent_free(m_bufevent);
m_bufevent = nullptr; m_bufevent = nullptr;
@ -200,7 +184,7 @@ EVENTFUNC(ping_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "ping_event> <Factor> Null pointer" ); SPDLOG_ERROR("ping_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -211,7 +195,7 @@ EVENTFUNC(ping_event)
if (!desc->IsPong()) if (!desc->IsPong())
{ {
sys_log(0, "PING_EVENT: no pong %s", desc->GetHostName()); SPDLOG_WARN("PING_EVENT: no pong {}", desc->GetHostName());
desc->SetPhase(PHASE_CLOSE); desc->SetPhase(PHASE_CLOSE);
@ -244,7 +228,7 @@ bool DESC::Setup(event_base * evbase, evutil_socket_t fd, const sockaddr * c_rSo
{ {
m_bufevent = bufferevent_socket_new(evbase, fd, BEV_OPT_CLOSE_ON_FREE); m_bufevent = bufferevent_socket_new(evbase, fd, BEV_OPT_CLOSE_ON_FREE);
if (m_bufevent == nullptr) { if (m_bufevent == nullptr) {
sys_err("DESC::Setup : Could not set up bufferevent!"); SPDLOG_ERROR("DESC::Setup : Could not set up bufferevent!");
return false; return false;
} }
@ -270,10 +254,8 @@ bool DESC::Setup(event_base * evbase, evutil_socket_t fd, const sockaddr * c_rSo
SetPhase(PHASE_HANDSHAKE); SetPhase(PHASE_HANDSHAKE);
StartHandshake(_handshake); StartHandshake(_handshake);
sys_log(0, "SYSTEM: new connection from [%s] handshake %u, ptr %p", SPDLOG_DEBUG("SYSTEM: new connection from [{}] handshake {}, ptr {}", m_stHost, m_dwHandshake, (void*) this);
m_stHost.c_str(), m_dwHandshake, this);
Log("SYSTEM: new connection from [%s] handshake %u ptr %p", m_stHost.c_str(), m_dwHandshake, this);
return true; return true;
} }
@ -281,12 +263,12 @@ bool DESC::ProcessInput()
{ {
evbuffer *input = bufferevent_get_input(m_bufevent); evbuffer *input = bufferevent_get_input(m_bufevent);
if (input == nullptr) { if (input == nullptr) {
sys_err("DESC::ProcessInput : nil input buffer"); SPDLOG_ERROR("DESC::ProcessInput : nil input buffer");
return false; return false;
} }
if (!m_pInputProcessor) { if (!m_pInputProcessor) {
sys_err("no input processor"); SPDLOG_ERROR("no input processor");
return false; return false;
} }
@ -320,12 +302,12 @@ bool DESC::RawPacket(const void * c_pvData, int iSize)
return false; return false;
if (!m_bufevent) { if (!m_bufevent) {
sys_err("Bufferevent not ready!"); SPDLOG_ERROR("Bufferevent not ready!");
return false; return false;
} }
if (bufferevent_write(m_bufevent, c_pvData, iSize) != 0) { if (bufferevent_write(m_bufevent, c_pvData, iSize) != 0) {
sys_err("Buffer write error!"); SPDLOG_ERROR("Buffer write error!");
return false; return false;
} }
@ -373,8 +355,6 @@ void DESC::Packet(const void * c_pvData, int iSize)
m_iPhase = PHASE_CLOSE; m_iPhase = PHASE_CLOSE;
} }
} }
//sys_log(0, "%d bytes written (first byte %d)", iSize, *(BYTE *) c_pvData);
} }
void DESC::SetPhase(int _phase) void DESC::SetPhase(int _phase)
@ -413,7 +393,7 @@ void DESC::SetPhase(int _phase)
case PHASE_AUTH: case PHASE_AUTH:
m_pInputProcessor = &m_inputAuth; m_pInputProcessor = &m_inputAuth;
sys_log(0, "AUTH_PHASE %p", this); SPDLOG_DEBUG("AUTH_PHASE {}", (void*) this);
break; break;
} }
} }
@ -425,33 +405,6 @@ void DESC::BindAccountTable(TAccountTable * pAccountTable)
DESC_MANAGER::instance().ConnectAccount(m_accountTable.login, this); DESC_MANAGER::instance().ConnectAccount(m_accountTable.login, this);
} }
void DESC::Log(const char * format, ...)
{
if (!m_pLogFile)
return;
va_list args;
time_t ct = get_global_time();
struct tm tm = *localtime(&ct);
fprintf(m_pLogFile,
"%02d %02d %02d:%02d:%02d | ",
tm.tm_mon + 1,
tm.tm_mday,
tm.tm_hour,
tm.tm_min,
tm.tm_sec);
va_start(args, format);
vfprintf(m_pLogFile, format, args);
va_end(args);
fputs("\n", m_pLogFile);
fflush(m_pLogFile);
}
void DESC::StartHandshake(DWORD _handshake) void DESC::StartHandshake(DWORD _handshake)
{ {
// Handshake // Handshake
@ -483,7 +436,7 @@ bool DESC::HandshakeProcess(DWORD dwTime, LONG lDelta, bool bInfiniteRetry)
if (lDelta < 0) if (lDelta < 0)
{ {
sys_err("Desc::HandshakeProcess : value error (lDelta %d, ip %s)", lDelta, m_stHost.c_str()); SPDLOG_ERROR("Desc::HandshakeProcess : value error (lDelta {}, ip {})", lDelta, m_stHost.c_str());
return false; return false;
} }
@ -498,9 +451,9 @@ bool DESC::HandshakeProcess(DWORD dwTime, LONG lDelta, bool bInfiniteRetry)
} }
if (GetCharacter()) if (GetCharacter())
sys_log(0, "Handshake: client_time %u server_time %u name: %s", m_dwClientTime, dwCurTime, GetCharacter()->GetName()); SPDLOG_DEBUG("Handshake: client_time {} server_time {} name: {}", m_dwClientTime, dwCurTime, GetCharacter()->GetName());
else else
sys_log(0, "Handshake: client_time %u server_time %u", m_dwClientTime, dwCurTime, lDelta); SPDLOG_DEBUG("Handshake: client_time {} server_time {}", m_dwClientTime, dwCurTime, lDelta);
m_dwClientTime = dwCurTime; m_dwClientTime = dwCurTime;
m_bHandshaking = false; m_bHandshaking = false;
@ -511,16 +464,16 @@ bool DESC::HandshakeProcess(DWORD dwTime, LONG lDelta, bool bInfiniteRetry)
if (lNewDelta < 0) if (lNewDelta < 0)
{ {
sys_log(0, "Handshake: lower than zero %d", lNewDelta); SPDLOG_DEBUG("Handshake: lower than zero {}", lNewDelta);
lNewDelta = (dwCurTime - m_dwHandshakeSentTime) / 2; lNewDelta = (dwCurTime - m_dwHandshakeSentTime) / 2;
} }
sys_log(1, "Handshake: ServerTime %u dwTime %u lDelta %d SentTime %u lNewDelta %d", dwCurTime, dwTime, lDelta, m_dwHandshakeSentTime, lNewDelta); SPDLOG_DEBUG("Handshake: ServerTime {} dwTime {} lDelta {} SentTime {} lNewDelta {}", dwCurTime, dwTime, lDelta, m_dwHandshakeSentTime, lNewDelta);
if (!bInfiniteRetry) if (!bInfiniteRetry)
if (++m_iHandshakeRetry > HANDSHAKE_RETRY_LIMIT) if (++m_iHandshakeRetry > HANDSHAKE_RETRY_LIMIT)
{ {
sys_err("handshake retry limit reached! (limit %d character %s)", SPDLOG_ERROR("handshake retry limit reached! (limit {} character {})",
HANDSHAKE_RETRY_LIMIT, GetCharacter() ? GetCharacter()->GetName() : "!NO CHARACTER!"); HANDSHAKE_RETRY_LIMIT, GetCharacter() ? GetCharacter()->GetName() : "!NO CHARACTER!");
SetPhase(PHASE_CLOSE); SetPhase(PHASE_CLOSE);
return false; return false;
@ -556,10 +509,9 @@ void DESC::FlushOutput()
return; return;
if (bufferevent_flush(m_bufevent, EV_WRITE, BEV_FLUSH) < 0) if (bufferevent_flush(m_bufevent, EV_WRITE, BEV_FLUSH) < 0)
sys_log(0, "FLUSH FAIL"); SPDLOG_ERROR("FLUSH FAIL");
else
sys_log(0, "FLUSH SUCCESS");
// TODO: investigate if necessary
usleep(250000); usleep(250000);
} }
@ -569,7 +521,7 @@ EVENTFUNC(disconnect_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "disconnect_event> <Factor> Null pointer" ); SPDLOG_ERROR("disconnect_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -714,7 +666,7 @@ void DESC::SetLoginKey(DWORD dwKey)
void DESC::SetLoginKey(CLoginKey * pkKey) void DESC::SetLoginKey(CLoginKey * pkKey)
{ {
m_pkLoginKey = pkKey; m_pkLoginKey = pkKey;
sys_log(0, "SetLoginKey %u", m_pkLoginKey->m_dwKey); SPDLOG_DEBUG("SetLoginKey {}", m_pkLoginKey->m_dwKey);
} }
DWORD DESC::GetLoginKey() DWORD DESC::GetLoginKey()

View File

@ -109,8 +109,6 @@ class DESC
bool IsPhase(int phase) const { return m_iPhase == phase ? true : false; } bool IsPhase(int phase) const { return m_iPhase == phase ? true : false; }
void Log(const char * format, ...);
// 핸드쉐이크 (시간 동기화) // 핸드쉐이크 (시간 동기화)
void StartHandshake(DWORD _dw); void StartHandshake(DWORD _dw);
void SendHandshake(DWORD dwCurTime, LONG lNewDelta); void SendHandshake(DWORD dwCurTime, LONG lNewDelta);
@ -197,7 +195,6 @@ class DESC
LPCHARACTER m_lpCharacter; LPCHARACTER m_lpCharacter;
TAccountTable m_accountTable; TAccountTable m_accountTable;
FILE * m_pLogFile;
std::string m_stRelayName; std::string m_stRelayName;
WORD m_wP2PPort; WORD m_wP2PPort;

View File

@ -33,7 +33,7 @@ void ClientDescEventHandler(bufferevent *bev, short events, void *ptr) {
auto * clientDesc = static_cast<LPCLIENT_DESC>(ptr); auto * clientDesc = static_cast<LPCLIENT_DESC>(ptr);
if (events & BEV_EVENT_CONNECTED) { if (events & BEV_EVENT_CONNECTED) {
sys_log(0, "SYSTEM: connected to server (ptr %p)", clientDesc); SPDLOG_DEBUG("SYSTEM: connected to server (ptr {})", (void*) clientDesc);
clientDesc->OnConnectSuccessful(); clientDesc->OnConnectSuccessful();
// Now that we're connected, we can set the read/write/event handlers (and therefore stop using this handler) // Now that we're connected, we can set the read/write/event handlers (and therefore stop using this handler)
@ -43,10 +43,10 @@ void ClientDescEventHandler(bufferevent *bev, short events, void *ptr) {
if (events & BEV_EVENT_ERROR) { if (events & BEV_EVENT_ERROR) {
int err = bufferevent_socket_get_dns_error(bev); int err = bufferevent_socket_get_dns_error(bev);
if (err) if (err)
sys_err("SYSTEM: Client connection DNS error: %s", evutil_gai_strerror(err)); SPDLOG_ERROR("SYSTEM: Client connection DNS error: {}", evutil_gai_strerror(err));
} }
sys_log(0, "SYSTEM: closing client connection (ptr %p)", clientDesc); SPDLOG_DEBUG("SYSTEM: closing client connection (ptr {})", (void*) clientDesc);
clientDesc->SetPhase(PHASE_CLOSE); clientDesc->SetPhase(PHASE_CLOSE);
} }
} }
@ -78,7 +78,7 @@ void CLIENT_DESC::Destroy()
DBManager::instance().StopAllBilling(); DBManager::instance().StopAllBilling();
} }
sys_log(0, "SYSTEM: closing client socket."); SPDLOG_DEBUG("SYSTEM: closing client socket.");
bufferevent_free(m_bufevent); bufferevent_free(m_bufevent);
m_bufevent = nullptr; m_bufevent = nullptr;
@ -105,14 +105,14 @@ bool CLIENT_DESC::Connect(int iPhaseWhenSucceed)
if (m_bufevent != nullptr) if (m_bufevent != nullptr)
return false; return false;
sys_log(0, "SYSTEM: Trying to connect to %s:%d", m_stHost.c_str(), m_wPort); SPDLOG_DEBUG("SYSTEM: Trying to connect to {}:{}", m_stHost.c_str(), m_wPort);
if (m_evbase == nullptr) { if (m_evbase == nullptr) {
sys_err("SYSTEM: event base not set!"); SPDLOG_ERROR("SYSTEM: event base not set!");
return false; return false;
} }
if (m_dnsBase == nullptr) { if (m_dnsBase == nullptr) {
sys_err("SYSTEM: DNS event base not set!"); SPDLOG_ERROR("SYSTEM: DNS event base not set!");
return false; return false;
} }
@ -126,7 +126,7 @@ bool CLIENT_DESC::Connect(int iPhaseWhenSucceed)
} }
void CLIENT_DESC::OnConnectSuccessful() { void CLIENT_DESC::OnConnectSuccessful() {
sys_log(0, "SYSTEM: connected to server (ptr %p)", this); SPDLOG_DEBUG("SYSTEM: connected to server (ptr {})", (void*) this);
SetPhase(m_iPhaseWhenSucceed); SetPhase(m_iPhaseWhenSucceed);
} }
@ -144,13 +144,13 @@ void CLIENT_DESC::SetPhase(int iPhase)
switch (iPhase) switch (iPhase)
{ {
case PHASE_CLIENT_CONNECTING: case PHASE_CLIENT_CONNECTING:
sys_log(1, "PHASE_CLIENT_DESC::CONNECTING"); SPDLOG_DEBUG("PHASE_CLIENT_DESC::CONNECTING");
m_pInputProcessor = NULL; m_pInputProcessor = NULL;
break; break;
case PHASE_DBCLIENT: case PHASE_DBCLIENT:
{ {
sys_log(1, "PHASE_DBCLIENT"); SPDLOG_DEBUG("PHASE_DBCLIENT");
if (!g_bAuthServer) if (!g_bAuthServer)
{ {
@ -218,7 +218,7 @@ void CLIENT_DESC::SetPhase(int iPhase)
} }
} }
sys_log(0, "DB_SETUP current user %d size %d", p.dwLoginCount, buf.size()); SPDLOG_DEBUG("DB_SETUP current user {} size {}", p.dwLoginCount, buf.size());
// ÆÄƼ¸¦ ó¸®ÇÒ ¼ö ÀÖ°Ô µÊ. // ÆÄƼ¸¦ ó¸®ÇÒ ¼ö ÀÖ°Ô µÊ.
CPartyManager::instance().EnablePCParty(); CPartyManager::instance().EnablePCParty();
@ -236,7 +236,7 @@ void CLIENT_DESC::SetPhase(int iPhase)
break; break;
case PHASE_P2P: case PHASE_P2P:
sys_log(1, "PHASE_P2P"); SPDLOG_DEBUG("PHASE_P2P");
m_pInputProcessor = &m_inputP2P; m_pInputProcessor = &m_inputP2P;
break; break;
@ -264,11 +264,11 @@ void CLIENT_DESC::DBPacketHeader(BYTE bHeader, DWORD dwHandle, DWORD dwSize)
void CLIENT_DESC::DBPacket(BYTE bHeader, DWORD dwHandle, const void * c_pvData, DWORD dwSize) void CLIENT_DESC::DBPacket(BYTE bHeader, DWORD dwHandle, const void * c_pvData, DWORD dwSize)
{ {
if (m_bufevent == nullptr) { if (m_bufevent == nullptr) {
sys_log(0, "CLIENT_DESC [%s] trying DBPacket() while not connected", SPDLOG_INFO("CLIENT_DESC [{}] trying DBPacket() while not connected",
GetKnownClientDescName(this)); GetKnownClientDescName(this));
return; return;
} }
sys_log(1, "DB_PACKET: header %d handle %d size %d", bHeader, dwHandle, dwSize); SPDLOG_TRACE("DB_PACKET: header {} handle {} size {}", bHeader, dwHandle, dwSize);
DBPacketHeader(bHeader, dwHandle, dwSize); DBPacketHeader(bHeader, dwHandle, dwSize);
if (c_pvData) if (c_pvData)
@ -278,7 +278,7 @@ void CLIENT_DESC::DBPacket(BYTE bHeader, DWORD dwHandle, const void * c_pvData,
void CLIENT_DESC::Packet(const void * c_pvData, int iSize) void CLIENT_DESC::Packet(const void * c_pvData, int iSize)
{ {
if (m_bufevent == nullptr) { if (m_bufevent == nullptr) {
sys_log(0, "CLIENT_DESC [%s] trying Packet() while not connected", SPDLOG_INFO("CLIENT_DESC [{}] trying Packet() while not connected",
GetKnownClientDescName(this)); GetKnownClientDescName(this));
return; return;
} }

View File

@ -10,7 +10,6 @@
#include "protocol.h" #include "protocol.h"
#include "messenger_manager.h" #include "messenger_manager.h"
#include "p2p.h" #include "p2p.h"
#include "dev_log.h"
#include "ClientPackageCryptInfo.h" #include "ClientPackageCryptInfo.h"
struct valid_ip struct valid_ip
@ -151,7 +150,7 @@ LPDESC DESC_MANAGER::AcceptDesc(evconnlistener* listener, evutil_socket_t fd, so
{ {
if (m_iSocketsConnected >= MAX_ALLOW_USER) if (m_iSocketsConnected >= MAX_ALLOW_USER)
{ {
sys_err("max connection reached. MAX_ALLOW_USER = %d", MAX_ALLOW_USER); SPDLOG_ERROR("max connection reached. MAX_ALLOW_USER = {}", MAX_ALLOW_USER);
return nullptr; return nullptr;
} }
} }
@ -183,7 +182,7 @@ LPDESC DESC_MANAGER::AcceptP2PDesc(evconnlistener* listener, evutil_socket_t fd,
if (!pkDesc->Setup(base, fd, address)) if (!pkDesc->Setup(base, fd, address))
{ {
sys_err("DESC_MANAGER::AcceptP2PDesc : Setup failed"); SPDLOG_ERROR("DESC_MANAGER::AcceptP2PDesc : Setup failed");
delete pkDesc; delete pkDesc;
return nullptr; return nullptr;
} }
@ -191,20 +190,20 @@ LPDESC DESC_MANAGER::AcceptP2PDesc(evconnlistener* listener, evutil_socket_t fd,
m_set_pkDesc.insert(pkDesc); m_set_pkDesc.insert(pkDesc);
++m_iSocketsConnected; ++m_iSocketsConnected;
sys_log(0, "DESC_MANAGER::AcceptP2PDesc %s:%u", GetSocketHost(address).c_str(), GetSocketPort(address)); SPDLOG_DEBUG("DESC_MANAGER::AcceptP2PDesc {}:{}", GetSocketHost(address).c_str(), GetSocketPort(address));
P2P_MANAGER::instance().RegisterAcceptor(pkDesc); P2P_MANAGER::instance().RegisterAcceptor(pkDesc);
return (pkDesc); return (pkDesc);
} }
void DESC_MANAGER::ConnectAccount(const std::string& login, LPDESC d) void DESC_MANAGER::ConnectAccount(const std::string& login, LPDESC d)
{ {
dev_log(LOG_DEB0, "BBBB ConnectAccount(%s)", login.c_str()); SPDLOG_TRACE("BBBB ConnectAccount({})", login.c_str());
m_map_loginName.insert(DESC_LOGINNAME_MAP::value_type(login,d)); m_map_loginName.insert(DESC_LOGINNAME_MAP::value_type(login,d));
} }
void DESC_MANAGER::DisconnectAccount(const std::string& login) void DESC_MANAGER::DisconnectAccount(const std::string& login)
{ {
dev_log(LOG_DEB0, "BBBB DisConnectAccount(%s)", login.c_str()); SPDLOG_TRACE("BBBB DisConnectAccount({})", login.c_str());
m_map_loginName.erase(login); m_map_loginName.erase(login);
} }
@ -402,7 +401,7 @@ void DESC_MANAGER::GetUserCount(int & iTotal, int ** paiEmpireUserCount, int & i
int iCount = P2P_MANAGER::instance().GetCount(); int iCount = P2P_MANAGER::instance().GetCount();
if (iCount < 0) if (iCount < 0)
{ {
sys_err("P2P_MANAGER::instance().GetCount() == -1"); SPDLOG_ERROR("P2P_MANAGER::instance().GetCount() == -1");
} }
iTotal = m_iLocalUserCount + iCount; iTotal = m_iLocalUserCount + iCount;
iLocalCount = m_iLocalUserCount; iLocalCount = m_iLocalUserCount;

View File

@ -14,7 +14,7 @@ void DESC_P2P::Destroy()
P2P_MANAGER::instance().UnregisterAcceptor(this); P2P_MANAGER::instance().UnregisterAcceptor(this);
sys_log(0, "SYSTEM: closing p2p socket."); SPDLOG_DEBUG("SYSTEM: closing p2p socket.");
bufferevent_free(m_bufevent); bufferevent_free(m_bufevent);
m_bufevent = nullptr; m_bufevent = nullptr;
@ -27,7 +27,7 @@ bool DESC_P2P::Setup(event_base * evbase, evutil_socket_t fd, const sockaddr * c
{ {
m_bufevent = bufferevent_socket_new(evbase, fd, BEV_OPT_CLOSE_ON_FREE); m_bufevent = bufferevent_socket_new(evbase, fd, BEV_OPT_CLOSE_ON_FREE);
if (m_bufevent == nullptr) { if (m_bufevent == nullptr) {
sys_err("DESC::Setup : Could not set up bufferevent!"); SPDLOG_ERROR("DESC::Setup : Could not set up bufferevent!");
return false; return false;
} }
@ -42,7 +42,7 @@ bool DESC_P2P::Setup(event_base * evbase, evutil_socket_t fd, const sockaddr * c
SetPhase(PHASE_P2P); SetPhase(PHASE_P2P);
sys_log(0, "SYSTEM: new p2p connection from [%s]", m_stHost.c_str()); SPDLOG_DEBUG("SYSTEM: new p2p connection from [{}]", m_stHost.c_str());
return true; return true;
} }
@ -54,7 +54,7 @@ void DESC_P2P::SetPhase(int iPhase)
switch (iPhase) switch (iPhase)
{ {
case PHASE_P2P: case PHASE_P2P:
sys_log(1, "PHASE_P2P"); SPDLOG_DEBUG("PHASE_P2P");
m_pInputProcessor = &s_inputP2P; m_pInputProcessor = &s_inputP2P;
break; break;
@ -63,7 +63,7 @@ void DESC_P2P::SetPhase(int iPhase)
break; break;
default: default:
sys_err("DESC_P2P::SetPhase : Unknown phase"); SPDLOG_ERROR("DESC_P2P::SetPhase : Unknown phase");
break; break;
} }

View File

@ -1,152 +0,0 @@
/*********************************************************************
* date : 2006.09.07
* file : dev_log.cpp
* author : mhh
* description :
*/
#define _dev_log_cpp_
#include "stdafx.h"
#include "dev_log.h"
#ifndef IS_SET
# define IS_SET(flag,bit) ((flag) & (bit))
#endif // IS_SET
#ifndef SET_BIT
# define SET_BIT(var,bit) ((var) |= (bit))
#endif // SET_BIT
#ifndef REMOVE_BIT
# define REMOVE_BIT(var,bit) ((var) &= ~(bit))
#endif // REMOVE_BIT
#ifndef TOGGLE_BIT
# define TOGGLE_BIT(var,bit) ((var) = (var) ^ (bit))
#endif // TOGGLE_BIT
extern int test_server;
static int s_log_mask = 0xffffffff;
void dev_log(const char *file, int line, const char *function, int level, const char *fmt, ...)
{
// 테스트 서버에서만 남기며, 마스크가 꺼져있으면 남기지 않는다.
if (!test_server || !IS_SET(s_log_mask, level))
return;
static char buf[1024*1024]; // 1M
int fd;
char strtime[64+1];
const char *strlevel;
struct timeval tv;
struct tm ltm;
int mon, day, hour, min, sec, usec;
int nlen;
va_list args;
// ---------------------------------------
// open file
// ---------------------------------------
#ifndef __WIN32__
fd = ::open("DEV_LOG.log", O_WRONLY|O_APPEND|O_CREAT, 0666);
#else
fd = ::_open("DEV_LOG.log", _O_WRONLY|_O_APPEND|_O_CREAT, 0666);
#endif
if (fd < 0)
return;
// ---------------------------------------
// set time string
// ---------------------------------------
gettimeofday (&tv, NULL);
localtime_r((time_t*) &tv.tv_sec, &ltm);
mon = ltm.tm_mon + 1;
day = ltm.tm_mday;
hour = ltm.tm_hour;
min = ltm.tm_min;
sec = ltm.tm_sec;
usec = tv.tv_usec;
nlen = snprintf(strtime, sizeof(strtime), "%02d%02d %02d:%02d.%02d.%06d", mon, day, hour, min, sec, usec);
if (nlen < 0 || nlen >= (int) sizeof(strtime))
nlen = sizeof(strtime) - 1;
strtime[nlen - 2] = '\0';
// ---------------------------------------
// get level string
// ---------------------------------------
#define GET_LEVEL_STRING(level) case L_##level : strlevel = #level; break
switch ( level ) {
GET_LEVEL_STRING ( WARN );
GET_LEVEL_STRING ( ERR );
GET_LEVEL_STRING ( CRIT );
GET_LEVEL_STRING ( INFO );
GET_LEVEL_STRING ( MIN );
GET_LEVEL_STRING ( MAX );
GET_LEVEL_STRING ( LIB0 );
GET_LEVEL_STRING ( LIB1 );
GET_LEVEL_STRING ( LIB2 );
GET_LEVEL_STRING ( LIB3 );
GET_LEVEL_STRING ( DEB0 );
GET_LEVEL_STRING ( DEB1 );
GET_LEVEL_STRING ( DEB2 );
GET_LEVEL_STRING ( DEB3 );
GET_LEVEL_STRING ( USR0 );
GET_LEVEL_STRING ( USR1 );
GET_LEVEL_STRING ( USR2 );
GET_LEVEL_STRING ( USR3 );
default : strlevel = "UNKNOWN"; break;
}
#undef GET_LEVEL_STRING
nlen = snprintf(buf, sizeof(buf), "%s %-4s (%-15s,%4d,%-24s) ",
strtime, strlevel, file, line, function);
if (nlen < 0 || nlen >= (int) sizeof(buf))
return;
// ---------------------------------------
// write_log
// ---------------------------------------
va_start(args, fmt);
int vlen = vsnprintf(buf + nlen, sizeof(buf) - (nlen + 2), fmt, args);
va_end(args);
if (vlen < 0 || vlen >= (int) sizeof(buf) - (nlen + 2))
nlen += (sizeof(buf) - (nlen + 2)) - 1;
else
nlen += vlen;
buf[nlen++] = '\n';
buf[nlen] = 0;
::write(fd, buf, nlen);
::close(fd);
}
void dev_log_add_level(int level)
{
SET_BIT(s_log_mask, level);
}
void dev_log_del_level(int level)
{
REMOVE_BIT(s_log_mask, level);
}
void dev_log_set_level(int mask)
{
s_log_mask = mask;
}

View File

@ -1,79 +0,0 @@
/*********************************************************************
* date : 2006.09.07
* file : dev_log.h
* author : mhh
* description : .
* example)
* dev_log(LOG_DEB0, "My Name is %s", name);
*/
#ifndef _dev_log_h_
#define _dev_log_h_
// -----------------------------------------------
// define log level
// -----------------------------------------------
#define L_WARN (1<<1)
#define L_ERR (1<<2)
#define L_CRIT (1<<3)
#define L_INFO (1<<4)
#define L_MIN (1<<5)
#define L_MAX (1<<6)
#define L_LIB0 (1<<7)
#define L_LIB1 (1<<8)
#define L_LIB2 (1<<9)
#define L_LIB3 (1<<10)
#define L_DEB0 (1<<11)
#define L_DEB1 (1<<12)
#define L_DEB2 (1<<13)
#define L_DEB3 (1<<14)
#define L_USR0 (1<<15)
#define L_USR1 (1<<16)
#define L_USR2 (1<<17)
#define L_USR3 (1<<18)
// -----------------------------------------------
// define log level
// -----------------------------------------------
#define LOG_WARN __FILE__,__LINE__,__FUNCTION__,L_WARN
#define LOG_ERR __FILE__,__LINE__,__FUNCTION__,L_ERR
#define LOG_CRIT __FILE__,__LINE__,__FUNCTION__,L_CRIT
#define LOG_INFO __FILE__,__LINE__,__FUNCTION__,L_INFO
#define LOG_MIN __FILE__,__LINE__,__FUNCTION__,L_MIN
#define LOG_MAX __FILE__,__LINE__,__FUNCTION__,L_MAX
#define LOG_LIB0 __FILE__,__LINE__,__FUNCTION__,L_LIB0
#define LOG_LIB1 __FILE__,__LINE__,__FUNCTION__,L_LIB1
#define LOG_LIB2 __FILE__,__LINE__,__FUNCTION__,L_LIB2
#define LOG_LIB3 __FILE__,__LINE__,__FUNCTION__,L_LIB3
#define LOG_DEB0 __FILE__,__LINE__,__FUNCTION__,L_DEB0
#define LOG_DEB1 __FILE__,__LINE__,__FUNCTION__,L_DEB1
#define LOG_DEB2 __FILE__,__LINE__,__FUNCTION__,L_DEB2
#define LOG_DEB3 __FILE__,__LINE__,__FUNCTION__,L_DEB3
#define LOG_USR0 __FILE__,__LINE__,__FUNCTION__,L_USR0
#define LOG_USR1 __FILE__,__LINE__,__FUNCTION__,L_USR1
#define LOG_USR2 __FILE__,__LINE__,__FUNCTION__,L_USR2
#define LOG_USR3 __FILE__,__LINE__,__FUNCTION__,L_USR3
void dev_log(const char *file, int line, const char *function, int level, const char *fmt, ...);
void dev_log_add_level(int level);
void dev_log_del_level(int level);
void dev_log_set_level(int mask);
#endif /* _dev_log_h_ */

View File

@ -41,7 +41,7 @@ bool DragonSoulTable::ReadDragonSoulTableFile(const char * c_pszFileName)
if (false == loader.Load(c_pszFileName)) if (false == loader.Load(c_pszFileName))
{ {
sys_err ("dragon_soul_table.txt load error"); SPDLOG_ERROR("dragon_soul_table.txt load error");
return false; return false;
} }
@ -77,7 +77,7 @@ bool DragonSoulTable::ReadDragonSoulTableFile(const char * c_pszFileName)
} }
else else
{ {
sys_err ("DragonSoul table Check failed."); SPDLOG_ERROR("DragonSoul table Check failed.");
return false; return false;
} }
} }
@ -92,7 +92,7 @@ bool DragonSoulTable::GetDragonSoulGroupName(BYTE bType, std::string& stGroupNam
} }
else else
{ {
sys_err ("Invalid DragonSoul Type(%d)", bType); SPDLOG_ERROR("Invalid DragonSoul Type({})", bType);
return false; return false;
} }
} }
@ -106,7 +106,7 @@ bool DragonSoulTable::ReadVnumMapper()
if (NULL == pGroupNode) if (NULL == pGroupNode)
{ {
sys_err ("dragon_soul_table.txt need VnumMapper."); SPDLOG_ERROR("dragon_soul_table.txt need VnumMapper.");
return false; return false;
} }
{ {
@ -128,18 +128,18 @@ bool DragonSoulTable::ReadVnumMapper()
BYTE bType; BYTE bType;
if (!pRow->GetValue("dragonsoulname", stDragonSoulName)) if (!pRow->GetValue("dragonsoulname", stDragonSoulName))
{ {
sys_err ("In Group VnumMapper, No DragonSoulName column."); SPDLOG_ERROR("In Group VnumMapper, No DragonSoulName column.");
return false; return false;
} }
if (!pRow->GetValue("type", bType)) if (!pRow->GetValue("type", bType))
{ {
sys_err ("In Group VnumMapper, %s's Vnum is invalid", stDragonSoulName.c_str()); SPDLOG_ERROR("In Group VnumMapper, {}'s Vnum is invalid", stDragonSoulName.c_str());
return false; return false;
} }
if (setTypes.end() != setTypes.find(bType)) if (setTypes.end() != setTypes.find(bType))
{ {
sys_err ("In Group VnumMapper, duplicated vnum exist."); SPDLOG_ERROR("In Group VnumMapper, duplicated vnum exist.");
return false; return false;
} }
m_map_name_to_type.insert(TMapNameToType::value_type(stDragonSoulName, bType)); m_map_name_to_type.insert(TMapNameToType::value_type(stDragonSoulName, bType));
@ -157,7 +157,7 @@ bool DragonSoulTable::ReadBasicApplys()
if (NULL == pGroupNode) if (NULL == pGroupNode)
{ {
sys_err ("dragon_soul_table.txt need BasicApplys."); SPDLOG_ERROR("dragon_soul_table.txt need BasicApplys.");
return false; return false;
} }
@ -166,7 +166,7 @@ bool DragonSoulTable::ReadBasicApplys()
CGroupNode* pChild; CGroupNode* pChild;
if (NULL == (pChild = pGroupNode->GetChildNode(m_vecDragonSoulNames[i]))) if (NULL == (pChild = pGroupNode->GetChildNode(m_vecDragonSoulNames[i])))
{ {
sys_err ("In Group BasicApplys, %s group is not defined.", m_vecDragonSoulNames[i].c_str()); SPDLOG_ERROR("In Group BasicApplys, {} group is not defined.", m_vecDragonSoulNames[i].c_str());
return false; return false;
} }
TVecApplys vecApplys; TVecApplys vecApplys;
@ -182,7 +182,7 @@ bool DragonSoulTable::ReadBasicApplys()
pChild->GetRow(ss.str(), &pRow); pChild->GetRow(ss.str(), &pRow);
if (NULL == pRow) if (NULL == pRow)
{ {
sys_err("In Group BasicApplys, No %d row.", j); SPDLOG_ERROR("In Group BasicApplys, No {} row.", j);
} }
EApplyTypes at; EApplyTypes at;
int av; int av;
@ -190,17 +190,17 @@ bool DragonSoulTable::ReadBasicApplys()
std::string stTypeName; std::string stTypeName;
if (!pRow->GetValue("apply_type", stTypeName)) if (!pRow->GetValue("apply_type", stTypeName))
{ {
sys_err ("In Group BasicApplys, %s group's apply_type is empty.", m_vecDragonSoulNames[i].c_str()); SPDLOG_ERROR("In Group BasicApplys, {} group's apply_type is empty.", m_vecDragonSoulNames[i].c_str());
return false; return false;
} }
if (!(at = (EApplyTypes)FN_get_apply_type(stTypeName.c_str()))) if (!(at = (EApplyTypes)FN_get_apply_type(stTypeName.c_str())))
{ {
sys_err ("In Group BasicApplys, %s group's apply_type %s is invalid.", m_vecDragonSoulNames[i].c_str(), stTypeName.c_str()); SPDLOG_ERROR("In Group BasicApplys, {} group's apply_type {} is invalid.", m_vecDragonSoulNames[i].c_str(), stTypeName.c_str());
return false; return false;
} }
if (!pRow->GetValue("apply_value", av)) if (!pRow->GetValue("apply_value", av))
{ {
sys_err ("In Group BasicApplys, %s group's apply_value %s is invalid.", m_vecDragonSoulNames[i].c_str(), av); SPDLOG_ERROR("In Group BasicApplys, {} group's apply_value {} is invalid.", m_vecDragonSoulNames[i].c_str(), av);
return false; return false;
} }
vecApplys.push_back(SApply(at, av)); vecApplys.push_back(SApply(at, av));
@ -216,7 +216,7 @@ bool DragonSoulTable::ReadAdditionalApplys()
CGroupNode* pGroupNode = m_pLoader->GetGroup("additionalapplys"); CGroupNode* pGroupNode = m_pLoader->GetGroup("additionalapplys");
if (NULL == pGroupNode) if (NULL == pGroupNode)
{ {
sys_err ("dragon_soul_table.txt need AdditionalApplys."); SPDLOG_ERROR("dragon_soul_table.txt need AdditionalApplys.");
return false; return false;
} }
@ -225,7 +225,7 @@ bool DragonSoulTable::ReadAdditionalApplys()
CGroupNode* pChild; CGroupNode* pChild;
if (NULL == (pChild = pGroupNode->GetChildNode(m_vecDragonSoulNames[i]))) if (NULL == (pChild = pGroupNode->GetChildNode(m_vecDragonSoulNames[i])))
{ {
sys_err ("In Group AdditionalApplys, %s group is not defined.", m_vecDragonSoulNames[i].c_str()); SPDLOG_ERROR("In Group AdditionalApplys, {} group is not defined.", m_vecDragonSoulNames[i].c_str());
return false; return false;
} }
TVecApplys vecApplys; TVecApplys vecApplys;
@ -244,22 +244,22 @@ bool DragonSoulTable::ReadAdditionalApplys()
std::string stTypeName; std::string stTypeName;
if (!pRow->GetValue("apply_type", stTypeName)) if (!pRow->GetValue("apply_type", stTypeName))
{ {
sys_err ("In Group AdditionalApplys, %s group's apply_type is empty.", m_vecDragonSoulNames[i].c_str()); SPDLOG_ERROR("In Group AdditionalApplys, {} group's apply_type is empty.", m_vecDragonSoulNames[i].c_str());
return false; return false;
} }
if (!(at = (EApplyTypes)FN_get_apply_type(stTypeName.c_str()))) if (!(at = (EApplyTypes)FN_get_apply_type(stTypeName.c_str())))
{ {
sys_err ("In Group AdditionalApplys, %s group's apply_type %s is invalid.", m_vecDragonSoulNames[i].c_str(), stTypeName.c_str()); SPDLOG_ERROR("In Group AdditionalApplys, {} group's apply_type {} is invalid.", m_vecDragonSoulNames[i].c_str(), stTypeName.c_str());
return false; return false;
} }
if (!pRow->GetValue("apply_value", av)) if (!pRow->GetValue("apply_value", av))
{ {
sys_err ("In Group AdditionalApplys, %s group's apply_value %s is invalid.", m_vecDragonSoulNames[i].c_str(), av); SPDLOG_ERROR("In Group AdditionalApplys, {} group's apply_value {} is invalid.", m_vecDragonSoulNames[i].c_str(), av);
return false; return false;
} }
if (!pRow->GetValue("prob", prob)) if (!pRow->GetValue("prob", prob))
{ {
sys_err ("In Group AdditionalApplys, %s group's probability %s is invalid.", m_vecDragonSoulNames[i].c_str(), prob); SPDLOG_ERROR("In Group AdditionalApplys, {} group's probability {} is invalid.", m_vecDragonSoulNames[i].c_str(), prob);
return false; return false;
} }
vecApplys.push_back(SApply(at, av, prob)); vecApplys.push_back(SApply(at, av, prob));
@ -275,7 +275,7 @@ bool DragonSoulTable::CheckApplyNumSettings ()
// Group ApplyNumSettings Reading. // Group ApplyNumSettings Reading.
if (NULL == m_pApplyNumSettingNode) if (NULL == m_pApplyNumSettingNode)
{ {
sys_err ("dragon_soul_table.txt need ApplyNumSettings."); SPDLOG_ERROR("dragon_soul_table.txt need ApplyNumSettings.");
return false; return false;
} }
else else
@ -287,7 +287,7 @@ bool DragonSoulTable::CheckApplyNumSettings ()
int basis, add_min, add_max; int basis, add_min, add_max;
if (!GetApplyNumSettings(m_vecDragonSoulTypes[i], j, basis, add_min, add_max)) if (!GetApplyNumSettings(m_vecDragonSoulTypes[i], j, basis, add_min, add_max))
{ {
sys_err ("In %s group of ApplyNumSettings, values in Grade(%s) row is invalid.", SPDLOG_ERROR("In {} group of ApplyNumSettings, values in Grade({}) row is invalid.",
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str()); m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str());
return false; return false;
} }
@ -303,7 +303,7 @@ bool DragonSoulTable::CheckWeightTables ()
// Group WeightTables Reading. // Group WeightTables Reading.
if (NULL == m_pWeightTableNode) if (NULL == m_pWeightTableNode)
{ {
sys_err ("dragon_soul_table.txt need WeightTables."); SPDLOG_ERROR("dragon_soul_table.txt need WeightTables.");
return false; return false;
} }
else else
@ -319,7 +319,7 @@ bool DragonSoulTable::CheckWeightTables ()
float fWeight; float fWeight;
if (!GetWeight(m_vecDragonSoulTypes[i], j, k, l, fWeight)) if (!GetWeight(m_vecDragonSoulTypes[i], j, k, l, fWeight))
{ {
sys_err ("In %s group of WeightTables, value(Grade(%s), Step(%s), Strength(%d) is invalid.", SPDLOG_ERROR("In {} group of WeightTables, value(Grade({}), Step({}), Strength({}) is invalid.",
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str(), g_astStepName[k].c_str(), l); m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str(), g_astStepName[k].c_str(), l);
} }
} }
@ -335,7 +335,7 @@ bool DragonSoulTable::CheckRefineGradeTables()
// Group UpgradeTables Reading. // Group UpgradeTables Reading.
if (NULL == m_pRefineGradeTableNode) if (NULL == m_pRefineGradeTableNode)
{ {
sys_err ("dragon_soul_table.txt need RefineGradeTables."); SPDLOG_ERROR("dragon_soul_table.txt need RefineGradeTables.");
return false; return false;
} }
else else
@ -348,32 +348,33 @@ bool DragonSoulTable::CheckRefineGradeTables()
std::vector <float> vec_probs; std::vector <float> vec_probs;
if (!GetRefineGradeValues(m_vecDragonSoulTypes[i], j, need_count, fee, vec_probs)) if (!GetRefineGradeValues(m_vecDragonSoulTypes[i], j, need_count, fee, vec_probs))
{ {
sys_err ("In %s group of RefineGradeTables, values in Grade(%s) row is invalid.", SPDLOG_ERROR("In {} group of RefineGradeTables, values in Grade({}) row is invalid.",
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str()); m_vecDragonSoulNames[i], g_astGradeName[j]);
return false; return false;
} }
if (need_count < 1) if (need_count < 1)
{ {
sys_err ("In %s group of RefineGradeTables, need_count of Grade(%s) is less than 1.", SPDLOG_ERROR("In {} group of RefineGradeTables, need_count of Grade({}) is less than 1.",
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str()); m_vecDragonSoulNames[i], g_astGradeName[j]);
return false; return false;
} }
if (fee < 0) if (fee < 0)
{ {
sys_err ("In %s group of RefineGradeTables, fee of Grade(%s) is less than 0.", SPDLOG_ERROR("In {} group of RefineGradeTables, fee of Grade({}) is less than 0.",
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str()); m_vecDragonSoulNames[i], g_astGradeName[j]);
return false; return false;
} }
if (DRAGON_SOUL_GRADE_MAX != vec_probs.size()) if (DRAGON_SOUL_GRADE_MAX != vec_probs.size())
{ {
sys_err ("In %s group of RefineGradeTables, probability list size is not %d.", DRAGON_SOUL_GRADE_MAX); SPDLOG_ERROR("In {} group of RefineGradeTables, probability list size is not {}.",
m_vecDragonSoulNames[i], (int) DRAGON_SOUL_GRADE_MAX);
return false; return false;
} }
for (int k = 0; k < vec_probs.size(); k++) for (int k = 0; k < vec_probs.size(); k++)
{ {
if (vec_probs[k] < 0.f) if (vec_probs[k] < 0.f)
{ {
sys_err ("In %s group of RefineGradeTables, probability(index : %d) is less than 0.", k); SPDLOG_ERROR("In {} group of RefineGradeTables, probability(index : {}) is less than 0.", k);
return false; return false;
} }
} }
@ -389,7 +390,7 @@ bool DragonSoulTable::CheckRefineStepTables ()
// Group ImproveTables Reading. // Group ImproveTables Reading.
if (NULL == m_pRefineStrengthTableNode) if (NULL == m_pRefineStrengthTableNode)
{ {
sys_err ("dragon_soul_table.txt need RefineStepTables."); SPDLOG_ERROR("dragon_soul_table.txt need RefineStepTables.");
return false; return false;
} }
else else
@ -402,34 +403,34 @@ bool DragonSoulTable::CheckRefineStepTables ()
std::vector <float> vec_probs; std::vector <float> vec_probs;
if (!GetRefineStepValues(m_vecDragonSoulTypes[i], j, need_count, fee, vec_probs)) if (!GetRefineStepValues(m_vecDragonSoulTypes[i], j, need_count, fee, vec_probs))
{ {
sys_err ("In %s group of RefineStepTables, values in Step(%s) row is invalid.", SPDLOG_ERROR("In {} group of RefineStepTables, values in Step({}) row is invalid.",
m_vecDragonSoulNames[i].c_str(), g_astStepName[j].c_str()); m_vecDragonSoulNames[i], g_astStepName[j]);
return false; return false;
} }
if (need_count < 1) if (need_count < 1)
{ {
sys_err ("In %s group of RefineStepTables, need_count of Step(%s) is less than 1.", SPDLOG_ERROR("In {} group of RefineStepTables, need_count of Step({}) is less than 1.",
m_vecDragonSoulNames[i].c_str(), g_astStepName[j].c_str()); m_vecDragonSoulNames[i], g_astStepName[j]);
return false; return false;
} }
if (fee < 0) if (fee < 0)
{ {
sys_err ("In %s group of RefineStepTables, fee of Step(%s) is less than 0.", SPDLOG_ERROR("In {} group of RefineStepTables, fee of Step({}) is less than 0.",
m_vecDragonSoulNames[i].c_str(), g_astStepName[j].c_str()); m_vecDragonSoulNames[i], g_astStepName[j]);
return false; return false;
} }
if (DRAGON_SOUL_GRADE_MAX != vec_probs.size()) if (DRAGON_SOUL_GRADE_MAX != vec_probs.size())
{ {
sys_err ("In %s group of RefineStepTables, probability list size is not %d.", SPDLOG_ERROR("In {} group of RefineStepTables, probability list size is not {}.",
m_vecDragonSoulNames[i].c_str(), DRAGON_SOUL_GRADE_MAX); m_vecDragonSoulNames[i], (int) DRAGON_SOUL_GRADE_MAX);
return false; return false;
} }
for (int k = 0; k < vec_probs.size(); k++) for (int k = 0; k < vec_probs.size(); k++)
{ {
if (vec_probs[k] < 0.f) if (vec_probs[k] < 0.f)
{ {
sys_err ("In %s group of RefineStepTables, probability(index : %d) is less than 0.", SPDLOG_ERROR("In {} group of RefineStepTables, probability(index : {}) is less than 0.",
m_vecDragonSoulNames[i].c_str(), k); m_vecDragonSoulNames[i], k);
return false; return false;
} }
} }
@ -447,7 +448,7 @@ bool DragonSoulTable::CheckRefineStrengthTables()
// Group RefineTables Reading. // Group RefineTables Reading.
if (NULL == pGroupNode) if (NULL == pGroupNode)
{ {
sys_err ("dragon_soul_table.txt need RefineStrengthTables."); SPDLOG_ERROR("dragon_soul_table.txt need RefineStrengthTables.");
return false; return false;
} }
for (int i = 0; i < m_vecDragonSoulTypes.size(); i++) for (int i = 0; i < m_vecDragonSoulTypes.size(); i++)
@ -460,19 +461,19 @@ bool DragonSoulTable::CheckRefineStrengthTables()
{ {
if (!GetRefineStrengthValues(m_vecDragonSoulTypes[i], j, k, fee, prob)) if (!GetRefineStrengthValues(m_vecDragonSoulTypes[i], j, k, fee, prob))
{ {
sys_err ("In %s group of RefineStrengthTables, value(Material(%s), Strength(%d)) or fee are invalid.", SPDLOG_ERROR("In {} group of RefineStrengthTables, value(Material({}), Strength({})) or fee are invalid.",
m_vecDragonSoulNames[i].c_str(), g_astMaterialName[j].c_str(), k); m_vecDragonSoulNames[i].c_str(), g_astMaterialName[j].c_str(), k);
return false; return false;
} }
if (fee < 0) if (fee < 0)
{ {
sys_err ("In %s group of RefineStrengthTables, fee of Material(%s) is less than 0.", SPDLOG_ERROR("In {} group of RefineStrengthTables, fee of Material({}) is less than 0.",
m_vecDragonSoulNames[i].c_str(), g_astMaterialName[j].c_str()); m_vecDragonSoulNames[i].c_str(), g_astMaterialName[j].c_str());
return false; return false;
} }
if (prob < 0.f) if (prob < 0.f)
{ {
sys_err ("In %s group of RefineStrengthTables, probability(Material(%s), Strength(%d)) is less than 0.", SPDLOG_ERROR("In {} group of RefineStrengthTables, probability(Material({}), Strength({})) is less than 0.",
m_vecDragonSoulNames[i].c_str(), g_astMaterialName[j].c_str(), k); m_vecDragonSoulNames[i].c_str(), g_astMaterialName[j].c_str(), k);
return false; return false;
} }
@ -488,7 +489,7 @@ bool DragonSoulTable::CheckDragonHeartExtTables()
// Group DragonHeartExtTables Reading. // Group DragonHeartExtTables Reading.
if (NULL == m_pDragonHeartExtTableNode) if (NULL == m_pDragonHeartExtTableNode)
{ {
sys_err ("dragon_soul_table.txt need DragonHeartExtTables."); SPDLOG_ERROR("dragon_soul_table.txt need DragonHeartExtTables.");
return false; return false;
} }
for (int i = 0; i < m_vecDragonSoulTypes.size(); i++) for (int i = 0; i < m_vecDragonSoulTypes.size(); i++)
@ -500,13 +501,13 @@ bool DragonSoulTable::CheckDragonHeartExtTables()
if (!GetDragonHeartExtValues(m_vecDragonSoulTypes[i], j, vec_chargings, vec_probs)) if (!GetDragonHeartExtValues(m_vecDragonSoulTypes[i], j, vec_chargings, vec_probs))
{ {
sys_err ("In %s group of DragonHeartExtTables, CHARGING row or Grade(%s) row are invalid.", SPDLOG_ERROR("In {} group of DragonHeartExtTables, CHARGING row or Grade({}) row are invalid.",
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str()); m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str());
return false; return false;
} }
if (vec_chargings.size() != vec_probs.size()) if (vec_chargings.size() != vec_probs.size())
{ {
sys_err ("In %s group of DragonHeartExtTables, CHARGING row size(%d) are not equal Grade(%s) row size(%d).", SPDLOG_ERROR("In {} group of DragonHeartExtTables, CHARGING row size({}) are not equal Grade({}) row size({}).",
m_vecDragonSoulNames[i].c_str(), vec_chargings.size(), vec_probs.size()); m_vecDragonSoulNames[i].c_str(), vec_chargings.size(), vec_probs.size());
return false; return false;
} }
@ -514,7 +515,7 @@ bool DragonSoulTable::CheckDragonHeartExtTables()
{ {
if (vec_chargings[k] < 0.f) if (vec_chargings[k] < 0.f)
{ {
sys_err ("In %s group of DragonHeartExtTables, CHARGING value(index : %d) is less than 0", SPDLOG_ERROR("In {} group of DragonHeartExtTables, CHARGING value(index : {}) is less than 0",
m_vecDragonSoulNames[i].c_str(), k); m_vecDragonSoulNames[i].c_str(), k);
return false; return false;
} }
@ -523,7 +524,7 @@ bool DragonSoulTable::CheckDragonHeartExtTables()
{ {
if (vec_probs[k] < 0.f) if (vec_probs[k] < 0.f)
{ {
sys_err ("In %s group of DragonHeartExtTables, Probability(Grade : %s, index : %d) is less than 0", SPDLOG_ERROR("In {} group of DragonHeartExtTables, Probability(Grade : {}, index : {}) is less than 0",
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str(), k); m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str(), k);
return false; return false;
} }
@ -539,7 +540,7 @@ bool DragonSoulTable::CheckDragonSoulExtTables()
// Group DragonSoulExtTables Reading. // Group DragonSoulExtTables Reading.
if (NULL == m_pDragonSoulExtTableNode) if (NULL == m_pDragonSoulExtTableNode)
{ {
sys_err ("dragon_soul_table.txt need DragonSoulExtTables."); SPDLOG_ERROR("dragon_soul_table.txt need DragonSoulExtTables.");
return false; return false;
} }
for (int i = 0; i < m_vecDragonSoulTypes.size(); i++) for (int i = 0; i < m_vecDragonSoulTypes.size(); i++)
@ -550,19 +551,19 @@ bool DragonSoulTable::CheckDragonSoulExtTables()
DWORD by_product; DWORD by_product;
if (!GetDragonSoulExtValues(m_vecDragonSoulTypes[i], j, prob, by_product)) if (!GetDragonSoulExtValues(m_vecDragonSoulTypes[i], j, prob, by_product))
{ {
sys_err ("In %s group of DragonSoulExtTables, Grade(%s) row is invalid.", SPDLOG_ERROR("In {} group of DragonSoulExtTables, Grade({}) row is invalid.",
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str()); m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str());
return false; return false;
} }
if (prob < 0.f) if (prob < 0.f)
{ {
sys_err ("In %s group of DragonSoulExtTables, Probability(Grade : %s) is less than 0", SPDLOG_ERROR("In {} group of DragonSoulExtTables, Probability(Grade : {}) is less than 0",
m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str()); m_vecDragonSoulNames[i].c_str(), g_astGradeName[j].c_str());
return false; return false;
} }
if (0 != by_product && NULL == ITEM_MANAGER::instance().GetTable(by_product)) if (0 != by_product && NULL == ITEM_MANAGER::instance().GetTable(by_product))
{ {
sys_err ("In %s group of DragonSoulExtTables, ByProduct(%d) of Grade %s is not exist.", SPDLOG_ERROR("In {} group of DragonSoulExtTables, ByProduct({}) of Grade {} is not exist.",
m_vecDragonSoulNames[i].c_str(), by_product, g_astGradeName[j].c_str()); m_vecDragonSoulNames[i].c_str(), by_product, g_astGradeName[j].c_str());
return false; return false;
} }
@ -597,7 +598,7 @@ bool DragonSoulTable::GetApplyNumSettings(BYTE ds_type, BYTE grade_idx, OUT int&
{ {
if (grade_idx >= DRAGON_SOUL_GRADE_MAX) if (grade_idx >= DRAGON_SOUL_GRADE_MAX)
{ {
sys_err ("Invalid dragon soul grade_idx(%d).", grade_idx); SPDLOG_ERROR("Invalid dragon soul grade_idx({}).", grade_idx);
return false; return false;
} }
@ -605,25 +606,25 @@ bool DragonSoulTable::GetApplyNumSettings(BYTE ds_type, BYTE grade_idx, OUT int&
std::string stDragonSoulName; std::string stDragonSoulName;
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName)) if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
{ {
sys_err ("Invalid dragon soul type(%d).", ds_type); SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
return false; return false;
} }
if (!m_pApplyNumSettingNode->GetGroupValue(stDragonSoulName, "basis", g_astGradeName[grade_idx], basis)) if (!m_pApplyNumSettingNode->GetGroupValue(stDragonSoulName, "basis", g_astGradeName[grade_idx], basis))
{ {
sys_err ("Invalid basis value. DragonSoulGroup(%s) Grade(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str()); SPDLOG_ERROR("Invalid basis value. DragonSoulGroup({}) Grade({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
return false; return false;
} }
if (!m_pApplyNumSettingNode->GetGroupValue(stDragonSoulName, "add_min", g_astGradeName[grade_idx], add_min)) if (!m_pApplyNumSettingNode->GetGroupValue(stDragonSoulName, "add_min", g_astGradeName[grade_idx], add_min))
{ {
sys_err ("Invalid add_min value. DragonSoulGroup(%s) Grade(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str()); SPDLOG_ERROR("Invalid add_min value. DragonSoulGroup({}) Grade({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
return false; return false;
} }
if (!m_pApplyNumSettingNode->GetGroupValue(stDragonSoulName, "add_max", g_astGradeName[grade_idx], add_max)) if (!m_pApplyNumSettingNode->GetGroupValue(stDragonSoulName, "add_max", g_astGradeName[grade_idx], add_max))
{ {
sys_err ("Invalid add_max value. DragonSoulGroup(%s) Grade(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str()); SPDLOG_ERROR("Invalid add_max value. DragonSoulGroup({}) Grade({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
return false; return false;
} }
@ -634,7 +635,7 @@ bool DragonSoulTable::GetWeight(BYTE ds_type, BYTE grade_idx, BYTE step_index, B
{ {
if (grade_idx >= DRAGON_SOUL_GRADE_MAX || step_index >= DRAGON_SOUL_STEP_MAX || strength_idx >= DRAGON_SOUL_STRENGTH_MAX) if (grade_idx >= DRAGON_SOUL_GRADE_MAX || step_index >= DRAGON_SOUL_STEP_MAX || strength_idx >= DRAGON_SOUL_STRENGTH_MAX)
{ {
sys_err ("Invalid dragon soul grade_idx(%d) step_index(%d) strength_idx(%d).", grade_idx, step_index, strength_idx); SPDLOG_ERROR("Invalid dragon soul grade_idx({}) step_index({}) strength_idx({}).", grade_idx, step_index, strength_idx);
return false; return false;
} }
@ -642,7 +643,7 @@ bool DragonSoulTable::GetWeight(BYTE ds_type, BYTE grade_idx, BYTE step_index, B
std::string stDragonSoulName; std::string stDragonSoulName;
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName)) if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
{ {
sys_err ("Invalid dragon soul type(%d).", ds_type); SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
return false; return false;
} }
@ -660,13 +661,13 @@ bool DragonSoulTable::GetWeight(BYTE ds_type, BYTE grade_idx, BYTE step_index, B
{ {
if (!pDragonSoulGroup->GetGroupValue(g_astGradeName[grade_idx], g_astStepName[step_index], strength_idx, fWeight)) if (!pDragonSoulGroup->GetGroupValue(g_astGradeName[grade_idx], g_astStepName[step_index], strength_idx, fWeight))
{ {
sys_err ("Invalid float. DragonSoulGroup(%s) Grade(%s) Row(%s) Col(%d))", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astStepName[step_index].c_str(), strength_idx); SPDLOG_ERROR("Invalid float. DragonSoulGroup({}) Grade({}) Row({}) Col({}))", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astStepName[step_index].c_str(), strength_idx);
return false; return false;
} }
else else
return true; return true;
} }
sys_err ("Invalid value. DragonSoulGroup(%s) Grade(%s) Row(%s) Col(%d))", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astStepName[step_index].c_str(), strength_idx); SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Grade({}) Row({}) Col({}))", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astStepName[step_index].c_str(), strength_idx);
return false; return false;
} }
@ -674,7 +675,7 @@ bool DragonSoulTable::GetRefineGradeValues(BYTE ds_type, BYTE grade_idx, OUT int
{ {
if (grade_idx >= DRAGON_SOUL_GRADE_MAX -1) if (grade_idx >= DRAGON_SOUL_GRADE_MAX -1)
{ {
sys_err ("Invalid dragon soul grade_idx(%d).", grade_idx); SPDLOG_ERROR("Invalid dragon soul grade_idx({}).", grade_idx);
return false; return false;
} }
@ -682,26 +683,26 @@ bool DragonSoulTable::GetRefineGradeValues(BYTE ds_type, BYTE grade_idx, OUT int
std::string stDragonSoulName; std::string stDragonSoulName;
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName)) if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
{ {
sys_err ("Invalid dragon soul type(%d).", ds_type); SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
return false; return false;
} }
const CGroupNode::CGroupNodeRow * pRow; const CGroupNode::CGroupNodeRow * pRow;
if (!m_pRefineGradeTableNode->GetGroupRow(stDragonSoulName, g_astGradeName[grade_idx], &pRow)) if (!m_pRefineGradeTableNode->GetGroupRow(stDragonSoulName, g_astGradeName[grade_idx], &pRow))
{ {
sys_err ("Invalid row. DragonSoulGroup(%s) Grade(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str()); SPDLOG_ERROR("Invalid row. DragonSoulGroup({}) Grade({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
return false; return false;
} }
if (!pRow->GetValue("need_count", need_count)) if (!pRow->GetValue("need_count", need_count))
{ {
sys_err ("Invalid value. DragonSoulGroup(%s) Grade(%s) Col(need_count)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str()); SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Grade({}) Col(need_count)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
return false; return false;
} }
if (!pRow->GetValue("fee", fee)) if (!pRow->GetValue("fee", fee))
{ {
sys_err ("Invalid value. DragonSoulGroup(%s) Grade(%s) Col(fee)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str()); SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Grade({}) Col(fee)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
return false; return false;
} }
@ -710,7 +711,7 @@ bool DragonSoulTable::GetRefineGradeValues(BYTE ds_type, BYTE grade_idx, OUT int
{ {
if (!pRow->GetValue(g_astGradeName[i], vec_probs[i])) if (!pRow->GetValue(g_astGradeName[i], vec_probs[i]))
{ {
sys_err ("Invalid value. DragonSoulGroup(%s) Grade(%s) Col(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astGradeName[i].c_str()); SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Grade({}) Col({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astGradeName[i].c_str());
return false; return false;
} }
} }
@ -722,7 +723,7 @@ bool DragonSoulTable::GetRefineStepValues(BYTE ds_type, BYTE step_idx, OUT int&
{ {
if (step_idx >= DRAGON_SOUL_STEP_MAX - 1) if (step_idx >= DRAGON_SOUL_STEP_MAX - 1)
{ {
sys_err ("Invalid dragon soul step_idx(%d).", step_idx); SPDLOG_ERROR("Invalid dragon soul step_idx({}).", step_idx);
return false; return false;
} }
@ -730,26 +731,26 @@ bool DragonSoulTable::GetRefineStepValues(BYTE ds_type, BYTE step_idx, OUT int&
std::string stDragonSoulName; std::string stDragonSoulName;
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName)) if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
{ {
sys_err ("Invalid dragon soul type(%d).", ds_type); SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
return false; return false;
} }
const CGroupNode::CGroupNodeRow * pRow; const CGroupNode::CGroupNodeRow * pRow;
if (!m_pRefineStepTableNode->GetGroupRow(stDragonSoulName, g_astStepName[step_idx], &pRow)) if (!m_pRefineStepTableNode->GetGroupRow(stDragonSoulName, g_astStepName[step_idx], &pRow))
{ {
sys_err ("Invalid row. DragonSoulGroup(%s) Step(%s)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str()); SPDLOG_ERROR("Invalid row. DragonSoulGroup({}) Step({})", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str());
return false; return false;
} }
if (!pRow->GetValue("need_count", need_count)) if (!pRow->GetValue("need_count", need_count))
{ {
sys_err ("Invalid value. DragonSoulGroup(%s) Step(%s) Col(need_count)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str()); SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Step({}) Col(need_count)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str());
return false; return false;
} }
if (!pRow->GetValue("fee", fee)) if (!pRow->GetValue("fee", fee))
{ {
sys_err ("Invalid value. DragonSoulGroup(%s) Step(%s) Col(fee)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str()); SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Step({}) Col(fee)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str());
return false; return false;
} }
@ -758,7 +759,7 @@ bool DragonSoulTable::GetRefineStepValues(BYTE ds_type, BYTE step_idx, OUT int&
{ {
if (!pRow->GetValue(g_astStepName[i], vec_probs[i])) if (!pRow->GetValue(g_astStepName[i], vec_probs[i]))
{ {
sys_err ("Invalid value. DragonSoulGroup(%s) Step(%s) Col(%s)", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str(), g_astStepName[i].c_str()); SPDLOG_ERROR("Invalid value. DragonSoulGroup({}) Step({}) Col({})", stDragonSoulName.c_str(), g_astStepName[step_idx].c_str(), g_astStepName[i].c_str());
return false; return false;
} }
} }
@ -770,7 +771,7 @@ bool DragonSoulTable::GetRefineStrengthValues(BYTE ds_type, BYTE material_type,
{ {
if (material_type < MATERIAL_DS_REFINE_NORMAL || material_type > MATERIAL_DS_REFINE_HOLLY) if (material_type < MATERIAL_DS_REFINE_NORMAL || material_type > MATERIAL_DS_REFINE_HOLLY)
{ {
sys_err ("Invalid dragon soul material_type(%d).", material_type); SPDLOG_ERROR("Invalid dragon soul material_type({}).", material_type);
return false; return false;
} }
@ -778,13 +779,13 @@ bool DragonSoulTable::GetRefineStrengthValues(BYTE ds_type, BYTE material_type,
std::string stDragonSoulName; std::string stDragonSoulName;
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName)) if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
{ {
sys_err ("Invalid dragon soul type(%d).", ds_type); SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
return false; return false;
} }
if (!m_pRefineStrengthTableNode->GetGroupValue(stDragonSoulName, g_astMaterialName[material_type], "fee", fee)) if (!m_pRefineStrengthTableNode->GetGroupValue(stDragonSoulName, g_astMaterialName[material_type], "fee", fee))
{ {
sys_err ("Invalid fee. DragonSoulGroup(%s) Material(%s)", SPDLOG_ERROR("Invalid fee. DragonSoulGroup({}) Material({})",
stDragonSoulName.c_str(), g_astMaterialName[material_type].c_str()); stDragonSoulName.c_str(), g_astMaterialName[material_type].c_str());
return false; return false;
} }
@ -792,7 +793,7 @@ bool DragonSoulTable::GetRefineStrengthValues(BYTE ds_type, BYTE material_type,
if (!m_pRefineStrengthTableNode->GetGroupValue(stDragonSoulName, g_astMaterialName[material_type], stStrengthIdx, prob)) if (!m_pRefineStrengthTableNode->GetGroupValue(stDragonSoulName, g_astMaterialName[material_type], stStrengthIdx, prob))
{ {
sys_err ("Invalid prob. DragonSoulGroup(%s) Material(%s) Strength(%d)", SPDLOG_ERROR("Invalid prob. DragonSoulGroup({}) Material({}) Strength({})",
stDragonSoulName.c_str(), g_astMaterialName[material_type].c_str(), strength_idx); stDragonSoulName.c_str(), g_astMaterialName[material_type].c_str(), strength_idx);
return false; return false;
} }
@ -804,21 +805,21 @@ bool DragonSoulTable::GetDragonHeartExtValues(BYTE ds_type, BYTE grade_idx, OUT
{ {
if (grade_idx >= DRAGON_SOUL_GRADE_MAX) if (grade_idx >= DRAGON_SOUL_GRADE_MAX)
{ {
sys_err ("Invalid dragon soul grade_idx(%d).", grade_idx); SPDLOG_ERROR("Invalid dragon soul grade_idx({}).", grade_idx);
return false; return false;
} }
std::string stDragonSoulName; std::string stDragonSoulName;
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName)) if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
{ {
sys_err ("Invalid dragon soul type(%d).", ds_type); SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
return false; return false;
} }
const CGroupNode::CGroupNodeRow * pRow; const CGroupNode::CGroupNodeRow * pRow;
if (!m_pDragonHeartExtTableNode->GetGroupRow(stDragonSoulName, "charging", &pRow)) if (!m_pDragonHeartExtTableNode->GetGroupRow(stDragonSoulName, "charging", &pRow))
{ {
sys_err ("Invalid CHARGING row. DragonSoulGroup(%s)", stDragonSoulName.c_str()); SPDLOG_ERROR("Invalid CHARGING row. DragonSoulGroup({})", stDragonSoulName.c_str());
return false; return false;
} }
int n = pRow->GetSize(); int n = pRow->GetSize();
@ -827,21 +828,21 @@ bool DragonSoulTable::GetDragonHeartExtValues(BYTE ds_type, BYTE grade_idx, OUT
{ {
if (!pRow->GetValue(i, vec_chargings[i])) if (!pRow->GetValue(i, vec_chargings[i]))
{ {
sys_err ("Invalid CHARGING value. DragonSoulGroup(%s), Col(%d)", stDragonSoulName.c_str(), i); SPDLOG_ERROR("Invalid CHARGING value. DragonSoulGroup({}), Col({})", stDragonSoulName.c_str(), i);
return false; return false;
} }
} }
if (!m_pDragonHeartExtTableNode->GetGroupRow(stDragonSoulName, g_astGradeName[grade_idx], &pRow)) if (!m_pDragonHeartExtTableNode->GetGroupRow(stDragonSoulName, g_astGradeName[grade_idx], &pRow))
{ {
sys_err ("Invalid row. DragonSoulGroup(%s) Grade(%s)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str()); SPDLOG_ERROR("Invalid row. DragonSoulGroup({}) Grade({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
return false; return false;
} }
int m = pRow->GetSize(); int m = pRow->GetSize();
if (n != m) if (n != m)
{ {
sys_err ("Invalid row size(%d). It must be same CHARGING row size(%d). DragonSoulGroup(%s) Grade(%s)", m, n, SPDLOG_ERROR("Invalid row size({}). It must be same CHARGING row size({}). DragonSoulGroup({}) Grade({})", m, n,
stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str()); stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str());
return false; return false;
} }
@ -850,7 +851,7 @@ bool DragonSoulTable::GetDragonHeartExtValues(BYTE ds_type, BYTE grade_idx, OUT
{ {
if (!pRow->GetValue(i, vec_probs[i])) if (!pRow->GetValue(i, vec_probs[i]))
{ {
sys_err ("Invalid value. DragonSoulGroup(%s), Grade(%s) Col(%d)", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), i); SPDLOG_ERROR("Invalid value. DragonSoulGroup({}), Grade({}) Col({})", stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), i);
return false; return false;
} }
} }
@ -862,7 +863,7 @@ bool DragonSoulTable::GetDragonSoulExtValues(BYTE ds_type, BYTE grade_idx, OUT f
{ {
if (grade_idx >= DRAGON_SOUL_GRADE_MAX) if (grade_idx >= DRAGON_SOUL_GRADE_MAX)
{ {
sys_err ("Invalid dragon soul grade_idx(%d).", grade_idx); SPDLOG_ERROR("Invalid dragon soul grade_idx({}).", grade_idx);
return false; return false;
} }
@ -870,20 +871,20 @@ bool DragonSoulTable::GetDragonSoulExtValues(BYTE ds_type, BYTE grade_idx, OUT f
std::string stDragonSoulName; std::string stDragonSoulName;
if (!GetDragonSoulGroupName(ds_type, stDragonSoulName)) if (!GetDragonSoulGroupName(ds_type, stDragonSoulName))
{ {
sys_err ("Invalid dragon soul type(%d).", ds_type); SPDLOG_ERROR("Invalid dragon soul type({}).", ds_type);
return false; return false;
} }
if (!m_pDragonSoulExtTableNode->GetGroupValue(stDragonSoulName, g_astGradeName[grade_idx], "prob", prob)) if (!m_pDragonSoulExtTableNode->GetGroupValue(stDragonSoulName, g_astGradeName[grade_idx], "prob", prob))
{ {
sys_err ("Invalid Prob. DragonSoulGroup(%s) Grade(%s)", SPDLOG_ERROR("Invalid Prob. DragonSoulGroup({}) Grade({})",
stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astGradeName[grade_idx].c_str()); stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), g_astGradeName[grade_idx].c_str());
return false; return false;
} }
if (!m_pDragonSoulExtTableNode->GetGroupValue(stDragonSoulName, g_astGradeName[grade_idx], "byproduct", by_product)) if (!m_pDragonSoulExtTableNode->GetGroupValue(stDragonSoulName, g_astGradeName[grade_idx], "byproduct", by_product))
{ {
sys_err ("Invalid fee. DragonSoulGroup(%s) Grade(%d)", SPDLOG_ERROR("Invalid fee. DragonSoulGroup({}) Grade({})",
stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), grade_idx); stDragonSoulName.c_str(), g_astGradeName[grade_idx].c_str(), grade_idx);
return false; return false;
} }

View File

@ -21,7 +21,6 @@ CDungeon::CDungeon(IdType id, int lOriginalMapIndex, int lMapIndex)
m_map_Area(SECTREE_MANAGER::instance().GetDungeonArea(lOriginalMapIndex)) m_map_Area(SECTREE_MANAGER::instance().GetDungeonArea(lOriginalMapIndex))
{ {
Initialize(); Initialize();
//sys_log(0,"DUNGEON create orig %d real %d", lOriginalMapIndex, lMapIndex);
} }
CDungeon::~CDungeon() CDungeon::~CDungeon()
@ -30,7 +29,6 @@ CDungeon::~CDungeon()
{ {
m_pParty->SetDungeon_for_Only_party (NULL); m_pParty->SetDungeon_for_Only_party (NULL);
} }
//sys_log(0,"DUNGEON destroy orig %d real %d", m_lOrigMapIndex, m_lMapIndex );
ClearRegen(); ClearRegen();
event_cancel(&deadEvent); event_cancel(&deadEvent);
// <Factor> // <Factor>
@ -109,7 +107,7 @@ void CDungeon::SendDestPositionToParty(LPPARTY pParty, int x, int y)
{ {
if (m_map_pkParty.find(pParty) == m_map_pkParty.end()) if (m_map_pkParty.find(pParty) == m_map_pkParty.end())
{ {
sys_err("PARTY %u not in DUNGEON %d", pParty->GetLeaderPID(), m_lMapIndex); SPDLOG_ERROR("PARTY {} not in DUNGEON {}", pParty->GetLeaderPID(), m_lMapIndex);
return; return;
} }
@ -143,7 +141,7 @@ struct FWarpToDungeon
void CDungeon::Join(LPCHARACTER ch) void CDungeon::Join(LPCHARACTER ch)
{ {
if (SECTREE_MANAGER::instance().GetMap(m_lMapIndex) == NULL) { if (SECTREE_MANAGER::instance().GetMap(m_lMapIndex) == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return; return;
} }
FWarpToDungeon(m_lMapIndex, this) (ch); FWarpToDungeon(m_lMapIndex, this) (ch);
@ -155,18 +153,16 @@ void CDungeon::JoinParty(LPPARTY pParty)
m_map_pkParty.insert(std::make_pair(pParty,0)); m_map_pkParty.insert(std::make_pair(pParty,0));
if (SECTREE_MANAGER::instance().GetMap(m_lMapIndex) == NULL) { if (SECTREE_MANAGER::instance().GetMap(m_lMapIndex) == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return; return;
} }
FWarpToDungeon f(m_lMapIndex, this); FWarpToDungeon f(m_lMapIndex, this);
pParty->ForEachOnlineMember(f); pParty->ForEachOnlineMember(f);
//sys_log(0, "DUNGEON-PARTY join %p %p", this, pParty);
} }
void CDungeon::QuitParty(LPPARTY pParty) void CDungeon::QuitParty(LPPARTY pParty)
{ {
pParty->SetDungeon(NULL); pParty->SetDungeon(NULL);
//sys_log(0, "DUNGEON-PARTY quit %p %p", this, pParty);
TPartyMap::iterator it = m_map_pkParty.find(pParty); TPartyMap::iterator it = m_map_pkParty.find(pParty);
if (it != m_map_pkParty.end()) if (it != m_map_pkParty.end())
@ -189,7 +185,7 @@ EVENTFUNC(dungeon_dead_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "dungeon_dead_event> <Factor> Null pointer" ); SPDLOG_ERROR("dungeon_dead_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -234,7 +230,6 @@ void CDungeon::DecMember(LPCHARACTER ch)
void CDungeon::IncPartyMember(LPPARTY pParty, LPCHARACTER ch) void CDungeon::IncPartyMember(LPPARTY pParty, LPCHARACTER ch)
{ {
//sys_log(0, "DUNGEON-PARTY inc %p %p", this, pParty);
TPartyMap::iterator it = m_map_pkParty.find(pParty); TPartyMap::iterator it = m_map_pkParty.find(pParty);
if (it != m_map_pkParty.end()) if (it != m_map_pkParty.end())
@ -247,11 +242,10 @@ void CDungeon::IncPartyMember(LPPARTY pParty, LPCHARACTER ch)
void CDungeon::DecPartyMember(LPPARTY pParty, LPCHARACTER ch) void CDungeon::DecPartyMember(LPPARTY pParty, LPCHARACTER ch)
{ {
//sys_log(0, "DUNGEON-PARTY dec %p %p", this, pParty);
TPartyMap::iterator it = m_map_pkParty.find(pParty); TPartyMap::iterator it = m_map_pkParty.find(pParty);
if (it == m_map_pkParty.end()) if (it == m_map_pkParty.end())
sys_err("cannot find party"); SPDLOG_ERROR("cannot find party");
else else
{ {
it->second--; it->second--;
@ -324,7 +318,7 @@ void CDungeon::JumpAll(int lFromMapIndex, int x, int y)
if (!pMap) if (!pMap)
{ {
sys_err("cannot find map by index %d", lFromMapIndex); SPDLOG_ERROR("cannot find map by index {}", lFromMapIndex);
return; return;
} }
@ -343,7 +337,7 @@ void CDungeon::WarpAll(int lFromMapIndex, int x, int y)
if (!pMap) if (!pMap)
{ {
sys_err("cannot find map by index %d", lFromMapIndex); SPDLOG_ERROR("cannot find map by index {}", lFromMapIndex);
return; return;
} }
@ -362,7 +356,7 @@ void CDungeon::JumpParty(LPPARTY pParty, int lFromMapIndex, int x, int y)
if (!pMap) if (!pMap)
{ {
sys_err("cannot find map by index %d", lFromMapIndex); SPDLOG_ERROR("cannot find map by index {}", lFromMapIndex);
return; return;
} }
@ -374,7 +368,7 @@ void CDungeon::JumpParty(LPPARTY pParty, int lFromMapIndex, int x, int y)
} }
else if (m_pParty != pParty) else if (m_pParty != pParty)
{ {
sys_err ("Dungeon already has party. Another party cannot jump in dungeon : index %d", GetMapIndex()); SPDLOG_ERROR("Dungeon already has party. Another party cannot jump in dungeon : index {}", GetMapIndex());
return; return;
} }
pParty->SetDungeon_for_Only_party (this); pParty->SetDungeon_for_Only_party (this);
@ -393,7 +387,7 @@ void CDungeon::SetPartyNull()
void CDungeonManager::Destroy(CDungeon::IdType dungeon_id) void CDungeonManager::Destroy(CDungeon::IdType dungeon_id)
{ {
sys_log(0, "DUNGEON destroy : map index %u", dungeon_id); SPDLOG_DEBUG("DUNGEON destroy : map index {}", dungeon_id);
LPDUNGEON pDungeon = Find(dungeon_id); LPDUNGEON pDungeon = Find(dungeon_id);
if (pDungeon == NULL) { if (pDungeon == NULL) {
return; return;
@ -433,7 +427,7 @@ LPDUNGEON CDungeonManager::Create(int lOriginalMapIndex)
if (!lMapIndex) if (!lMapIndex)
{ {
sys_log( 0, "Fail to Create Dungeon : OrginalMapindex %d NewMapindex %d", lOriginalMapIndex, lMapIndex ); SPDLOG_ERROR("Fail to Create Dungeon : OrginalMapindex {} NewMapindex {}", lOriginalMapIndex, lMapIndex );
return NULL; return NULL;
} }
@ -446,7 +440,7 @@ LPDUNGEON CDungeonManager::Create(int lOriginalMapIndex)
LPDUNGEON pDungeon = M2_NEW CDungeon(id, lOriginalMapIndex, lMapIndex); LPDUNGEON pDungeon = M2_NEW CDungeon(id, lOriginalMapIndex, lMapIndex);
if (!pDungeon) if (!pDungeon)
{ {
sys_err("M2_NEW CDungeon failed"); SPDLOG_ERROR("M2_NEW CDungeon failed");
return NULL; return NULL;
} }
m_map_pkDungeon.insert(std::make_pair(id, pDungeon)); m_map_pkDungeon.insert(std::make_pair(id, pDungeon));
@ -469,7 +463,7 @@ void CDungeon::UniqueSetMaxHP(const std::string& key, int iMaxHP)
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key); TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
if (it == m_map_UniqueMob.end()) if (it == m_map_UniqueMob.end())
{ {
sys_err("Unknown Key : %s", key.c_str()); SPDLOG_ERROR("Unknown Key : {}", key.c_str());
return; return;
} }
it->second->SetMaxHP(iMaxHP); it->second->SetMaxHP(iMaxHP);
@ -480,7 +474,7 @@ void CDungeon::UniqueSetHP(const std::string& key, int iHP)
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key); TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
if (it == m_map_UniqueMob.end()) if (it == m_map_UniqueMob.end())
{ {
sys_err("Unknown Key : %s", key.c_str()); SPDLOG_ERROR("Unknown Key : {}", key.c_str());
return; return;
} }
it->second->SetHP(iHP); it->second->SetHP(iHP);
@ -491,7 +485,7 @@ void CDungeon::UniqueSetDefGrade(const std::string& key, int iGrade)
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key); TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
if (it == m_map_UniqueMob.end()) if (it == m_map_UniqueMob.end())
{ {
sys_err("Unknown Key : %s", key.c_str()); SPDLOG_ERROR("Unknown Key : {}", key.c_str());
return; return;
} }
it->second->PointChange(POINT_DEF_GRADE,iGrade - it->second->GetPoint(POINT_DEF_GRADE)); it->second->PointChange(POINT_DEF_GRADE,iGrade - it->second->GetPoint(POINT_DEF_GRADE));
@ -502,14 +496,14 @@ void CDungeon::SpawnMoveUnique(const char* key, DWORD vnum, const char* pos_from
TAreaMap::iterator it_to = m_map_Area.find(pos_to); TAreaMap::iterator it_to = m_map_Area.find(pos_to);
if (it_to == m_map_Area.end()) if (it_to == m_map_Area.end())
{ {
sys_err("Wrong position string : %s", pos_to); SPDLOG_ERROR("Wrong position string : {}", pos_to);
return; return;
} }
TAreaMap::iterator it_from = m_map_Area.find(pos_from); TAreaMap::iterator it_from = m_map_Area.find(pos_from);
if (it_from == m_map_Area.end()) if (it_from == m_map_Area.end())
{ {
sys_err("Wrong position string : %s", pos_from); SPDLOG_ERROR("Wrong position string : {}", pos_from);
return; return;
} }
@ -521,7 +515,7 @@ void CDungeon::SpawnMoveUnique(const char* key, DWORD vnum, const char* pos_from
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (pkSectreeMap == NULL) { if (pkSectreeMap == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return; return;
} }
for (int i=0;i<100;i++) for (int i=0;i<100;i++)
@ -544,7 +538,7 @@ void CDungeon::SpawnMoveUnique(const char* key, DWORD vnum, const char* pos_from
} }
else else
{ {
sys_err("Cannot spawn at %d %d", pkSectreeMap->m_setting.iBaseX+((ai.sx+ai.ex)>>1), pkSectreeMap->m_setting.iBaseY+((ai.sy+ai.ey)>>1)); SPDLOG_ERROR("Cannot spawn at {} {}", pkSectreeMap->m_setting.iBaseX+((ai.sx+ai.ex)>>1), pkSectreeMap->m_setting.iBaseY+((ai.sy+ai.ey)>>1));
} }
} }
@ -555,7 +549,7 @@ void CDungeon::SpawnUnique(const char* key, DWORD vnum, const char* pos)
TAreaMap::iterator it = m_map_Area.find(pos); TAreaMap::iterator it = m_map_Area.find(pos);
if (it == m_map_Area.end()) if (it == m_map_Area.end())
{ {
sys_err("Wrong position string : %s", pos); SPDLOG_ERROR("Wrong position string : {}", pos);
return; return;
} }
@ -566,7 +560,7 @@ void CDungeon::SpawnUnique(const char* key, DWORD vnum, const char* pos)
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (pkSectreeMap == NULL) { if (pkSectreeMap == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return; return;
} }
for (int i=0;i<100;i++) for (int i=0;i<100;i++)
@ -585,7 +579,7 @@ void CDungeon::SpawnUnique(const char* key, DWORD vnum, const char* pos)
} }
else else
{ {
sys_err("Cannot spawn at %d %d", pkSectreeMap->m_setting.iBaseX+((ai.sx+ai.ex)>>1), pkSectreeMap->m_setting.iBaseY+((ai.sy+ai.ey)>>1)); SPDLOG_ERROR("Cannot spawn at {} {}", pkSectreeMap->m_setting.iBaseX+((ai.sx+ai.ex)>>1), pkSectreeMap->m_setting.iBaseY+((ai.sy+ai.ey)>>1));
} }
} }
} }
@ -618,7 +612,7 @@ void CDungeon::PurgeUnique(const std::string& key)
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key); TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
if (it == m_map_UniqueMob.end()) if (it == m_map_UniqueMob.end())
{ {
sys_err("Unknown Key or Dead: %s", key.c_str()); SPDLOG_ERROR("Unknown Key or Dead: {}", key.c_str());
return; return;
} }
LPCHARACTER ch = it->second; LPCHARACTER ch = it->second;
@ -631,7 +625,7 @@ void CDungeon::KillUnique(const std::string& key)
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key); TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
if (it == m_map_UniqueMob.end()) if (it == m_map_UniqueMob.end())
{ {
sys_err("Unknown Key or Dead: %s", key.c_str()); SPDLOG_ERROR("Unknown Key or Dead: {}", key.c_str());
return; return;
} }
LPCHARACTER ch = it->second; LPCHARACTER ch = it->second;
@ -644,7 +638,7 @@ DWORD CDungeon::GetUniqueVid(const std::string& key)
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key); TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
if (it == m_map_UniqueMob.end()) if (it == m_map_UniqueMob.end())
{ {
sys_err("Unknown Key or Dead: %s", key.c_str()); SPDLOG_ERROR("Unknown Key or Dead: {}", key.c_str());
return 0; return 0;
} }
LPCHARACTER ch = it->second; LPCHARACTER ch = it->second;
@ -656,7 +650,7 @@ float CDungeon::GetUniqueHpPerc(const std::string& key)
TUniqueMobMap::iterator it = m_map_UniqueMob.find(key); TUniqueMobMap::iterator it = m_map_UniqueMob.find(key);
if (it == m_map_UniqueMob.end()) if (it == m_map_UniqueMob.end())
{ {
sys_err("Unknown Key : %s", key.c_str()); SPDLOG_ERROR("Unknown Key : {}", key.c_str());
return false; return false;
} }
return (100.f*it->second->GetHP())/it->second->GetMaxHP(); return (100.f*it->second->GetHP())/it->second->GetMaxHP();
@ -671,7 +665,6 @@ void CDungeon::DeadCharacter(LPCHARACTER ch)
{ {
if (it->second == ch) if (it->second == ch)
{ {
//sys_log(0,"Dead unique %s", it->first.c_str());
m_map_UniqueMob.erase(it); m_map_UniqueMob.erase(it);
break; break;
} }
@ -686,7 +679,7 @@ bool CDungeon::IsUniqueDead(const std::string& key)
if (it == m_map_UniqueMob.end()) if (it == m_map_UniqueMob.end())
{ {
sys_err("Unknown Key or Dead : %s", key.c_str()); SPDLOG_ERROR("Unknown Key or Dead : {}", key.c_str());
return true; return true;
} }
@ -695,12 +688,11 @@ bool CDungeon::IsUniqueDead(const std::string& key)
void CDungeon::Spawn(DWORD vnum, const char* pos) void CDungeon::Spawn(DWORD vnum, const char* pos)
{ {
//sys_log(0,"DUNGEON Spawn %u %s", vnum, pos);
TAreaMap::iterator it = m_map_Area.find(pos); TAreaMap::iterator it = m_map_Area.find(pos);
if (it == m_map_Area.end()) if (it == m_map_Area.end())
{ {
sys_err("Wrong position string : %s", pos); SPDLOG_ERROR("Wrong position string : {}", pos);
return; return;
} }
@ -712,7 +704,7 @@ void CDungeon::Spawn(DWORD vnum, const char* pos)
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (pkSectreeMap == NULL) if (pkSectreeMap == NULL)
{ {
sys_err("cannot find map by index %d", m_lMapIndex); SPDLOG_ERROR("cannot find map by index {}", m_lMapIndex);
return; return;
} }
int dx = Random::get(ai.sx, ai.ex); int dx = Random::get(ai.sx, ai.ex);
@ -727,17 +719,17 @@ LPCHARACTER CDungeon::SpawnMob(DWORD vnum, int x, int y, int dir)
{ {
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (pkSectreeMap == NULL) { if (pkSectreeMap == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return NULL; return NULL;
} }
sys_log(0, "CDungeon::SpawnMob %u %d %d", vnum, x, y); SPDLOG_DEBUG("CDungeon::SpawnMob {} {} {}", vnum, x, y);
LPCHARACTER ch = CHARACTER_MANAGER::instance().SpawnMob(vnum, m_lMapIndex, pkSectreeMap->m_setting.iBaseX+x*100, pkSectreeMap->m_setting.iBaseY+y*100, 0, false, dir == 0 ? -1 : (dir - 1) * 45); LPCHARACTER ch = CHARACTER_MANAGER::instance().SpawnMob(vnum, m_lMapIndex, pkSectreeMap->m_setting.iBaseX+x*100, pkSectreeMap->m_setting.iBaseY+y*100, 0, false, dir == 0 ? -1 : (dir - 1) * 45);
if (ch) if (ch)
{ {
ch->SetDungeon(this); ch->SetDungeon(this);
sys_log(0, "CDungeon::SpawnMob name %s", ch->GetName()); SPDLOG_DEBUG("CDungeon::SpawnMob name {}", ch->GetName());
} }
return ch; return ch;
@ -747,17 +739,17 @@ LPCHARACTER CDungeon::SpawnMob_ac_dir(DWORD vnum, int x, int y, int dir)
{ {
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (pkSectreeMap == NULL) { if (pkSectreeMap == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return NULL; return NULL;
} }
sys_log(0, "CDungeon::SpawnMob %u %d %d", vnum, x, y); SPDLOG_DEBUG("CDungeon::SpawnMob {} {} {}", vnum, x, y);
LPCHARACTER ch = CHARACTER_MANAGER::instance().SpawnMob(vnum, m_lMapIndex, pkSectreeMap->m_setting.iBaseX+x*100, pkSectreeMap->m_setting.iBaseY+y*100, 0, false, dir); LPCHARACTER ch = CHARACTER_MANAGER::instance().SpawnMob(vnum, m_lMapIndex, pkSectreeMap->m_setting.iBaseX+x*100, pkSectreeMap->m_setting.iBaseY+y*100, 0, false, dir);
if (ch) if (ch)
{ {
ch->SetDungeon(this); ch->SetDungeon(this);
sys_log(0, "CDungeon::SpawnMob name %s", ch->GetName()); SPDLOG_DEBUG("CDungeon::SpawnMob name {}", ch->GetName());
} }
return ch; return ch;
@ -767,7 +759,7 @@ void CDungeon::SpawnNameMob(DWORD vnum, int x, int y, const char* name)
{ {
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (pkSectreeMap == NULL) { if (pkSectreeMap == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return; return;
} }
@ -785,11 +777,11 @@ void CDungeon::SpawnGotoMob(int lFromX, int lFromY, int lToX, int lToY)
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (pkSectreeMap == NULL) { if (pkSectreeMap == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return; return;
} }
sys_log(0, "SpawnGotoMob %d %d to %d %d", lFromX, lFromY, lToX, lToY); SPDLOG_DEBUG("SpawnGotoMob {} {} to {} {}", lFromX, lFromY, lToX, lToY);
lFromX = pkSectreeMap->m_setting.iBaseX+lFromX*100; lFromX = pkSectreeMap->m_setting.iBaseX+lFromX*100;
lFromY = pkSectreeMap->m_setting.iBaseY+lFromY*100; lFromY = pkSectreeMap->m_setting.iBaseY+lFromY*100;
@ -810,7 +802,7 @@ LPCHARACTER CDungeon::SpawnGroup(DWORD vnum, int x, int y, float radius, bool bA
{ {
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (pkSectreeMap == NULL) { if (pkSectreeMap == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return NULL; return NULL;
} }
@ -837,14 +829,14 @@ void CDungeon::SpawnRegen(const char* filename, bool bOnce)
{ {
if (!filename) if (!filename)
{ {
sys_err("CDungeon::SpawnRegen(filename=NULL, bOnce=%d) - m_lMapIndex[%d]", bOnce, m_lMapIndex); SPDLOG_ERROR("CDungeon::SpawnRegen(filename=NULL, bOnce={}) - m_lMapIndex[{}]", bOnce, m_lMapIndex);
return; return;
} }
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (!pkSectreeMap) if (!pkSectreeMap)
{ {
sys_err("CDungeon::SpawnRegen(filename=%s, bOnce=%d) - m_lMapIndex[%d]", filename, bOnce, m_lMapIndex); SPDLOG_ERROR("CDungeon::SpawnRegen(filename={}, bOnce={}) - m_lMapIndex[{}]", filename, bOnce, m_lMapIndex);
return; return;
} }
regen_do(filename, m_lMapIndex, pkSectreeMap->m_setting.iBaseX, pkSectreeMap->m_setting.iBaseY, this, bOnce); regen_do(filename, m_lMapIndex, pkSectreeMap->m_setting.iBaseX, pkSectreeMap->m_setting.iBaseY, this, bOnce);
@ -883,7 +875,7 @@ void CDungeon::SpawnMoveGroup(DWORD vnum, const char* pos_from, const char* pos_
if (it_to == m_map_Area.end()) if (it_to == m_map_Area.end())
{ {
sys_err("Wrong position string : %s", pos_to); SPDLOG_ERROR("Wrong position string : {}", pos_to);
return; return;
} }
@ -891,7 +883,7 @@ void CDungeon::SpawnMoveGroup(DWORD vnum, const char* pos_from, const char* pos_
if (it_from == m_map_Area.end()) if (it_from == m_map_Area.end())
{ {
sys_err("Wrong position string : %s", pos_from); SPDLOG_ERROR("Wrong position string : {}", pos_from);
return; return;
} }
@ -904,7 +896,7 @@ void CDungeon::SpawnMoveGroup(DWORD vnum, const char* pos_from, const char* pos_
LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkSectreeMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (pkSectreeMap == NULL) { if (pkSectreeMap == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return; return;
} }
@ -952,7 +944,7 @@ namespace
M2_DESTROY_ITEM(item); M2_DESTROY_ITEM(item);
} }
else else
sys_err("unknown entity type %d is in dungeon", ent->GetType()); SPDLOG_ERROR("unknown entity type {} is in dungeon", ent->GetType());
} }
}; };
} }
@ -962,7 +954,7 @@ void CDungeon::KillAll()
{ {
LPSECTREE_MAP pkMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (pkMap == NULL) { if (pkMap == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return; return;
} }
FKillSectree f; FKillSectree f;
@ -974,7 +966,7 @@ void CDungeon::Purge()
{ {
LPSECTREE_MAP pkMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pkMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (pkMap == NULL) { if (pkMap == NULL) {
sys_err("CDungeon: SECTREE_MAP not found for #%ld", m_lMapIndex); SPDLOG_ERROR("CDungeon: SECTREE_MAP not found for #{}", m_lMapIndex);
return; return;
} }
FPurgeSectree f; FPurgeSectree f;
@ -1039,7 +1031,7 @@ int CDungeon::CountRealMonster()
if (!pMap) if (!pMap)
{ {
sys_err("cannot find map by index %d", m_lOrigMapIndex); SPDLOG_ERROR("cannot find map by index {}", m_lOrigMapIndex);
return 0; return 0;
} }
@ -1070,7 +1062,7 @@ void CDungeon::ExitAll()
if (!pMap) if (!pMap)
{ {
sys_err("cannot find map by index %d", m_lMapIndex); SPDLOG_ERROR("cannot find map by index {}", m_lMapIndex);
return; return;
} }
@ -1104,12 +1096,12 @@ namespace
void CDungeon::Notice(const char* msg) void CDungeon::Notice(const char* msg)
{ {
sys_log(0, "XXX Dungeon Notice %p %s", this, msg); SPDLOG_DEBUG("Dungeon Notice {} {}", (void*) this, msg);
LPSECTREE_MAP pMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex); LPSECTREE_MAP pMap = SECTREE_MANAGER::instance().GetMap(m_lMapIndex);
if (!pMap) if (!pMap)
{ {
sys_err("cannot find map by index %d", m_lMapIndex); SPDLOG_ERROR("cannot find map by index {}", m_lMapIndex);
return; return;
} }
@ -1146,7 +1138,7 @@ void CDungeon::ExitAllToStartPosition()
if (!pMap) if (!pMap)
{ {
sys_err("cannot find map by index %d", m_lMapIndex); SPDLOG_ERROR("cannot find map by index {}", m_lMapIndex);
return; return;
} }
@ -1162,7 +1154,7 @@ EVENTFUNC(dungeon_jump_to_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "dungeon_jump_to_event> <Factor> Null pointer" ); SPDLOG_ERROR("dungeon_jump_to_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -1172,7 +1164,7 @@ EVENTFUNC(dungeon_jump_to_event)
if (pDungeon) if (pDungeon)
pDungeon->JumpToEliminateLocation(); pDungeon->JumpToEliminateLocation();
else else
sys_err("cannot find dungeon with map index %u", info->dungeon_id); SPDLOG_ERROR("cannot find dungeon with map index {}", info->dungeon_id);
return 0; return 0;
} }
@ -1183,7 +1175,7 @@ EVENTFUNC(dungeon_exit_all_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "dungeon_exit_all_event> <Factor> Null pointer" ); SPDLOG_ERROR("dungeon_exit_all_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -1203,7 +1195,7 @@ void CDungeon::CheckEliminated()
if (m_bExitAllAtEliminate) if (m_bExitAllAtEliminate)
{ {
sys_log(0, "CheckEliminated: exit"); SPDLOG_DEBUG("CheckEliminated: exit");
m_bExitAllAtEliminate = false; m_bExitAllAtEliminate = false;
if (m_iWarpDelay) if (m_iWarpDelay)
@ -1221,7 +1213,7 @@ void CDungeon::CheckEliminated()
} }
else if (m_bWarpAtEliminate) else if (m_bWarpAtEliminate)
{ {
sys_log(0, "CheckEliminated: warp"); SPDLOG_DEBUG("CheckEliminated: warp");
m_bWarpAtEliminate = false; m_bWarpAtEliminate = false;
if (m_iWarpDelay) if (m_iWarpDelay)
@ -1238,12 +1230,12 @@ void CDungeon::CheckEliminated()
} }
} }
else else
sys_log(0, "CheckEliminated: none"); SPDLOG_DEBUG("CheckEliminated: none");
} }
void CDungeon::SetExitAllAtEliminate(int time) void CDungeon::SetExitAllAtEliminate(int time)
{ {
sys_log(0, "SetExitAllAtEliminate: time %d", time); SPDLOG_DEBUG("SetExitAllAtEliminate: time {}", time);
m_bExitAllAtEliminate = true; m_bExitAllAtEliminate = true;
m_iWarpDelay = time; m_iWarpDelay = time;
} }
@ -1261,7 +1253,7 @@ void CDungeon::SetWarpAtEliminate(int time, int lMapIndex, int x, int y, const c
else else
m_stRegenFile = regen_file; m_stRegenFile = regen_file;
sys_log(0, "SetWarpAtEliminate: time %d map %d %dx%d regenfile %s", time, lMapIndex, x, y, m_stRegenFile.c_str()); SPDLOG_DEBUG("SetWarpAtEliminate: time {} map {} {}x{} regenfile {}", time, lMapIndex, x, y, m_stRegenFile.c_str());
} }
void CDungeon::JumpToEliminateLocation() void CDungeon::JumpToEliminateLocation()
@ -1285,7 +1277,7 @@ void CDungeon::JumpToEliminateLocation()
if (!pMap) if (!pMap)
{ {
sys_err("no map by index %d", m_lMapIndex); SPDLOG_ERROR("no map by index {}", m_lMapIndex);
return; return;
} }
@ -1332,7 +1324,7 @@ bool CDungeon::IsAllPCNearTo(int x, int y, int dist)
if (!pMap) if (!pMap)
{ {
sys_err("cannot find map by index %d", m_lMapIndex); SPDLOG_ERROR("cannot find map by index {}", m_lMapIndex);
return false; return false;
} }

View File

@ -36,7 +36,7 @@ class CDungeon
void KillAll(); void KillAll();
// END_OF_DUNGEON_KILL_ALL_BUG_FIX // END_OF_DUNGEON_KILL_ALL_BUG_FIX
void IncMonster() { m_iMonsterCount++; sys_log(0, "MonsterCount %d", m_iMonsterCount); } void IncMonster() { m_iMonsterCount++; SPDLOG_DEBUG("MonsterCount {}", m_iMonsterCount); }
void DecMonster() { m_iMonsterCount--; CheckEliminated(); } void DecMonster() { m_iMonsterCount--; CheckEliminated(); }
int CountMonster() { return m_iMonsterCount; } // 데이터로 리젠한 몬스터의 수 int CountMonster() { return m_iMonsterCount; } // 데이터로 리젠한 몬스터의 수
int CountRealMonster(); // 실제로 맵상에 있는 몬스터 int CountRealMonster(); // 실제로 맵상에 있는 몬스터

View File

@ -126,7 +126,7 @@ void CEntity::UpdateSectree()
if (IsType(ENTITY_CHARACTER)) if (IsType(ENTITY_CHARACTER))
{ {
LPCHARACTER tch = (LPCHARACTER) this; LPCHARACTER tch = (LPCHARACTER) this;
sys_err("null sectree name: %s %d %d", tch->GetName(), GetX(), GetY()); SPDLOG_ERROR("null sectree name: {} {} {}", tch->GetName(), GetX(), GetY());
} }
return; return;

View File

@ -51,7 +51,7 @@ void event_cancel(LPEVENT * ppevent)
if (!ppevent) if (!ppevent)
{ {
sys_err("null pointer"); SPDLOG_ERROR("null pointer");
return; return;
} }
@ -136,7 +136,6 @@ int event_process(int pulse)
} }
else else
{ {
//sys_log(0, "EVENT: %s %d event %p info %p", the_event->file, the_event->line, the_event, the_event->info);
new_time = (the_event->func) (get_pointer(the_event), processing_time); new_time = (the_event->func) (get_pointer(the_event), processing_time);
if (new_time <= 0 || the_event->is_force_to_end) if (new_time <= 0 || the_event->is_force_to_end)

View File

@ -166,13 +166,13 @@ bool CExchange::AddItem(TItemPos item_pos, BYTE display_pos)
// 이미 교환창에 추가된 아이템인가? // 이미 교환창에 추가된 아이템인가?
if (item->IsExchanging()) if (item->IsExchanging())
{ {
sys_log(0, "EXCHANGE under exchanging"); SPDLOG_DEBUG("EXCHANGE under exchanging");
return false; return false;
} }
if (!m_pGrid->IsEmpty(display_pos, 1, item->GetSize())) if (!m_pGrid->IsEmpty(display_pos, 1, item->GetSize()))
{ {
sys_log(0, "EXCHANGE not empty item_pos %d %d %d", display_pos, 1, item->GetSize()); SPDLOG_DEBUG("EXCHANGE not empty item_pos {} {} {}", display_pos, 1, item->GetSize());
return false; return false;
} }
@ -207,7 +207,7 @@ bool CExchange::AddItem(TItemPos item_pos, BYTE display_pos)
item->GetCount(), item->GetCount(),
item); item);
sys_log(0, "EXCHANGE AddItem success %s pos(%d, %d) %d", item->GetName(), item_pos.window_type, item_pos.cell, display_pos); SPDLOG_DEBUG("EXCHANGE AddItem success {} pos({}, {}) {}", item->GetName(), item_pos.window_type, item_pos.cell, display_pos);
return true; return true;
} }
@ -431,7 +431,7 @@ bool CExchange::Done()
if (empty_pos < 0) if (empty_pos < 0)
{ {
sys_err("Exchange::Done : Cannot find blank position in inventory %s <-> %s item %s", SPDLOG_ERROR("Exchange::Done : Cannot find blank position in inventory {} <-> {} item {}",
m_pOwner->GetName(), victim->GetName(), item->GetName()); m_pOwner->GetName(), victim->GetName(), item->GetName());
continue; continue;
} }
@ -548,7 +548,7 @@ bool CExchange::Accept(bool bAccept)
if (!db_clientdesc->IsPhase(PHASE_DBCLIENT)) if (!db_clientdesc->IsPhase(PHASE_DBCLIENT))
{ {
sys_err("Cannot use exchange feature while DB cache connection is dead."); SPDLOG_ERROR("Cannot use exchange feature while DB cache connection is dead.");
victim->ChatPacket(CHAT_TYPE_INFO, "Unknown error"); victim->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
GetOwner()->ChatPacket(CHAT_TYPE_INFO, "Unknown error"); GetOwner()->ChatPacket(CHAT_TYPE_INFO, "Unknown error");
goto EXCHANGE_END; goto EXCHANGE_END;

View File

@ -301,7 +301,7 @@ void Initialize()
for (int i = 0; i < MAX_FISH; ++i) for (int i = 0; i < MAX_FISH; ++i)
{ {
sys_log(0, "FISH: %-24s vnum %5lu prob %4d %4d %4d %4d len %d %d %d", SPDLOG_TRACE("FISH: {:24} vnum {:5} prob {:4} {:4} {:4} {:4} len {} {} {}",
fish_info[i].name, fish_info[i].name,
fish_info[i].vnum, fish_info[i].vnum,
fish_info[i].prob[0], fish_info[i].prob[0],
@ -322,7 +322,7 @@ void Initialize()
g_prob_accumulate[j][i] = fish_info[i].prob[j] + g_prob_accumulate[j][i - 1]; g_prob_accumulate[j][i] = fish_info[i].prob[j] + g_prob_accumulate[j][i - 1];
g_prob_sum[j] = g_prob_accumulate[j][MAX_FISH - 1]; g_prob_sum[j] = g_prob_accumulate[j][MAX_FISH - 1];
sys_log(0, "FISH: prob table %d %d", j, g_prob_sum[j]); SPDLOG_DEBUG("FISH: prob table {} {}", j, g_prob_sum[j]);
} }
} }
@ -472,7 +472,7 @@ EVENTFUNC(fishing_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "fishing_event> <Factor> Null pointer" ); SPDLOG_ERROR("fishing_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -558,7 +558,7 @@ int Compute(DWORD fish_id, DWORD ms, DWORD* item, int level)
if (fish_id >= MAX_FISH) if (fish_id >= MAX_FISH)
{ {
sys_err("Wrong FISH ID : %d", fish_id); SPDLOG_ERROR("Wrong FISH ID : {}", fish_id);
return -2; return -2;
} }
@ -857,7 +857,7 @@ int RealRefineRod(LPCHARACTER ch, LPITEM item)
// REFINE_ROD_HACK_BUG_FIX // REFINE_ROD_HACK_BUG_FIX
if (!RefinableRod(item)) if (!RefinableRod(item))
{ {
sys_err("REFINE_ROD_HACK pid(%u) item(%s:%d)", ch->GetPlayerID(), item->GetName(), item->GetID()); SPDLOG_ERROR("REFINE_ROD_HACK pid({}) item({}:{})", ch->GetPlayerID(), item->GetName(), item->GetID());
LogManager::instance().RefineLog(ch->GetPlayerID(), item->GetName(), item->GetID(), -1, 1, "ROD_HACK"); LogManager::instance().RefineLog(ch->GetPlayerID(), item->GetName(), item->GetID(), -1, 1, "ROD_HACK");

View File

@ -23,7 +23,7 @@ void gm_new_clear()
void gm_new_insert( const tAdminInfo &rAdminInfo ) void gm_new_insert( const tAdminInfo &rAdminInfo )
{ {
sys_log( 0, "InsertGMList(account:%s, player:%s, contact_ip:%s, server_ip:%s, auth:%d)", SPDLOG_DEBUG("InsertGMList(account:{}, player:{}, contact_ip:{}, server_ip:{}, auth:{})",
rAdminInfo.m_szAccount, rAdminInfo.m_szAccount,
rAdminInfo.m_szName, rAdminInfo.m_szName,
rAdminInfo.m_szContactIP, rAdminInfo.m_szContactIP,
@ -35,12 +35,12 @@ void gm_new_insert( const tAdminInfo &rAdminInfo )
if ( strlen( rAdminInfo.m_szContactIP ) == 0 ) if ( strlen( rAdminInfo.m_szContactIP ) == 0 )
{ {
t.pset_Host = &g_set_Host; t.pset_Host = &g_set_Host;
sys_log(0, "GM Use ContactIP" ); SPDLOG_DEBUG("GM Use ContactIP" );
} }
else else
{ {
t.pset_Host = NULL; t.pset_Host = NULL;
sys_log(0, "GM Use Default Host List" ); SPDLOG_DEBUG("GM Use Default Host List" );
} }
memcpy ( &t.Info, &rAdminInfo, sizeof ( rAdminInfo ) ); memcpy ( &t.Info, &rAdminInfo, sizeof ( rAdminInfo ) );
@ -52,7 +52,7 @@ void gm_new_insert( const tAdminInfo &rAdminInfo )
void gm_new_host_inert( const char * host ) void gm_new_host_inert( const char * host )
{ {
g_set_Host.insert( host ); g_set_Host.insert( host );
sys_log( 0, "InsertGMHost(ip:%s)", host ); SPDLOG_DEBUG("InsertGMHost(ip:{})", host );
} }
BYTE gm_new_get_level( const char * name, const char * host, const char* account) BYTE gm_new_get_level( const char * name, const char * host, const char* account)
@ -72,11 +72,11 @@ BYTE gm_new_get_level( const char * name, const char * host, const char* account
{ {
if ( strcmp ( it->second.Info.m_szAccount, account ) != 0 ) if ( strcmp ( it->second.Info.m_szAccount, account ) != 0 )
{ {
sys_log(0, "GM_NEW_GET_LEVEL : BAD ACCOUNT [ACCOUNT:%s/%s", it->second.Info.m_szAccount, account); SPDLOG_DEBUG("GM_NEW_GET_LEVEL : BAD ACCOUNT [ACCOUNT:{}/{}", it->second.Info.m_szAccount, account);
return GM_PLAYER; return GM_PLAYER;
} }
} }
sys_log(0, "GM_NEW_GET_LEVEL : FIND ACCOUNT"); SPDLOG_DEBUG("GM_NEW_GET_LEVEL : FIND ACCOUNT");
return it->second.Info.m_Authority; return it->second.Info.m_Authority;
} }
// END_OF_GERMAN_GM_NOT_CHECK_HOST // END_OF_GERMAN_GM_NOT_CHECK_HOST
@ -89,7 +89,7 @@ BYTE gm_new_get_level( const char * name, const char * host, const char* account
{ {
if ( it->second.pset_Host->end() == it->second.pset_Host->find( host ) ) if ( it->second.pset_Host->end() == it->second.pset_Host->find( host ) )
{ {
sys_log(0, "GM_NEW_GET_LEVEL : BAD HOST IN HOST_LIST"); SPDLOG_DEBUG("GM_NEW_GET_LEVEL : BAD HOST IN HOST_LIST");
return GM_PLAYER; return GM_PLAYER;
} }
} }
@ -97,12 +97,12 @@ BYTE gm_new_get_level( const char * name, const char * host, const char* account
{ {
if ( strcmp ( it->second.Info.m_szContactIP, host ) != 0 ) if ( strcmp ( it->second.Info.m_szContactIP, host ) != 0 )
{ {
sys_log(0, "GM_NEW_GET_LEVEL : BAD HOST IN GMLIST"); SPDLOG_DEBUG("GM_NEW_GET_LEVEL : BAD HOST IN GMLIST");
return GM_PLAYER; return GM_PLAYER;
} }
} }
} }
sys_log(0, "GM_NEW_GET_LEVEL : FIND HOST"); SPDLOG_DEBUG("GM_NEW_GET_LEVEL : FIND HOST");
return it->second.Info.m_Authority; return it->second.Info.m_Authority;
} }

View File

@ -75,10 +75,10 @@ bool CGroupTextParseTreeLoader::LoadGroup(CGroupNode * pGroupNode)
{ {
if (2 != stTokenVector.size()) if (2 != stTokenVector.size())
{ {
sys_err("Invalid group syntax token size: %u != 2 (DO NOT SPACE IN NAME)", stTokenVector.size()); SPDLOG_ERROR("Invalid group syntax token size: {} != 2 (DO NOT SPACE IN NAME)", stTokenVector.size());
for (unsigned int i = 0; i < stTokenVector.size(); ++i) for (unsigned int i = 0; i < stTokenVector.size(); ++i)
sys_err(" %u %s", i, stTokenVector[i].c_str()); SPDLOG_ERROR(" {} {}", i, stTokenVector[i].c_str());
exit(1); exit(EXIT_FAILURE);
continue; continue;
} }
@ -108,7 +108,7 @@ bool CGroupTextParseTreeLoader::LoadGroup(CGroupNode * pGroupNode)
if (1 == stTokenVector.size()) if (1 == stTokenVector.size())
{ {
sys_err("CGroupTextParseTreeLoader::LoadGroup : must have a value (filename: %s line: %d key: %s)", SPDLOG_ERROR("CGroupTextParseTreeLoader::LoadGroup : must have a value (filename: {} line: {} key: {})",
m_strFileName.c_str(), m_strFileName.c_str(),
m_dwcurLineIndex, m_dwcurLineIndex,
key.c_str()); key.c_str());

View File

@ -139,7 +139,7 @@ void CGuild::RequestAddMember(LPCHARACTER ch, int grade)
if (m_member.find(ch->GetPlayerID()) != m_member.end()) if (m_member.find(ch->GetPlayerID()) != m_member.end())
{ {
sys_err("Already a member in guild %s[%d]", ch->GetName(), ch->GetPlayerID()); SPDLOG_ERROR("Already a member in guild {}[{}]", ch->GetName(), ch->GetPlayerID());
return; return;
} }
@ -172,8 +172,8 @@ void CGuild::AddMember(TPacketDGGuildMember * p)
LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(p->dwPID); LPCHARACTER ch = CHARACTER_MANAGER::instance().FindByPID(p->dwPID);
sys_log(0, "GUILD: AddMember PID %u, grade %u, job %u, level %u, offer %u, name %s ptr %p", SPDLOG_DEBUG("GUILD: AddMember PID {}, grade {}, job {}, level {}, offer {}, name {} ptr {}",
p->dwPID, p->bGrade, p->bJob, p->bLevel, p->dwOffer, p->szName, get_pointer(ch)); p->dwPID, p->bGrade, p->bJob, p->bLevel, p->dwOffer, p->szName, (void*) get_pointer(ch));
if (ch) if (ch)
LoginMember(ch); LoginMember(ch);
@ -202,7 +202,7 @@ bool CGuild::RequestRemoveMember(DWORD pid)
bool CGuild::RemoveMember(DWORD pid) bool CGuild::RemoveMember(DWORD pid)
{ {
sys_log(0, "Receive Guild P2P RemoveMember"); SPDLOG_DEBUG("Receive Guild P2P RemoveMember");
TGuildMemberContainer::iterator it; TGuildMemberContainer::iterator it;
if ((it = m_member.find(pid)) == m_member.end()) if ((it = m_member.find(pid)) == m_member.end())
@ -240,7 +240,7 @@ void CGuild::P2PLoginMember(DWORD pid)
{ {
if (m_member.find(pid) == m_member.end()) if (m_member.find(pid) == m_member.end())
{ {
sys_err("GUILD [%d] is not a memeber of guild.", pid); SPDLOG_ERROR("GUILD [{}] is not a memeber of guild.", pid);
return; return;
} }
@ -257,7 +257,7 @@ void CGuild::LoginMember(LPCHARACTER ch)
{ {
if (m_member.find(ch->GetPlayerID()) == m_member.end()) if (m_member.find(ch->GetPlayerID()) == m_member.end())
{ {
sys_err("GUILD %s[%d] is not a memeber of guild.", ch->GetName(), ch->GetPlayerID()); SPDLOG_ERROR("GUILD {}[{}] is not a memeber of guild.", ch->GetName(), ch->GetPlayerID());
return; return;
} }
@ -284,7 +284,7 @@ void CGuild::P2PLogoutMember(DWORD pid)
{ {
if (m_member.find(pid)==m_member.end()) if (m_member.find(pid)==m_member.end())
{ {
sys_err("GUILD [%d] is not a memeber of guild.", pid); SPDLOG_ERROR("GUILD [{}] is not a memeber of guild.", pid);
return; return;
} }
@ -302,7 +302,7 @@ void CGuild::LogoutMember(LPCHARACTER ch)
{ {
if (m_member.find(ch->GetPlayerID())==m_member.end()) if (m_member.find(ch->GetPlayerID())==m_member.end())
{ {
sys_err("GUILD %s[%d] is not a memeber of guild.", ch->GetName(), ch->GetPlayerID()); SPDLOG_ERROR("GUILD {}[{}] is not a memeber of guild.", ch->GetName(), ch->GetPlayerID());
return; return;
} }
@ -450,8 +450,7 @@ void CGuild::SendListPacket(LPCHARACTER ch)
buf.write(c, CHARACTER_NAME_MAX_LEN+1 ); buf.write(c, CHARACTER_NAME_MAX_LEN+1 );
if ( test_server ) SPDLOG_TRACE("name {} job {} ", it->second.name.c_str(), it->second.job );
sys_log(0 ,"name %s job %d ", it->second.name.c_str(), it->second.job );
} }
d->Packet(buf.read_peek(), buf.size()); d->Packet(buf.read_peek(), buf.size());
@ -564,7 +563,7 @@ void CGuild::LoadGuildGradeData(SQLMsg* pmsg)
// 15개 아닐 가능성 존재 // 15개 아닐 가능성 존재
if (pmsg->Get()->iNumRows != 15) if (pmsg->Get()->iNumRows != 15)
{ {
sys_err("Query failed: getting guild grade data. GuildID(%d)", GetID()); SPDLOG_ERROR("Query failed: getting guild grade data. GuildID({})", GetID());
return; return;
} }
*/ */
@ -578,7 +577,6 @@ void CGuild::LoadGuildGradeData(SQLMsg* pmsg)
if (grade >= 1 && grade <= 15) if (grade >= 1 && grade <= 15)
{ {
//sys_log(0, "GuildGradeLoad %s", name);
strlcpy(m_data.grade_array[grade-1].grade_name, name, sizeof(m_data.grade_array[grade-1].grade_name)); strlcpy(m_data.grade_array[grade-1].grade_name, name, sizeof(m_data.grade_array[grade-1].grade_name));
m_data.grade_array[grade-1].auth_flag = auth; m_data.grade_array[grade-1].auth_flag = auth;
} }
@ -588,7 +586,7 @@ void CGuild::LoadGuildData(SQLMsg* pmsg)
{ {
if (pmsg->Get()->uiNumRows == 0) if (pmsg->Get()->uiNumRows == 0)
{ {
sys_err("Query failed: getting guild data %s", pmsg->stQuery.c_str()); SPDLOG_ERROR("Query failed: getting guild data {}", pmsg->stQuery.c_str());
return; return;
} }
@ -628,7 +626,7 @@ void CGuild::Load(DWORD guild_id)
DBManager::instance().FuncQuery(std::bind1st(std::mem_fun(&CGuild::LoadGuildData), this), DBManager::instance().FuncQuery(std::bind1st(std::mem_fun(&CGuild::LoadGuildData), this),
"SELECT master, level, exp, name, skill_point, skill, sp, ladder_point, win, draw, loss, gold FROM guild%s WHERE id = %u", get_table_postfix(), m_data.guild_id); "SELECT master, level, exp, name, skill_point, skill, sp, ladder_point, win, draw, loss, gold FROM guild%s WHERE id = %u", get_table_postfix(), m_data.guild_id);
sys_log(0, "GUILD: loading guild id %12s %u", m_data.name, guild_id); SPDLOG_DEBUG("GUILD: loading guild id {:>12} {}", m_data.name, guild_id);
DBManager::instance().FuncQuery(std::bind1st(std::mem_fun(&CGuild::LoadGuildGradeData), this), DBManager::instance().FuncQuery(std::bind1st(std::mem_fun(&CGuild::LoadGuildGradeData), this),
"SELECT grade, name, auth+0 FROM guild_grade%s WHERE guild_id = %u", get_table_postfix(), m_data.guild_id); "SELECT grade, name, auth+0 FROM guild_grade%s WHERE guild_id = %u", get_table_postfix(), m_data.guild_id);
@ -794,7 +792,7 @@ void CGuild::ChangeGradeName(BYTE grade, const char* grade_name)
if (grade < 1 || grade > 15) if (grade < 1 || grade > 15)
{ {
sys_err("Wrong guild grade value %d", grade); SPDLOG_ERROR("Wrong guild grade value {}", grade);
return; return;
} }
@ -842,7 +840,7 @@ void CGuild::ChangeGradeAuth(BYTE grade, BYTE auth)
if (grade < 1 || grade > 15) if (grade < 1 || grade > 15)
{ {
sys_err("Wrong guild grade value %d", grade); SPDLOG_ERROR("Wrong guild grade value {}", grade);
return; return;
} }
@ -900,8 +898,8 @@ void CGuild::SendGuildInfoPacket(LPCHARACTER ch)
pack_sub.gold = m_data.gold; pack_sub.gold = m_data.gold;
pack_sub.has_land = HasLand(); pack_sub.has_land = HasLand();
sys_log(0, "GMC guild_name %s", m_data.name); SPDLOG_DEBUG("GMC guild_name {}", m_data.name);
sys_log(0, "GMC master %d", m_data.master_pid); SPDLOG_DEBUG("GMC master {}", m_data.master_pid);
d->RawPacket(&pack, sizeof(TPacketGCGuild)); d->RawPacket(&pack, sizeof(TPacketGCGuild));
d->Packet(&pack_sub, sizeof(TPacketGCGuildInfo)); d->Packet(&pack_sub, sizeof(TPacketGCGuildInfo));
@ -928,7 +926,7 @@ bool CGuild::OfferExp(LPCHARACTER ch, int amount)
if (ch->GetExp() - (DWORD) amount > ch->GetExp()) if (ch->GetExp() - (DWORD) amount > ch->GetExp())
{ {
sys_err("Wrong guild offer amount %d by %s[%u]", amount, ch->GetName(), ch->GetPlayerID()); SPDLOG_ERROR("Wrong guild offer amount {} by {}[{}]", amount, ch->GetName(), ch->GetPlayerID());
return false; return false;
} }
@ -974,7 +972,7 @@ bool CGuild::OfferExp(LPCHARACTER ch, int amount)
void CGuild::Disband() void CGuild::Disband()
{ {
sys_log(0, "GUILD: Disband %s:%u", GetName(), GetID()); SPDLOG_DEBUG("GUILD: Disband {}:{}", GetName(), GetID());
//building::CLand* pLand = building::CManager::instance().FindLandByGuild(GetID()); //building::CLand* pLand = building::CManager::instance().FindLandByGuild(GetID());
//if (pLand) //if (pLand)
@ -1193,7 +1191,7 @@ void CGuild::SkillLevelUp(DWORD dwVnum)
if (!pkSk) if (!pkSk)
{ {
sys_err("There is no such guild skill by number %u", dwVnum); SPDLOG_ERROR("There is no such guild skill by number {}", dwVnum);
return; return;
} }
@ -1232,7 +1230,7 @@ void CGuild::SkillLevelUp(DWORD dwVnum)
for_each(m_memberOnline.begin(), m_memberOnline.end(), std::bind1st(std::mem_fun_ref(&CGuild::SendSkillInfoPacket),*this)); for_each(m_memberOnline.begin(), m_memberOnline.end(), std::bind1st(std::mem_fun_ref(&CGuild::SendSkillInfoPacket),*this));
sys_log(0, "Guild SkillUp: %s %d level %d type %u", GetName(), pkSk->dwVnum, m_data.abySkill[dwRealVnum], pkSk->dwType); SPDLOG_DEBUG("Guild SkillUp: {} {} level {} type {}", GetName(), pkSk->dwVnum, m_data.abySkill[dwRealVnum], pkSk->dwType);
} }
void CGuild::UseSkill(DWORD dwVnum, LPCHARACTER ch, DWORD pid) void CGuild::UseSkill(DWORD dwVnum, LPCHARACTER ch, DWORD pid)
@ -1242,7 +1240,7 @@ void CGuild::UseSkill(DWORD dwVnum, LPCHARACTER ch, DWORD pid)
if (!GetMember(ch->GetPlayerID()) || !HasGradeAuth(GetMember(ch->GetPlayerID())->grade, GUILD_AUTH_USE_SKILL)) if (!GetMember(ch->GetPlayerID()) || !HasGradeAuth(GetMember(ch->GetPlayerID())->grade, GUILD_AUTH_USE_SKILL))
return; return;
sys_log(0,"GUILD_USE_SKILL : cname(%s), skill(%d)", ch ? ch->GetName() : "", dwVnum); SPDLOG_DEBUG("GUILD_USE_SKILL : cname({}), skill({})", ch ? ch->GetName() : "", dwVnum);
DWORD dwRealVnum = dwVnum - GUILD_SKILL_START; DWORD dwRealVnum = dwVnum - GUILD_SKILL_START;
@ -1256,7 +1254,7 @@ void CGuild::UseSkill(DWORD dwVnum, LPCHARACTER ch, DWORD pid)
if (!pkSk) if (!pkSk)
{ {
sys_err("There is no such guild skill by number %u", dwVnum); SPDLOG_ERROR("There is no such guild skill by number {}", dwVnum);
return; return;
} }
@ -1748,7 +1746,7 @@ void CGuild::SkillUsableChange(DWORD dwSkillVnum, bool bUsable)
abSkillUsable[dwRealVnum] = bUsable; abSkillUsable[dwRealVnum] = bUsable;
// GUILD_SKILL_COOLTIME_BUG_FIX // GUILD_SKILL_COOLTIME_BUG_FIX
sys_log(0, "CGuild::SkillUsableChange(guild=%s, skill=%d, usable=%d)", GetName(), dwSkillVnum, bUsable); SPDLOG_DEBUG("CGuild::SkillUsableChange(guild={}, skill={}, usable={})", GetName(), dwSkillVnum, bUsable);
// END_OF_GUILD_SKILL_COOLTIME_BUG_FIX // END_OF_GUILD_SKILL_COOLTIME_BUG_FIX
} }
@ -1756,7 +1754,7 @@ void CGuild::SkillUsableChange(DWORD dwSkillVnum, bool bUsable)
void CGuild::SetMemberCountBonus(int iBonus) void CGuild::SetMemberCountBonus(int iBonus)
{ {
m_iMemberCountBonus = iBonus; m_iMemberCountBonus = iBonus;
sys_log(0, "GUILD_IS_FULL_BUG : Bonus set to %d(val:%d)", iBonus, m_iMemberCountBonus); SPDLOG_DEBUG("GUILD_IS_FULL_BUG : Bonus set to {}(val:{})", iBonus, m_iMemberCountBonus);
} }
void CGuild::BroadcastMemberCountBonus() void CGuild::BroadcastMemberCountBonus()
@ -1827,7 +1825,7 @@ void CGuild::RequestDepositMoney(LPCHARACTER ch, int iGold)
LogManager::instance().CharLog(ch, iGold, "GUILD_DEPOSIT", buf); LogManager::instance().CharLog(ch, iGold, "GUILD_DEPOSIT", buf);
ch->UpdateDepositPulse(); ch->UpdateDepositPulse();
sys_log(0, "GUILD: DEPOSIT %s:%u player %s[%u] gold %d", GetName(), GetID(), ch->GetName(), ch->GetPlayerID(), iGold); SPDLOG_DEBUG("GUILD: DEPOSIT {}:{} player {}[{}] gold {}", GetName(), GetID(), ch->GetName(), ch->GetPlayerID(), iGold);
} }
void CGuild::RequestWithdrawMoney(LPCHARACTER ch, int iGold) void CGuild::RequestWithdrawMoney(LPCHARACTER ch, int iGold)
@ -1883,7 +1881,7 @@ void CGuild::RecvWithdrawMoneyGive(int iChangeGold)
if (ch) if (ch)
{ {
ch->PointChange(POINT_GOLD, iChangeGold); ch->PointChange(POINT_GOLD, iChangeGold);
sys_log(0, "GUILD: WITHDRAW %s:%u player %s[%u] gold %d", GetName(), GetID(), ch->GetName(), ch->GetPlayerID(), iChangeGold); SPDLOG_DEBUG("GUILD: WITHDRAW {}:{} player {}[{}] gold {}", GetName(), GetID(), ch->GetName(), ch->GetPlayerID(), iChangeGold);
} }
TPacketGDGuildMoneyWithdrawGiveReply p; TPacketGDGuildMoneyWithdrawGiveReply p;
@ -1922,7 +1920,7 @@ EVENTFUNC( GuildInviteEvent )
if ( pInfo == NULL ) if ( pInfo == NULL )
{ {
sys_err( "GuildInviteEvent> <Factor> Null pointer" ); SPDLOG_ERROR("GuildInviteEvent> <Factor> Null pointer" );
return 0; return 0;
} }
@ -1930,7 +1928,7 @@ EVENTFUNC( GuildInviteEvent )
if ( pGuild ) if ( pGuild )
{ {
sys_log( 0, "GuildInviteEvent %s", pGuild->GetName() ); SPDLOG_DEBUG("GuildInviteEvent {}", pGuild->GetName() );
pGuild->InviteDeny( pInfo->dwInviteePID ); pGuild->InviteDeny( pInfo->dwInviteePID );
} }
@ -1984,7 +1982,7 @@ void CGuild::Invite( LPCHARACTER pchInviter, LPCHARACTER pchInvitee )
case GERR_GUILD_IS_IN_WAR : pchInviter->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 길드가 전쟁 중 입니다.") ); return; case GERR_GUILD_IS_IN_WAR : pchInviter->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 길드가 전쟁 중 입니다.") ); return;
case GERR_INVITE_LIMIT : pchInviter->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 신규 가입 제한 상태 입니다.") ); return; case GERR_INVITE_LIMIT : pchInviter->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 신규 가입 제한 상태 입니다.") ); return;
default: sys_err( "ignore guild join error(%d)", errcode ); return; default: SPDLOG_ERROR("ignore guild join error({})", (int) errcode ); return;
} }
if ( m_GuildInviteEventMap.end() != m_GuildInviteEventMap.find( pchInvitee->GetPlayerID() ) ) if ( m_GuildInviteEventMap.end() != m_GuildInviteEventMap.find( pchInvitee->GetPlayerID() ) )
@ -2023,7 +2021,7 @@ void CGuild::InviteAccept( LPCHARACTER pchInvitee )
EventMap::iterator itFind = m_GuildInviteEventMap.find( pchInvitee->GetPlayerID() ); EventMap::iterator itFind = m_GuildInviteEventMap.find( pchInvitee->GetPlayerID() );
if ( itFind == m_GuildInviteEventMap.end() ) if ( itFind == m_GuildInviteEventMap.end() )
{ {
sys_log( 0, "GuildInviteAccept from not invited character(invite guild: %s, invitee: %s)", GetName(), pchInvitee->GetName() ); SPDLOG_DEBUG("GuildInviteAccept from not invited character(invite guild: {}, invitee: {})", GetName(), pchInvitee->GetName() );
return; return;
} }
@ -2049,7 +2047,7 @@ void CGuild::InviteAccept( LPCHARACTER pchInvitee )
case GERR_GUILD_IS_IN_WAR : pchInvitee->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 길드가 전쟁 중 입니다.") ); return; case GERR_GUILD_IS_IN_WAR : pchInvitee->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 길드가 전쟁 중 입니다.") ); return;
case GERR_INVITE_LIMIT : pchInvitee->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 신규 가입 제한 상태 입니다.") ); return; case GERR_INVITE_LIMIT : pchInvitee->ChatPacket( CHAT_TYPE_INFO, LC_TEXT("<길드> 현재 신규 가입 제한 상태 입니다.") ); return;
default: sys_err( "ignore guild join error(%d)", errcode ); return; default: SPDLOG_ERROR("ignore guild join error({})", (int) errcode); return;
} }
RequestAddMember( pchInvitee, 15 ); RequestAddMember( pchInvitee, 15 );
@ -2060,7 +2058,7 @@ void CGuild::InviteDeny( DWORD dwPID )
EventMap::iterator itFind = m_GuildInviteEventMap.find( dwPID ); EventMap::iterator itFind = m_GuildInviteEventMap.find( dwPID );
if ( itFind == m_GuildInviteEventMap.end() ) if ( itFind == m_GuildInviteEventMap.end() )
{ {
sys_log( 0, "GuildInviteDeny from not invited character(invite guild: %s, invitee PID: %d)", GetName(), dwPID ); SPDLOG_DEBUG("GuildInviteDeny from not invited character(invite guild: {}, invitee PID: {})", GetName(), dwPID );
return; return;
} }
@ -2080,7 +2078,7 @@ CGuild::GuildJoinErrCode CGuild::VerifyGuildJoinableCondition( const LPCHARACTER
return GERR_ALREADYJOIN; return GERR_ALREADYJOIN;
else if ( GetMemberCount() >= GetMaxMemberCount() ) else if ( GetMemberCount() >= GetMaxMemberCount() )
{ {
sys_log(1, "GuildName = %s, GetMemberCount() = %d, GetMaxMemberCount() = %d (32 + MAX(level(%d)-10, 0) * 2 + bonus(%d)", SPDLOG_DEBUG("GuildName = {}, GetMemberCount() = {}, GetMaxMemberCount() = {} (32 + MAX(level({})-10, 0) * 2 + bonus({})",
GetName(), GetMemberCount(), GetMaxMemberCount(), m_data.level, m_iMemberCountBonus); GetName(), GetMemberCount(), GetMaxMemberCount(), m_data.level, m_iMemberCountBonus);
return GERR_GUILDISFULL; return GERR_GUILDISFULL;
} }

View File

@ -197,11 +197,11 @@ CGuild* CGuildManager::FindGuildByName(const std::string guild_name)
void CGuildManager::Initialize() void CGuildManager::Initialize()
{ {
sys_log(0, "Initializing Guild"); SPDLOG_DEBUG("Initializing Guild");
if (g_bAuthServer) if (g_bAuthServer)
{ {
sys_log(0, " No need for auth server"); SPDLOG_DEBUG(" No need for auth server");
return; return;
} }
@ -469,7 +469,7 @@ void CGuildManager::GetAroundRankString(DWORD dwMyGuild, char * buffer, size_t b
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
void CGuildManager::RequestCancelWar(DWORD guild_id1, DWORD guild_id2) void CGuildManager::RequestCancelWar(DWORD guild_id1, DWORD guild_id2)
{ {
sys_log(0, "RequestCancelWar %d %d", guild_id1, guild_id2); SPDLOG_DEBUG("RequestCancelWar {} {}", guild_id1, guild_id2);
TPacketGuildWar p; TPacketGuildWar p;
p.bWar = GUILD_WAR_CANCEL; p.bWar = GUILD_WAR_CANCEL;
@ -480,7 +480,7 @@ void CGuildManager::RequestCancelWar(DWORD guild_id1, DWORD guild_id2)
void CGuildManager::RequestEndWar(DWORD guild_id1, DWORD guild_id2) void CGuildManager::RequestEndWar(DWORD guild_id1, DWORD guild_id2)
{ {
sys_log(0, "RequestEndWar %d %d", guild_id1, guild_id2); SPDLOG_DEBUG("RequestEndWar {} {}", guild_id1, guild_id2);
TPacketGuildWar p; TPacketGuildWar p;
p.bWar = GUILD_WAR_END; p.bWar = GUILD_WAR_END;
@ -496,7 +496,7 @@ void CGuildManager::RequestWarOver(DWORD dwGuild1, DWORD dwGuild2, DWORD dwGuild
if (g1->GetGuildWarState(g2->GetID()) != GUILD_WAR_ON_WAR) if (g1->GetGuildWarState(g2->GetID()) != GUILD_WAR_ON_WAR)
{ {
sys_log(0, "RequestWarOver : both guild was not in war %u %u", dwGuild1, dwGuild2); SPDLOG_DEBUG("RequestWarOver : both guild was not in war {} {}", dwGuild1, dwGuild2);
RequestEndWar(dwGuild1, dwGuild2); RequestEndWar(dwGuild1, dwGuild2);
return; return;
} }
@ -521,7 +521,7 @@ void CGuildManager::RequestWarOver(DWORD dwGuild1, DWORD dwGuild2, DWORD dwGuild
} }
db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p)); db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p));
sys_log(0, "RequestWarOver : winner %u loser %u draw %u betprice %d", p.dwGuildFrom, p.dwGuildTo, p.bType, p.lWarPrice); SPDLOG_DEBUG("RequestWarOver : winner {} loser {} draw {} betprice {}", p.dwGuildFrom, p.dwGuildTo, p.bType, p.lWarPrice);
} }
void CGuildManager::DeclareWar(DWORD guild_id1, DWORD guild_id2, BYTE bType) void CGuildManager::DeclareWar(DWORD guild_id1, DWORD guild_id2, BYTE bType)
@ -572,7 +572,7 @@ void CGuildManager::WaitStartWar(DWORD guild_id1, DWORD guild_id2)
if (!g1 || !g2) if (!g1 || !g2)
{ {
sys_log(0, "GuildWar: CGuildManager::WaitStartWar(%d,%d) - something wrong in arg. there is no guild like that.", guild_id1, guild_id2); SPDLOG_DEBUG("GuildWar: CGuildManager::WaitStartWar({},{}) - something wrong in arg. there is no guild like that.", guild_id1, guild_id2);
return; return;
} }
@ -677,7 +677,7 @@ bool CGuildManager::EndWar(DWORD guild_id1, DWORD guild_id2)
if (m_GuildWar.end() == it) if (m_GuildWar.end() == it)
{ {
sys_log(0, "EndWar(%d,%d) - EndWar request but guild is not in list", guild_id1, guild_id2); SPDLOG_DEBUG("EndWar({},{}) - EndWar request but guild is not in list", guild_id1, guild_id2);
return false; return false;
} }
@ -760,7 +760,7 @@ void CGuildManager::CancelWar(DWORD guild_id1, DWORD guild_id2)
void CGuildManager::ReserveWar(DWORD dwGuild1, DWORD dwGuild2, BYTE bType) // from DB void CGuildManager::ReserveWar(DWORD dwGuild1, DWORD dwGuild2, BYTE bType) // from DB
{ {
sys_log(0, "GuildManager::ReserveWar %u %u", dwGuild1, dwGuild2); SPDLOG_DEBUG("GuildManager::ReserveWar {} {}", dwGuild1, dwGuild2);
CGuild * g1 = FindGuild(dwGuild1); CGuild * g1 = FindGuild(dwGuild1);
CGuild * g2 = FindGuild(dwGuild2); CGuild * g2 = FindGuild(dwGuild2);
@ -822,7 +822,7 @@ void SendGuildWarScore(DWORD dwGuild, DWORD dwGuildOpp, int iDelta, int iBetScor
p.lBetScore = iBetScoreDelta; p.lBetScore = iBetScoreDelta;
db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR_SCORE, 0, &p, sizeof(TPacketGuildWarScore)); db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR_SCORE, 0, &p, sizeof(TPacketGuildWarScore));
sys_log(0, "SendGuildWarScore %u %u %d", dwGuild, dwGuildOpp, iDelta); SPDLOG_DEBUG("SendGuildWarScore {} {} {}", dwGuild, dwGuildOpp, iDelta);
} }
void CGuildManager::Kill(LPCHARACTER killer, LPCHARACTER victim) void CGuildManager::Kill(LPCHARACTER killer, LPCHARACTER victim)
@ -885,7 +885,7 @@ void CGuildManager::ReserveWarAdd(TGuildWarReserve * p)
memcpy(&pkReserve->data, p, sizeof(TGuildWarReserve)); memcpy(&pkReserve->data, p, sizeof(TGuildWarReserve));
sys_log(0, "ReserveWarAdd %u gid1 %u power %d gid2 %u power %d handicap %d", SPDLOG_DEBUG("ReserveWarAdd {} gid1 {} power {} gid2 {} power {} handicap {}",
pkReserve->data.dwID, p->dwGuildFrom, p->lPowerFrom, p->dwGuildTo, p->lPowerTo, p->lHandicap); pkReserve->data.dwID, p->dwGuildFrom, p->lPowerFrom, p->dwGuildTo, p->lPowerTo, p->lHandicap);
} }
@ -911,7 +911,7 @@ bool CGuildManager::IsBet(DWORD dwID, const char * c_pszLogin)
void CGuildManager::ReserveWarDelete(DWORD dwID) void CGuildManager::ReserveWarDelete(DWORD dwID)
{ {
sys_log(0, "ReserveWarDelete %u", dwID); SPDLOG_DEBUG("ReserveWarDelete {}", dwID);
itertype(m_map_kReserveWar) it = m_map_kReserveWar.find(dwID); itertype(m_map_kReserveWar) it = m_map_kReserveWar.find(dwID);
if (it == m_map_kReserveWar.end()) if (it == m_map_kReserveWar.end())

View File

@ -180,7 +180,7 @@ void CGuild::SetWarScoreAgainstTo(DWORD dwOppGID, int iScore)
{ {
DWORD dwSelfGID = GetID(); DWORD dwSelfGID = GetID();
sys_log(0, "GuildWarScore Set %u from %u %d", dwSelfGID, dwOppGID, iScore); SPDLOG_DEBUG("GuildWarScore Set {} from {} {}", dwSelfGID, dwOppGID, iScore);
itertype(m_EnemyGuild) it = m_EnemyGuild.find(dwOppGID); itertype(m_EnemyGuild) it = m_EnemyGuild.find(dwOppGID);
if (it != m_EnemyGuild.end()) if (it != m_EnemyGuild.end())
@ -226,11 +226,11 @@ int CGuild::GetWarScoreAgainstTo(DWORD dwOppGID)
if (it != m_EnemyGuild.end()) if (it != m_EnemyGuild.end())
{ {
sys_log(0, "GuildWarScore Get %u from %u %d", GetID(), dwOppGID, it->second.score); SPDLOG_DEBUG("GuildWarScore Get {} from {} {}", GetID(), dwOppGID, it->second.score);
return it->second.score; return it->second.score;
} }
sys_log(0, "GuildWarScore Get %u from %u No data", GetID(), dwOppGID); SPDLOG_DEBUG("GuildWarScore Get {} from {} No data", GetID(), dwOppGID);
return 0; return 0;
} }
@ -294,13 +294,13 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
{ {
if (dwOppGID == GetID()) if (dwOppGID == GetID())
{ {
sys_log(0, "GuildWar.DeclareWar.DECLARE_WAR_SELF id(%d -> %d), type(%d)", GetID(), dwOppGID, type); SPDLOG_ERROR("GuildWar.DeclareWar.DECLARE_WAR_SELF id({} -> {}), type({})", GetID(), dwOppGID, type);
return; return;
} }
if (type >= GUILD_WAR_TYPE_MAX_NUM) if (type >= GUILD_WAR_TYPE_MAX_NUM)
{ {
sys_log(0, "GuildWar.DeclareWar.UNKNOWN_WAR_TYPE id(%d -> %d), type(%d)", GetID(), dwOppGID, type); SPDLOG_ERROR("GuildWar.DeclareWar.UNKNOWN_WAR_TYPE id({} -> {}), type({})", GetID(), dwOppGID, type);
return; return;
} }
@ -309,7 +309,7 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
{ {
if (!GuildWar_IsWarMap(type)) if (!GuildWar_IsWarMap(type))
{ {
sys_err("GuildWar.DeclareWar.NOT_EXIST_MAP id(%d -> %d), type(%d), map(%d)", SPDLOG_ERROR("GuildWar.DeclareWar.NOT_EXIST_MAP id({} -> {}), type({}), map({})",
GetID(), dwOppGID, type, GuildWar_GetTypeMapIndex(type)); GetID(), dwOppGID, type, GuildWar_GetTypeMapIndex(type));
map_allow_log(); map_allow_log();
@ -324,7 +324,7 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
p.dwGuildFrom = GetID(); p.dwGuildFrom = GetID();
p.dwGuildTo = dwOppGID; p.dwGuildTo = dwOppGID;
db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p)); db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p));
sys_log(0, "GuildWar.DeclareWar id(%d -> %d), type(%d)", GetID(), dwOppGID, type); SPDLOG_DEBUG("GuildWar.DeclareWar id({} -> {}), type({})", GetID(), dwOppGID, type);
return; return;
} }
@ -343,13 +343,13 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
p.dwGuildFrom = GetID(); p.dwGuildFrom = GetID();
p.dwGuildTo = dwOppGID; p.dwGuildTo = dwOppGID;
db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p)); db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p));
sys_log(0, "GuildWar.AcceptWar id(%d -> %d), type(%d)", GetID(), dwOppGID, saved_type); SPDLOG_DEBUG("GuildWar.AcceptWar id({} -> {}), type({})", GetID(), dwOppGID, saved_type);
return; return;
} }
if (!GuildWar_IsWarMap(saved_type)) if (!GuildWar_IsWarMap(saved_type))
{ {
sys_err("GuildWar.AcceptWar.NOT_EXIST_MAP id(%d -> %d), type(%d), map(%d)", SPDLOG_ERROR("GuildWar.AcceptWar.NOT_EXIST_MAP id({} -> {}), type({}), map({})",
GetID(), dwOppGID, type, GuildWar_GetTypeMapIndex(type)); GetID(), dwOppGID, type, GuildWar_GetTypeMapIndex(type));
map_allow_log(); map_allow_log();
@ -372,7 +372,7 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p)); db_clientdesc->DBPacket(HEADER_GD_GUILD_WAR, 0, &p, sizeof(p));
sys_log(0, "GuildWar.WaitStartSendToDB id(%d vs %d), type(%d), bet(%d), map_index(%d)", SPDLOG_DEBUG("GuildWar.WaitStartSendToDB id({} vs {}), type({}), bet({}), map_index({})",
GetID(), dwOppGID, saved_type, guildWarInfo.iWarPrice, guildWarInfo.lMapIndex); GetID(), dwOppGID, saved_type, guildWarInfo.iWarPrice, guildWarInfo.lMapIndex);
} }
@ -383,7 +383,7 @@ void CGuild::RequestDeclareWar(DWORD dwOppGID, BYTE type)
} }
break; break;
default: default:
sys_err("GuildWar.DeclareWar.UNKNOWN_STATE[%d]: id(%d vs %d), type(%d), guild(%s:%u)", SPDLOG_ERROR("GuildWar.DeclareWar.UNKNOWN_STATE[{}]: id({} vs {}), type({}), guild({}:{})",
it->second.state, GetID(), dwOppGID, type, GetName(), GetID()); it->second.state, GetID(), dwOppGID, type, GetName(), GetID());
break; break;
} }
@ -444,7 +444,7 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
//자기자신이면 //자기자신이면
if (dwOppGID == GetID()) if (dwOppGID == GetID())
{ {
sys_log(0 ,"GuildWar.WaitStartWar.DECLARE_WAR_SELF id(%u -> %u)", GetID(), dwOppGID); SPDLOG_ERROR("GuildWar.WaitStartWar.DECLARE_WAR_SELF id({} -> {})", GetID(), dwOppGID);
return false; return false;
} }
@ -452,7 +452,7 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
itertype(m_EnemyGuild) it = m_EnemyGuild.find(dwOppGID); itertype(m_EnemyGuild) it = m_EnemyGuild.find(dwOppGID);
if (it == m_EnemyGuild.end()) if (it == m_EnemyGuild.end())
{ {
sys_log(0 ,"GuildWar.WaitStartWar.UNKNOWN_ENEMY id(%u -> %u)", GetID(), dwOppGID); SPDLOG_ERROR("GuildWar.WaitStartWar.UNKNOWN_ENEMY id({} -> {})", GetID(), dwOppGID);
return false; return false;
} }
@ -461,7 +461,7 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
if (gw.state == GUILD_WAR_WAIT_START) if (gw.state == GUILD_WAR_WAIT_START)
{ {
sys_log(0 ,"GuildWar.WaitStartWar.UNKNOWN_STATE id(%u -> %u), state(%d)", GetID(), dwOppGID, gw.state); SPDLOG_ERROR("GuildWar.WaitStartWar.UNKNOWN_STATE id({} -> {}), state({})", GetID(), dwOppGID, gw.state);
return false; return false;
} }
@ -472,7 +472,7 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
CGuild* g = CGuildManager::instance().FindGuild(dwOppGID); CGuild* g = CGuildManager::instance().FindGuild(dwOppGID);
if (!g) if (!g)
{ {
sys_log(0 ,"GuildWar.WaitStartWar.NOT_EXIST_GUILD id(%u -> %u)", GetID(), dwOppGID); SPDLOG_ERROR("GuildWar.WaitStartWar.NOT_EXIST_GUILD id({} -> {})", GetID(), dwOppGID);
return false; return false;
} }
@ -484,17 +484,17 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
// 필드형이면 맵생성 안함 // 필드형이면 맵생성 안함
if (gw.type == GUILD_WAR_TYPE_FIELD) if (gw.type == GUILD_WAR_TYPE_FIELD)
{ {
sys_log(0 ,"GuildWar.WaitStartWar.FIELD_TYPE id(%u -> %u)", GetID(), dwOppGID); SPDLOG_DEBUG("GuildWar.WaitStartWar.FIELD_TYPE id({} -> {})", GetID(), dwOppGID);
return true; return true;
} }
// 전쟁 서버 인지 확인 // 전쟁 서버 인지 확인
sys_log(0 ,"GuildWar.WaitStartWar.CheckWarServer id(%u -> %u), type(%d), map(%d)", SPDLOG_DEBUG("GuildWar.WaitStartWar.CheckWarServer id({} -> {}), type({}), map({})",
GetID(), dwOppGID, gw.type, rkGuildWarInfo.lMapIndex); GetID(), dwOppGID, gw.type, rkGuildWarInfo.lMapIndex);
if (!map_allow_find(rkGuildWarInfo.lMapIndex)) if (!map_allow_find(rkGuildWarInfo.lMapIndex))
{ {
sys_log(0 ,"GuildWar.WaitStartWar.SKIP_WAR_MAP id(%u -> %u)", GetID(), dwOppGID); SPDLOG_DEBUG("GuildWar.WaitStartWar.SKIP_WAR_MAP id({} -> {})", GetID(), dwOppGID);
return true; return true;
} }
@ -509,12 +509,12 @@ bool CGuild::WaitStartWar(DWORD dwOppGID)
DWORD lMapIndex = CWarMapManager::instance().CreateWarMap(rkGuildWarInfo, id1, id2); DWORD lMapIndex = CWarMapManager::instance().CreateWarMap(rkGuildWarInfo, id1, id2);
if (!lMapIndex) if (!lMapIndex)
{ {
sys_err("GuildWar.WaitStartWar.CREATE_WARMAP_ERROR id(%u vs %u), type(%u), map(%d)", id1, id2, gw.type, rkGuildWarInfo.lMapIndex); SPDLOG_ERROR("GuildWar.WaitStartWar.CREATE_WARMAP_ERROR id({} vs {}), type({}), map({})", id1, id2, gw.type, rkGuildWarInfo.lMapIndex);
CGuildManager::instance().RequestEndWar(GetID(), dwOppGID); CGuildManager::instance().RequestEndWar(GetID(), dwOppGID);
return false; return false;
} }
sys_log(0, "GuildWar.WaitStartWar.CreateMap id(%u vs %u), type(%u), map(%d) -> map_inst(%u)", id1, id2, gw.type, rkGuildWarInfo.lMapIndex, lMapIndex); SPDLOG_DEBUG("GuildWar.WaitStartWar.CreateMap id({} vs {}), type({}), map({}) -> map_inst({})", id1, id2, gw.type, rkGuildWarInfo.lMapIndex, lMapIndex);
//길드전 정보에 맵인덱스를 세팅 //길드전 정보에 맵인덱스를 세팅
gw.map_index = lMapIndex; gw.map_index = lMapIndex;
@ -588,7 +588,7 @@ void CGuild::ReserveWar(DWORD dwOppGID, BYTE type)
else else
it->second.state = GUILD_WAR_RESERVE; it->second.state = GUILD_WAR_RESERVE;
sys_log(0, "Guild::ReserveWar %u", dwOppGID); SPDLOG_DEBUG("Guild::ReserveWar {}", dwOppGID);
} }
void CGuild::EndWar(DWORD dwOppGID) void CGuild::EndWar(DWORD dwOppGID)
@ -634,7 +634,7 @@ void CGuild::SetGuildWarMapIndex(DWORD dwOppGID, int lMapIndex)
return; return;
it->second.map_index = lMapIndex; it->second.map_index = lMapIndex;
sys_log(0, "GuildWar.SetGuildWarMapIndex id(%d -> %d), map(%d)", GetID(), dwOppGID, lMapIndex); SPDLOG_DEBUG("GuildWar.SetGuildWarMapIndex id({} -> {}), map({})", GetID(), dwOppGID, lMapIndex);
} }
void CGuild::GuildWarEntryAccept(DWORD dwOppGID, LPCHARACTER ch) void CGuild::GuildWarEntryAccept(DWORD dwOppGID, LPCHARACTER ch)
@ -675,27 +675,27 @@ void CGuild::GuildWarEntryAsk(DWORD dwOppGID)
itertype(m_EnemyGuild) git = m_EnemyGuild.find(dwOppGID); itertype(m_EnemyGuild) git = m_EnemyGuild.find(dwOppGID);
if (git == m_EnemyGuild.end()) if (git == m_EnemyGuild.end())
{ {
sys_err("GuildWar.GuildWarEntryAsk.UNKNOWN_ENEMY(%d)", dwOppGID); SPDLOG_ERROR("GuildWar.GuildWarEntryAsk.UNKNOWN_ENEMY({})", dwOppGID);
return; return;
} }
TGuildWar & gw(git->second); TGuildWar & gw(git->second);
sys_log(0, "GuildWar.GuildWarEntryAsk id(%d vs %d), map(%d)", GetID(), dwOppGID, gw.map_index); SPDLOG_DEBUG("GuildWar.GuildWarEntryAsk id({} vs {}), map({})", GetID(), dwOppGID, gw.map_index);
if (!gw.map_index) if (!gw.map_index)
{ {
sys_err("GuildWar.GuildWarEntryAsk.NOT_EXIST_MAP id(%d vs %d)", GetID(), dwOppGID); SPDLOG_ERROR("GuildWar.GuildWarEntryAsk.NOT_EXIST_MAP id({} vs {})", GetID(), dwOppGID);
return; return;
} }
PIXEL_POSITION pos; PIXEL_POSITION pos;
if (!CWarMapManager::instance().GetStartPosition(gw.map_index, GetID() < dwOppGID ? 0 : 1, pos)) if (!CWarMapManager::instance().GetStartPosition(gw.map_index, GetID() < dwOppGID ? 0 : 1, pos))
{ {
sys_err("GuildWar.GuildWarEntryAsk.START_POSITION_ERROR id(%d vs %d), pos(%d, %d)", GetID(), dwOppGID, pos.x, pos.y); SPDLOG_ERROR("GuildWar.GuildWarEntryAsk.START_POSITION_ERROR id({} vs {}), pos({}, {})", GetID(), dwOppGID, pos.x, pos.y);
return; return;
} }
sys_log(0, "GuildWar.GuildWarEntryAsk.OnlineMemberCount(%d)", m_memberOnline.size()); SPDLOG_DEBUG("GuildWar.GuildWarEntryAsk.OnlineMemberCount({})", m_memberOnline.size());
itertype(m_memberOnline) it = m_memberOnline.begin(); itertype(m_memberOnline) it = m_memberOnline.begin();
@ -707,12 +707,12 @@ void CGuild::GuildWarEntryAsk(DWORD dwOppGID)
unsigned int questIndex=CQuestManager::instance().GetQuestIndexByName("guild_war_join"); unsigned int questIndex=CQuestManager::instance().GetQuestIndexByName("guild_war_join");
if (questIndex) if (questIndex)
{ {
sys_log(0, "GuildWar.GuildWarEntryAsk.SendLetterToMember pid(%d), qid(%d)", ch->GetPlayerID(), questIndex); SPDLOG_DEBUG("GuildWar.GuildWarEntryAsk.SendLetterToMember pid({}), qid({})", ch->GetPlayerID(), questIndex);
CQuestManager::instance().Letter(ch->GetPlayerID(), questIndex, 0); CQuestManager::instance().Letter(ch->GetPlayerID(), questIndex, 0);
} }
else else
{ {
sys_err("GuildWar.GuildWarEntryAsk.SendLetterToMember.QUEST_ERROR pid(%d), quest_name('guild_war_join.quest')", SPDLOG_ERROR("GuildWar.GuildWarEntryAsk.SendLetterToMember.QUEST_ERROR pid({}), quest_name('guild_war_join.quest')",
ch->GetPlayerID(), questIndex); ch->GetPlayerID(), questIndex);
break; break;
} }

View File

@ -223,7 +223,7 @@ EVENTFUNC(horse_stamina_consume_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "horse_stamina_consume_event> <Factor> Null pointer" ); SPDLOG_ERROR("horse_stamina_consume_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -247,7 +247,7 @@ EVENTFUNC(horse_stamina_consume_event)
} }
hr->CheckHorseHealthDropTime(); hr->CheckHorseHealthDropTime();
sys_log(0, "HORSE STAMINA - %p", get_pointer(event)); SPDLOG_DEBUG("HORSE STAMINA - {}", (void*) get_pointer(event));
return delta; return delta;
} }
@ -257,7 +257,7 @@ EVENTFUNC(horse_stamina_regen_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "horse_stamina_regen_event> <Factor> Null pointer" ); SPDLOG_ERROR("horse_stamina_regen_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -278,7 +278,7 @@ EVENTFUNC(horse_stamina_regen_event)
} }
hr->CheckHorseHealthDropTime(); hr->CheckHorseHealthDropTime();
sys_log(0, "HORSE STAMINA + %p", get_pointer(event)); SPDLOG_DEBUG("HORSE STAMINA + {}", (void*) get_pointer(event));
return delta; return delta;
@ -292,7 +292,7 @@ void CHorseRider::StartStaminaConsumeEvent()
if (GetHorseHealth() <= 0) if (GetHorseHealth() <= 0)
return; return;
sys_log(0,"HORSE STAMINA REGEN EVENT CANCEL %p", get_pointer(m_eventStaminaRegen)); SPDLOG_DEBUG("HORSE STAMINA REGEN EVENT CANCEL {}", (void*) get_pointer(m_eventStaminaRegen));
event_cancel(&m_eventStaminaRegen); event_cancel(&m_eventStaminaRegen);
if (m_eventStaminaConsume) if (m_eventStaminaConsume)
@ -302,7 +302,7 @@ void CHorseRider::StartStaminaConsumeEvent()
info->hr = this; info->hr = this;
m_eventStaminaConsume = event_create(horse_stamina_consume_event, info, PASSES_PER_SEC(HORSE_STAMINA_CONSUME_INTERVAL)); m_eventStaminaConsume = event_create(horse_stamina_consume_event, info, PASSES_PER_SEC(HORSE_STAMINA_CONSUME_INTERVAL));
sys_log(0,"HORSE STAMINA CONSUME EVENT CREATE %p", get_pointer(m_eventStaminaConsume)); SPDLOG_DEBUG("HORSE STAMINA CONSUME EVENT CREATE {}", (void*) get_pointer(m_eventStaminaConsume));
} }
void CHorseRider::StartStaminaRegenEvent() void CHorseRider::StartStaminaRegenEvent()
@ -313,7 +313,7 @@ void CHorseRider::StartStaminaRegenEvent()
if (GetHorseHealth() <= 0) if (GetHorseHealth() <= 0)
return; return;
sys_log(0,"HORSE STAMINA CONSUME EVENT CANCEL %p", get_pointer(m_eventStaminaConsume)); SPDLOG_DEBUG("HORSE STAMINA CONSUME EVENT CANCEL {}", (void*) get_pointer(m_eventStaminaConsume));
event_cancel(&m_eventStaminaConsume); event_cancel(&m_eventStaminaConsume);
if (m_eventStaminaRegen) if (m_eventStaminaRegen)
@ -323,7 +323,7 @@ void CHorseRider::StartStaminaRegenEvent()
info->hr = this; info->hr = this;
m_eventStaminaRegen = event_create(horse_stamina_regen_event, info, PASSES_PER_SEC(HORSE_STAMINA_REGEN_INTERVAL)); m_eventStaminaRegen = event_create(horse_stamina_regen_event, info, PASSES_PER_SEC(HORSE_STAMINA_REGEN_INTERVAL));
sys_log(0,"HORSE STAMINA REGEN EVENT CREATE %p", get_pointer(m_eventStaminaRegen)); SPDLOG_DEBUG("HORSE STAMINA REGEN EVENT CREATE {}", (void*) get_pointer(m_eventStaminaRegen));
} }
// Health // Health
@ -358,7 +358,7 @@ void CHorseRider::UpdateHorseHealth(int iHealth, bool bSend)
void CHorseRider::HorseDie() void CHorseRider::HorseDie()
{ {
sys_log(0, "HORSE DIE %p %p", get_pointer(m_eventStaminaRegen), get_pointer(m_eventStaminaConsume)); SPDLOG_DEBUG("HORSE DIE {} {}", (void*) get_pointer(m_eventStaminaRegen), (void*) get_pointer(m_eventStaminaConsume));
UpdateHorseStamina(-m_Horse.sStamina); UpdateHorseStamina(-m_Horse.sStamina);
event_cancel(&m_eventStaminaRegen); event_cancel(&m_eventStaminaRegen);
event_cancel(&m_eventStaminaConsume); event_cancel(&m_eventStaminaConsume);

View File

@ -32,11 +32,11 @@ void CHorseNameManager::UpdateHorseName(DWORD dwPlayerID, const char* szHorseNam
{ {
if ( szHorseName == NULL ) if ( szHorseName == NULL )
{ {
sys_err("HORSE_NAME: NULL NAME (%u)", dwPlayerID); SPDLOG_ERROR("HORSE_NAME: NULL NAME ({})", dwPlayerID);
szHorseName = ""; szHorseName = "";
} }
sys_log(0, "HORSENAME: update %u %s", dwPlayerID, szHorseName); SPDLOG_DEBUG("HORSENAME: update {} {}", dwPlayerID, szHorseName);
m_mapHorseNames[dwPlayerID] = szHorseName; m_mapHorseNames[dwPlayerID] = szHorseName;

View File

@ -16,7 +16,6 @@
#include "TrafficProfiler.h" #include "TrafficProfiler.h"
#include "priv_manager.h" #include "priv_manager.h"
#include "castle.h" #include "castle.h"
#include "dev_log.h"
extern time_t get_global_time(); extern time_t get_global_time();
@ -64,7 +63,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
if (!m_pPacketInfo) if (!m_pPacketInfo)
{ {
sys_err("No packet info has been binded to"); SPDLOG_ERROR("No packet info has been binded to");
return true; return true;
} }
@ -77,7 +76,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
iPacketLen = 1; iPacketLen = 1;
else if (!m_pPacketInfo->Get(bHeader, &iPacketLen, &c_pszName)) else if (!m_pPacketInfo->Get(bHeader, &iPacketLen, &c_pszName))
{ {
sys_err("UNKNOWN HEADER: %d, LAST HEADER: %d(%d), REMAIN BYTES: %d", SPDLOG_ERROR("UNKNOWN HEADER: {}, LAST HEADER: {}({}), REMAIN BYTES: {}",
bHeader, bLastHeader, iLastPacketLen, m_iBufferLeft); bHeader, bLastHeader, iLastPacketLen, m_iBufferLeft);
//printdata((BYTE *) c_pvOrig, m_iBufferLeft); //printdata((BYTE *) c_pvOrig, m_iBufferLeft);
lpDesc->SetPhase(PHASE_CLOSE); lpDesc->SetPhase(PHASE_CLOSE);
@ -89,9 +88,6 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
if (bHeader) if (bHeader)
{ {
if (test_server && bHeader != HEADER_CG_MOVE)
sys_log(0, "Packet Analyze [Header %d][bufferLeft %d] ", bHeader, m_iBufferLeft);
m_pPacketInfo->Start(); m_pPacketInfo->Start();
int iExtraPacketSize = Analyze(lpDesc, bHeader, c_pData); int iExtraPacketSize = Analyze(lpDesc, bHeader, c_pData);
@ -100,7 +96,6 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
return true; return true;
iPacketLen += iExtraPacketSize; iPacketLen += iExtraPacketSize;
lpDesc->Log("%s %d", c_pszName, iPacketLen);
m_pPacketInfo->End(); m_pPacketInfo->End();
} }
@ -110,7 +105,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
// END_OF_TRAFFIC_PROFILER // END_OF_TRAFFIC_PROFILER
if (bHeader == HEADER_CG_PONG) if (bHeader == HEADER_CG_PONG)
sys_log(0, "PONG! %u %u", m_pPacketInfo->IsSequence(bHeader), *(BYTE *) (c_pData + iPacketLen - sizeof(BYTE))); SPDLOG_TRACE("PONG! {} {}", m_pPacketInfo->IsSequence(bHeader), *(BYTE *) (c_pData + iPacketLen - sizeof(BYTE)));
if (m_pPacketInfo->IsSequence(bHeader)) if (m_pPacketInfo->IsSequence(bHeader))
{ {
@ -119,7 +114,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
if (bSeq != bSeqReceived) if (bSeq != bSeqReceived)
{ {
sys_err("SEQUENCE %x mismatch 0x%x != 0x%x header %u", get_pointer(lpDesc), bSeq, bSeqReceived, bHeader); SPDLOG_ERROR("SEQUENCE {} mismatch {:#x} != {:#x} header {}", (void*) get_pointer(lpDesc), bSeq, bSeqReceived, bHeader);
LPCHARACTER ch = lpDesc->GetCharacter(); LPCHARACTER ch = lpDesc->GetCharacter();
@ -144,7 +139,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
} }
snprintf(buf + offset, sizeof(buf) - offset, "\t[%03d : 0x%x]\n", bHeader, bSeq); snprintf(buf + offset, sizeof(buf) - offset, "\t[%03d : 0x%x]\n", bHeader, bSeq);
sys_err("%s", buf); SPDLOG_ERROR("{}", buf);
lpDesc->SetPhase(PHASE_CLOSE); lpDesc->SetPhase(PHASE_CLOSE);
return true; return true;
@ -153,7 +148,7 @@ bool CInputProcessor::Process(LPDESC lpDesc, const void * c_pvOrig, int iBytes,
{ {
lpDesc->push_seq(bHeader, bSeq); lpDesc->push_seq(bHeader, bSeq);
lpDesc->SetNextSequence(); lpDesc->SetNextSequence();
sys_err("SEQUENCE %x match %u next %u header %u", lpDesc, bSeq, lpDesc->GetSequence(), bHeader); SPDLOG_TRACE("SEQUENCE {} match {} next {} header {}", (void*) lpDesc, bSeq, lpDesc->GetSequence(), bHeader);
} }
} }
@ -182,7 +177,7 @@ void CInputProcessor::Handshake(LPDESC d, const char * c_pData)
if (d->GetHandshake() != p->dwHandshake) if (d->GetHandshake() != p->dwHandshake)
{ {
sys_err("Invalid Handshake"); SPDLOG_ERROR("Invalid Handshake");
d->SetPhase(PHASE_CLOSE); d->SetPhase(PHASE_CLOSE);
} }
else else
@ -208,7 +203,7 @@ void CInputProcessor::Version(LPCHARACTER ch, const char* c_pData)
return; return;
TPacketCGClientVersion * p = (TPacketCGClientVersion *) c_pData; TPacketCGClientVersion * p = (TPacketCGClientVersion *) c_pData;
sys_log(0, "VERSION: %s %s %s", ch->GetName(), p->timestamp, p->filename); SPDLOG_DEBUG("VERSION: {} {} {}", ch->GetName(), p->timestamp, p->filename);
ch->GetDesc()->SetClientVersion(p->timestamp); ch->GetDesc()->SetClientVersion(p->timestamp);
} }
@ -272,7 +267,7 @@ int CInputHandshake::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
std::string stBuf; std::string stBuf;
stBuf.assign(c_pData, 0, c_pSep - c_pData); stBuf.assign(c_pData, 0, c_pSep - c_pData);
sys_log(0, "SOCKET_CMD: FROM(%s) CMD(%s)", d->GetHostName(), stBuf.c_str()); SPDLOG_DEBUG("SOCKET_CMD: FROM({}) CMD({})", d->GetHostName(), stBuf.c_str());
if (!stBuf.compare("IS_SERVER_UP")) if (!stBuf.compare("IS_SERVER_UP"))
{ {
@ -366,7 +361,6 @@ int CInputHandshake::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
TPacketDeleteAwardID p; TPacketDeleteAwardID p;
p.dwID = (DWORD)(atoi(msg.c_str())); p.dwID = (DWORD)(atoi(msg.c_str()));
snprintf(szTmp,sizeof(szTmp),"Sent to DB cache to delete ItemAward, id: %d",p.dwID); snprintf(szTmp,sizeof(szTmp),"Sent to DB cache to delete ItemAward, id: %d",p.dwID);
//sys_log(0,"%d",p.dwID);
// strlcpy(p.login, msg.c_str(), sizeof(p.login)); // strlcpy(p.login, msg.c_str(), sizeof(p.login));
db_clientdesc->DBPacket(HEADER_GD_DELETE_AWARDID, 0, &p, sizeof(p)); db_clientdesc->DBPacket(HEADER_GD_DELETE_AWARDID, 0, &p, sizeof(p));
stResult += szTmp; stResult += szTmp;
@ -390,20 +384,20 @@ int CInputHandshake::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
TPacketGGShutdown p; TPacketGGShutdown p;
p.bHeader = HEADER_GG_SHUTDOWN; p.bHeader = HEADER_GG_SHUTDOWN;
P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShutdown)); P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGShutdown));
sys_err("Accept shutdown command from %s.", d->GetHostName()); SPDLOG_ERROR("Accept shutdown command from {}.", d->GetHostName());
Shutdown(10); Shutdown(10);
} }
else if (!stBuf.compare("SHUTDOWN_ONLY")) else if (!stBuf.compare("SHUTDOWN_ONLY"))
{ {
LogManager::instance().CharLog(0, 0, 0, 2, "SHUTDOWN", "", d->GetHostName()); LogManager::instance().CharLog(0, 0, 0, 2, "SHUTDOWN", "", d->GetHostName());
sys_err("Accept shutdown only command from %s.", d->GetHostName()); SPDLOG_ERROR("Accept shutdown only command from {}.", d->GetHostName());
Shutdown(10); Shutdown(10);
} }
else if (!stBuf.compare(0, 3, "DC ")) else if (!stBuf.compare(0, 3, "DC "))
{ {
std::string msg = stBuf.substr(3, LOGIN_MAX_LEN); std::string msg = stBuf.substr(3, LOGIN_MAX_LEN);
dev_log(LOG_DEB0, "DC : '%s'", msg.c_str()); SPDLOG_TRACE("DC : '{}'", msg.c_str());
TPacketGGDisconnect pgg; TPacketGGDisconnect pgg;
@ -471,7 +465,7 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
case 'a': case 'a':
db_clientdesc->DBPacket(HEADER_GD_RELOAD_ADMIN, 0, NULL, 0); db_clientdesc->DBPacket(HEADER_GD_RELOAD_ADMIN, 0, NULL, 0);
sys_log(0, "Reloading admin infomation."); SPDLOG_INFO("Reloading admin infomation.");
break; break;
} }
} }
@ -485,7 +479,7 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
if (!is.fail()) if (!is.fail())
{ {
sys_log(0, "EXTERNAL EVENT FLAG name %s value %d", strFlagName.c_str(), lValue); SPDLOG_DEBUG("EXTERNAL EVENT FLAG name {} value {}", strFlagName.c_str(), lValue);
quest::CQuestManager::instance().RequestSetEventFlag(strFlagName, lValue); quest::CQuestManager::instance().RequestSetEventFlag(strFlagName, lValue);
stResult = "EVENT FLAG CHANGE "; stResult = "EVENT FLAG CHANGE ";
stResult += strFlagName; stResult += strFlagName;
@ -505,7 +499,7 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
if (!is.fail()) if (!is.fail())
{ {
sys_log(0, "EXTERNAL BLOCK_CHAT name %s duration %d", strCharName.c_str(), lDuration); SPDLOG_DEBUG("EXTERNAL BLOCK_CHAT name {} duration {}", strCharName.c_str(), lDuration);
do_block_chat(NULL, const_cast<char*>(stBuf.c_str() + 11), 0, 0); do_block_chat(NULL, const_cast<char*>(stBuf.c_str() + 11), 0, 0);
@ -543,7 +537,7 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
// 시간 단위로 변경 // 시간 단위로 변경
duration = duration * (60 * 60); duration = duration * (60 * 60);
sys_log(0, "_give_empire_privileage(empire=%d, type=%d, value=%d, duration=%d) by web", SPDLOG_DEBUG("_give_empire_privileage(empire={}, type={}, value={}, duration={}) by web",
empire, type, value, duration); empire, type, value, duration);
CPrivManager::instance().RequestGiveEmpirePriv(empire, type, value, duration); CPrivManager::instance().RequestGiveEmpirePriv(empire, type, value, duration);
} }
@ -559,14 +553,14 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
is >> dummy_string >> cmd >> login_string; is >> dummy_string >> cmd >> login_string;
sys_log(0, "block_exception %s:%d", login_string.c_str(), cmd); SPDLOG_DEBUG("block_exception {}:{}", login_string.c_str(), cmd);
DBManager::instance().RequestBlockException(login_string.c_str(), cmd); DBManager::instance().RequestBlockException(login_string.c_str(), cmd);
stResult = "BLOCK_EXCEPTION_YES"; stResult = "BLOCK_EXCEPTION_YES";
} }
} }
} }
sys_log(1, "TEXT %s RESULT %s", stBuf.c_str(), stResult.c_str()); SPDLOG_DEBUG("TEXT {} RESULT {}", stBuf.c_str(), stResult.c_str());
stResult += "\n"; stResult += "\n";
d->Packet(stResult.c_str(), stResult.length()); d->Packet(stResult.c_str(), stResult.length());
return (c_pSep - c_pData) + 1; return (c_pSep - c_pData) + 1;
@ -576,13 +570,13 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
if (!guild_mark_server) if (!guild_mark_server)
{ {
// 끊어버려! - 마크 서버가 아닌데 마크를 요청하려고? // 끊어버려! - 마크 서버가 아닌데 마크를 요청하려고?
sys_err("Guild Mark login requested but i'm not a mark server!"); SPDLOG_ERROR("Guild Mark login requested but i'm not a mark server!");
d->SetPhase(PHASE_CLOSE); d->SetPhase(PHASE_CLOSE);
return 0; return 0;
} }
// 무조건 인증 --; // 무조건 인증 --;
sys_log(0, "MARK_SERVER: Login"); SPDLOG_DEBUG("MARK_SERVER: Login");
d->SetPhase(PHASE_LOGIN); d->SetPhase(PHASE_LOGIN);
return 0; return 0;
} }
@ -599,7 +593,7 @@ dev_log(LOG_DEB0, "DC : '%s'", msg.c_str());
else if (bHeader == HEADER_CG_HANDSHAKE) else if (bHeader == HEADER_CG_HANDSHAKE)
Handshake(d, c_pData); Handshake(d, c_pData);
else else
sys_err("Handshake phase does not handle packet %d", bHeader); SPDLOG_ERROR("Handshake phase does not handle packet {}", bHeader);
return 0; return 0;
} }

View File

@ -106,7 +106,7 @@ void CInputAuth::Login(LPDESC d, const char * c_pData)
if (!g_bAuthServer) if (!g_bAuthServer)
{ {
sys_err ("CInputAuth class is not for game server. IP %s might be a hacker.", d->GetHostName()); SPDLOG_ERROR("CInputAuth class is not for game server. IP {} might be a hacker.", d->GetHostName());
d->DelayedDisconnect(5); d->DelayedDisconnect(5);
return; return;
} }
@ -118,14 +118,14 @@ void CInputAuth::Login(LPDESC d, const char * c_pData)
char passwd[PASSWD_MAX_LEN + 1]; char passwd[PASSWD_MAX_LEN + 1];
strlcpy(passwd, pinfo->passwd, sizeof(passwd)); strlcpy(passwd, pinfo->passwd, sizeof(passwd));
sys_log(0, "InputAuth::Login : %s(%d) desc %p", SPDLOG_DEBUG("InputAuth::Login : {}({}) desc {}",
login, strlen(login), get_pointer(d)); login, strlen(login), (void*) get_pointer(d));
// check login string // check login string
if (false == FN_IS_VALID_LOGIN_STRING(login)) if (false == FN_IS_VALID_LOGIN_STRING(login))
{ {
sys_log(0, "InputAuth::Login : IS_NOT_VALID_LOGIN_STRING(%s) desc %p", SPDLOG_DEBUG("InputAuth::Login : IS_NOT_VALID_LOGIN_STRING({}) desc {}",
login, get_pointer(d)); login, (void*) get_pointer(d));
LoginFailure(d, "NOID"); LoginFailure(d, "NOID");
return; return;
} }
@ -151,7 +151,7 @@ void CInputAuth::Login(LPDESC d, const char * c_pData)
DWORD dwPanamaKey = dwKey ^ pinfo->adwClientKey[0] ^ pinfo->adwClientKey[1] ^ pinfo->adwClientKey[2] ^ pinfo->adwClientKey[3]; DWORD dwPanamaKey = dwKey ^ pinfo->adwClientKey[0] ^ pinfo->adwClientKey[1] ^ pinfo->adwClientKey[2] ^ pinfo->adwClientKey[3];
d->SetPanamaKey(dwPanamaKey); d->SetPanamaKey(dwPanamaKey);
sys_log(0, "InputAuth::Login : key %u:0x%x login %s", dwKey, dwPanamaKey, login); SPDLOG_DEBUG("InputAuth::Login : key {}:{} login {}", dwKey, dwPanamaKey, login);
TPacketCGLogin3 * p = M2_NEW TPacketCGLogin3; TPacketCGLogin3 * p = M2_NEW TPacketCGLogin3;
memcpy(p, pinfo, sizeof(TPacketCGLogin3)); memcpy(p, pinfo, sizeof(TPacketCGLogin3));
@ -165,7 +165,7 @@ void CInputAuth::Login(LPDESC d, const char * c_pData)
// CHANNEL_SERVICE_LOGIN // CHANNEL_SERVICE_LOGIN
if (Login_IsInChannelService(szLogin)) if (Login_IsInChannelService(szLogin))
{ {
sys_log(0, "ChannelServiceLogin [%s]", szLogin); SPDLOG_DEBUG("ChannelServiceLogin [{}]", szLogin);
DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, dwKey, p, DBManager::instance().ReturnQuery(QID_AUTH_LOGIN, dwKey, p,
"SELECT '%s',password,securitycode,social_id,id,status,availDt - NOW() > 0," "SELECT '%s',password,securitycode,social_id,id,status,availDt - NOW() > 0,"
@ -204,15 +204,14 @@ int CInputAuth::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
if (!g_bAuthServer) if (!g_bAuthServer)
{ {
sys_err ("CInputAuth class is not for game server. IP %s might be a hacker.", d->GetHostName()); SPDLOG_ERROR("CInputAuth class is not for game server. IP {} might be a hacker.", d->GetHostName());
d->DelayedDisconnect(5); d->DelayedDisconnect(5);
return 0; return 0;
} }
int iExtraLen = 0; int iExtraLen = 0;
if (test_server) SPDLOG_TRACE(" InputAuth Analyze Header[{}] ", bHeader);
sys_log(0, " InputAuth Analyze Header[%d] ", bHeader);
switch (bHeader) switch (bHeader)
{ {
@ -228,7 +227,7 @@ int CInputAuth::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
break; break;
default: default:
sys_err("This phase does not handle this header %d (0x%x)(phase: AUTH)", bHeader, bHeader); SPDLOG_ERROR("This phase does not handle this header {} (0x{})(phase: AUTH)", bHeader, bHeader);
break; break;
} }

View File

@ -35,7 +35,6 @@
#include "block_country.h" #include "block_country.h"
#include "motion.h" #include "motion.h"
#include "dev_log.h"
#include "log.h" #include "log.h"
@ -78,7 +77,7 @@ bool GetServerLocation(TAccountTable & rTab, BYTE bEmpire)
rTab.players[i].lAddr, rTab.players[i].lAddr,
rTab.players[i].wPort)) rTab.players[i].wPort))
{ {
sys_err("location error name %s mapindex %d %d x %d empire %d", SPDLOG_ERROR("location error name {} mapindex {} {} x {} empire {}",
rTab.players[i].szName, lIndex, rTab.players[i].x, rTab.players[i].y, rTab.bEmpire); rTab.players[i].szName, lIndex, rTab.players[i].x, rTab.players[i].y, rTab.bEmpire);
rTab.players[i].x = EMPIRE_START_X(rTab.bEmpire); rTab.players[i].x = EMPIRE_START_X(rTab.bEmpire);
@ -88,7 +87,7 @@ bool GetServerLocation(TAccountTable & rTab, BYTE bEmpire)
if (!CMapLocation::instance().Get(rTab.players[i].x, rTab.players[i].y, lIndex, rTab.players[i].lAddr, rTab.players[i].wPort)) if (!CMapLocation::instance().Get(rTab.players[i].x, rTab.players[i].y, lIndex, rTab.players[i].lAddr, rTab.players[i].wPort))
{ {
sys_err("cannot find server for mapindex %d %d x %d (name %s)", SPDLOG_ERROR("cannot find server for mapindex {} {} x {} (name {})",
lIndex, lIndex,
rTab.players[i].x, rTab.players[i].x,
rTab.players[i].y, rTab.players[i].y,
@ -100,7 +99,7 @@ bool GetServerLocation(TAccountTable & rTab, BYTE bEmpire)
struct in_addr in; struct in_addr in;
in.s_addr = rTab.players[i].lAddr; in.s_addr = rTab.players[i].lAddr;
sys_log(0, "success to %s:%d", inet_ntoa(in), rTab.players[i].wPort); SPDLOG_DEBUG("success to {}:{}", inet_ntoa(in), rTab.players[i].wPort);
} }
return bFound; return bFound;
@ -111,14 +110,14 @@ extern std::map<DWORD, CLoginSim *> g_simByPID;
void CInputDB::LoginSuccess(DWORD dwHandle, const char *data) void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
{ {
sys_log(0, "LoginSuccess"); SPDLOG_DEBUG("LoginSuccess");
TAccountTable * pTab = (TAccountTable *) data; TAccountTable * pTab = (TAccountTable *) data;
itertype(g_sim) it = g_sim.find(pTab->id); itertype(g_sim) it = g_sim.find(pTab->id);
if (g_sim.end() != it) if (g_sim.end() != it)
{ {
sys_log(0, "CInputDB::LoginSuccess - already exist sim [%s]", pTab->login); SPDLOG_ERROR("CInputDB::LoginSuccess - already exist sim [{}]", pTab->login);
it->second->SendLoad(); it->second->SendLoad();
return; return;
} }
@ -127,7 +126,7 @@ void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
if (!d) if (!d)
{ {
sys_log(0, "CInputDB::LoginSuccess - cannot find handle [%s]", pTab->login); SPDLOG_ERROR("CInputDB::LoginSuccess - cannot find handle [{}]", pTab->login);
TLogoutPacket pack; TLogoutPacket pack;
@ -138,7 +137,7 @@ void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
if (strcmp(pTab->status, "OK")) // OK°¡ ¾Æ´Ï¸é if (strcmp(pTab->status, "OK")) // OK°¡ ¾Æ´Ï¸é
{ {
sys_log(0, "CInputDB::LoginSuccess - status[%s] is not OK [%s]", pTab->status, pTab->login); SPDLOG_DEBUG("CInputDB::LoginSuccess - status[{}] is not OK [{}]", pTab->status, pTab->login);
TLogoutPacket pack; TLogoutPacket pack;
@ -152,7 +151,7 @@ void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
for (int i = 0; i != PLAYER_PER_ACCOUNT; ++i) for (int i = 0; i != PLAYER_PER_ACCOUNT; ++i)
{ {
TSimplePlayer& player = pTab->players[i]; TSimplePlayer& player = pTab->players[i];
sys_log(0, "\tplayer(%s).job(%d)", player.szName, player.byJob); SPDLOG_DEBUG("\tplayer({}).job({})", player.szName, player.byJob);
} }
bool bFound = GetServerLocation(*pTab, pTab->bEmpire); bool bFound = GetServerLocation(*pTab, pTab->bEmpire);
@ -177,7 +176,7 @@ void CInputDB::LoginSuccess(DWORD dwHandle, const char *data)
d->SetPhase(PHASE_SELECT); d->SetPhase(PHASE_SELECT);
d->SendLoginSuccessPacket(); d->SendLoginSuccessPacket();
sys_log(0, "InputDB::login_success: %s", pTab->login); SPDLOG_DEBUG("InputDB::login_success: {}", pTab->login);
} }
void CInputDB::PlayerCreateFailure(LPDESC d, BYTE bType) void CInputDB::PlayerCreateFailure(LPDESC d, BYTE bType)
@ -214,7 +213,7 @@ void CInputDB::PlayerCreateSuccess(LPDESC d, const char * data)
pPacketDB->player.lAddr, pPacketDB->player.lAddr,
pPacketDB->player.wPort)) pPacketDB->player.wPort))
{ {
sys_err("InputDB::PlayerCreateSuccess: cannot find server for mapindex %d %d x %d (name %s)", SPDLOG_ERROR("InputDB::PlayerCreateSuccess: cannot find server for mapindex {} {} x {} (name {})",
lIndex, lIndex,
pPacketDB->player.x, pPacketDB->player.x,
pPacketDB->player.y, pPacketDB->player.y,
@ -370,7 +369,7 @@ void CInputDB::PlayerLoad(LPDESC d, const char * data)
// by rtsummit // by rtsummit
if (!SECTREE_MANAGER::instance().GetValidLocation(pTab->lMapIndex, pTab->x, pTab->y, lMapIndex, pos, d->GetEmpire())) if (!SECTREE_MANAGER::instance().GetValidLocation(pTab->lMapIndex, pTab->x, pTab->y, lMapIndex, pos, d->GetEmpire()))
{ {
sys_err("InputDB::PlayerLoad : cannot find valid location %d x %d (name: %s)", pTab->x, pTab->y, pTab->name); SPDLOG_ERROR("InputDB::PlayerLoad : cannot find valid location {} x {} (name: {})", pTab->x, pTab->y, pTab->name);
d->SetPhase(PHASE_CLOSE); d->SetPhase(PHASE_CLOSE);
return; return;
} }
@ -382,13 +381,13 @@ void CInputDB::PlayerLoad(LPDESC d, const char * data)
if (d->GetCharacter() || d->IsPhase(PHASE_GAME)) if (d->GetCharacter() || d->IsPhase(PHASE_GAME))
{ {
LPCHARACTER p = d->GetCharacter(); LPCHARACTER p = d->GetCharacter();
sys_err("login state already has main state (character %s %p)", p->GetName(), get_pointer(p)); SPDLOG_ERROR("login state already has main state (character {} {})", p->GetName(), (void*) get_pointer(p));
return; return;
} }
if (NULL != CHARACTER_MANAGER::Instance().FindPC(pTab->name)) if (NULL != CHARACTER_MANAGER::Instance().FindPC(pTab->name))
{ {
sys_err("InputDB: PlayerLoad : %s already exist in game", pTab->name); SPDLOG_ERROR("InputDB: PlayerLoad : {} already exist in game", pTab->name);
return; return;
} }
@ -444,7 +443,7 @@ void CInputDB::PlayerLoad(LPDESC d, const char * data)
//if (!map_allow_find(lMapIndex >= 10000 ? lMapIndex / 10000 : lMapIndex) || !CheckEmpire(ch, lMapIndex)) //if (!map_allow_find(lMapIndex >= 10000 ? lMapIndex / 10000 : lMapIndex) || !CheckEmpire(ch, lMapIndex))
if (!map_allow_find(lPublicMapIndex)) if (!map_allow_find(lPublicMapIndex))
{ {
sys_err("InputDB::PlayerLoad : entering %d map is not allowed here (name: %s, empire %u)", SPDLOG_ERROR("InputDB::PlayerLoad : entering {} map is not allowed here (name: {}, empire {})",
lMapIndex, pTab->name, d->GetEmpire()); lMapIndex, pTab->name, d->GetEmpire());
ch->SetWarpLocation(EMPIRE_START_MAP(d->GetEmpire()), ch->SetWarpLocation(EMPIRE_START_MAP(d->GetEmpire()),
@ -463,7 +462,7 @@ void CInputDB::PlayerLoad(LPDESC d, const char * data)
ch->PointsPacket(); ch->PointsPacket();
ch->SkillLevelPacket(); ch->SkillLevelPacket();
sys_log(0, "InputDB: player_load %s %dx%dx%d LEVEL %d MOV_SPEED %d JOB %d ATG %d DFG %d GMLv %d", SPDLOG_DEBUG("InputDB: player_load {} {}x{}x{} LEVEL {} MOV_SPEED {} JOB {} ATG {} DFG {} GMLv {}",
pTab->name, pTab->name,
ch->GetX(), ch->GetY(), ch->GetZ(), ch->GetX(), ch->GetY(), ch->GetZ(),
ch->GetLevel(), ch->GetLevel(),
@ -488,27 +487,27 @@ void CInputDB::Boot(const char* data)
BYTE bVersion = decode_byte(data); BYTE bVersion = decode_byte(data);
data += 1; data += 1;
sys_log(0, "BOOT: PACKET: %d", dwPacketSize); SPDLOG_INFO("BOOT: PACKET: {}", dwPacketSize);
sys_log(0, "BOOT: VERSION: %d", bVersion); SPDLOG_INFO("BOOT: VERSION: {}", bVersion);
if (bVersion != 6) if (bVersion != 6)
{ {
sys_err("boot version error"); SPDLOG_ERROR("boot version error");
thecore_shutdown(); thecore_shutdown();
} }
sys_log(0, "sizeof(TMobTable) = %d", sizeof(TMobTable)); SPDLOG_DEBUG("sizeof(TMobTable) = {}", sizeof(TMobTable));
sys_log(0, "sizeof(TItemTable) = %d", sizeof(TItemTable)); SPDLOG_DEBUG("sizeof(TItemTable) = {}", sizeof(TItemTable));
sys_log(0, "sizeof(TShopTable) = %d", sizeof(TShopTable)); SPDLOG_DEBUG("sizeof(TShopTable) = {}", sizeof(TShopTable));
sys_log(0, "sizeof(TSkillTable) = %d", sizeof(TSkillTable)); SPDLOG_DEBUG("sizeof(TSkillTable) = {}", sizeof(TSkillTable));
sys_log(0, "sizeof(TRefineTable) = %d", sizeof(TRefineTable)); SPDLOG_DEBUG("sizeof(TRefineTable) = {}", sizeof(TRefineTable));
sys_log(0, "sizeof(TItemAttrTable) = %d", sizeof(TItemAttrTable)); SPDLOG_DEBUG("sizeof(TItemAttrTable) = {}", sizeof(TItemAttrTable));
sys_log(0, "sizeof(TItemRareTable) = %d", sizeof(TItemAttrTable)); SPDLOG_DEBUG("sizeof(TItemRareTable) = {}", sizeof(TItemAttrTable));
sys_log(0, "sizeof(TBanwordTable) = %d", sizeof(TBanwordTable)); SPDLOG_DEBUG("sizeof(TBanwordTable) = {}", sizeof(TBanwordTable));
sys_log(0, "sizeof(TLand) = %d", sizeof(building::TLand)); SPDLOG_DEBUG("sizeof(TLand) = {}", sizeof(building::TLand));
sys_log(0, "sizeof(TObjectProto) = %d", sizeof(building::TObjectProto)); SPDLOG_DEBUG("sizeof(TObjectProto) = {}", sizeof(building::TObjectProto));
sys_log(0, "sizeof(TObject) = %d", sizeof(building::TObject)); SPDLOG_DEBUG("sizeof(TObject) = {}", sizeof(building::TObject));
//ADMIN_MANAGER //ADMIN_MANAGER
sys_log(0, "sizeof(TAdminManager) = %d", sizeof (TAdminInfo) ); SPDLOG_DEBUG("sizeof(TAdminManager) = {}", sizeof (TAdminInfo) );
//END_ADMIN_MANAGER //END_ADMIN_MANAGER
WORD size; WORD size;
@ -519,7 +518,7 @@ void CInputDB::Boot(const char* data)
if (decode_2bytes(data)!=sizeof(TMobTable)) if (decode_2bytes(data)!=sizeof(TMobTable))
{ {
sys_err("mob table size error"); SPDLOG_ERROR("mob table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -527,7 +526,7 @@ void CInputDB::Boot(const char* data)
size = decode_2bytes(data); size = decode_2bytes(data);
data += 2; data += 2;
sys_log(0, "BOOT: MOB: %d", size); SPDLOG_DEBUG("BOOT: MOB: {}", size);
if (size) if (size)
{ {
@ -541,7 +540,7 @@ void CInputDB::Boot(const char* data)
if (decode_2bytes(data) != sizeof(TItemTable)) if (decode_2bytes(data) != sizeof(TItemTable))
{ {
sys_err("item table size error"); SPDLOG_ERROR("item table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -549,7 +548,7 @@ void CInputDB::Boot(const char* data)
size = decode_2bytes(data); size = decode_2bytes(data);
data += 2; data += 2;
sys_log(0, "BOOT: ITEM: %d", size); SPDLOG_DEBUG("BOOT: ITEM: {}", size);
if (size) if (size)
@ -564,7 +563,7 @@ void CInputDB::Boot(const char* data)
if (decode_2bytes(data) != sizeof(TShopTable)) if (decode_2bytes(data) != sizeof(TShopTable))
{ {
sys_err("shop table size error"); SPDLOG_ERROR("shop table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -572,14 +571,14 @@ void CInputDB::Boot(const char* data)
size = decode_2bytes(data); size = decode_2bytes(data);
data += 2; data += 2;
sys_log(0, "BOOT: SHOP: %d", size); SPDLOG_DEBUG("BOOT: SHOP: {}", size);
if (size) if (size)
{ {
if (!CShopManager::instance().Initialize((TShopTable *) data, size)) if (!CShopManager::instance().Initialize((TShopTable *) data, size))
{ {
sys_err("shop table Initialize error"); SPDLOG_ERROR("shop table Initialize error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -592,7 +591,7 @@ void CInputDB::Boot(const char* data)
if (decode_2bytes(data) != sizeof(TSkillTable)) if (decode_2bytes(data) != sizeof(TSkillTable))
{ {
sys_err("skill table size error"); SPDLOG_ERROR("skill table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -600,13 +599,13 @@ void CInputDB::Boot(const char* data)
size = decode_2bytes(data); size = decode_2bytes(data);
data += 2; data += 2;
sys_log(0, "BOOT: SKILL: %d", size); SPDLOG_DEBUG("BOOT: SKILL: {}", size);
if (size) if (size)
{ {
if (!CSkillManager::instance().Initialize((TSkillTable *) data, size)) if (!CSkillManager::instance().Initialize((TSkillTable *) data, size))
{ {
sys_err("cannot initialize skill table"); SPDLOG_ERROR("cannot initialize skill table");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -618,7 +617,7 @@ void CInputDB::Boot(const char* data)
*/ */
if (decode_2bytes(data) != sizeof(TRefineTable)) if (decode_2bytes(data) != sizeof(TRefineTable))
{ {
sys_err("refine table size error"); SPDLOG_ERROR("refine table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -626,7 +625,7 @@ void CInputDB::Boot(const char* data)
size = decode_2bytes(data); size = decode_2bytes(data);
data += 2; data += 2;
sys_log(0, "BOOT: REFINE: %d", size); SPDLOG_DEBUG("BOOT: REFINE: {}", size);
if (size) if (size)
{ {
@ -639,7 +638,7 @@ void CInputDB::Boot(const char* data)
*/ */
if (decode_2bytes(data) != sizeof(TItemAttrTable)) if (decode_2bytes(data) != sizeof(TItemAttrTable))
{ {
sys_err("item attr table size error"); SPDLOG_ERROR("item attr table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -647,7 +646,7 @@ void CInputDB::Boot(const char* data)
size = decode_2bytes(data); size = decode_2bytes(data);
data += 2; data += 2;
sys_log(0, "BOOT: ITEM_ATTR: %d", size); SPDLOG_DEBUG("BOOT: ITEM_ATTR: {}", size);
if (size) if (size)
{ {
@ -659,7 +658,7 @@ void CInputDB::Boot(const char* data)
continue; continue;
g_map_itemAttr[p->dwApplyIndex] = *p; g_map_itemAttr[p->dwApplyIndex] = *p;
sys_log(0, "ITEM_ATTR[%d]: %s %u", p->dwApplyIndex, p->szApply, p->dwProb); SPDLOG_DEBUG("ITEM_ATTR[{}]: {} {}", p->dwApplyIndex, p->szApply, p->dwProb);
} }
} }
@ -671,7 +670,7 @@ void CInputDB::Boot(const char* data)
*/ */
if (decode_2bytes(data) != sizeof(TItemAttrTable)) if (decode_2bytes(data) != sizeof(TItemAttrTable))
{ {
sys_err("item rare table size error"); SPDLOG_ERROR("item rare table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -679,7 +678,7 @@ void CInputDB::Boot(const char* data)
size = decode_2bytes(data); size = decode_2bytes(data);
data += 2; data += 2;
sys_log(0, "BOOT: ITEM_RARE: %d", size); SPDLOG_DEBUG("BOOT: ITEM_RARE: {}", size);
if (size) if (size)
{ {
@ -691,7 +690,7 @@ void CInputDB::Boot(const char* data)
continue; continue;
g_map_itemRare[p->dwApplyIndex] = *p; g_map_itemRare[p->dwApplyIndex] = *p;
sys_log(0, "ITEM_RARE[%d]: %s %u", p->dwApplyIndex, p->szApply, p->dwProb); SPDLOG_DEBUG("ITEM_RARE[{}]: {} {}", p->dwApplyIndex, p->szApply, p->dwProb);
} }
} }
@ -704,7 +703,7 @@ void CInputDB::Boot(const char* data)
if (decode_2bytes(data) != sizeof(TBanwordTable)) if (decode_2bytes(data) != sizeof(TBanwordTable))
{ {
sys_err("ban word table size error"); SPDLOG_ERROR("ban word table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -725,7 +724,7 @@ void CInputDB::Boot(const char* data)
if (decode_2bytes(data) != sizeof(TLand)) if (decode_2bytes(data) != sizeof(TLand))
{ {
sys_err("land table size error"); SPDLOG_ERROR("land table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -746,7 +745,7 @@ void CInputDB::Boot(const char* data)
if (decode_2bytes(data) != sizeof(TObjectProto)) if (decode_2bytes(data) != sizeof(TObjectProto))
{ {
sys_err("object proto table size error"); SPDLOG_ERROR("object proto table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -763,7 +762,7 @@ void CInputDB::Boot(const char* data)
*/ */
if (decode_2bytes(data) != sizeof(TObject)) if (decode_2bytes(data) != sizeof(TObject))
{ {
sys_err("object table size error"); SPDLOG_ERROR("object table size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -787,7 +786,7 @@ void CInputDB::Boot(const char* data)
if (decode_2bytes(data) != sizeof(TItemIDRangeTable) ) if (decode_2bytes(data) != sizeof(TItemIDRangeTable) )
{ {
sys_err("ITEM ID RANGE size error"); SPDLOG_ERROR("ITEM ID RANGE size error");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -808,11 +807,11 @@ void CInputDB::Boot(const char* data)
data += 2; data += 2;
int HostSize = decode_2bytes(data ); int HostSize = decode_2bytes(data );
data += 2; data += 2;
sys_log(0, "GM Value Count %d %d", HostSize, ChunkSize ); SPDLOG_INFO("GM Value Count {} {}", HostSize, ChunkSize );
for (int n = 0; n < HostSize; ++n ) for (int n = 0; n < HostSize; ++n )
{ {
gm_new_host_inert(data ); gm_new_host_inert(data );
sys_log(0, "GM HOST : IP[%s] ", data ); SPDLOG_INFO("GM HOST : IP[{}] ", data );
data += ChunkSize; data += ChunkSize;
} }
@ -844,7 +843,7 @@ void CInputDB::Boot(const char* data)
for (int n = 1; n < 4; ++n) for (int n = 1; n < 4; ++n)
{ {
if (p.name[n] && *p.name[n]) if (p.name[n] && *p.name[n])
sys_log(0, "[MONARCH] Empire %d Pid %d Money %d %s", n, p.pid[n], p.money[n], p.name[n]); SPDLOG_DEBUG("[MONARCH] Empire {} Pid {} Money {} {}", n, p.pid[n], p.money[n], p.name[n]);
} }
int CandidacySize = decode_2bytes(data); int CandidacySize = decode_2bytes(data);
@ -853,8 +852,7 @@ void CInputDB::Boot(const char* data)
int CandidacyCount = decode_2bytes(data); int CandidacyCount = decode_2bytes(data);
data += 2; data += 2;
if (test_server) SPDLOG_TRACE("[MONARCH] Size {} Count {}", CandidacySize, CandidacyCount);
sys_log (0, "[MONARCH] Size %d Count %d", CandidacySize, CandidacyCount);
data += CandidacySize * CandidacyCount; data += CandidacySize * CandidacyCount;
@ -864,24 +862,24 @@ void CInputDB::Boot(const char* data)
WORD endCheck=decode_2bytes(data); WORD endCheck=decode_2bytes(data);
if (endCheck != 0xffff) if (endCheck != 0xffff)
{ {
sys_err("boot packet end check error [%x]!=0xffff", endCheck); SPDLOG_CRITICAL("boot packet end check error [{}]!=0xffff", endCheck);
thecore_shutdown(); thecore_shutdown();
return; return;
} }
else else
sys_log(0, "boot packet end check ok [%x]==0xffff", endCheck ); SPDLOG_DEBUG("boot packet end check ok [{}]==0xffff", endCheck );
data +=2; data +=2;
if (!ITEM_MANAGER::instance().SetMaxItemID(*range)) if (!ITEM_MANAGER::instance().SetMaxItemID(*range))
{ {
sys_err("not enough item id contact your administrator!"); SPDLOG_CRITICAL("not enough item id contact your administrator!");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
if (!ITEM_MANAGER::instance().SetMaxSpareItemID(*rangespare)) if (!ITEM_MANAGER::instance().SetMaxSpareItemID(*rangespare))
{ {
sys_err("not enough item id for spare contact your administrator!"); SPDLOG_CRITICAL("not enough item id for spare contact your administrator!");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
@ -916,72 +914,72 @@ void CInputDB::Boot(const char* data)
snprintf(szDragonSoulTableFileName, sizeof(szDragonSoulTableFileName), snprintf(szDragonSoulTableFileName, sizeof(szDragonSoulTableFileName),
"%s/dragon_soul_table.txt", LocaleService_GetBasePath().c_str()); "%s/dragon_soul_table.txt", LocaleService_GetBasePath().c_str());
sys_log(0, "Initializing Informations of Cube System"); SPDLOG_DEBUG("Initializing Informations of Cube System");
if (!Cube_InformationInitialize()) if (!Cube_InformationInitialize())
{ {
sys_err("cannot init cube infomation."); SPDLOG_ERROR("cannot init cube infomation.");
thecore_shutdown(); thecore_shutdown();
return; return;
} }
sys_log(0, "LoadLocaleFile: CommonDropItem: %s", szCommonDropItemFileName); SPDLOG_DEBUG("LoadLocaleFile: CommonDropItem: {}", szCommonDropItemFileName);
if (!ITEM_MANAGER::instance().ReadCommonDropItemFile(szCommonDropItemFileName)) if (!ITEM_MANAGER::instance().ReadCommonDropItemFile(szCommonDropItemFileName))
{ {
sys_err("cannot load CommonDropItem: %s", szCommonDropItemFileName); SPDLOG_ERROR("cannot load CommonDropItem: {}", szCommonDropItemFileName);
thecore_shutdown(); thecore_shutdown();
return; return;
} }
sys_log(0, "LoadLocaleFile: ETCDropItem: %s", szETCDropItemFileName); SPDLOG_DEBUG("LoadLocaleFile: ETCDropItem: {}", szETCDropItemFileName);
if (!ITEM_MANAGER::instance().ReadEtcDropItemFile(szETCDropItemFileName)) if (!ITEM_MANAGER::instance().ReadEtcDropItemFile(szETCDropItemFileName))
{ {
sys_err("cannot load ETCDropItem: %s", szETCDropItemFileName); SPDLOG_ERROR("cannot load ETCDropItem: {}", szETCDropItemFileName);
thecore_shutdown(); thecore_shutdown();
return; return;
} }
sys_log(0, "LoadLocaleFile: DropItemGroup: %s", szDropItemGroupFileName); SPDLOG_DEBUG("LoadLocaleFile: DropItemGroup: {}", szDropItemGroupFileName);
if (!ITEM_MANAGER::instance().ReadDropItemGroup(szDropItemGroupFileName)) if (!ITEM_MANAGER::instance().ReadDropItemGroup(szDropItemGroupFileName))
{ {
sys_err("cannot load DropItemGroup: %s", szDropItemGroupFileName); SPDLOG_ERROR("cannot load DropItemGroup: {}", szDropItemGroupFileName);
thecore_shutdown(); thecore_shutdown();
return; return;
} }
sys_log(0, "LoadLocaleFile: SpecialItemGroup: %s", szSpecialItemGroupFileName); SPDLOG_DEBUG("LoadLocaleFile: SpecialItemGroup: {}", szSpecialItemGroupFileName);
if (!ITEM_MANAGER::instance().ReadSpecialDropItemFile(szSpecialItemGroupFileName)) if (!ITEM_MANAGER::instance().ReadSpecialDropItemFile(szSpecialItemGroupFileName))
{ {
sys_err("cannot load SpecialItemGroup: %s", szSpecialItemGroupFileName); SPDLOG_ERROR("cannot load SpecialItemGroup: {}", szSpecialItemGroupFileName);
thecore_shutdown(); thecore_shutdown();
return; return;
} }
sys_log(0, "LoadLocaleFile: ItemVnumMaskTable : %s", szItemVnumMaskTableFileName); SPDLOG_DEBUG("LoadLocaleFile: ItemVnumMaskTable : {}", szItemVnumMaskTableFileName);
if (!ITEM_MANAGER::instance().ReadItemVnumMaskTable(szItemVnumMaskTableFileName)) if (!ITEM_MANAGER::instance().ReadItemVnumMaskTable(szItemVnumMaskTableFileName))
{ {
sys_log(0, "Could not open MaskItemTable"); SPDLOG_ERROR("Could not open MaskItemTable");
} }
sys_log(0, "LoadLocaleFile: MOBDropItemFile: %s", szMOBDropItemFileName); SPDLOG_DEBUG("LoadLocaleFile: MOBDropItemFile: {}", szMOBDropItemFileName);
if (!ITEM_MANAGER::instance().ReadMonsterDropItemGroup(szMOBDropItemFileName)) if (!ITEM_MANAGER::instance().ReadMonsterDropItemGroup(szMOBDropItemFileName))
{ {
sys_err("cannot load MOBDropItemFile: %s", szMOBDropItemFileName); SPDLOG_ERROR("cannot load MOBDropItemFile: {}", szMOBDropItemFileName);
thecore_shutdown(); thecore_shutdown();
return; return;
} }
sys_log(0, "LoadLocaleFile: MapIndex: %s", szMapIndexFileName); SPDLOG_DEBUG("LoadLocaleFile: MapIndex: {}", szMapIndexFileName);
if (!SECTREE_MANAGER::instance().Build(szMapIndexFileName, LocaleService_GetMapPath().c_str())) if (!SECTREE_MANAGER::instance().Build(szMapIndexFileName, LocaleService_GetMapPath().c_str()))
{ {
sys_err("cannot load MapIndex: %s", szMapIndexFileName); SPDLOG_ERROR("cannot load MapIndex: {}", szMapIndexFileName);
thecore_shutdown(); thecore_shutdown();
return; return;
} }
sys_log(0, "LoadLocaleFile: DragonSoulTable: %s", szDragonSoulTableFileName); SPDLOG_DEBUG("LoadLocaleFile: DragonSoulTable: {}", szDragonSoulTableFileName);
if (!DSManager::instance().ReadDragonSoulTableFile(szDragonSoulTableFileName)) if (!DSManager::instance().ReadDragonSoulTableFile(szDragonSoulTableFileName))
{ {
sys_err("cannot load DragonSoulTable: %s", szDragonSoulTableFileName); SPDLOG_ERROR("cannot load DragonSoulTable: {}", szDragonSoulTableFileName);
//thecore_shutdown(); //thecore_shutdown();
//return; //return;
} }
@ -1008,7 +1006,7 @@ void CInputDB::Boot(const char* data)
// request blocked_country_ip // request blocked_country_ip
{ {
db_clientdesc->DBPacket(HEADER_GD_BLOCK_COUNTRY_IP, 0, NULL, 0); db_clientdesc->DBPacket(HEADER_GD_BLOCK_COUNTRY_IP, 0, NULL, 0);
dev_log(LOG_DEB0, "<sent HEADER_GD_BLOCK_COUNTRY_IP>"); SPDLOG_TRACE("<sent HEADER_GD_BLOCK_COUNTRY_IP>");
} }
} }
@ -1028,7 +1026,7 @@ EVENTFUNC(quest_login_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "quest_login_event> <Factor> Null pointer" ); SPDLOG_ERROR("quest_login_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -1058,13 +1056,13 @@ EVENTFUNC(quest_login_event)
} }
else if (d->IsPhase(PHASE_GAME)) else if (d->IsPhase(PHASE_GAME))
{ {
sys_log(0, "QUEST_LOAD: Login pc %d by event", ch->GetPlayerID()); SPDLOG_DEBUG("QUEST_LOAD: Login pc {} by event", ch->GetPlayerID());
quest::CQuestManager::instance().Login(ch->GetPlayerID()); quest::CQuestManager::instance().Login(ch->GetPlayerID());
return 0; return 0;
} }
else else
{ {
sys_err(0, "input_db.cpp:quest_login_event INVALID PHASE pid %d", ch->GetPlayerID()); SPDLOG_ERROR("input_db.cpp:quest_login_event INVALID PHASE pid {}", ch->GetPlayerID());
return 0; return 0;
} }
} }
@ -1089,18 +1087,18 @@ void CInputDB::QuestLoad(LPDESC d, const char * c_pData)
{ {
if (ch->GetPlayerID() != pQuestTable[0].dwPID) if (ch->GetPlayerID() != pQuestTable[0].dwPID)
{ {
sys_err("PID differs %u %u", ch->GetPlayerID(), pQuestTable[0].dwPID); SPDLOG_ERROR("PID differs {} {}", ch->GetPlayerID(), pQuestTable[0].dwPID);
return; return;
} }
} }
sys_log(0, "QUEST_LOAD: count %d", dwCount); SPDLOG_DEBUG("QUEST_LOAD: count {}", dwCount);
quest::PC * pkPC = quest::CQuestManager::instance().GetPCForce(ch->GetPlayerID()); quest::PC * pkPC = quest::CQuestManager::instance().GetPCForce(ch->GetPlayerID());
if (!pkPC) if (!pkPC)
{ {
sys_err("null quest::PC with id %u", pQuestTable[0].dwPID); SPDLOG_ERROR("null quest::PC with id {}", pQuestTable[0].dwPID);
return; return;
} }
@ -1114,7 +1112,7 @@ void CInputDB::QuestLoad(LPDESC d, const char * c_pData)
st += "."; st += ".";
st += pQuestTable[i].szState; st += pQuestTable[i].szState;
sys_log(0, " %s %d", st.c_str(), pQuestTable[i].lValue); SPDLOG_DEBUG(" {} {}", st.c_str(), pQuestTable[i].lValue);
pkPC->SetFlag(st.c_str(), pQuestTable[i].lValue, false); pkPC->SetFlag(st.c_str(), pQuestTable[i].lValue, false);
} }
@ -1123,7 +1121,7 @@ void CInputDB::QuestLoad(LPDESC d, const char * c_pData)
if (ch->GetDesc()->IsPhase(PHASE_GAME)) if (ch->GetDesc()->IsPhase(PHASE_GAME))
{ {
sys_log(0, "QUEST_LOAD: Login pc %d", pQuestTable[0].dwPID); SPDLOG_DEBUG("QUEST_LOAD: Login pc {}", pQuestTable[0].dwPID);
quest::CQuestManager::instance().Login(pQuestTable[0].dwPID); quest::CQuestManager::instance().Login(pQuestTable[0].dwPID);
} }
else else
@ -1145,7 +1143,7 @@ void CInputDB::SafeboxLoad(LPDESC d, const char * c_pData)
if (d->GetAccountTable().id != p->dwID) if (d->GetAccountTable().id != p->dwID)
{ {
sys_err("SafeboxLoad: safebox has different id %u != %u", d->GetAccountTable().id, p->dwID); SPDLOG_ERROR("SafeboxLoad: safebox has different id {} != {}", d->GetAccountTable().id, p->dwID);
return; return;
} }
@ -1237,7 +1235,7 @@ void CInputDB::MallLoad(LPDESC d, const char * c_pData)
if (d->GetAccountTable().id != p->dwID) if (d->GetAccountTable().id != p->dwID)
{ {
sys_err("safebox has different id %u != %u", d->GetAccountTable().id, p->dwID); SPDLOG_ERROR("safebox has different id {} != {}", d->GetAccountTable().id, p->dwID);
return; return;
} }
@ -1277,7 +1275,7 @@ void CInputDB::LoginAlready(LPDESC d, const char * c_pData)
void CInputDB::EmpireSelect(LPDESC d, const char * c_pData) void CInputDB::EmpireSelect(LPDESC d, const char * c_pData)
{ {
sys_log(0, "EmpireSelect %p", get_pointer(d)); SPDLOG_DEBUG("EmpireSelect {}", (void*) get_pointer(d));
if (!d) if (!d)
return; return;
@ -1306,7 +1304,7 @@ void CInputDB::MapLocations(const char * c_pData)
{ {
BYTE bCount = *(BYTE *) (c_pData++); BYTE bCount = *(BYTE *) (c_pData++);
sys_log(0, "InputDB::MapLocations %d", bCount); SPDLOG_DEBUG("InputDB::MapLocations {}", bCount);
TMapLocation * pLoc = (TMapLocation *) c_pData; TMapLocation * pLoc = (TMapLocation *) c_pData;
@ -1336,7 +1334,7 @@ void CInputDB::P2P(const char * c_pData)
if (false == DESC_MANAGER::instance().IsP2PDescExist(p->szHost, p->wPort)) if (false == DESC_MANAGER::instance().IsP2PDescExist(p->szHost, p->wPort))
{ {
LPCLIENT_DESC pkDesc = NULL; LPCLIENT_DESC pkDesc = NULL;
sys_log(0, "InputDB:P2P %s:%u", p->szHost, p->wPort); SPDLOG_DEBUG("InputDB:P2P {}:{}", p->szHost, p->wPort);
pkDesc = DESC_MANAGER::instance().CreateConnectionDesc(ev_base, dns_base, p->szHost, p->wPort, PHASE_P2P, false); pkDesc = DESC_MANAGER::instance().CreateConnectionDesc(ev_base, dns_base, p->szHost, p->wPort, PHASE_P2P, false);
mgr.RegisterConnector(pkDesc); mgr.RegisterConnector(pkDesc);
pkDesc->SetP2P(p->wPort, p->bChannel); pkDesc->SetP2P(p->wPort, p->bChannel);
@ -1365,7 +1363,7 @@ void CInputDB::GuildWar(const char* c_pData)
{ {
TPacketGuildWar * p = (TPacketGuildWar*) c_pData; TPacketGuildWar * p = (TPacketGuildWar*) c_pData;
sys_log(0, "InputDB::GuildWar %u %u state %d", p->dwGuildFrom, p->dwGuildTo, p->bWar); SPDLOG_DEBUG("InputDB::GuildWar {} {} state {}", p->dwGuildFrom, p->dwGuildTo, p->bWar);
switch (p->bWar) switch (p->bWar)
{ {
@ -1403,7 +1401,7 @@ void CInputDB::GuildWar(const char* c_pData)
break; break;
default: default:
sys_err("Unknown guild war state"); SPDLOG_ERROR("Unknown guild war state");
break; break;
} }
} }
@ -1423,7 +1421,7 @@ void CInputDB::GuildSkillRecharge()
void CInputDB::GuildExpUpdate(const char* c_pData) void CInputDB::GuildExpUpdate(const char* c_pData)
{ {
TPacketGuildSkillUpdate * p = (TPacketGuildSkillUpdate *) c_pData; TPacketGuildSkillUpdate * p = (TPacketGuildSkillUpdate *) c_pData;
sys_log(1, "GuildExpUpdate %d", p->amount); SPDLOG_DEBUG("GuildExpUpdate {}", p->amount);
CGuild * g = CGuildManager::instance().TouchGuild(p->guild_id); CGuild * g = CGuildManager::instance().TouchGuild(p->guild_id);
@ -1460,7 +1458,7 @@ void CInputDB::GuildChangeGrade(const char* c_pData)
void CInputDB::GuildChangeMemberData(const char* c_pData) void CInputDB::GuildChangeMemberData(const char* c_pData)
{ {
sys_log(0, "Recv GuildChangeMemberData"); SPDLOG_DEBUG("Recv GuildChangeMemberData");
TPacketGuildChangeMemberData * p = (TPacketGuildChangeMemberData *) c_pData; TPacketGuildChangeMemberData * p = (TPacketGuildChangeMemberData *) c_pData;
CGuild * g = CGuildManager::instance().TouchGuild(p->guild_id); CGuild * g = CGuildManager::instance().TouchGuild(p->guild_id);
@ -1477,7 +1475,7 @@ void CInputDB::GuildDisband(const char* c_pData)
void CInputDB::GuildLadder(const char* c_pData) void CInputDB::GuildLadder(const char* c_pData)
{ {
TPacketGuildLadder* p = (TPacketGuildLadder*) c_pData; TPacketGuildLadder* p = (TPacketGuildLadder*) c_pData;
sys_log(0, "Recv GuildLadder %u %d / w %d d %d l %d", p->dwGuild, p->lLadderPoint, p->lWin, p->lDraw, p->lLoss); SPDLOG_DEBUG("Recv GuildLadder {} {} / w {} d {} l {}", p->dwGuild, p->lLadderPoint, p->lWin, p->lDraw, p->lLoss);
CGuild * g = CGuildManager::instance().TouchGuild(p->dwGuild); CGuild * g = CGuildManager::instance().TouchGuild(p->dwGuild);
g->SetLadderPoint(p->lLadderPoint); g->SetLadderPoint(p->lLadderPoint);
@ -1497,7 +1495,7 @@ void CInputDB::ItemLoad(LPDESC d, const char * c_pData)
DWORD dwCount = decode_4bytes(c_pData); DWORD dwCount = decode_4bytes(c_pData);
c_pData += sizeof(DWORD); c_pData += sizeof(DWORD);
sys_log(0, "ITEM_LOAD: COUNT %s %u", ch->GetName(), dwCount); SPDLOG_INFO("ITEM_LOAD: COUNT {} {}", ch->GetName(), dwCount);
std::vector<LPITEM> v; std::vector<LPITEM> v;
@ -1509,7 +1507,7 @@ void CInputDB::ItemLoad(LPDESC d, const char * c_pData)
if (!item) if (!item)
{ {
sys_err("cannot create item by vnum %u (name %s id %u)", p->vnum, ch->GetName(), p->id); SPDLOG_ERROR("cannot create item by vnum {} (name {} id {})", p->vnum, ch->GetName(), p->id);
continue; continue;
} }
@ -1520,7 +1518,7 @@ void CInputDB::ItemLoad(LPDESC d, const char * c_pData)
if ((p->window == INVENTORY && ch->GetInventoryItem(p->pos)) || if ((p->window == INVENTORY && ch->GetInventoryItem(p->pos)) ||
(p->window == EQUIPMENT && ch->GetWear(p->pos))) (p->window == EQUIPMENT && ch->GetWear(p->pos)))
{ {
sys_log(0, "ITEM_RESTORE: %s %s", ch->GetName(), item->GetName()); SPDLOG_INFO("ITEM_RESTORE: {} {}", ch->GetName(), item->GetName());
v.push_back(item); v.push_back(item);
} }
else else
@ -1549,7 +1547,7 @@ void CInputDB::ItemLoad(LPDESC d, const char * c_pData)
} }
if (false == item->OnAfterCreatedItem()) if (false == item->OnAfterCreatedItem())
sys_err("Failed to call ITEM::OnAfterCreatedItem (vnum: %d, id: %d)", item->GetVnum(), item->GetID()); SPDLOG_ERROR("Failed to call ITEM::OnAfterCreatedItem (vnum: {}, id: {})", item->GetVnum(), item->GetID());
item->SetSkipSave(false); item->SetSkipSave(false);
} }
@ -1684,7 +1682,7 @@ void CInputDB::ReloadProto(const char * c_pData)
*/ */
wSize = decode_2bytes(c_pData); wSize = decode_2bytes(c_pData);
c_pData += 2; c_pData += 2;
sys_log(0, "RELOAD: ITEM: %d", wSize); SPDLOG_INFO("RELOAD: ITEM: {}", wSize);
if (wSize) if (wSize)
{ {
@ -1697,7 +1695,7 @@ void CInputDB::ReloadProto(const char * c_pData)
*/ */
wSize = decode_2bytes(c_pData); wSize = decode_2bytes(c_pData);
c_pData += 2; c_pData += 2;
sys_log(0, "RELOAD: MOB: %d", wSize); SPDLOG_INFO("RELOAD: MOB: {}", wSize);
if (wSize) if (wSize)
{ {
@ -1751,7 +1749,7 @@ void CInputDB::AuthLogin(LPDESC d, const char * c_pData)
ptoc.bResult = bResult; ptoc.bResult = bResult;
d->Packet(&ptoc, sizeof(TPacketGCAuthSuccess)); d->Packet(&ptoc, sizeof(TPacketGCAuthSuccess));
sys_log(0, "AuthLogin result %u key %u", bResult, d->GetLoginKey()); SPDLOG_INFO("AuthLogin result {} key {}", bResult, d->GetLoginKey());
} }
void CInputDB::ChangeEmpirePriv(const char* c_pData) void CInputDB::ChangeEmpirePriv(const char* c_pData)
@ -1858,7 +1856,7 @@ void CInputDB::BillingRepair(const char * c_pData)
pkLD->SetLogin(p->szLogin); pkLD->SetLogin(p->szLogin);
pkLD->SetIP(p->szHost); pkLD->SetIP(p->szHost);
sys_log(0, "BILLING: REPAIR %s host %s", p->szLogin, p->szHost); SPDLOG_INFO("BILLING: REPAIR {} host {}", p->szLogin, p->szHost);
} }
} }
@ -1876,7 +1874,7 @@ void CInputDB::BillingExpire(const char * c_pData)
if (p->dwRemainSeconds <= 60) if (p->dwRemainSeconds <= 60)
{ {
int i = std::max<int>(5, p->dwRemainSeconds); int i = std::max<int>(5, p->dwRemainSeconds);
sys_log(0, "BILLING_EXPIRE: %s %u", p->szLogin, p->dwRemainSeconds); SPDLOG_INFO("BILLING_EXPIRE: {} {}", p->szLogin, p->dwRemainSeconds);
d->DelayedDisconnect(i); d->DelayedDisconnect(i);
} }
else else
@ -1919,7 +1917,7 @@ void CInputDB::BillingCheck(const char * c_pData)
DWORD dwKey = *(DWORD *) c_pData; DWORD dwKey = *(DWORD *) c_pData;
c_pData += sizeof(DWORD); c_pData += sizeof(DWORD);
sys_log(0, "BILLING: NOT_LOGIN %u", dwKey); SPDLOG_INFO("BILLING: NOT_LOGIN {}", dwKey);
DBManager::instance().SetBilling(dwKey, 0, true); DBManager::instance().SetBilling(dwKey, 0, true);
} }
} }
@ -1931,7 +1929,7 @@ void CInputDB::Notice(const char * c_pData)
char szBuf[256+1]; char szBuf[256+1];
strlcpy(szBuf, c_pData, sizeof(szBuf)); strlcpy(szBuf, c_pData, sizeof(szBuf));
sys_log(0, "InputDB:: Notice: %s", szBuf); SPDLOG_INFO("InputDB:: Notice: {}", szBuf);
//SendNotice(LC_TEXT(szBuf)); //SendNotice(LC_TEXT(szBuf));
SendNotice(szBuf); SendNotice(szBuf);
@ -1941,12 +1939,12 @@ void CInputDB::VCard(const char * c_pData)
{ {
TPacketGDVCard * p = (TPacketGDVCard *) c_pData; TPacketGDVCard * p = (TPacketGDVCard *) c_pData;
sys_log(0, "VCARD: %u %s %s %s %s", p->dwID, p->szSellCharacter, p->szSellAccount, p->szBuyCharacter, p->szBuyAccount); SPDLOG_DEBUG("VCARD: {} {} {} {} {}", p->dwID, p->szSellCharacter, p->szSellAccount, p->szBuyCharacter, p->szBuyAccount);
std::unique_ptr<SQLMsg> pmsg(DBManager::instance().DirectQuery("SELECT sell_account, buy_account, time FROM vcard WHERE id=%u", p->dwID)); std::unique_ptr<SQLMsg> pmsg(DBManager::instance().DirectQuery("SELECT sell_account, buy_account, time FROM vcard WHERE id=%u", p->dwID));
if (pmsg->Get()->uiNumRows != 1) if (pmsg->Get()->uiNumRows != 1)
{ {
sys_log(0, "VCARD_FAIL: no data"); SPDLOG_ERROR("VCARD_FAIL: no data");
return; return;
} }
@ -1954,13 +1952,13 @@ void CInputDB::VCard(const char * c_pData)
if (strcmp(row[0], p->szSellAccount)) if (strcmp(row[0], p->szSellAccount))
{ {
sys_log(0, "VCARD_FAIL: sell account differ %s", row[0]); SPDLOG_ERROR("VCARD_FAIL: sell account differ {}", row[0]);
return; return;
} }
if (!row[1] || *row[1]) if (!row[1] || *row[1])
{ {
sys_log(0, "VCARD_FAIL: buy account already exist"); SPDLOG_ERROR("VCARD_FAIL: buy account already exist");
return; return;
} }
@ -1969,7 +1967,7 @@ void CInputDB::VCard(const char * c_pData)
if (!row[2] || time < 0) if (!row[2] || time < 0)
{ {
sys_log(0, "VCARD_FAIL: time null"); SPDLOG_ERROR("VCARD_FAIL: time null");
return; return;
} }
@ -1977,7 +1975,7 @@ void CInputDB::VCard(const char * c_pData)
if (pmsg1->Get()->uiAffectedRows == 0 || pmsg1->Get()->uiAffectedRows == (uint32_t)-1) if (pmsg1->Get()->uiAffectedRows == 0 || pmsg1->Get()->uiAffectedRows == (uint32_t)-1)
{ {
sys_log(0, "VCARD_FAIL: cannot modify GameTime table"); SPDLOG_ERROR("VCARD_FAIL: cannot modify GameTime table");
return; return;
} }
@ -1985,11 +1983,11 @@ void CInputDB::VCard(const char * c_pData)
if (pmsg2->Get()->uiAffectedRows == 0 || pmsg2->Get()->uiAffectedRows == (uint32_t)-1) if (pmsg2->Get()->uiAffectedRows == 0 || pmsg2->Get()->uiAffectedRows == (uint32_t)-1)
{ {
sys_log(0, "VCARD_FAIL: cannot modify vcard table"); SPDLOG_ERROR("VCARD_FAIL: cannot modify vcard table");
return; return;
} }
sys_log(0, "VCARD_SUCCESS: %s %s", p->szBuyAccount, p->szBuyCharacter); SPDLOG_DEBUG("VCARD_SUCCESS: {} {}", p->szBuyAccount, p->szBuyCharacter);
} }
void CInputDB::GuildWarReserveAdd(TGuildWarReserve * p) void CInputDB::GuildWarReserveAdd(TGuildWarReserve * p)
@ -2009,19 +2007,19 @@ void CInputDB::GuildWarBet(TPacketGDGuildWarBet * p)
void CInputDB::MarriageAdd(TPacketMarriageAdd * p) void CInputDB::MarriageAdd(TPacketMarriageAdd * p)
{ {
sys_log(0, "MarriageAdd %u %u %u %s %s", p->dwPID1, p->dwPID2, (DWORD)p->tMarryTime, p->szName1, p->szName2); SPDLOG_DEBUG("MarriageAdd {} {} {} {} {}", p->dwPID1, p->dwPID2, (DWORD)p->tMarryTime, p->szName1, p->szName2);
marriage::CManager::instance().Add(p->dwPID1, p->dwPID2, p->tMarryTime, p->szName1, p->szName2); marriage::CManager::instance().Add(p->dwPID1, p->dwPID2, p->tMarryTime, p->szName1, p->szName2);
} }
void CInputDB::MarriageUpdate(TPacketMarriageUpdate * p) void CInputDB::MarriageUpdate(TPacketMarriageUpdate * p)
{ {
sys_log(0, "MarriageUpdate %u %u %d %d", p->dwPID1, p->dwPID2, p->iLovePoint, p->byMarried); SPDLOG_DEBUG("MarriageUpdate {} {} {} {}", p->dwPID1, p->dwPID2, p->iLovePoint, p->byMarried);
marriage::CManager::instance().Update(p->dwPID1, p->dwPID2, p->iLovePoint, p->byMarried); marriage::CManager::instance().Update(p->dwPID1, p->dwPID2, p->iLovePoint, p->byMarried);
} }
void CInputDB::MarriageRemove(TPacketMarriageRemove * p) void CInputDB::MarriageRemove(TPacketMarriageRemove * p)
{ {
sys_log(0, "MarriageRemove %u %u", p->dwPID1, p->dwPID2); SPDLOG_DEBUG("MarriageRemove {} {}", p->dwPID1, p->dwPID2);
marriage::CManager::instance().Remove(p->dwPID1, p->dwPID2); marriage::CManager::instance().Remove(p->dwPID1, p->dwPID2);
} }
@ -2032,19 +2030,19 @@ void CInputDB::WeddingRequest(TPacketWeddingRequest* p)
void CInputDB::WeddingReady(TPacketWeddingReady* p) void CInputDB::WeddingReady(TPacketWeddingReady* p)
{ {
sys_log(0, "WeddingReady %u %u %u", p->dwPID1, p->dwPID2, p->dwMapIndex); SPDLOG_DEBUG("WeddingReady {} {} {}", p->dwPID1, p->dwPID2, p->dwMapIndex);
marriage::CManager::instance().WeddingReady(p->dwPID1, p->dwPID2, p->dwMapIndex); marriage::CManager::instance().WeddingReady(p->dwPID1, p->dwPID2, p->dwMapIndex);
} }
void CInputDB::WeddingStart(TPacketWeddingStart* p) void CInputDB::WeddingStart(TPacketWeddingStart* p)
{ {
sys_log(0, "WeddingStart %u %u", p->dwPID1, p->dwPID2); SPDLOG_DEBUG("WeddingStart {} {}", p->dwPID1, p->dwPID2);
marriage::CManager::instance().WeddingStart(p->dwPID1, p->dwPID2); marriage::CManager::instance().WeddingStart(p->dwPID1, p->dwPID2);
} }
void CInputDB::WeddingEnd(TPacketWeddingEnd* p) void CInputDB::WeddingEnd(TPacketWeddingEnd* p)
{ {
sys_log(0, "WeddingEnd %u %u", p->dwPID1, p->dwPID2); SPDLOG_DEBUG("WeddingEnd {} {}", p->dwPID1, p->dwPID2);
marriage::CManager::instance().WeddingEnd(p->dwPID1, p->dwPID2); marriage::CManager::instance().WeddingEnd(p->dwPID1, p->dwPID2);
} }
@ -2056,8 +2054,8 @@ void CInputDB::MyshopPricelistRes(LPDESC d, const TPacketMyshopPricelistHeader*
if (!d || !(ch = d->GetCharacter()) ) if (!d || !(ch = d->GetCharacter()) )
return; return;
sys_log(0, "RecvMyshopPricelistRes name[%s]", ch->GetName()); SPDLOG_DEBUG("RecvMyshopPricelistRes name[{}]", ch->GetName());
ch->UseSilkBotaryReal(p ); ch->UseSilkBotaryReal(p);
} }
// END_OF_MYSHOP_PRICE_LIST // END_OF_MYSHOP_PRICE_LIST
@ -2150,11 +2148,9 @@ int CInputDB::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
break; break;
case HEADER_DG_PLAYER_LOAD_FAILED: case HEADER_DG_PLAYER_LOAD_FAILED:
//sys_log(0, "PLAYER_LOAD_FAILED");
break; break;
case HEADER_DG_PLAYER_DELETE_FAILED: case HEADER_DG_PLAYER_DELETE_FAILED:
//sys_log(0, "PLAYER_DELETE_FAILED");
PlayerDeleteFail(DESC_MANAGER::instance().FindByHandle(m_dwHandle)); PlayerDeleteFail(DESC_MANAGER::instance().FindByHandle(m_dwHandle));
break; break;
@ -2490,7 +2486,7 @@ bool CInputDB::Process(LPDESC d, const void * orig, int bytes, int & r_iBytesPro
m_dwHandle = *((DWORD *) (c_pData + 1)); // 4 m_dwHandle = *((DWORD *) (c_pData + 1)); // 4
iSize = *((DWORD *) (c_pData + 5)); // 4 iSize = *((DWORD *) (c_pData + 5)); // 4
sys_log(1, "DBCLIENT: header %d handle %d size %d bytes %d", bHeader, m_dwHandle, iSize, bytes); SPDLOG_TRACE("DBCLIENT: header {} handle {} size {} bytes {}", bHeader, m_dwHandle, iSize, bytes);
if (m_iBufferLeft - 9 < iSize) if (m_iBufferLeft - 9 < iSize)
return true; return true;
@ -2499,7 +2495,7 @@ bool CInputDB::Process(LPDESC d, const void * orig, int bytes, int & r_iBytesPro
if (Analyze(d, bHeader, pRealData) < 0) if (Analyze(d, bHeader, pRealData) < 0)
{ {
sys_err("in InputDB: UNKNOWN HEADER: %d, LAST HEADER: %d(%d), REMAIN BYTES: %d", SPDLOG_ERROR("in InputDB: UNKNOWN HEADER: {}, LAST HEADER: {}({}), REMAIN BYTES: {}",
bHeader, bLastHeader, iLastPacketLen, m_iBufferLeft); bHeader, bLastHeader, iLastPacketLen, m_iBufferLeft);
//printdata((BYTE*) orig, bytes); //printdata((BYTE*) orig, bytes);
@ -2589,7 +2585,7 @@ void CInputDB::ChangeMonarchLord(TPacketChangeMonarchLordACK* info)
void CInputDB::UpdateMonarchInfo(TMonarchInfo* info) void CInputDB::UpdateMonarchInfo(TMonarchInfo* info)
{ {
CMonarch::instance().SetMonarchInfo(info); CMonarch::instance().SetMonarchInfo(info);
sys_log(0, "MONARCH INFO UPDATED"); SPDLOG_INFO("MONARCH INFO UPDATED");
} }
void CInputDB::AddBlockCountryIp(TPacketBlockCountryIp * data) void CInputDB::AddBlockCountryIp(TPacketBlockCountryIp * data)

View File

@ -26,7 +26,6 @@
#include "OXEvent.h" #include "OXEvent.h"
#include "priv_manager.h" #include "priv_manager.h"
#include "block_country.h" #include "block_country.h"
#include "dev_log.h"
#include "log.h" #include "log.h"
#include "horsename_manager.h" #include "horsename_manager.h"
#include "MarkManager.h" #include "MarkManager.h"
@ -89,7 +88,7 @@ void CInputLogin::Login(LPDESC d, const char * data)
char login[LOGIN_MAX_LEN + 1]; char login[LOGIN_MAX_LEN + 1];
trim_and_lower(pinfo->login, login, sizeof(login)); trim_and_lower(pinfo->login, login, sizeof(login));
sys_log(0, "InputLogin::Login : %s", login); SPDLOG_DEBUG("InputLogin::Login : {}", login);
TPacketGCLoginFailure failurePacket; TPacketGCLoginFailure failurePacket;
@ -143,16 +142,16 @@ void CInputLogin::LoginByKey(LPDESC d, const char * data)
// is blocked ip? // is blocked ip?
{ {
dev_log(LOG_DEB0, "check_blocked_country_start"); SPDLOG_TRACE("check_blocked_country_start");
if (!is_block_exception(login) && is_blocked_country_ip(d->GetHostName())) if (!is_block_exception(login) && is_blocked_country_ip(d->GetHostName()))
{ {
sys_log(0, "BLOCK_COUNTRY_IP (%s)", d->GetHostName()); SPDLOG_DEBUG("BLOCK_COUNTRY_IP ({})", d->GetHostName());
d->SetPhase(PHASE_CLOSE); d->SetPhase(PHASE_CLOSE);
return; return;
} }
dev_log(LOG_DEB0, "check_blocked_country_end"); SPDLOG_TRACE("check_blocked_country_end");
} }
if (g_bNoMoreClient) if (g_bNoMoreClient)
@ -185,7 +184,7 @@ void CInputLogin::LoginByKey(LPDESC d, const char * data)
} }
} }
sys_log(0, "LOGIN_BY_KEY: %s key %u", login, pinfo->dwLoginKey); SPDLOG_DEBUG("LOGIN_BY_KEY: {} key {}", login, pinfo->dwLoginKey);
d->SetLoginKey(pinfo->dwLoginKey); d->SetLoginKey(pinfo->dwLoginKey);
@ -206,7 +205,7 @@ void CInputLogin::ChangeName(LPDESC d, const char * data)
if (!c_r.id) if (!c_r.id)
{ {
sys_err("no account table"); SPDLOG_ERROR("no account table");
return; return;
} }
@ -234,23 +233,23 @@ void CInputLogin::CharacterSelect(LPDESC d, const char * data)
struct command_player_select * pinfo = (struct command_player_select *) data; struct command_player_select * pinfo = (struct command_player_select *) data;
const TAccountTable & c_r = d->GetAccountTable(); const TAccountTable & c_r = d->GetAccountTable();
sys_log(0, "player_select: login: %s index: %d", c_r.login, pinfo->index); SPDLOG_DEBUG("player_select: login: {} index: {}", c_r.login, pinfo->index);
if (!c_r.id) if (!c_r.id)
{ {
sys_err("no account table"); SPDLOG_ERROR("no account table");
return; return;
} }
if (pinfo->index >= PLAYER_PER_ACCOUNT) if (pinfo->index >= PLAYER_PER_ACCOUNT)
{ {
sys_err("index overflow %d, login: %s", pinfo->index, c_r.login); SPDLOG_ERROR("index overflow {}, login: {}", pinfo->index, c_r.login);
return; return;
} }
if (c_r.players[pinfo->index].bChangeName) if (c_r.players[pinfo->index].bChangeName)
{ {
sys_err("name must be changed idx %d, login %s, name %s", SPDLOG_ERROR("name must be changed idx {}, login {}, name {}",
pinfo->index, c_r.login, c_r.players[pinfo->index].szName); pinfo->index, c_r.login, c_r.players[pinfo->index].szName);
return; return;
} }
@ -379,7 +378,7 @@ bool NewPlayerTable2(TPlayerTable * table, const char * name, BYTE race, BYTE sh
{ {
if (race >= MAIN_RACE_MAX_NUM) if (race >= MAIN_RACE_MAX_NUM)
{ {
sys_err("NewPlayerTable2.OUT_OF_RACE_RANGE(%d >= max(%d))\n", race, MAIN_RACE_MAX_NUM); SPDLOG_ERROR("NewPlayerTable2.OUT_OF_RACE_RANGE({} >= max({}))", race, (int) MAIN_RACE_MAX_NUM);
return false; return false;
} }
@ -387,11 +386,11 @@ bool NewPlayerTable2(TPlayerTable * table, const char * name, BYTE race, BYTE sh
if (!RaceToJob(race, &job)) if (!RaceToJob(race, &job))
{ {
sys_err("NewPlayerTable2.RACE_TO_JOB_ERROR(%d)\n", race); SPDLOG_ERROR("NewPlayerTable2.RACE_TO_JOB_ERROR({})", race);
return false; return false;
} }
sys_log(0, "NewPlayerTable2(name=%s, race=%d, job=%d)", name, race, job); SPDLOG_DEBUG("NewPlayerTable2(name={}, race={}, job={})", name, race, job);
memset(table, 0, sizeof(TPlayerTable)); memset(table, 0, sizeof(TPlayerTable));
@ -428,7 +427,7 @@ void CInputLogin::CharacterCreate(LPDESC d, const char * data)
struct command_player_create * pinfo = (struct command_player_create *) data; struct command_player_create * pinfo = (struct command_player_create *) data;
TPlayerCreatePacket player_create_packet; TPlayerCreatePacket player_create_packet;
sys_log(0, "PlayerCreate: name %s pos %d job %d shape %d", SPDLOG_DEBUG("PlayerCreate: name {} pos {} job {} shape {}",
pinfo->name, pinfo->name,
pinfo->index, pinfo->index,
pinfo->job, pinfo->job,
@ -480,7 +479,7 @@ void CInputLogin::CharacterCreate(LPDESC d, const char * data)
if (!NewPlayerTable2(&player_create_packet.player_table, pinfo->name, pinfo->job, pinfo->shape, d->GetEmpire())) if (!NewPlayerTable2(&player_create_packet.player_table, pinfo->name, pinfo->job, pinfo->shape, d->GetEmpire()))
{ {
sys_err("player_prototype error: job %d face %d ", pinfo->job); SPDLOG_ERROR("player_prototype error: job {} face {} ", pinfo->job);
d->Packet(&packFailure, sizeof(packFailure)); d->Packet(&packFailure, sizeof(packFailure));
return; return;
} }
@ -493,7 +492,7 @@ void CInputLogin::CharacterCreate(LPDESC d, const char * data)
player_create_packet.account_id = c_rAccountTable.id; player_create_packet.account_id = c_rAccountTable.id;
player_create_packet.account_index = pinfo->index; player_create_packet.account_index = pinfo->index;
sys_log(0, "PlayerCreate: name %s account_id %d, TPlayerCreatePacketSize(%d), Packet->Gold %d", SPDLOG_DEBUG("PlayerCreate: name {} account_id {}, TPlayerCreatePacketSize({}), Packet->Gold {}",
pinfo->name, pinfo->name,
pinfo->index, pinfo->index,
sizeof(TPlayerCreatePacket), sizeof(TPlayerCreatePacket),
@ -509,21 +508,21 @@ void CInputLogin::CharacterDelete(LPDESC d, const char * data)
if (!c_rAccountTable.id) if (!c_rAccountTable.id)
{ {
sys_err("PlayerDelete: no login data"); SPDLOG_ERROR("PlayerDelete: no login data");
return; return;
} }
sys_log(0, "PlayerDelete: login: %s index: %d, social_id %s", c_rAccountTable.login, pinfo->index, pinfo->private_code); SPDLOG_DEBUG("PlayerDelete: login: {} index: {}, social_id {}", c_rAccountTable.login, pinfo->index, pinfo->private_code);
if (pinfo->index >= PLAYER_PER_ACCOUNT) if (pinfo->index >= PLAYER_PER_ACCOUNT)
{ {
sys_err("PlayerDelete: index overflow %d, login: %s", pinfo->index, c_rAccountTable.login); SPDLOG_ERROR("PlayerDelete: index overflow {}, login: {}", pinfo->index, c_rAccountTable.login);
return; return;
} }
if (!c_rAccountTable.players[pinfo->index].dwID) if (!c_rAccountTable.players[pinfo->index].dwID)
{ {
sys_err("PlayerDelete: Wrong Social ID index %d, login: %s", pinfo->index, c_rAccountTable.login); SPDLOG_ERROR("PlayerDelete: Wrong Social ID index {}, login: {}", pinfo->index, c_rAccountTable.login);
d->Packet(encode_byte(HEADER_GC_CHARACTER_DELETE_WRONG_SOCIAL_ID), 1); d->Packet(encode_byte(HEADER_GC_CHARACTER_DELETE_WRONG_SOCIAL_ID), 1);
return; return;
} }
@ -564,7 +563,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
PIXEL_POSITION pos2; PIXEL_POSITION pos2;
SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos2); SECTREE_MANAGER::instance().GetRecallPositionByEmpire(ch->GetMapIndex(), ch->GetEmpire(), pos2);
sys_err("!GetMovablePosition (name %s %dx%d map %d changed to %dx%d)", SPDLOG_ERROR("!GetMovablePosition (name {} {}x{} map {} changed to {}x{})",
ch->GetName(), ch->GetName(),
pos.x, pos.y, pos.x, pos.y,
ch->GetMapIndex(), ch->GetMapIndex(),
@ -585,7 +584,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
if(ch->GetItemAward_cmd()) //게임페이즈 들어가면 if(ch->GetItemAward_cmd()) //게임페이즈 들어가면
quest::CQuestManager::instance().ItemInformer(ch->GetPlayerID(),ch->GetItemAward_vnum()); //questmanager 호출 quest::CQuestManager::instance().ItemInformer(ch->GetPlayerID(),ch->GetItemAward_vnum()); //questmanager 호출
sys_log(0, "ENTERGAME: %s %dx%dx%d %s map_index %d", SPDLOG_DEBUG("ENTERGAME: {} {}x{}x{} {} map_index {}",
ch->GetName(), ch->GetX(), ch->GetY(), ch->GetZ(), d->GetHostName(), ch->GetMapIndex()); ch->GetName(), ch->GetX(), ch->GetY(), ch->GetZ(), d->GetHostName(), ch->GetMapIndex());
if (ch->GetHorseLevel() > 0) if (ch->GetHorseLevel() > 0)
@ -635,7 +634,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
continue; continue;
ch->AddAffect(AFFECT_PREMIUM_START + i, POINT_NONE, 0, 0, remain, 0, true); ch->AddAffect(AFFECT_PREMIUM_START + i, POINT_NONE, 0, 0, remain, 0, true);
sys_log(0, "PREMIUM: %s type %d %dmin", ch->GetName(), i, remain); SPDLOG_DEBUG("PREMIUM: {} type {} {}min", ch->GetName(), i, remain);
} }
if (LC_IsEurope()) if (LC_IsEurope())
@ -645,7 +644,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
int version = atoi(g_stClientVersion.c_str()); int version = atoi(g_stClientVersion.c_str());
int date = atoi(d->GetClientVersion()); int date = atoi(d->GetClientVersion());
sys_log(0, "VERSION CHECK %d %d %s %s", version, date, g_stClientVersion.c_str(), d->GetClientVersion()); SPDLOG_DEBUG("VERSION CHECK {} {} {} {}", version, date, g_stClientVersion.c_str(), d->GetClientVersion());
if (!d->GetClientVersion()) if (!d->GetClientVersion())
{ {
@ -660,7 +659,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
d->DelayedDisconnect(10); d->DelayedDisconnect(10);
LogManager::instance().HackLog("VERSION_CONFLICT", ch); LogManager::instance().HackLog("VERSION_CONFLICT", ch);
sys_log(0, "VERSION : WRONG VERSION USER : account:%s name:%s hostName:%s server_version:%s client_version:%s", SPDLOG_WARN("VERSION : WRONG VERSION USER : account:{} name:{} hostName:{} server_version:{} client_version:{}",
d->GetAccountTable().login, d->GetAccountTable().login,
ch->GetName(), ch->GetName(),
d->GetHostName(), d->GetHostName(),
@ -671,12 +670,12 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
} }
else else
{ {
sys_log(0, "VERSION : NO CHECK"); SPDLOG_WARN("VERSION : NO CHECK");
} }
} }
else else
{ {
sys_log(0, "VERSION : NO LOGIN"); SPDLOG_WARN("VERSION : NO LOGIN");
} }
if (LC_IsEurope() == true) if (LC_IsEurope() == true)
@ -704,7 +703,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
ch->SetArenaObserverMode(true); ch->SetArenaObserverMode(true);
if (CArenaManager::instance().RegisterObserverPtr(ch, ch->GetMapIndex(), ch->GetX()/100, ch->GetY()/100)) if (CArenaManager::instance().RegisterObserverPtr(ch, ch->GetMapIndex(), ch->GetX()/100, ch->GetY()/100))
{ {
sys_log(0, "ARENA : Observer add failed"); SPDLOG_ERROR("ARENA : Observer add failed");
} }
if (ch->IsHorseRiding() == true) if (ch->IsHorseRiding() == true)
@ -780,7 +779,7 @@ void CInputLogin::Entergame(LPDESC d, const char * data)
p.id = d->GetAccountTable().id; p.id = d->GetAccountTable().id;
g_TeenDesc->Packet(&p, sizeof(p)); g_TeenDesc->Packet(&p, sizeof(p));
sys_log(0, "TEEN_SEND: (%u, %s)", d->GetAccountTable().id, ch->GetName()); SPDLOG_DEBUG("TEEN_SEND: ({}, {})", d->GetAccountTable().id, ch->GetName());
} }
if (ch->GetHorseLevel() > 0) if (ch->GetHorseLevel() > 0)
@ -821,7 +820,7 @@ void CInputLogin::Empire(LPDESC d, const char * c_pData)
{ {
if (0 != r.players[i].dwID) if (0 != r.players[i].dwID)
{ {
sys_err("EmpireSelectFailed %d", r.players[i].dwID); SPDLOG_ERROR("EmpireSelectFailed {}", r.players[i].dwID);
return; return;
} }
} }
@ -840,7 +839,7 @@ int CInputLogin::GuildSymbolUpload(LPDESC d, const char* c_pData, size_t uiBytes
if (uiBytes < sizeof(TPacketCGGuildSymbolUpload)) if (uiBytes < sizeof(TPacketCGGuildSymbolUpload))
return -1; return -1;
sys_log(0, "GuildSymbolUpload uiBytes %u", uiBytes); SPDLOG_DEBUG("GuildSymbolUpload uiBytes {}", uiBytes);
TPacketCGGuildSymbolUpload* p = (TPacketCGGuildSymbolUpload*) c_pData; TPacketCGGuildSymbolUpload* p = (TPacketCGGuildSymbolUpload*) c_pData;
@ -865,7 +864,7 @@ int CInputLogin::GuildSymbolUpload(LPDESC d, const char* c_pData, size_t uiBytes
return 0; return 0;
} }
sys_log(0, "GuildSymbolUpload Do Upload %02X%02X%02X%02X %d", c_pData[7], c_pData[8], c_pData[9], c_pData[10], sizeof(*p)); SPDLOG_DEBUG("GuildSymbolUpload Do Upload {:02X}{:02X}{:02X}{:02X} {}", c_pData[7], c_pData[8], c_pData[9], c_pData[10], sizeof(*p));
CGuildMarkManager::instance().UploadSymbol(p->guild_id, iSymbolSize, (const BYTE*)(c_pData + sizeof(*p))); CGuildMarkManager::instance().UploadSymbol(p->guild_id, iSymbolSize, (const BYTE*)(c_pData + sizeof(*p)));
CGuildMarkManager::instance().SaveSymbol(GUILD_SYMBOL_FILENAME); CGuildMarkManager::instance().SaveSymbol(GUILD_SYMBOL_FILENAME);
@ -876,14 +875,14 @@ void CInputLogin::GuildSymbolCRC(LPDESC d, const char* c_pData)
{ {
const TPacketCGSymbolCRC & CGPacket = *((TPacketCGSymbolCRC *) c_pData); const TPacketCGSymbolCRC & CGPacket = *((TPacketCGSymbolCRC *) c_pData);
sys_log(0, "GuildSymbolCRC %u %u %u", CGPacket.guild_id, CGPacket.crc, CGPacket.size); SPDLOG_DEBUG("GuildSymbolCRC {} {} {}", CGPacket.guild_id, CGPacket.crc, CGPacket.size);
const CGuildMarkManager::TGuildSymbol * pkGS = CGuildMarkManager::instance().GetGuildSymbol(CGPacket.guild_id); const CGuildMarkManager::TGuildSymbol * pkGS = CGuildMarkManager::instance().GetGuildSymbol(CGPacket.guild_id);
if (!pkGS) if (!pkGS)
return; return;
sys_log(0, " Server %u %u", pkGS->crc, pkGS->raw.size()); SPDLOG_DEBUG(" Server {} {}", pkGS->crc, pkGS->raw.size());
if (pkGS->raw.size() != CGPacket.size || pkGS->crc != CGPacket.crc) if (pkGS->raw.size() != CGPacket.size || pkGS->crc != CGPacket.crc)
{ {
@ -896,7 +895,7 @@ void CInputLogin::GuildSymbolCRC(LPDESC d, const char* c_pData)
d->RawPacket(&GCPacket, sizeof(GCPacket)); d->RawPacket(&GCPacket, sizeof(GCPacket));
d->Packet(&pkGS->raw[0], pkGS->raw.size()); d->Packet(&pkGS->raw[0], pkGS->raw.size());
sys_log(0, "SendGuildSymbolHead %02X%02X%02X%02X Size %d", SPDLOG_DEBUG("SendGuildSymbolHead {:02X}{:02X}{:02X}{:02X} Size {}",
pkGS->raw[0], pkGS->raw[1], pkGS->raw[2], pkGS->raw[3], pkGS->raw.size()); pkGS->raw[0], pkGS->raw[1], pkGS->raw[2], pkGS->raw[3], pkGS->raw.size());
} }
} }
@ -909,19 +908,19 @@ void CInputLogin::GuildMarkUpload(LPDESC d, const char* c_pData)
if (!(pkGuild = rkGuildMgr.FindGuild(p->gid))) if (!(pkGuild = rkGuildMgr.FindGuild(p->gid)))
{ {
sys_err("MARK_SERVER: GuildMarkUpload: no guild. gid %u", p->gid); SPDLOG_ERROR("MARK_SERVER: GuildMarkUpload: no guild. gid {}", p->gid);
return; return;
} }
if (pkGuild->GetLevel() < guild_mark_min_level) if (pkGuild->GetLevel() < guild_mark_min_level)
{ {
sys_log(0, "MARK_SERVER: GuildMarkUpload: level < %u (%u)", guild_mark_min_level, pkGuild->GetLevel()); SPDLOG_DEBUG("MARK_SERVER: GuildMarkUpload: level < {} ({})", guild_mark_min_level, pkGuild->GetLevel());
return; return;
} }
CGuildMarkManager & rkMarkMgr = CGuildMarkManager::instance(); CGuildMarkManager & rkMarkMgr = CGuildMarkManager::instance();
sys_log(0, "MARK_SERVER: GuildMarkUpload: gid %u", p->gid); SPDLOG_DEBUG("MARK_SERVER: GuildMarkUpload: gid {}", p->gid);
bool isEmpty = true; bool isEmpty = true;
@ -962,7 +961,7 @@ void CInputLogin::GuildMarkIDXList(LPDESC d, const char* c_pData)
else else
d->Packet(&p, sizeof(p)); d->Packet(&p, sizeof(p));
sys_log(0, "MARK_SERVER: GuildMarkIDXList %d bytes sent.", p.bufSize); SPDLOG_DEBUG("MARK_SERVER: GuildMarkIDXList {} bytes sent.", p.bufSize);
} }
void CInputLogin::GuildMarkCRCList(LPDESC d, const char* c_pData) void CInputLogin::GuildMarkCRCList(LPDESC d, const char* c_pData)
@ -994,7 +993,7 @@ void CInputLogin::GuildMarkCRCList(LPDESC d, const char* c_pData)
pGC.bufSize = buf.size() + sizeof(TPacketGCMarkBlock); pGC.bufSize = buf.size() + sizeof(TPacketGCMarkBlock);
pGC.count = blockCount; pGC.count = blockCount;
sys_log(0, "MARK_SERVER: Sending blocks. (imgIdx %u diff %u size %u)", pCG->imgIdx, mapDiffBlocks.size(), pGC.bufSize); SPDLOG_DEBUG("MARK_SERVER: Sending blocks. (imgIdx {} diff {} size {})", pCG->imgIdx, mapDiffBlocks.size(), pGC.bufSize);
if (buf.size() > 0) if (buf.size() > 0)
{ {
@ -1091,7 +1090,7 @@ int CInputLogin::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
break; break;
default: default:
sys_err("login phase does not handle this packet! header %d", bHeader); SPDLOG_ERROR("login phase does not handle this packet! header {}", bHeader);
//d->SetPhase(PHASE_CLOSE); //d->SetPhase(PHASE_CLOSE);
return (0); return (0);
} }

View File

@ -95,7 +95,7 @@ EVENTFUNC(block_chat_by_ip_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "block_chat_by_ip_event> <Factor> Null pointer" ); SPDLOG_ERROR("block_chat_by_ip_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -138,7 +138,7 @@ bool SpamBlockCheck(LPCHARACTER ch, const char* const buf, const size_t buflen)
it->second.first += score; it->second.first += score;
if (word) if (word)
sys_log(0, "SPAM_SCORE: %s text: %s score: %u total: %u word: %s", ch->GetName(), buf, score, it->second.first, word); SPDLOG_DEBUG("SPAM_SCORE: {} text: {} score: {} total: {} word: {}", ch->GetName(), buf, score, it->second.first, word);
extern unsigned int g_uiSpamBlockScore; extern unsigned int g_uiSpamBlockScore;
extern unsigned int g_uiSpamBlockDuration; extern unsigned int g_uiSpamBlockDuration;
@ -149,7 +149,7 @@ bool SpamBlockCheck(LPCHARACTER ch, const char* const buf, const size_t buflen)
strlcpy(info->host, ch->GetDesc()->GetHostName(), sizeof(info->host)); strlcpy(info->host, ch->GetDesc()->GetHostName(), sizeof(info->host));
it->second.second = event_create(block_chat_by_ip_event, info, PASSES_PER_SEC(g_uiSpamBlockDuration)); it->second.second = event_create(block_chat_by_ip_event, info, PASSES_PER_SEC(g_uiSpamBlockDuration));
sys_log(0, "SPAM_IP: %s for %u seconds", info->host, g_uiSpamBlockDuration); SPDLOG_DEBUG("SPAM_IP: {} for {} seconds", info->host, g_uiSpamBlockDuration);
LogManager::instance().CharLog(ch, 0, "SPAM", word); LogManager::instance().CharLog(ch, 0, "SPAM", word);
@ -288,7 +288,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
if (iExtraLen < 0) if (iExtraLen < 0)
{ {
sys_err("invalid packet length (len %d size %u buffer %u)", iExtraLen, pinfo->wSize, uiBytes); SPDLOG_ERROR("invalid packet length (len {} size {} buffer {})", iExtraLen, pinfo->wSize, uiBytes);
ch->GetDesc()->SetPhase(PHASE_CLOSE); ch->GetDesc()->SetPhase(PHASE_CLOSE);
return -1; return -1;
} }
@ -311,9 +311,9 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
if (test_server) if (test_server)
{ {
if (!pkChr) if (!pkChr)
sys_log(0, "Whisper to %s(%s) from %s", "Null", pinfo->szNameTo, ch->GetName()); SPDLOG_DEBUG("Whisper to {}({}) from {}", "Null", pinfo->szNameTo, ch->GetName());
else else
sys_log(0, "Whisper to %s(%s) from %s", pkChr->GetName(), pinfo->szNameTo, ch->GetName()); SPDLOG_DEBUG("Whisper to {}({}) from {}", pkChr->GetName(), pinfo->szNameTo, ch->GetName());
} }
if (ch->IsBlockMode(BLOCK_WHISPER)) if (ch->IsBlockMode(BLOCK_WHISPER))
@ -340,8 +340,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
pkDesc->SetRelay(pinfo->szNameTo); pkDesc->SetRelay(pinfo->szNameTo);
bOpponentEmpire = pkCCI->bEmpire; bOpponentEmpire = pkCCI->bEmpire;
if (test_server) SPDLOG_TRACE("Whisper to {} from {} (Channel {} Mapindex {})", "Null", ch->GetName(), pkCCI->bChannel, pkCCI->lMapIndex);
sys_log(0, "Whisper to %s from %s (Channel %d Mapindex %d)", "Null", ch->GetName(), pkCCI->bChannel, pkCCI->lMapIndex);
} }
} }
else else
@ -361,7 +360,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
pack.wSize = sizeof(TPacketGCWhisper); pack.wSize = sizeof(TPacketGCWhisper);
strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom)); strlcpy(pack.szNameFrom, pinfo->szNameTo, sizeof(pack.szNameFrom));
ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper)); ch->GetDesc()->Packet(&pack, sizeof(TPacketGCWhisper));
sys_log(0, "WHISPER: no player"); SPDLOG_DEBUG("WHISPER: no player");
} }
} }
else else
@ -467,7 +466,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
ch->GetDesc()->RawPacket(&pack, sizeof(pack)); ch->GetDesc()->RawPacket(&pack, sizeof(pack));
ch->GetDesc()->Packet(buf, len); ch->GetDesc()->Packet(buf, len);
sys_log(0, "WHISPER: not enough %s: char: %s", pTable->szLocaleName, ch->GetName()); SPDLOG_DEBUG("WHISPER: not enough {}: char: {}", pTable->szLocaleName, ch->GetName());
} }
} }
@ -499,7 +498,7 @@ int CInputMain::Whisper(LPCHARACTER ch, const char * data, size_t uiBytes)
if (LC_IsEurope() != true) if (LC_IsEurope() != true)
{ {
sys_log(0, "WHISPER: %s -> %s : %s", ch->GetName(), pinfo->szNameTo, buf); SPDLOG_DEBUG("WHISPER: {} -> {} : {}", ch->GetName(), pinfo->szNameTo, buf);
} }
} }
} }
@ -648,7 +647,7 @@ int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
if (iExtraLen < 0) if (iExtraLen < 0)
{ {
sys_err("invalid packet length (len %d size %u buffer %u)", iExtraLen, pinfo->size, uiBytes); SPDLOG_ERROR("invalid packet length (len {} size {} buffer {})", iExtraLen, pinfo->size, uiBytes);
ch->GetDesc()->SetPhase(PHASE_CLOSE); ch->GetDesc()->SetPhase(PHASE_CLOSE);
return -1; return -1;
} }
@ -667,7 +666,7 @@ int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
{ {
if (ch->GetChatCounter() == 10) if (ch->GetChatCounter() == 10)
{ {
sys_log(0, "CHAT_HACK: %s", ch->GetName()); SPDLOG_WARN("CHAT_HACK: {}", ch->GetName());
ch->GetDesc()->DelayedDisconnect(5); ch->GetDesc()->DelayedDisconnect(5);
} }
@ -814,7 +813,7 @@ int CInputMain::Chat(LPCHARACTER ch, const char * data, size_t uiBytes)
break; break;
default: default:
sys_err("Unknown chat type %d", pinfo->type); SPDLOG_ERROR("Unknown chat type {}", pinfo->type);
break; break;
} }
@ -1003,7 +1002,7 @@ int CInputMain::Messenger(LPCHARACTER ch, const char* c_pData, size_t uiBytes)
return CHARACTER_NAME_MAX_LEN; return CHARACTER_NAME_MAX_LEN;
default: default:
sys_err("CInputMain::Messenger : Unknown subheader %d : %s", p->subheader, ch->GetName()); SPDLOG_ERROR("CInputMain::Messenger : Unknown subheader {} : {}", p->subheader, ch->GetName());
break; break;
} }
@ -1017,8 +1016,7 @@ int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
if (uiBytes < sizeof(TPacketCGShop)) if (uiBytes < sizeof(TPacketCGShop))
return -1; return -1;
if (test_server) SPDLOG_TRACE("CInputMain::Shop() ==> SubHeader {}", p->subheader);
sys_log(0, "CInputMain::Shop() ==> SubHeader %d", p->subheader);
const char * c_pData = data + sizeof(TPacketCGShop); const char * c_pData = data + sizeof(TPacketCGShop);
uiBytes -= sizeof(TPacketCGShop); uiBytes -= sizeof(TPacketCGShop);
@ -1026,7 +1024,7 @@ int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
switch (p->subheader) switch (p->subheader)
{ {
case SHOP_SUBHEADER_CG_END: case SHOP_SUBHEADER_CG_END:
sys_log(1, "INPUT: %s SHOP: END", ch->GetName()); SPDLOG_DEBUG("INPUT: {} SHOP: END", ch->GetName());
CShopManager::instance().StopShopping(ch); CShopManager::instance().StopShopping(ch);
return 0; return 0;
@ -1036,7 +1034,7 @@ int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
return -1; return -1;
BYTE bPos = *(c_pData + 1); BYTE bPos = *(c_pData + 1);
sys_log(1, "INPUT: %s SHOP: BUY %d", ch->GetName(), bPos); SPDLOG_DEBUG("INPUT: {} SHOP: BUY {}", ch->GetName(), bPos);
CShopManager::instance().Buy(ch, bPos); CShopManager::instance().Buy(ch, bPos);
return (sizeof(BYTE) + sizeof(BYTE)); return (sizeof(BYTE) + sizeof(BYTE));
} }
@ -1048,7 +1046,7 @@ int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
BYTE pos = *c_pData; BYTE pos = *c_pData;
sys_log(0, "INPUT: %s SHOP: SELL", ch->GetName()); SPDLOG_DEBUG("INPUT: {} SHOP: SELL", ch->GetName());
CShopManager::instance().Sell(ch, pos); CShopManager::instance().Sell(ch, pos);
return sizeof(BYTE); return sizeof(BYTE);
} }
@ -1061,13 +1059,13 @@ int CInputMain::Shop(LPCHARACTER ch, const char * data, size_t uiBytes)
BYTE pos = *(c_pData++); BYTE pos = *(c_pData++);
BYTE count = *(c_pData); BYTE count = *(c_pData);
sys_log(0, "INPUT: %s SHOP: SELL2", ch->GetName()); SPDLOG_DEBUG("INPUT: {} SHOP: SELL2", ch->GetName());
CShopManager::instance().Sell(ch, pos, count); CShopManager::instance().Sell(ch, pos, count);
return sizeof(BYTE) + sizeof(BYTE); return sizeof(BYTE) + sizeof(BYTE);
} }
default: default:
sys_err("CInputMain::Shop : Unknown subheader %d : %s", p->subheader, ch->GetName()); SPDLOG_ERROR("CInputMain::Shop : Unknown subheader {} : {}", p->subheader, ch->GetName());
break; break;
} }
@ -1081,10 +1079,8 @@ void CInputMain::OnClick(LPCHARACTER ch, const char * data)
if ((victim = CHARACTER_MANAGER::instance().Find(pinfo->vid))) if ((victim = CHARACTER_MANAGER::instance().Find(pinfo->vid)))
victim->OnClick(ch); victim->OnClick(ch);
else if (test_server) else
{ SPDLOG_TRACE("CInputMain::OnClick {}.Click.NOT_EXIST_VID[{}]", ch->GetName(), pinfo->vid);
sys_err("CInputMain::OnClick %s.Click.NOT_EXIST_VID[%d]", ch->GetName(), pinfo->vid);
}
} }
void CInputMain::Exchange(LPCHARACTER ch, const char * data) void CInputMain::Exchange(LPCHARACTER ch, const char * data)
@ -1111,7 +1107,7 @@ void CInputMain::Exchange(LPCHARACTER ch, const char * data)
} }
} }
sys_log(0, "CInputMain()::Exchange() SubHeader %d ", pinfo->sub_header); SPDLOG_DEBUG("CInputMain()::Exchange() SubHeader {} ", pinfo->sub_header);
if (iPulse - ch->GetSafeboxLoadTime() < PASSES_PER_SEC(g_nPortalLimitTime)) if (iPulse - ch->GetSafeboxLoadTime() < PASSES_PER_SEC(g_nPortalLimitTime))
{ {
@ -1159,7 +1155,7 @@ void CInputMain::Exchange(LPCHARACTER ch, const char * data)
{ {
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("액수가 20억 냥을 초과하여 거래를 할수가 없습니다..")); ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("액수가 20억 냥을 초과하여 거래를 할수가 없습니다.."));
sys_err("[OVERFLOG_GOLD] START (%u) id %u name %s ", ch->GetGold(), ch->GetPlayerID(), ch->GetName()); SPDLOG_ERROR("[OVERFLOG_GOLD] START ({}) id {} name {} ", ch->GetGold(), ch->GetPlayerID(), ch->GetName());
return; return;
} }
@ -1167,7 +1163,7 @@ void CInputMain::Exchange(LPCHARACTER ch, const char * data)
{ {
if (quest::CQuestManager::instance().GiveItemToPC(ch->GetPlayerID(), to_ch)) if (quest::CQuestManager::instance().GiveItemToPC(ch->GetPlayerID(), to_ch))
{ {
sys_log(0, "Exchange canceled by quest %s %s", ch->GetName(), to_ch->GetName()); SPDLOG_DEBUG("Exchange canceled by quest {} {}", ch->GetName(), to_ch->GetName());
return; return;
} }
} }
@ -1209,7 +1205,7 @@ void CInputMain::Exchange(LPCHARACTER ch, const char * data)
{ {
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방의 총금액이 20억 냥을 초과하여 거래를 할수가 없습니다..")); ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("상대방의 총금액이 20억 냥을 초과하여 거래를 할수가 없습니다.."));
sys_err("[OVERFLOW_GOLD] ELK_ADD (%u) id %u name %s ", SPDLOG_ERROR("[OVERFLOW_GOLD] ELK_ADD ({}) id {} name {} ",
ch->GetExchange()->GetCompany()->GetOwner()->GetGold(), ch->GetExchange()->GetCompany()->GetOwner()->GetGold(),
ch->GetExchange()->GetCompany()->GetOwner()->GetPlayerID(), ch->GetExchange()->GetCompany()->GetOwner()->GetPlayerID(),
ch->GetExchange()->GetCompany()->GetOwner()->GetName()); ch->GetExchange()->GetCompany()->GetOwner()->GetName());
@ -1225,7 +1221,7 @@ void CInputMain::Exchange(LPCHARACTER ch, const char * data)
case EXCHANGE_SUBHEADER_CG_ACCEPT: // arg1 == not used case EXCHANGE_SUBHEADER_CG_ACCEPT: // arg1 == not used
if (ch->GetExchange()) if (ch->GetExchange())
{ {
sys_log(0, "CInputMain()::Exchange() ==> ACCEPT "); SPDLOG_DEBUG("CInputMain()::Exchange() ==> ACCEPT ");
ch->GetExchange()->Accept(true); ch->GetExchange()->Accept(true);
} }
@ -1276,7 +1272,7 @@ DWORD ClacValidComboInterval( LPCHARACTER ch, BYTE bArg )
if( !ch ) if( !ch )
{ {
sys_err( "ClacValidComboInterval() ch is NULL"); SPDLOG_ERROR("ClacValidComboInterval() ch is NULL");
return nInterval; return nInterval;
} }
@ -1295,7 +1291,7 @@ DWORD ClacValidComboInterval( LPCHARACTER ch, BYTE bArg )
} }
else else
{ {
sys_err( "ClacValidComboInterval() Invalid bArg(%d) ch(%s)", bArg, ch->GetName() ); SPDLOG_ERROR("ClacValidComboInterval() Invalid bArg({}) ch({})", bArg, ch->GetName() );
} }
return nInterval; return nInterval;
@ -1316,7 +1312,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
int HackScalar = 0; // 기본 스칼라 단위 1 int HackScalar = 0; // 기본 스칼라 단위 1
// [2013 09 11 CYH] debugging log // [2013 09 11 CYH] debugging log
/*sys_log(0, "COMBO_TEST_LOG: %s arg:%u interval:%d valid:%u atkspd:%u riding:%s", /*SPDLOG_DEBUG("COMBO_TEST_LOG: {} arg:{} interval:{} valid:{} atkspd:{} riding:{}",
ch->GetName(), ch->GetName(),
bArg, bArg,
ComboInterval, ComboInterval,
@ -1325,7 +1321,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
ch->IsRiding() ? "yes" : "no");*/ ch->IsRiding() ? "yes" : "no");*/
#if 0 #if 0
sys_log(0, "COMBO: %s arg:%u seq:%u delta:%d checkspeedhack:%d", SPDLOG_DEBUG("COMBO: {} arg:{} seq:{} delta:{} checkspeedhack:{}",
ch->GetName(), bArg, ch->GetComboSequence(), ComboInterval - ch->GetValidComboInterval(), CheckSpeedHack); ch->GetName(), bArg, ch->GetComboSequence(), ComboInterval - ch->GetValidComboInterval(), CheckSpeedHack);
#endif #endif
// bArg 14 ~ 21번 까지 총 8콤보 가능 // bArg 14 ~ 21번 까지 총 8콤보 가능
@ -1342,11 +1338,11 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
// 이로 인해 콤보핵으로 튕기는 경우가 있어 다음 코드 비 활성화. // 이로 인해 콤보핵으로 튕기는 경우가 있어 다음 코드 비 활성화.
//HackScalar = 1 + (ch->GetValidComboInterval() - ComboInterval) / 300; //HackScalar = 1 + (ch->GetValidComboInterval() - ComboInterval) / 300;
//sys_log(0, "COMBO_HACK: 2 %s arg:%u interval:%d valid:%u atkspd:%u riding:%s", //SPDLOG_WARN("COMBO_HACK: 2 {} arg:{} interval:{} valid:{} atkspd:{} riding:{}",
// ch->GetName(), // ch->GetName(),
// bArg, // bArg,
// ComboInterval, // ComboInterval,
// ch->GetValidComboInterval(), // ch->GetValidComboInterval(),
// ch->GetPoint(POINT_ATT_SPEED), // ch->GetPoint(POINT_ATT_SPEED),
// ch->IsRiding() ? "yes" : "no"); // ch->IsRiding() ? "yes" : "no");
} }
@ -1365,7 +1361,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
{ {
HackScalar = 1; HackScalar = 1;
ch->SetValidComboInterval(300); ch->SetValidComboInterval(300);
sys_log(0, "COMBO_HACK: 5 %s combo_seq:%d", ch->GetName(), ch->GetComboSequence()); SPDLOG_WARN("COMBO_HACK: 5 {} combo_seq:{}", ch->GetName(), ch->GetComboSequence());
} }
// 자객 쌍수 콤보 예외처리 // 자객 쌍수 콤보 예외처리
else if (bArg == 21 && else if (bArg == 21 &&
@ -1380,7 +1376,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
HackScalar = 1; HackScalar = 1;
ch->SetValidComboInterval(300); ch->SetValidComboInterval(300);
sys_log(0, "COMBO_HACK: 3 %s arg:%u valid:%u combo_idx:%d combo_seq:%d", SPDLOG_WARN("COMBO_HACK: 3 {} arg:{} valid:{} combo_idx:{} combo_seq:{}",
ch->GetName(), ch->GetName(),
bArg, bArg,
ComboSequenceBySkillLevel[idx][ch->GetComboSequence()], ComboSequenceBySkillLevel[idx][ch->GetComboSequence()],
@ -1393,7 +1389,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
{ {
HackScalar = 1 + (ch->GetValidComboInterval() - ComboInterval) / 100; HackScalar = 1 + (ch->GetValidComboInterval() - ComboInterval) / 100;
sys_log(0, "COMBO_HACK: 2 %s arg:%u interval:%d valid:%u atkspd:%u riding:%s", SPDLOG_WARN("COMBO_HACK: 2 {} arg:{} interval:{} valid:{} atkspd:{} riding:{}",
ch->GetName(), ch->GetName(),
bArg, bArg,
ComboInterval, ComboInterval,
@ -1424,8 +1420,8 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
// 이로 인해 콤보핵으로 튕기는 경우가 있어 다음 코드 비 활성화. // 이로 인해 콤보핵으로 튕기는 경우가 있어 다음 코드 비 활성화.
//HackScalar = 1 + (ch->GetValidComboInterval() - ComboInterval) / 100; //HackScalar = 1 + (ch->GetValidComboInterval() - ComboInterval) / 100;
//sys_log(0, "COMBO_HACK: 6 %s arg:%u interval:%d valid:%u atkspd:%u", //SPDLOG_WARN("COMBO_HACK: 6 {} arg:{} interval:{} valid:{} atkspd:{}",
// ch->GetName(), // ch->GetName(),
// bArg, // bArg,
// ComboInterval, // ComboInterval,
// ch->GetValidComboInterval(), // ch->GetValidComboInterval(),
@ -1441,7 +1437,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
const CMotion * pkMotion = CMotionManager::instance().GetMotion(ch->GetRaceNum(), MAKE_MOTION_KEY(MOTION_MODE_GENERAL, MOTION_NORMAL_ATTACK)); const CMotion * pkMotion = CMotionManager::instance().GetMotion(ch->GetRaceNum(), MAKE_MOTION_KEY(MOTION_MODE_GENERAL, MOTION_NORMAL_ATTACK));
if (!pkMotion) if (!pkMotion)
sys_err("cannot find motion by race %u", ch->GetRaceNum()); SPDLOG_ERROR("cannot find motion by race {}", ch->GetRaceNum());
else else
{ {
// 정상적 계산이라면 1000.f를 곱해야 하지만 클라이언트가 애니메이션 속도의 90%에서 // 정상적 계산이라면 1000.f를 곱해야 하지만 클라이언트가 애니메이션 속도의 90%에서
@ -1466,7 +1462,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
//if (ch->GetDesc()->DelayedDisconnect(Random::get(2, 9))) //if (ch->GetDesc()->DelayedDisconnect(Random::get(2, 9)))
//{ //{
// LogManager::instance().HackLog("Hacker", ch); // LogManager::instance().HackLog("Hacker", ch);
// sys_log(0, "HACKER: %s arg %u", ch->GetName(), bArg); // SPDLOG_WARN("HACKER: {} arg {}", ch->GetName(), bArg);
//} //}
// 위 코드로 인해, 폴리모프를 푸는 중에 공격 하면, // 위 코드로 인해, 폴리모프를 푸는 중에 공격 하면,
@ -1491,7 +1487,7 @@ bool CheckComboHack(LPCHARACTER ch, BYTE bArg, DWORD dwTime, bool CheckSpeedHack
if (ch->GetDesc()->DelayedDisconnect(Random::get(2, 9))) if (ch->GetDesc()->DelayedDisconnect(Random::get(2, 9)))
{ {
LogManager::instance().HackLog("Hacker", ch); LogManager::instance().HackLog("Hacker", ch);
sys_log(0, "HACKER: %s arg %u", ch->GetName(), bArg); SPDLOG_WARN("HACKER: {} arg {}", ch->GetName(), bArg);
} }
HackScalar = 10; HackScalar = 10;
@ -1519,7 +1515,7 @@ void CInputMain::Move(LPCHARACTER ch, const char * data)
if (pinfo->bFunc >= FUNC_MAX_NUM && !(pinfo->bFunc & 0x80)) if (pinfo->bFunc >= FUNC_MAX_NUM && !(pinfo->bFunc & 0x80))
{ {
sys_err("invalid move type: %s", ch->GetName()); SPDLOG_ERROR("invalid move type: {}", ch->GetName());
return; return;
} }
@ -1551,7 +1547,7 @@ void CInputMain::Move(LPCHARACTER ch, const char * data)
LogManager::instance().HackLog("Teleport", ch); // 부정확할 수 있음 LogManager::instance().HackLog("Teleport", ch); // 부정확할 수 있음
} }
sys_log(0, "MOVE: %s trying to move too far (dist: %.1fm) Riding(%d)", ch->GetName(), fDist, ch->IsRiding()); SPDLOG_WARN("MOVE: {} trying to move too far (dist: {:.1f}m) Riding({})", ch->GetName(), fDist, ch->IsRiding());
ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ()); ch->Show(ch->GetMapIndex(), ch->GetX(), ch->GetY(), ch->GetZ());
ch->Stop(); ch->Stop();
@ -1575,13 +1571,13 @@ void CInputMain::Move(LPCHARACTER ch, const char * data)
// 시간이 늦게간다. 일단 로그만 해둔다. 진짜 이런 사람들이 많은지 체크해야함. TODO // 시간이 늦게간다. 일단 로그만 해둔다. 진짜 이런 사람들이 많은지 체크해야함. TODO
if (iDelta >= 30000) if (iDelta >= 30000)
{ {
sys_log(0, "SPEEDHACK: slow timer name %s delta %d", ch->GetName(), iDelta); SPDLOG_WARN("SPEEDHACK: slow timer name {} delta {}", ch->GetName(), iDelta);
ch->GetDesc()->DelayedDisconnect(3); ch->GetDesc()->DelayedDisconnect(3);
} }
// 1초에 20msec 빨리 가는거 까지는 이해한다. // 1초에 20msec 빨리 가는거 까지는 이해한다.
else if (iDelta < -(iServerDelta / 50)) else if (iDelta < -(iServerDelta / 50))
{ {
sys_log(0, "SPEEDHACK: DETECTED! %s (delta %d %d)", ch->GetName(), iDelta, iServerDelta); SPDLOG_WARN("SPEEDHACK: DETECTED! {} (delta {} {})", ch->GetName(), iDelta, iServerDelta);
ch->GetDesc()->DelayedDisconnect(3); ch->GetDesc()->DelayedDisconnect(3);
} }
} }
@ -1623,7 +1619,7 @@ void CInputMain::Move(LPCHARACTER ch, const char * data)
char szBuf[256]; char szBuf[256];
snprintf(szBuf, sizeof(szBuf), "SKILL_HACK: name=%s, job=%d, group=%d, motion=%d", name, job, group, motion); snprintf(szBuf, sizeof(szBuf), "SKILL_HACK: name=%s, job=%d, group=%d, motion=%d", name, job, group, motion);
LogManager::instance().HackLog(szBuf, ch->GetDesc()->GetAccountTable().login, ch->GetName(), ch->GetDesc()->GetHostName()); LogManager::instance().HackLog(szBuf, ch->GetDesc()->GetAccountTable().login, ch->GetName(), ch->GetDesc()->GetHostName());
sys_log(0, "%s", szBuf); SPDLOG_WARN("{}", szBuf);
if (test_server) if (test_server)
{ {
@ -1674,7 +1670,7 @@ void CInputMain::Move(LPCHARACTER ch, const char * data)
} }
*/ */
/* /*
sys_log(0, SPDLOG_TRACE(
"MOVE: %s Func:%u Arg:%u Pos:%dx%d Time:%u Dist:%.1f", "MOVE: %s Func:%u Arg:%u Pos:%dx%d Time:%u Dist:%.1f",
ch->GetName(), ch->GetName(),
pinfo->bFunc, pinfo->bFunc,
@ -1789,14 +1785,14 @@ int CInputMain::SyncPosition(LPCHARACTER ch, const char * c_pcData, size_t uiByt
if (iExtraLen < 0) if (iExtraLen < 0)
{ {
sys_err("invalid packet length (len %d size %u buffer %u)", iExtraLen, pinfo->wSize, uiBytes); SPDLOG_ERROR("invalid packet length (len {} size {} buffer {})", iExtraLen, pinfo->wSize, uiBytes);
ch->GetDesc()->SetPhase(PHASE_CLOSE); ch->GetDesc()->SetPhase(PHASE_CLOSE);
return -1; return -1;
} }
if (0 != (iExtraLen % sizeof(TPacketCGSyncPositionElement))) if (0 != (iExtraLen % sizeof(TPacketCGSyncPositionElement)))
{ {
sys_err("invalid packet length %d (name: %s)", pinfo->wSize, ch->GetName()); SPDLOG_ERROR("invalid packet length {} (name: {})", pinfo->wSize, ch->GetName());
return iExtraLen; return iExtraLen;
} }
@ -1810,7 +1806,7 @@ int CInputMain::SyncPosition(LPCHARACTER ch, const char * c_pcData, size_t uiByt
if( iCount > nCountLimit ) if( iCount > nCountLimit )
{ {
//LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch ); //LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch );
sys_err( "Too many SyncPosition Count(%d) from Name(%s)", iCount, ch->GetName() ); SPDLOG_ERROR("Too many SyncPosition Count({}) from Name({})", iCount, ch->GetName() );
//ch->GetDesc()->SetPhase(PHASE_CLOSE); //ch->GetDesc()->SetPhase(PHASE_CLOSE);
//return -1; //return -1;
iCount = nCountLimit; iCount = nCountLimit;
@ -1866,7 +1862,7 @@ int CInputMain::SyncPosition(LPCHARACTER ch, const char * c_pcData, size_t uiByt
{ {
LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch ); LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch );
sys_err( "Too far SyncPosition DistanceWithSyncOwner(%f)(%s) from Name(%s) CH(%d,%d) VICTIM(%d,%d) SYNC(%d,%d)", SPDLOG_ERROR("Too far SyncPosition DistanceWithSyncOwner({})({}) from Name({}) CH({},{}) VICTIM({},{}) SYNC({},{})",
fDistWithSyncOwner, victim->GetName(), ch->GetName(), ch->GetX(), ch->GetY(), victim->GetX(), victim->GetY(), fDistWithSyncOwner, victim->GetName(), ch->GetName(), ch->GetX(), ch->GetY(), victim->GetX(), victim->GetY(),
e->lX, e->lY ); e->lX, e->lY );
@ -1895,7 +1891,7 @@ int CInputMain::SyncPosition(LPCHARACTER ch, const char * c_pcData, size_t uiByt
{ {
LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch ); LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch );
sys_err( "Too often SyncPosition Interval(%ldms)(%s) from Name(%s) VICTIM(%d,%d) SYNC(%d,%d)", SPDLOG_ERROR("Too often SyncPosition Interval({}ms)({}) from Name({}) VICTIM({},{}) SYNC({},{})",
tvDiff->tv_sec * 1000 + tvDiff->tv_usec / 1000, victim->GetName(), ch->GetName(), victim->GetX(), victim->GetY(), tvDiff->tv_sec * 1000 + tvDiff->tv_usec / 1000, victim->GetName(), ch->GetName(), victim->GetX(), victim->GetY(),
e->lX, e->lY ); e->lX, e->lY );
@ -1908,7 +1904,7 @@ int CInputMain::SyncPosition(LPCHARACTER ch, const char * c_pcData, size_t uiByt
{ {
LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch ); LogManager::instance().HackLog( "SYNC_POSITION_HACK", ch );
sys_err( "Too far SyncPosition Distance(%f)(%s) from Name(%s) CH(%d,%d) VICTIM(%d,%d) SYNC(%d,%d)", SPDLOG_ERROR("Too far SyncPosition Distance({})({}) from Name({}) CH({},{}) VICTIM({},{}) SYNC({},{})",
fDist, victim->GetName(), ch->GetName(), ch->GetX(), ch->GetY(), victim->GetX(), victim->GetY(), fDist, victim->GetName(), ch->GetName(), ch->GetX(), ch->GetY(), victim->GetX(), victim->GetY(),
e->lX, e->lY ); e->lX, e->lY );
@ -1950,7 +1946,7 @@ void CInputMain::UseSkill(LPCHARACTER ch, const char * pcData)
void CInputMain::ScriptButton(LPCHARACTER ch, const void* c_pData) void CInputMain::ScriptButton(LPCHARACTER ch, const void* c_pData)
{ {
TPacketCGScriptButton * p = (TPacketCGScriptButton *) c_pData; TPacketCGScriptButton * p = (TPacketCGScriptButton *) c_pData;
sys_log(0, "QUEST ScriptButton pid %d idx %u", ch->GetPlayerID(), p->idx); SPDLOG_DEBUG("QUEST ScriptButton pid {} idx {}", ch->GetPlayerID(), p->idx);
quest::PC* pc = quest::CQuestManager::instance().GetPCForce(ch->GetPlayerID()); quest::PC* pc = quest::CQuestManager::instance().GetPCForce(ch->GetPlayerID());
if (pc && pc->IsConfirmWait()) if (pc && pc->IsConfirmWait())
@ -1970,7 +1966,7 @@ void CInputMain::ScriptButton(LPCHARACTER ch, const void* c_pData)
void CInputMain::ScriptAnswer(LPCHARACTER ch, const void* c_pData) void CInputMain::ScriptAnswer(LPCHARACTER ch, const void* c_pData)
{ {
TPacketCGScriptAnswer * p = (TPacketCGScriptAnswer *) c_pData; TPacketCGScriptAnswer * p = (TPacketCGScriptAnswer *) c_pData;
sys_log(0, "QUEST ScriptAnswer pid %d answer %d", ch->GetPlayerID(), p->answer); SPDLOG_DEBUG("QUEST ScriptAnswer pid {} answer {}", ch->GetPlayerID(), p->answer);
if (p->answer > 250) // 다음 버튼에 대한 응답으로 온 패킷인 경우 if (p->answer > 250) // 다음 버튼에 대한 응답으로 온 패킷인 경우
{ {
@ -1987,7 +1983,7 @@ void CInputMain::ScriptAnswer(LPCHARACTER ch, const void* c_pData)
void CInputMain::ScriptSelectItem(LPCHARACTER ch, const void* c_pData) void CInputMain::ScriptSelectItem(LPCHARACTER ch, const void* c_pData)
{ {
TPacketCGScriptSelectItem* p = (TPacketCGScriptSelectItem*) c_pData; TPacketCGScriptSelectItem* p = (TPacketCGScriptSelectItem*) c_pData;
sys_log(0, "QUEST ScriptSelectItem pid %d answer %d", ch->GetPlayerID(), p->selection); SPDLOG_DEBUG("QUEST ScriptSelectItem pid {} answer {}", ch->GetPlayerID(), p->selection);
quest::CQuestManager::Instance().SelectItem(ch->GetPlayerID(), p->selection); quest::CQuestManager::Instance().SelectItem(ch->GetPlayerID(), p->selection);
} }
// END_OF_SCRIPT_SELECT_ITEM // END_OF_SCRIPT_SELECT_ITEM
@ -1998,7 +1994,7 @@ void CInputMain::QuestInputString(LPCHARACTER ch, const void* c_pData)
char msg[65]; char msg[65];
strlcpy(msg, p->msg, sizeof(msg)); strlcpy(msg, p->msg, sizeof(msg));
sys_log(0, "QUEST InputString pid %u msg %s", ch->GetPlayerID(), msg); SPDLOG_DEBUG("QUEST InputString pid {} msg {}", ch->GetPlayerID(), msg);
quest::CQuestManager::Instance().Input(ch->GetPlayerID(), msg); quest::CQuestManager::Instance().Input(ch->GetPlayerID(), msg);
} }
@ -2009,7 +2005,7 @@ void CInputMain::QuestConfirm(LPCHARACTER ch, const void* c_pData)
LPCHARACTER ch_wait = CHARACTER_MANAGER::instance().FindByPID(p->requestPID); LPCHARACTER ch_wait = CHARACTER_MANAGER::instance().FindByPID(p->requestPID);
if (p->answer) if (p->answer)
p->answer = quest::CONFIRM_YES; p->answer = quest::CONFIRM_YES;
sys_log(0, "QuestConfirm from %s pid %u name %s answer %d", ch->GetName(), p->requestPID, (ch_wait)?ch_wait->GetName():"", p->answer); SPDLOG_DEBUG("QuestConfirm from {} pid {} name {} answer {}", ch->GetName(), p->requestPID, (ch_wait)?ch_wait->GetName():"", p->answer);
if (ch_wait) if (ch_wait)
{ {
quest::CQuestManager::Instance().Confirm(ch_wait->GetPlayerID(), (quest::EQuestConfirmType) p->answer, ch->GetPlayerID()); quest::CQuestManager::Instance().Confirm(ch_wait->GetPlayerID(), (quest::EQuestConfirmType) p->answer, ch->GetPlayerID());
@ -2164,7 +2160,7 @@ void CInputMain::SafeboxCheckout(LPCHARACTER ch, const char * c_pData, bool bMal
{ {
if (NULL == pkItem->GetProto()) if (NULL == pkItem->GetProto())
{ {
sys_err ("pkItem->GetProto() == NULL (id : %d)",pkItem->GetID()); SPDLOG_ERROR("pkItem->GetProto() == NULL (id : {})",pkItem->GetID());
return ; return ;
} }
// 100% 확률로 속성이 붙어야 하는데 안 붙어있다면 새로 붙힌다. ............... // 100% 확률로 속성이 붙어야 하는데 안 붙어있다면 새로 붙힌다. ...............
@ -2217,7 +2213,7 @@ void CInputMain::PartyInvite(LPCHARACTER ch, const char * c_pData)
if (!pInvitee || !ch->GetDesc() || !pInvitee->GetDesc()) if (!pInvitee || !ch->GetDesc() || !pInvitee->GetDesc())
{ {
sys_err("PARTY Cannot find invited character"); SPDLOG_ERROR("PARTY Cannot find invited character");
return; return;
} }
@ -2273,7 +2269,7 @@ void CInputMain::PartySetState(LPCHARACTER ch, const char* c_pData)
} }
DWORD pid = p->pid; DWORD pid = p->pid;
sys_log(0, "PARTY SetRole pid %d to role %d state %s", pid, p->byRole, p->flag ? "on" : "off"); SPDLOG_DEBUG("PARTY SetRole pid {} to role {} state {}", pid, p->byRole, p->flag ? "on" : "off");
switch (p->byRole) switch (p->byRole)
{ {
@ -2300,7 +2296,7 @@ void CInputMain::PartySetState(LPCHARACTER ch, const char* c_pData)
break; break;
default: default:
sys_err("wrong byRole in PartySetState Packet name %s state %d", ch->GetName(), p->byRole); SPDLOG_ERROR("wrong byRole in PartySetState Packet name {} state {}", ch->GetName(), p->byRole);
break; break;
} }
} }
@ -2778,7 +2774,7 @@ int CInputMain::Guild(LPCHARACTER ch, const char * data, size_t uiBytes)
if (length > GUILD_COMMENT_MAX_LEN) if (length > GUILD_COMMENT_MAX_LEN)
{ {
// 잘못된 길이.. 끊어주자. // 잘못된 길이.. 끊어주자.
sys_err("POST_COMMENT: %s comment too long (length: %u)", ch->GetName(), length); SPDLOG_ERROR("POST_COMMENT: {} comment too long (length: {})", ch->GetName(), length);
ch->GetDesc()->SetPhase(PHASE_CLOSE); ch->GetDesc()->SetPhase(PHASE_CLOSE);
return -1; return -1;
} }
@ -2919,7 +2915,7 @@ int CInputMain::MyShop(LPCHARACTER ch, const char * c_pData, size_t uiBytes)
if (ch->GetGold() >= GOLD_MAX) if (ch->GetGold() >= GOLD_MAX)
{ {
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소유 돈이 20억냥을 넘어 거래를 핼수가 없습니다.")); ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("소유 돈이 20억냥을 넘어 거래를 핼수가 없습니다."));
sys_log(0, "MyShop ==> OverFlow Gold id %u name %s ", ch->GetPlayerID(), ch->GetName()); SPDLOG_DEBUG("MyShop ==> OverFlow Gold id {} name {} ", ch->GetPlayerID(), ch->GetName());
return (iExtraLen); return (iExtraLen);
} }
@ -2932,7 +2928,7 @@ int CInputMain::MyShop(LPCHARACTER ch, const char * c_pData, size_t uiBytes)
return (iExtraLen); return (iExtraLen);
} }
sys_log(0, "MyShop count %d", p->bCount); SPDLOG_DEBUG("MyShop count {}", p->bCount);
ch->OpenMyShop(p->szSign, (TShopItemTable *) (c_pData + sizeof(TPacketCGMyShop)), p->bCount); ch->OpenMyShop(p->szSign, (TShopItemTable *) (c_pData + sizeof(TPacketCGMyShop)), p->bCount);
return (iExtraLen); return (iExtraLen);
} }
@ -2973,12 +2969,12 @@ void CInputMain::Refine(LPCHARACTER ch, const char* c_pData)
if (p->type == REFINE_TYPE_NORMAL) if (p->type == REFINE_TYPE_NORMAL)
{ {
sys_log (0, "refine_type_noraml"); SPDLOG_DEBUG("refine_type_noraml");
ch->DoRefine(item); ch->DoRefine(item);
} }
else if (p->type == REFINE_TYPE_SCROLL || p->type == REFINE_TYPE_HYUNIRON || p->type == REFINE_TYPE_MUSIN || p->type == REFINE_TYPE_BDRAGON) else if (p->type == REFINE_TYPE_SCROLL || p->type == REFINE_TYPE_HYUNIRON || p->type == REFINE_TYPE_MUSIN || p->type == REFINE_TYPE_BDRAGON)
{ {
sys_log (0, "refine_type_scroll, ..."); SPDLOG_DEBUG("refine_type_scroll, ...");
ch->DoRefineWithScroll(item); ch->DoRefineWithScroll(item);
} }
else if (p->type == REFINE_TYPE_MONEY_ONLY) else if (p->type == REFINE_TYPE_MONEY_ONLY)
@ -3015,7 +3011,7 @@ int CInputMain::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
if (!(ch = d->GetCharacter())) if (!(ch = d->GetCharacter()))
{ {
sys_err("no character on desc"); SPDLOG_ERROR("no character on desc");
d->SetPhase(PHASE_CLOSE); d->SetPhase(PHASE_CLOSE);
return (0); return (0);
} }
@ -3023,7 +3019,7 @@ int CInputMain::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
int iExtraLen = 0; int iExtraLen = 0;
if (test_server && bHeader != HEADER_CG_MOVE) if (test_server && bHeader != HEADER_CG_MOVE)
sys_log(0, "CInputMain::Analyze() ==> Header [%d] ", bHeader); SPDLOG_TRACE("CInputMain::Analyze() ==> Header [{}] ", bHeader);
switch (bHeader) switch (bHeader)
{ {
@ -3039,7 +3035,7 @@ int CInputMain::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
if (test_server) if (test_server)
{ {
char* pBuf = (char*)c_pData; char* pBuf = (char*)c_pData;
sys_log(0, "%s", pBuf + sizeof(TPacketCGChat)); SPDLOG_DEBUG("{}", pBuf + sizeof(TPacketCGChat));
} }
if ((iExtraLen = Chat(ch, c_pData, m_iBufferLeft)) < 0) if ((iExtraLen = Chat(ch, c_pData, m_iBufferLeft)) < 0)
@ -3074,7 +3070,7 @@ int CInputMain::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
{ {
if (!*d->GetClientVersion()) if (!*d->GetClientVersion())
{ {
sys_err("Version not recieved name %s", ch->GetName()); SPDLOG_ERROR("Version not recieved name {}", ch->GetName());
d->SetPhase(PHASE_CLOSE); d->SetPhase(PHASE_CLOSE);
} }
} }
@ -3308,7 +3304,7 @@ int CInputDead::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
if (!(ch = d->GetCharacter())) if (!(ch = d->GetCharacter()))
{ {
sys_err("no character on desc"); SPDLOG_ERROR("no character on desc");
return 0; return 0;
} }

View File

@ -15,7 +15,6 @@
#include "xmas_event.h" #include "xmas_event.h"
#include "affect.h" #include "affect.h"
#include "castle.h" #include "castle.h"
#include "dev_log.h"
#include "locale_service.h" #include "locale_service.h"
#include "questmanager.h" #include "questmanager.h"
#include "pcbang.h" #include "pcbang.h"
@ -50,12 +49,12 @@ int CInputP2P::Relay(LPDESC d, const char * c_pData, size_t uiBytes)
if (p->lSize < 0) if (p->lSize < 0)
{ {
sys_err("invalid packet length %d", p->lSize); SPDLOG_ERROR("invalid packet length {}", p->lSize);
d->SetPhase(PHASE_CLOSE); d->SetPhase(PHASE_CLOSE);
return -1; return -1;
} }
sys_log(0, "InputP2P::Relay : %s size %d", p->szName, p->lSize); SPDLOG_INFO("InputP2P::Relay : {} size {}", p->szName, p->lSize);
LPCHARACTER pkChr = CHARACTER_MANAGER::instance().FindPC(p->szName); LPCHARACTER pkChr = CHARACTER_MANAGER::instance().FindPC(p->szName);
@ -111,7 +110,7 @@ int CInputP2P::Notice(LPDESC d, const char * c_pData, size_t uiBytes)
if (p->lSize < 0) if (p->lSize < 0)
{ {
sys_err("invalid packet length %d", p->lSize); SPDLOG_ERROR("invalid packet length {}", p->lSize);
d->SetPhase(PHASE_CLOSE); d->SetPhase(PHASE_CLOSE);
return -1; return -1;
} }
@ -131,7 +130,7 @@ int CInputP2P::MonarchNotice(LPDESC d, const char * c_pData, size_t uiBytes)
if (p->lSize < 0) if (p->lSize < 0)
{ {
sys_err("invalid packet length %d", p->lSize); SPDLOG_ERROR("invalid packet length {}", p->lSize);
d->SetPhase(PHASE_CLOSE); d->SetPhase(PHASE_CLOSE);
return -1; return -1;
} }
@ -199,7 +198,7 @@ int CInputP2P::Guild(LPDESC d, const char* c_pData, size_t uiBytes)
return sizeof(int); return sizeof(int);
} }
default: default:
sys_err ("UNKNOWN GUILD SUB PACKET"); SPDLOG_ERROR("UNKNOWN GUILD SUB PACKET");
break; break;
} }
return 0; return 0;
@ -256,21 +255,21 @@ void CInputP2P::Disconnect(const char * c_pData)
void CInputP2P::Setup(LPDESC d, const char * c_pData) void CInputP2P::Setup(LPDESC d, const char * c_pData)
{ {
TPacketGGSetup * p = (TPacketGGSetup *) c_pData; TPacketGGSetup * p = (TPacketGGSetup *) c_pData;
sys_log(0, "P2P: Setup %s:%d", d->GetHostName(), p->wPort); SPDLOG_INFO("P2P: Setup {}:{}", d->GetHostName(), p->wPort);
d->SetP2P(p->wPort, p->bChannel); d->SetP2P(p->wPort, p->bChannel);
} }
void CInputP2P::MessengerAdd(const char * c_pData) void CInputP2P::MessengerAdd(const char * c_pData)
{ {
TPacketGGMessenger * p = (TPacketGGMessenger *) c_pData; TPacketGGMessenger * p = (TPacketGGMessenger *) c_pData;
sys_log(0, "P2P: Messenger Add %s %s", p->szAccount, p->szCompanion); SPDLOG_INFO("P2P: Messenger Add {} {}", p->szAccount, p->szCompanion);
MessengerManager::instance().__AddToList(p->szAccount, p->szCompanion); MessengerManager::instance().__AddToList(p->szAccount, p->szCompanion);
} }
void CInputP2P::MessengerRemove(const char * c_pData) void CInputP2P::MessengerRemove(const char * c_pData)
{ {
TPacketGGMessenger * p = (TPacketGGMessenger *) c_pData; TPacketGGMessenger * p = (TPacketGGMessenger *) c_pData;
sys_log(0, "P2P: Messenger Remove %s %s", p->szAccount, p->szCompanion); SPDLOG_INFO("P2P: Messenger Remove {} {}", p->szAccount, p->szCompanion);
MessengerManager::instance().__RemoveFromList(p->szAccount, p->szCompanion); MessengerManager::instance().__RemoveFromList(p->szAccount, p->szCompanion);
} }
@ -304,7 +303,7 @@ void CInputP2P::GuildWarZoneMapIndex(const char* c_pData)
TPacketGGGuildWarMapIndex * p = (TPacketGGGuildWarMapIndex*) c_pData; TPacketGGGuildWarMapIndex * p = (TPacketGGGuildWarMapIndex*) c_pData;
CGuildManager & gm = CGuildManager::instance(); CGuildManager & gm = CGuildManager::instance();
sys_log(0, "P2P: GuildWarZoneMapIndex g1(%u) vs g2(%u), mapIndex(%d)", p->dwGuildID1, p->dwGuildID2, p->lMapIndex); SPDLOG_DEBUG("P2P: GuildWarZoneMapIndex g1({}) vs g2({}), mapIndex({})", p->dwGuildID1, p->dwGuildID2, p->lMapIndex);
CGuild * g1 = gm.FindGuild(p->dwGuildID1); CGuild * g1 = gm.FindGuild(p->dwGuildID1);
CGuild * g2 = gm.FindGuild(p->dwGuildID2); CGuild * g2 = gm.FindGuild(p->dwGuildID2);
@ -386,12 +385,12 @@ void CInputP2P::BlockChat(const char * c_pData)
if (ch) if (ch)
{ {
sys_log(0, "BLOCK CHAT apply name %s dur %d", p->szName, p->lBlockDuration); SPDLOG_DEBUG("BLOCK CHAT apply name {} dur {}", p->szName, p->lBlockDuration);
ch->AddAffect(AFFECT_BLOCK_CHAT, POINT_NONE, 0, AFF_NONE, p->lBlockDuration, 0, true); ch->AddAffect(AFFECT_BLOCK_CHAT, POINT_NONE, 0, AFF_NONE, p->lBlockDuration, 0, true);
} }
else else
{ {
sys_log(0, "BLOCK CHAT fail name %s dur %d", p->szName, p->lBlockDuration); SPDLOG_DEBUG("BLOCK CHAT fail name {} dur {}", p->szName, p->lBlockDuration);
} }
} }
// END_OF_BLOCK_CHAT // END_OF_BLOCK_CHAT
@ -408,13 +407,12 @@ void CInputP2P::IamAwake(LPDESC d, const char * c_pData)
{ {
std::string hostNames; std::string hostNames;
P2P_MANAGER::instance().GetP2PHostNames(hostNames); P2P_MANAGER::instance().GetP2PHostNames(hostNames);
sys_log(0, "P2P Awakeness check from %s. My P2P connection number is %d. and details...\n%s", d->GetHostName(), P2P_MANAGER::instance().GetDescCount(), hostNames.c_str()); SPDLOG_INFO("P2P Awakeness check from {}. My P2P connection number is {}. and details...\n{}", d->GetHostName(), P2P_MANAGER::instance().GetDescCount(), hostNames.c_str());
} }
int CInputP2P::Analyze(LPDESC d, BYTE bHeader, const char * c_pData) int CInputP2P::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
{ {
if (test_server) SPDLOG_TRACE("CInputP2P::Anlayze[Header {}]", bHeader);
sys_log(0, "CInputP2P::Anlayze[Header %d]", bHeader);
int iExtraLen = 0; int iExtraLen = 0;
@ -443,7 +441,7 @@ int CInputP2P::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
break; break;
case HEADER_GG_SHUTDOWN: case HEADER_GG_SHUTDOWN:
sys_err("Accept shutdown p2p command from %s.", d->GetHostName()); SPDLOG_ERROR("Accept shutdown p2p command from {}.", d->GetHostName());
Shutdown(10); Shutdown(10);
break; break;

View File

@ -16,7 +16,6 @@
#include "db.h" #include "db.h"
#include "protocol.h" #include "protocol.h"
#include "char.h" #include "char.h"
#include "dev_log.h"
#define HANDSHAKE_XOR 0x6AB3D224 #define HANDSHAKE_XOR 0x6AB3D224

View File

@ -12,7 +12,6 @@
#include "profiler.h" #include "profiler.h"
#include "marriage.h" #include "marriage.h"
#include "item_addon.h" #include "item_addon.h"
#include "dev_log.h"
#include "locale_service.h" #include "locale_service.h"
#include "item.h" #include "item.h"
#include "item_manager.h" #include "item_manager.h"
@ -86,14 +85,14 @@ EVENTFUNC(item_destroy_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "item_destroy_event> <Factor> Null pointer" ); SPDLOG_ERROR("item_destroy_event> <Factor> Null pointer" );
return 0; return 0;
} }
LPITEM pkItem = info->item; LPITEM pkItem = info->item;
if (pkItem->GetOwner()) if (pkItem->GetOwner())
sys_err("item_destroy_event: Owner exist. (item %s owner %s)", pkItem->GetName(), pkItem->GetOwner()->GetName()); SPDLOG_ERROR("item_destroy_event: Owner exist. (item {} owner {})", pkItem->GetName(), pkItem->GetOwner()->GetName());
pkItem->SetDestroyEvent(NULL); pkItem->SetDestroyEvent(NULL);
M2_DESTROY_ITEM(pkItem); M2_DESTROY_ITEM(pkItem);
@ -143,7 +142,7 @@ void CItem::EncodeInsertPacket(LPENTITY ent)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "CItem::EncodeInsertPacket> <Factor> Null pointer" ); SPDLOG_ERROR("CItem::EncodeInsertPacket> <Factor> Null pointer" );
return; return;
} }
@ -170,7 +169,7 @@ void CItem::EncodeRemovePacket(LPENTITY ent)
pack.dwVID = m_dwVID; pack.dwVID = m_dwVID;
d->Packet(&pack, sizeof(pack)); d->Packet(&pack, sizeof(pack));
sys_log(2, "Item::EncodeRemovePacket %s to %s", GetName(), ((LPCHARACTER) ent)->GetName()); SPDLOG_TRACE("Item::EncodeRemovePacket {} to {}", GetName(), ((LPCHARACTER) ent)->GetName());
} }
void CItem::SetProto(const TItemTable * table) void CItem::SetProto(const TItemTable * table)
@ -218,7 +217,7 @@ void CItem::UpdatePacket()
memcpy(pack.aAttr, GetAttributes(), sizeof(pack.aAttr)); memcpy(pack.aAttr, GetAttributes(), sizeof(pack.aAttr));
sys_log(2, "UpdatePacket %s -> %s", GetName(), m_pOwner->GetName()); SPDLOG_TRACE("UpdatePacket {} -> {}", GetName(), m_pOwner->GetName());
m_pOwner->GetDesc()->Packet(&pack, sizeof(pack)); m_pOwner->GetDesc()->Packet(&pack, sizeof(pack));
} }
@ -289,7 +288,7 @@ LPITEM CItem::RemoveFromCharacter()
{ {
if (!m_pOwner) if (!m_pOwner)
{ {
sys_err("Item::RemoveFromCharacter owner null"); SPDLOG_ERROR("Item::RemoveFromCharacter owner null");
return (this); return (this);
} }
@ -311,7 +310,7 @@ LPITEM CItem::RemoveFromCharacter()
if (IsDragonSoul()) if (IsDragonSoul())
{ {
if (m_wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM) if (m_wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
sys_err("CItem::RemoveFromCharacter: pos >= DRAGON_SOUL_INVENTORY_MAX_NUM"); SPDLOG_ERROR("CItem::RemoveFromCharacter: pos >= DRAGON_SOUL_INVENTORY_MAX_NUM");
else else
pOwner->SetItem(TItemPos(m_bWindow, m_wCell), NULL); pOwner->SetItem(TItemPos(m_bWindow, m_wCell), NULL);
} }
@ -320,7 +319,7 @@ LPITEM CItem::RemoveFromCharacter()
TItemPos cell(INVENTORY, m_wCell); TItemPos cell(INVENTORY, m_wCell);
if (false == cell.IsDefaultInventoryPosition() && false == cell.IsBeltInventoryPosition()) // ¾Æ´Ï¸é ¼ÒÁöÇ°¿¡? if (false == cell.IsDefaultInventoryPosition() && false == cell.IsBeltInventoryPosition()) // ¾Æ´Ï¸é ¼ÒÁöÇ°¿¡?
sys_err("CItem::RemoveFromCharacter: Invalid Item Position"); SPDLOG_ERROR("CItem::RemoveFromCharacter: Invalid Item Position");
else else
{ {
pOwner->SetItem(cell, NULL); pOwner->SetItem(cell, NULL);
@ -348,7 +347,7 @@ bool CItem::AddToCharacter(LPCHARACTER ch, TItemPos Cell)
{ {
if (m_wCell >= INVENTORY_MAX_NUM && BELT_INVENTORY_SLOT_START > m_wCell) if (m_wCell >= INVENTORY_MAX_NUM && BELT_INVENTORY_SLOT_START > m_wCell)
{ {
sys_err("CItem::AddToCharacter: cell overflow: %s to %s cell %d", m_pProto->szName, ch->GetName(), m_wCell); SPDLOG_ERROR("CItem::AddToCharacter: cell overflow: {} to {} cell {}", m_pProto->szName, ch->GetName(), m_wCell);
return false; return false;
} }
} }
@ -356,7 +355,7 @@ bool CItem::AddToCharacter(LPCHARACTER ch, TItemPos Cell)
{ {
if (m_wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM) if (m_wCell >= DRAGON_SOUL_INVENTORY_MAX_NUM)
{ {
sys_err("CItem::AddToCharacter: cell overflow: %s to %s cell %d", m_pProto->szName, ch->GetName(), m_wCell); SPDLOG_ERROR("CItem::AddToCharacter: cell overflow: {} to {} cell {}", m_pProto->szName, ch->GetName(), m_wCell);
return false; return false;
} }
} }
@ -393,19 +392,19 @@ bool CItem::AddToGround(int lMapIndex, const PIXEL_POSITION & pos, bool skipOwne
{ {
if (0 == lMapIndex) if (0 == lMapIndex)
{ {
sys_err("wrong map index argument: %d", lMapIndex); SPDLOG_ERROR("wrong map index argument: {}", lMapIndex);
return false; return false;
} }
if (GetSectree()) if (GetSectree())
{ {
sys_err("sectree already assigned"); SPDLOG_ERROR("sectree already assigned");
return false; return false;
} }
if (!skipOwnerCheck && m_pOwner) if (!skipOwnerCheck && m_pOwner)
{ {
sys_err("owner pointer not null"); SPDLOG_ERROR("owner pointer not null");
return false; return false;
} }
@ -413,7 +412,7 @@ bool CItem::AddToGround(int lMapIndex, const PIXEL_POSITION & pos, bool skipOwne
if (!tree) if (!tree)
{ {
sys_err("cannot find sectree by %dx%d", pos.x, pos.y); SPDLOG_ERROR("cannot find sectree by {}x{}", pos.x, pos.y);
return false; return false;
} }
@ -605,7 +604,7 @@ void CItem::ModifyPoints(bool bAdd)
if (!p) if (!p)
{ {
sys_err("cannot find table by vnum %u", dwVnum); SPDLOG_ERROR("cannot find table by vnum {}", dwVnum);
continue; continue;
} }
@ -817,7 +816,7 @@ bool CItem::EquipTo(LPCHARACTER ch, BYTE bWearCell)
{ {
if (!ch) if (!ch)
{ {
sys_err("EquipTo: nil character"); SPDLOG_ERROR("EquipTo: nil character");
return false; return false;
} }
@ -826,7 +825,7 @@ bool CItem::EquipTo(LPCHARACTER ch, BYTE bWearCell)
{ {
if (bWearCell < WEAR_MAX_NUM || bWearCell >= WEAR_MAX_NUM + DRAGON_SOUL_DECK_MAX_NUM * DS_SLOT_MAX) if (bWearCell < WEAR_MAX_NUM || bWearCell >= WEAR_MAX_NUM + DRAGON_SOUL_DECK_MAX_NUM * DS_SLOT_MAX)
{ {
sys_err("EquipTo: invalid dragon soul cell (this: #%d %s wearflag: %d cell: %d)", GetOriginalVnum(), GetName(), GetSubType(), bWearCell - WEAR_MAX_NUM); SPDLOG_ERROR("EquipTo: invalid dragon soul cell (this: #{} {} wearflag: {} cell: {})", GetOriginalVnum(), GetName(), GetSubType(), bWearCell - WEAR_MAX_NUM);
return false; return false;
} }
} }
@ -834,14 +833,14 @@ bool CItem::EquipTo(LPCHARACTER ch, BYTE bWearCell)
{ {
if (bWearCell >= WEAR_MAX_NUM) if (bWearCell >= WEAR_MAX_NUM)
{ {
sys_err("EquipTo: invalid wear cell (this: #%d %s wearflag: %d cell: %d)", GetOriginalVnum(), GetName(), GetWearFlag(), bWearCell); SPDLOG_ERROR("EquipTo: invalid wear cell (this: #{} {} wearflag: {} cell: {})", GetOriginalVnum(), GetName(), GetWearFlag(), bWearCell);
return false; return false;
} }
} }
if (ch->GetWear(bWearCell)) if (ch->GetWear(bWearCell))
{ {
sys_err("EquipTo: item already exist (this: #%d %s cell: %d %s)", GetOriginalVnum(), GetName(), bWearCell, ch->GetWear(bWearCell)->GetName()); SPDLOG_ERROR("EquipTo: item already exist (this: #{} {} cell: {} {})", GetOriginalVnum(), GetName(), bWearCell, ch->GetWear(bWearCell)->GetName());
return false; return false;
} }
@ -894,15 +893,15 @@ bool CItem::Unequip()
if (!m_pOwner || GetCell() < INVENTORY_MAX_NUM) if (!m_pOwner || GetCell() < INVENTORY_MAX_NUM)
{ {
// ITEM_OWNER_INVALID_PTR_BUG // ITEM_OWNER_INVALID_PTR_BUG
sys_err("%s %u m_pOwner %p, GetCell %d", SPDLOG_ERROR("{} {} m_pOwner {}, GetCell {}",
GetName(), GetID(), get_pointer(m_pOwner), GetCell()); GetName(), GetID(), (void*) get_pointer(m_pOwner), GetCell());
// END_OF_ITEM_OWNER_INVALID_PTR_BUG // END_OF_ITEM_OWNER_INVALID_PTR_BUG
return false; return false;
} }
if (this != m_pOwner->GetWear(GetCell() - INVENTORY_MAX_NUM)) if (this != m_pOwner->GetWear(GetCell() - INVENTORY_MAX_NUM))
{ {
sys_err("m_pOwner->GetWear() != this"); SPDLOG_ERROR("m_pOwner->GetWear() != this");
return false; return false;
} }
@ -977,7 +976,7 @@ bool CItem::CreateSocket(BYTE bSlot, BYTE bGold)
if (m_alSockets[bSlot] != 0) if (m_alSockets[bSlot] != 0)
{ {
sys_err("Item::CreateSocket : socket already exist %s %d", GetName(), bSlot); SPDLOG_ERROR("Item::CreateSocket : socket already exist {} {}", GetName(), bSlot);
return false; return false;
} }
@ -1040,7 +1039,7 @@ EVENTFUNC(ownership_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "ownership_event> <Factor> Null pointer" ); SPDLOG_ERROR("ownership_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -1132,7 +1131,7 @@ void CItem::AlterToSocketItem(int iSocketCount)
{ {
if (iSocketCount >= ITEM_SOCKET_MAX_NUM) if (iSocketCount >= ITEM_SOCKET_MAX_NUM)
{ {
sys_log(0, "Invalid Socket Count %d, set to maximum", ITEM_SOCKET_MAX_NUM); SPDLOG_ERROR("Invalid Socket Count {}, set to maximum", (int) ITEM_SOCKET_MAX_NUM);
iSocketCount = ITEM_SOCKET_MAX_NUM; iSocketCount = ITEM_SOCKET_MAX_NUM;
} }
@ -1245,7 +1244,7 @@ int CItem::GetRefineLevel()
str_to_number(locale_rtn, p+1); str_to_number(locale_rtn, p+1);
if (locale_rtn != rtn) if (locale_rtn != rtn)
{ {
sys_err("refine_level_based_on_NAME(%d) is not equal to refine_level_based_on_LOCALE_NAME(%d).", rtn, locale_rtn); SPDLOG_ERROR("refine_level_based_on_NAME({}) is not equal to refine_level_based_on_LOCALE_NAME({}).", rtn, locale_rtn);
} }
} }
@ -1263,7 +1262,7 @@ EVENTFUNC(unique_expire_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "unique_expire_event> <Factor> Null pointer" ); SPDLOG_ERROR("unique_expire_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -1273,7 +1272,7 @@ EVENTFUNC(unique_expire_event)
{ {
if (pkItem->GetSocket(ITEM_SOCKET_UNIQUE_REMAIN_TIME) <= 1) if (pkItem->GetSocket(ITEM_SOCKET_UNIQUE_REMAIN_TIME) <= 1)
{ {
sys_log(0, "UNIQUE_ITEM: expire %s %u", pkItem->GetName(), pkItem->GetID()); SPDLOG_DEBUG("UNIQUE_ITEM: expire {} {}", pkItem->GetName(), pkItem->GetID());
pkItem->SetUniqueExpireEvent(NULL); pkItem->SetUniqueExpireEvent(NULL);
ITEM_MANAGER::instance().RemoveItem(pkItem, "UNIQUE_EXPIRE"); ITEM_MANAGER::instance().RemoveItem(pkItem, "UNIQUE_EXPIRE");
return 0; return 0;
@ -1316,7 +1315,7 @@ EVENTFUNC(timer_based_on_wear_expire_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "expire_event <Factor> Null pointer" ); SPDLOG_ERROR("expire_event <Factor> Null pointer" );
return 0; return 0;
} }
@ -1324,7 +1323,7 @@ EVENTFUNC(timer_based_on_wear_expire_event)
int remain_time = pkItem->GetSocket(ITEM_SOCKET_REMAIN_SEC) - processing_time/passes_per_sec; int remain_time = pkItem->GetSocket(ITEM_SOCKET_REMAIN_SEC) - processing_time/passes_per_sec;
if (remain_time <= 0) if (remain_time <= 0)
{ {
sys_log(0, "ITEM EXPIRED : expired %s %u", pkItem->GetName(), pkItem->GetID()); SPDLOG_DEBUG("ITEM EXPIRED : expired {} {}", pkItem->GetName(), pkItem->GetID());
pkItem->SetTimerBasedOnWearExpireEvent(NULL); pkItem->SetTimerBasedOnWearExpireEvent(NULL);
pkItem->SetSocket(ITEM_SOCKET_REMAIN_SEC, 0); pkItem->SetSocket(ITEM_SOCKET_REMAIN_SEC, 0);
@ -1393,7 +1392,7 @@ void CItem::StartRealTimeExpireEvent()
m_pkRealTimeExpireEvent = event_create( real_time_expire_event, info, PASSES_PER_SEC(1)); m_pkRealTimeExpireEvent = event_create( real_time_expire_event, info, PASSES_PER_SEC(1));
sys_log(0, "REAL_TIME_EXPIRE: StartRealTimeExpireEvent"); SPDLOG_DEBUG("REAL_TIME_EXPIRE: StartRealTimeExpireEvent");
return; return;
} }
@ -1554,7 +1553,7 @@ EVENTFUNC(accessory_socket_expire_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "accessory_socket_expire_event> <Factor> Null pointer" ); SPDLOG_ERROR("accessory_socket_expire_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -1957,13 +1956,13 @@ bool CItem::MoveToAuction()
LPCHARACTER owner = GetOwner(); LPCHARACTER owner = GetOwner();
if (owner == NULL) if (owner == NULL)
{ {
sys_err ("Item those owner is not exist cannot regist in auction"); SPDLOG_ERROR("Item those owner is not exist cannot regist in auction");
return false; return false;
} }
if (GetWindow() == AUCTION) if (GetWindow() == AUCTION)
{ {
sys_err ("Item is already in auction."); SPDLOG_ERROR("Item is already in auction.");
} }
SetWindow(AUCTION); SetWindow(AUCTION);

View File

@ -16,7 +16,7 @@ void CItemAddonManager::ApplyAddonTo(int iAddonType, LPITEM pItem)
{ {
if (!pItem) if (!pItem)
{ {
sys_err("ITEM pointer null"); SPDLOG_ERROR("ITEM pointer null");
return; return;
} }

View File

@ -81,7 +81,7 @@ void CItem::AddAttribute(BYTE bApply, short sValue)
int i = GetAttributeCount(); int i = GetAttributeCount();
if (i >= MAX_NORM_ATTR_NUM) if (i >= MAX_NORM_ATTR_NUM)
sys_err("item attribute overflow!"); SPDLOG_ERROR("item attribute overflow!");
else else
{ {
if (sValue) if (sValue)
@ -100,7 +100,7 @@ void CItem::AddAttr(BYTE bApply, BYTE bLevel)
int i = GetAttributeCount(); int i = GetAttributeCount();
if (i == MAX_NORM_ATTR_NUM) if (i == MAX_NORM_ATTR_NUM)
sys_err("item attribute overflow!"); SPDLOG_ERROR("item attribute overflow!");
else else
{ {
const TItemAttrTable & r = g_map_itemAttr[bApply]; const TItemAttrTable & r = g_map_itemAttr[bApply];
@ -156,7 +156,7 @@ void CItem::PutAttributeWithLevel(BYTE bLevel)
if (!attr_idx) if (!attr_idx)
{ {
sys_err("Cannot put item attribute %d %d", iAttributeSet, bLevel); SPDLOG_ERROR("Cannot put item attribute {} {}", iAttributeSet, bLevel);
return; return;
} }

View File

@ -13,7 +13,6 @@
#include "unique_item.h" #include "unique_item.h"
#include "safebox.h" #include "safebox.h"
#include "blend_item.h" #include "blend_item.h"
#include "dev_log.h"
#include "locale_service.h" #include "locale_service.h"
#include "item.h" #include "item.h"
#include "item_manager.h" #include "item_manager.h"
@ -86,8 +85,7 @@ bool ITEM_MANAGER::Initialize(TItemTable * table, int size)
quest::CQuestManager::instance().RegisterNPCVnum(m_vec_prototype[i].dwVnum); quest::CQuestManager::instance().RegisterNPCVnum(m_vec_prototype[i].dwVnum);
m_map_vid.insert( std::map<DWORD,TItemTable>::value_type( m_vec_prototype[i].dwVnum, m_vec_prototype[i] ) ); m_map_vid.insert( std::map<DWORD,TItemTable>::value_type( m_vec_prototype[i].dwVnum, m_vec_prototype[i] ) );
if ( test_server ) SPDLOG_TRACE("ITEM_INFO {} {} ", m_vec_prototype[i].dwVnum, m_vec_prototype[i].szName );
sys_log( 0, "ITEM_INFO %d %s ", m_vec_prototype[i].dwVnum, m_vec_prototype[i].szName );
} }
int len = 0, len2; int len = 0, len2;
@ -104,8 +102,7 @@ bool ITEM_MANAGER::Initialize(TItemTable * table, int size)
if (!((i + 1) % 4)) if (!((i + 1) % 4))
{ {
if ( !test_server ) SPDLOG_TRACE("{}", buf);
sys_log(0, "%s", buf);
len = 0; len = 0;
} }
else else
@ -117,13 +114,12 @@ bool ITEM_MANAGER::Initialize(TItemTable * table, int size)
if ((i + 1) % 4) if ((i + 1) % 4)
{ {
if ( !test_server ) SPDLOG_TRACE("{}", buf);
sys_log(0, "%s", buf);
} }
ITEM_VID_MAP::iterator it = m_VIDMap.begin(); ITEM_VID_MAP::iterator it = m_VIDMap.begin();
sys_log (1, "ITEM_VID_MAP %d", m_VIDMap.size() ); SPDLOG_DEBUG("ITEM_VID_MAP {}", m_VIDMap.size() );
while (it != m_VIDMap.end()) while (it != m_VIDMap.end())
{ {
@ -134,7 +130,7 @@ bool ITEM_MANAGER::Initialize(TItemTable * table, int size)
if (NULL == tableInfo) if (NULL == tableInfo)
{ {
sys_err("cannot reset item table"); SPDLOG_ERROR("cannot reset item table");
item->SetProto(NULL); item->SetProto(NULL);
} }
@ -190,7 +186,7 @@ LPITEM ITEM_MANAGER::CreateItem(DWORD vnum, DWORD count, DWORD id, bool bTryMagi
{ {
item = m_map_pkItemByID[id]; item = m_map_pkItemByID[id];
LPCHARACTER owner = item->GetOwner(); LPCHARACTER owner = item->GetOwner();
sys_err("ITEM_ID_DUP: %u %s owner %p", id, item->GetName(), get_pointer(owner)); SPDLOG_ERROR("ITEM_ID_DUP: {} {} owner {}", id, item->GetName(), (void*) get_pointer(owner));
return NULL; return NULL;
} }
@ -446,11 +442,11 @@ void ITEM_MANAGER::SaveSingleItem(LPITEM item)
db_clientdesc->Packet(&dwID, sizeof(DWORD)); db_clientdesc->Packet(&dwID, sizeof(DWORD));
db_clientdesc->Packet(&dwOwnerID, sizeof(DWORD)); db_clientdesc->Packet(&dwOwnerID, sizeof(DWORD));
sys_log(1, "ITEM_DELETE %s:%u", item->GetName(), dwID); SPDLOG_DEBUG("ITEM_DELETE {}:{}", item->GetName(), dwID);
return; return;
} }
sys_log(1, "ITEM_SAVE %s:%d in %s window %d", item->GetName(), item->GetID(), item->GetOwner()->GetName(), item->GetWindow()); SPDLOG_DEBUG("ITEM_SAVE {}:{} in {} window {}", item->GetName(), item->GetID(), item->GetOwner()->GetName(), item->GetWindow());
TPlayerItem t; TPlayerItem t;
@ -531,12 +527,12 @@ void ITEM_MANAGER::DestroyItem(LPITEM item, const char* file, size_t line)
{ {
if (CHARACTER_MANAGER::instance().Find(item->GetOwner()->GetPlayerID()) != NULL) if (CHARACTER_MANAGER::instance().Find(item->GetOwner()->GetPlayerID()) != NULL)
{ {
sys_err("DestroyItem: GetOwner %s %s!!", item->GetName(), item->GetOwner()->GetName()); SPDLOG_ERROR("DestroyItem: GetOwner {} {}!!", item->GetName(), item->GetOwner()->GetName());
item->RemoveFromCharacter(); item->RemoveFromCharacter();
} }
else else
{ {
sys_err ("WTH! Invalid item owner. owner pointer : %p", item->GetOwner()); SPDLOG_ERROR("WTH! Invalid item owner. owner pointer : {}", (void*) item->GetOwner());
} }
} }
@ -546,7 +542,7 @@ void ITEM_MANAGER::DestroyItem(LPITEM item, const char* file, size_t line)
m_set_pkItemForDelayedSave.erase(it); m_set_pkItemForDelayedSave.erase(it);
DWORD dwID = item->GetID(); DWORD dwID = item->GetID();
sys_log(2, "ITEM_DESTROY %s:%u", item->GetName(), dwID); SPDLOG_TRACE("ITEM_DESTROY {}:{}", item->GetName(), dwID);
if (!item->GetSkipSave() && dwID) if (!item->GetSkipSave() && dwID)
{ {
@ -558,7 +554,7 @@ void ITEM_MANAGER::DestroyItem(LPITEM item, const char* file, size_t line)
} }
else else
{ {
sys_log(2, "ITEM_DESTROY_SKIP %s:%u (skip=%d)", item->GetName(), dwID, item->GetSkipSave()); SPDLOG_TRACE("ITEM_DESTROY_SKIP {}:{} (skip={})", item->GetName(), dwID, item->GetSkipSave());
} }
if (dwID) if (dwID)
@ -810,7 +806,7 @@ bool ITEM_MANAGER::GetDropPct(LPCHARACTER pkChr, LPCHARACTER pkKiller, OUT int&
else if (1 == Random::get(1, 10000)) else if (1 == Random::get(1, 10000))
iDeltaPercent += 500; iDeltaPercent += 500;
sys_log(3, "CreateDropItem for level: %d rank: %u pct: %d", iLevel, bRank, iDeltaPercent); SPDLOG_TRACE("CreateDropItem for level: {} rank: {} pct: {}", iLevel, bRank, iDeltaPercent);
iDeltaPercent = iDeltaPercent * CHARACTER_MANAGER::instance().GetMobItemRate(pkKiller) / 100; iDeltaPercent = iDeltaPercent * CHARACTER_MANAGER::instance().GetMobItemRate(pkKiller) / 100;
//if (pkKiller->GetPoint(POINT_MALL_ITEMBONUS) > 0) //if (pkKiller->GetPoint(POINT_MALL_ITEMBONUS) > 0)
@ -862,7 +858,7 @@ bool ITEM_MANAGER::CreateDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::
continue; continue;
int iPercent = (c_rInfo.m_iPercent * iDeltaPercent) / 100; int iPercent = (c_rInfo.m_iPercent * iDeltaPercent) / 100;
sys_log(3, "CreateDropItem %d ~ %d %d(%d)", c_rInfo.m_iLevelStart, c_rInfo.m_iLevelEnd, c_rInfo.m_dwVnum, iPercent, c_rInfo.m_iPercent); SPDLOG_TRACE("CreateDropItem {} ~ {} {}({})", c_rInfo.m_iLevelStart, c_rInfo.m_iLevelEnd, c_rInfo.m_dwVnum, iPercent, c_rInfo.m_iPercent);
if (iPercent >= Random::get(1, iRandRange)) if (iPercent >= Random::get(1, iRandRange))
{ {
@ -1035,7 +1031,7 @@ bool ITEM_MANAGER::CreateDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller, std::
if (pkKiller->IsHorseRiding() && if (pkKiller->IsHorseRiding() &&
GetDropPerKillPct(1000, 1000000, iDeltaPercent, "horse_skill_book_drop") >= Random::get(1, iRandRange)) GetDropPerKillPct(1000, 1000000, iDeltaPercent, "horse_skill_book_drop") >= Random::get(1, iRandRange))
{ {
sys_log(0, "EVENT HORSE_SKILL_BOOK_DROP"); SPDLOG_DEBUG("EVENT HORSE_SKILL_BOOK_DROP");
if ((item = CreateItem(ITEM_HORSE_SKILL_TRAIN_BOOK, 1, 0, true))) if ((item = CreateItem(ITEM_HORSE_SKILL_TRAIN_BOOK, 1, 0, true)))
vec_item.push_back(item); vec_item.push_back(item);
@ -1227,9 +1223,9 @@ bool DropEvent_CharStone_SetValue(const std::string& name, int value)
gs_dropEvent_charStone.alive = value; gs_dropEvent_charStone.alive = value;
if (value) if (value)
sys_log(0, "dropevent.drop_char_stone = on"); SPDLOG_DEBUG("dropevent.drop_char_stone = on");
else else
sys_log(0, "dropevent.drop_char_stone = off"); SPDLOG_DEBUG("dropevent.drop_char_stone = off");
} }
else if (name == "drop_char_stone.percent_lv01_10") else if (name == "drop_char_stone.percent_lv01_10")
@ -1243,11 +1239,11 @@ bool DropEvent_CharStone_SetValue(const std::string& name, int value)
else else
return false; return false;
sys_log(0, "dropevent.drop_char_stone: %d", gs_dropEvent_charStone.alive ? true : false); SPDLOG_DEBUG("dropevent.drop_char_stone: {}", gs_dropEvent_charStone.alive ? true : false);
sys_log(0, "dropevent.drop_char_stone.percent_lv01_10: %f", gs_dropEvent_charStone.percent_lv01_10/100.0f); SPDLOG_DEBUG("dropevent.drop_char_stone.percent_lv01_10: {}", gs_dropEvent_charStone.percent_lv01_10/100.0f);
sys_log(0, "dropevent.drop_char_stone.percent_lv11_30: %f", gs_dropEvent_charStone.percent_lv11_30/100.0f); SPDLOG_DEBUG("dropevent.drop_char_stone.percent_lv11_30: {}", gs_dropEvent_charStone.percent_lv11_30/100.0f);
sys_log(0, "dropevent.drop_char_stone.percent_lv31_MX: %f", gs_dropEvent_charStone.percent_lv31_MX/100.0f); SPDLOG_DEBUG("dropevent.drop_char_stone.percent_lv31_MX: {}", gs_dropEvent_charStone.percent_lv31_MX/100.0f);
sys_log(0, "dropevent.drop_char_stone.level_range: %d", gs_dropEvent_charStone.level_range); SPDLOG_DEBUG("dropevent.drop_char_stone.level_range: {}", gs_dropEvent_charStone.level_range);
return true; return true;
} }
@ -1355,9 +1351,9 @@ bool DropEvent_RefineBox_SetValue(const std::string& name, int value)
gs_dropEvent_refineBox.alive = value; gs_dropEvent_refineBox.alive = value;
if (value) if (value)
sys_log(0, "refine_box_drop = on"); SPDLOG_DEBUG("refine_box_drop = on");
else else
sys_log(0, "refine_box_drop = off"); SPDLOG_DEBUG("refine_box_drop = off");
} }
else if (name == "refine_box_low") else if (name == "refine_box_low")
@ -1371,11 +1367,10 @@ bool DropEvent_RefineBox_SetValue(const std::string& name, int value)
else else
return false; return false;
sys_log(0, "refine_box_drop: %d", gs_dropEvent_refineBox.alive ? true : false); SPDLOG_DEBUG("refine_box_drop: {}", gs_dropEvent_refineBox.alive ? true : false);
sys_log(0, "refine_box_low: %d", gs_dropEvent_refineBox.percent_low); SPDLOG_DEBUG("refine_box_low: {}", gs_dropEvent_refineBox.percent_low);
sys_log(0, "refine_box_mid: %d", gs_dropEvent_refineBox.percent_mid); SPDLOG_DEBUG("refine_box_mid: {}", gs_dropEvent_refineBox.percent_mid);
sys_log(0, "refine_box_high: %d", gs_dropEvent_refineBox.percent_high); SPDLOG_DEBUG("refine_box_high: {}", gs_dropEvent_refineBox.percent_high);
//sys_log(0, "refine_box_low_level_range: %d", gs_dropEvent_refineBox.level_range);
return true; return true;
} }
@ -1392,7 +1387,7 @@ void ITEM_MANAGER::CreateQuestDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller,
if (!pkKiller) if (!pkKiller)
return; return;
sys_log(1, "CreateQuestDropItem victim(%s), killer(%s)", pkChr->GetName(), pkKiller->GetName() ); SPDLOG_DEBUG("CreateQuestDropItem victim({}), killer({})", pkChr->GetName(), pkKiller->GetName() );
// DROPEVENT_CHARSTONE // DROPEVENT_CHARSTONE
__DropEvent_CharStone_DropItem(*pkKiller, *pkChr, *this, vec_item); __DropEvent_CharStone_DropItem(*pkKiller, *pkChr, *this, vec_item);
@ -1432,7 +1427,7 @@ void ITEM_MANAGER::CreateQuestDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller,
iPercent *= 10; iPercent *= 10;
} }
sys_log(0, "SOCK DROP %d %d", iPercent, iRandRange); SPDLOG_DEBUG("SOCK DROP {} {}", iPercent, iRandRange);
if (iPercent >= Random::get(1, iRandRange)) if (iPercent >= Random::get(1, iRandRange))
{ {
if ((item = CreateItem(SOCK_ITEM_VNUM, 1, 0, true))) if ((item = CreateItem(SOCK_ITEM_VNUM, 1, 0, true)))
@ -1490,7 +1485,7 @@ void ITEM_MANAGER::CreateQuestDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller,
//육각보합 //육각보합
if (GetDropPerKillPct(100, g_iUseLocale ? 2000 : 800, iDeltaPercent, "2006_drop") >= Random::get(1, iRandRange)) if (GetDropPerKillPct(100, g_iUseLocale ? 2000 : 800, iDeltaPercent, "2006_drop") >= Random::get(1, iRandRange))
{ {
sys_log(0, "À°°¢º¸ÇÕ DROP EVENT "); SPDLOG_DEBUG("À°°¢º¸ÇÕ DROP EVENT ");
const static DWORD dwVnum = 50037; const static DWORD dwVnum = 50037;
@ -1502,7 +1497,7 @@ void ITEM_MANAGER::CreateQuestDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller,
//육각보합+ //육각보합+
if (GetDropPerKillPct(100, g_iUseLocale ? 2000 : 800, iDeltaPercent, "2007_drop") >= Random::get(1, iRandRange)) if (GetDropPerKillPct(100, g_iUseLocale ? 2000 : 800, iDeltaPercent, "2007_drop") >= Random::get(1, iRandRange))
{ {
sys_log(0, "À°°¢º¸ÇÕ DROP EVENT "); SPDLOG_DEBUG("À°°¢º¸ÇÕ DROP EVENT ");
const static DWORD dwVnum = 50043; const static DWORD dwVnum = 50043;
@ -1523,7 +1518,7 @@ void ITEM_MANAGER::CreateQuestDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller,
// 새해 대보름 원소 이벤트 // 새해 대보름 원소 이벤트
if (GetDropPerKillPct(100, 500, iDeltaPercent, "newyear_moon") >= Random::get(1, iRandRange)) if (GetDropPerKillPct(100, 500, iDeltaPercent, "newyear_moon") >= Random::get(1, iRandRange))
{ {
sys_log(0, "EVENT NEWYEAR_MOON DROP"); SPDLOG_DEBUG("EVENT NEWYEAR_MOON DROP");
const static DWORD wonso_items[6] = { 50016, 50017, 50018, 50019, 50019, 50019, }; const static DWORD wonso_items[6] = { 50016, 50017, 50018, 50019, 50019, 50019, };
DWORD dwVnum = wonso_items[Random::get(0, 5)]; DWORD dwVnum = wonso_items[Random::get(0, 5)];
@ -1535,7 +1530,7 @@ void ITEM_MANAGER::CreateQuestDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller,
// 발렌타인 데이 이벤트. OGE의 요구에 따라 event 최소값을 1로 변경.(다른 이벤트는 일단 그대로 둠.) // 발렌타인 데이 이벤트. OGE의 요구에 따라 event 최소값을 1로 변경.(다른 이벤트는 일단 그대로 둠.)
if (GetDropPerKillPct(1, g_iUseLocale ? 2000 : 800, iDeltaPercent, "valentine_drop") >= Random::get(1, iRandRange)) if (GetDropPerKillPct(1, g_iUseLocale ? 2000 : 800, iDeltaPercent, "valentine_drop") >= Random::get(1, iRandRange))
{ {
sys_log(0, "EVENT VALENTINE_DROP"); SPDLOG_DEBUG("EVENT VALENTINE_DROP");
const static DWORD valentine_items[2] = { 50024, 50025 }; const static DWORD valentine_items[2] = { 50024, 50025 };
DWORD dwVnum = valentine_items[Random::get(0, 1)]; DWORD dwVnum = valentine_items[Random::get(0, 1)];
@ -1610,7 +1605,7 @@ void ITEM_MANAGER::CreateQuestDropItem(LPCHARACTER pkChr, LPCHARACTER pkKiller,
// 화이트 데이 이벤트 // 화이트 데이 이벤트
if (GetDropPerKillPct(100, g_iUseLocale ? 2000 : 800, iDeltaPercent, "whiteday_drop") >= Random::get(1, iRandRange)) if (GetDropPerKillPct(100, g_iUseLocale ? 2000 : 800, iDeltaPercent, "whiteday_drop") >= Random::get(1, iRandRange))
{ {
sys_log(0, "EVENT WHITEDAY_DROP"); SPDLOG_DEBUG("EVENT WHITEDAY_DROP");
const static DWORD whiteday_items[2] = { ITEM_WHITEDAY_ROSE, ITEM_WHITEDAY_CANDY }; const static DWORD whiteday_items[2] = { ITEM_WHITEDAY_ROSE, ITEM_WHITEDAY_CANDY };
DWORD dwVnum = whiteday_items[Random::get(0, 1)]; DWORD dwVnum = whiteday_items[Random::get(0, 1)];

View File

@ -9,7 +9,7 @@ int touch(const char *path)
if ( !(fp = fopen(path, "a")) ) if ( !(fp = fopen(path, "a")) )
{ {
sys_err("touch failed"); SPDLOG_ERROR("touch failed");
return (-1); return (-1);
} }
@ -25,14 +25,14 @@ DWORD ITEM_MANAGER::GetNewID()
{ {
if ( m_ItemIDSpareRange.dwMin == 0 || m_ItemIDSpareRange.dwMax == 0 || m_ItemIDSpareRange.dwUsableItemIDMin == 0 ) if ( m_ItemIDSpareRange.dwMin == 0 || m_ItemIDSpareRange.dwMax == 0 || m_ItemIDSpareRange.dwUsableItemIDMin == 0 )
{ {
for ( int i=0; i < 10; i++ ) sys_err("ItemIDRange: FATAL ERROR!!! no more item id"); for ( int i=0; i < 10; i++ ) SPDLOG_ERROR("ItemIDRange: FATAL ERROR!!! no more item id");
touch(".killscript"); touch(".killscript");
thecore_shutdown(); thecore_shutdown();
return 0; return 0;
} }
else else
{ {
sys_log(0, "ItemIDRange: First Range is full. Change to SpareRange %u ~ %u %u", SPDLOG_WARN("ItemIDRange: First Range is full. Change to SpareRange {} ~ {} {}",
m_ItemIDSpareRange.dwMin, m_ItemIDSpareRange.dwMax, m_ItemIDSpareRange.dwUsableItemIDMin); m_ItemIDSpareRange.dwMin, m_ItemIDSpareRange.dwMax, m_ItemIDSpareRange.dwUsableItemIDMin);
db_clientdesc->DBPacket(HEADER_GD_REQ_SPARE_ITEM_ID_RANGE, 0, &m_ItemIDRange.dwMax, sizeof(DWORD)); db_clientdesc->DBPacket(HEADER_GD_REQ_SPARE_ITEM_ID_RANGE, 0, &m_ItemIDRange.dwMax, sizeof(DWORD));
@ -54,7 +54,7 @@ bool ITEM_MANAGER::SetMaxItemID(TItemIDRangeTable range)
if ( m_ItemIDRange.dwMin == 0 || m_ItemIDRange.dwMax == 0 || m_ItemIDRange.dwUsableItemIDMin == 0 ) if ( m_ItemIDRange.dwMin == 0 || m_ItemIDRange.dwMax == 0 || m_ItemIDRange.dwUsableItemIDMin == 0 )
{ {
for ( int i=0; i < 10; i++ ) sys_err("ItemIDRange: FATAL ERROR!!! ITEM ID RANGE is not set."); for ( int i=0; i < 10; i++ ) SPDLOG_ERROR("ItemIDRange: FATAL ERROR!!! ITEM ID RANGE is not set.");
touch(".killscript"); touch(".killscript");
thecore_shutdown(); thecore_shutdown();
return false; return false;
@ -62,7 +62,7 @@ bool ITEM_MANAGER::SetMaxItemID(TItemIDRangeTable range)
m_dwCurrentID = range.dwUsableItemIDMin; m_dwCurrentID = range.dwUsableItemIDMin;
sys_log(0, "ItemIDRange: %u ~ %u %u", m_ItemIDRange.dwMin, m_ItemIDRange.dwMax, m_dwCurrentID); SPDLOG_DEBUG("ItemIDRange: {} ~ {} {}", m_ItemIDRange.dwMin, m_ItemIDRange.dwMax, m_dwCurrentID);
return true; return true;
} }
@ -71,13 +71,13 @@ bool ITEM_MANAGER::SetMaxSpareItemID(TItemIDRangeTable range)
{ {
if ( range.dwMin == 0 || range.dwMax == 0 || range.dwUsableItemIDMin == 0 ) if ( range.dwMin == 0 || range.dwMax == 0 || range.dwUsableItemIDMin == 0 )
{ {
for ( int i=0; i < 10; i++ ) sys_err("ItemIDRange: FATAL ERROR!!! Spare ITEM ID RANGE is not set"); for ( int i=0; i < 10; i++ ) SPDLOG_ERROR("ItemIDRange: FATAL ERROR!!! Spare ITEM ID RANGE is not set");
return false; return false;
} }
m_ItemIDSpareRange = range; m_ItemIDSpareRange = range;
sys_log(0, "ItemIDRange: New Spare ItemID Range Recv %u ~ %u %u", SPDLOG_DEBUG("ItemIDRange: New Spare ItemID Range Recv {} ~ {} {}",
m_ItemIDSpareRange.dwMin, m_ItemIDSpareRange.dwMax, m_ItemIDSpareRange.dwUsableItemIDMin); m_ItemIDSpareRange.dwMin, m_ItemIDSpareRange.dwMax, m_ItemIDSpareRange.dwUsableItemIDMin);
return true; return true;

View File

@ -13,7 +13,6 @@
#include "unique_item.h" #include "unique_item.h"
#include "safebox.h" #include "safebox.h"
#include "blend_item.h" #include "blend_item.h"
#include "dev_log.h"
#include "locale_service.h" #include "locale_service.h"
#include "item.h" #include "item.h"
#include "item_manager.h" #include "item_manager.h"
@ -28,7 +27,7 @@ bool ITEM_MANAGER::ReadCommonDropItemFile(const char * c_pszFileName)
if (!fp) if (!fp)
{ {
sys_err("Cannot open %s", c_pszFileName); SPDLOG_ERROR("Cannot open {}", c_pszFileName);
return false; return false;
} }
@ -83,7 +82,7 @@ bool ITEM_MANAGER::ReadCommonDropItemFile(const char * c_pszFileName)
str_to_number(dwItemVnum, d[i].szItemName); str_to_number(dwItemVnum, d[i].szItemName);
if (!ITEM_MANAGER::instance().GetTable(dwItemVnum)) if (!ITEM_MANAGER::instance().GetTable(dwItemVnum))
{ {
sys_err("No such an item (name: %s)", d[i].szItemName); SPDLOG_ERROR("No such an item (name: {})", d[i].szItemName);
fclose(fp); fclose(fp);
return false; return false;
} }
@ -105,12 +104,12 @@ bool ITEM_MANAGER::ReadCommonDropItemFile(const char * c_pszFileName)
std::vector<CItemDropInfo>::iterator it = v.begin(); std::vector<CItemDropInfo>::iterator it = v.begin();
sys_log(1, "CommonItemDrop rank %d", i); SPDLOG_DEBUG("CommonItemDrop rank {}", i);
while (it != v.end()) while (it != v.end())
{ {
const CItemDropInfo & c = *(it++); const CItemDropInfo & c = *(it++);
sys_log(1, "CommonItemDrop %d %d %d %u", c.m_iLevelStart, c.m_iLevelEnd, c.m_iPercent, c.m_dwVnum); SPDLOG_TRACE("CommonItemDrop {} {} {} {}", c.m_iLevelStart, c.m_iLevelEnd, c.m_iPercent, c.m_dwVnum);
} }
} }
@ -136,12 +135,12 @@ bool ITEM_MANAGER::ReadSpecialDropItemFile(const char * c_pszFileName)
if (!loader.GetTokenInteger("vnum", &iVnum)) if (!loader.GetTokenInteger("vnum", &iVnum))
{ {
sys_err("ReadSpecialDropItemFile : Syntax error %s : no vnum, node %s", c_pszFileName, stName.c_str()); SPDLOG_ERROR("ReadSpecialDropItemFile : Syntax error {} : no vnum, node {}", c_pszFileName, stName);
loader.SetParentNode(); loader.SetParentNode();
return false; return false;
} }
sys_log(0,"DROP_ITEM_GROUP %s %d", stName.c_str(), iVnum); SPDLOG_DEBUG("DROP_ITEM_GROUP {} {}", stName, iVnum);
TTokenVector * pTok; TTokenVector * pTok;
@ -184,14 +183,14 @@ bool ITEM_MANAGER::ReadSpecialDropItemFile(const char * c_pszFileName)
apply_type = FN_get_apply_type(pTok->at(0).c_str()); apply_type = FN_get_apply_type(pTok->at(0).c_str());
if (0 == apply_type) if (0 == apply_type)
{ {
sys_err ("Invalid APPLY_TYPE %s in Special Item Group Vnum %d", pTok->at(0).c_str(), iVnum); SPDLOG_ERROR("Invalid APPLY_TYPE {} in Special Item Group Vnum {}", pTok->at(0).c_str(), iVnum);
return false; return false;
} }
} }
str_to_number(apply_value, pTok->at(1).c_str()); str_to_number(apply_value, pTok->at(1).c_str());
if (apply_type > MAX_APPLY_NUM) if (apply_type > MAX_APPLY_NUM)
{ {
sys_err ("Invalid APPLY_TYPE %u in Special Item Group Vnum %d", apply_type, iVnum); SPDLOG_ERROR("Invalid APPLY_TYPE {} in Special Item Group Vnum {}", apply_type, iVnum);
M2_DELETE(pkGroup); M2_DELETE(pkGroup);
return false; return false;
} }
@ -253,7 +252,7 @@ bool ITEM_MANAGER::ReadSpecialDropItemFile(const char * c_pszFileName)
str_to_number(dwVnum, name.c_str()); str_to_number(dwVnum, name.c_str());
if (!ITEM_MANAGER::instance().GetTable(dwVnum)) if (!ITEM_MANAGER::instance().GetTable(dwVnum))
{ {
sys_err("ReadSpecialDropItemFile : there is no item %s : node %s", name.c_str(), stName.c_str()); SPDLOG_ERROR("ReadSpecialDropItemFile : there is no item {} : node {}", name.c_str(), stName.c_str());
M2_DELETE(pkGroup); M2_DELETE(pkGroup);
return false; return false;
@ -272,7 +271,7 @@ bool ITEM_MANAGER::ReadSpecialDropItemFile(const char * c_pszFileName)
str_to_number(iRarePct, pTok->at(3).c_str()); str_to_number(iRarePct, pTok->at(3).c_str());
} }
sys_log(0," name %s count %d prob %d rare %d", name.c_str(), iCount, iProb, iRarePct); SPDLOG_TRACE(" name {} count {} prob {} rare {}", name.c_str(), iCount, iProb, iRarePct);
pkGroup->AddItem(dwVnum, iCount, iProb, iRarePct); pkGroup->AddItem(dwVnum, iCount, iProb, iRarePct);
// CHECK_UNIQUE_GROUP // CHECK_UNIQUE_GROUP
@ -312,7 +311,7 @@ bool ITEM_MANAGER::ConvSpecialDropItemFile()
FILE *fp = fopen("special_item_group_vnum.txt", "w"); FILE *fp = fopen("special_item_group_vnum.txt", "w");
if (!fp) if (!fp)
{ {
sys_err("could not open file (%s)", "special_item_group_vnum.txt"); SPDLOG_ERROR("could not open file ({})", "special_item_group_vnum.txt");
return false; return false;
} }
@ -336,7 +335,7 @@ bool ITEM_MANAGER::ConvSpecialDropItemFile()
if (!loader.GetTokenInteger("vnum", &iVnum)) if (!loader.GetTokenInteger("vnum", &iVnum))
{ {
sys_err("ConvSpecialDropItemFile : Syntax error %s : no vnum, node %s", szSpecialItemGroupFileName, stName.c_str()); SPDLOG_ERROR("ConvSpecialDropItemFile : Syntax error {} : no vnum, node {}", szSpecialItemGroupFileName, stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
fclose(fp); fclose(fp);
return false; return false;
@ -387,7 +386,7 @@ bool ITEM_MANAGER::ConvSpecialDropItemFile()
str_to_number(dwVnum, name.c_str()); str_to_number(dwVnum, name.c_str());
if (!ITEM_MANAGER::instance().GetTable(dwVnum)) if (!ITEM_MANAGER::instance().GetTable(dwVnum))
{ {
sys_err("ReadSpecialDropItemFile : there is no item %s : node %s", name.c_str(), stName.c_str()); SPDLOG_ERROR("ReadSpecialDropItemFile : there is no item {} : node {}", name.c_str(), stName.c_str());
fclose(fp); fclose(fp);
return false; return false;
@ -433,7 +432,7 @@ bool ITEM_MANAGER::ReadEtcDropItemFile(const char * c_pszFileName)
if (!fp) if (!fp)
{ {
sys_err("Cannot open %s", c_pszFileName); SPDLOG_ERROR("Cannot open {}", c_pszFileName);
return false; return false;
} }
@ -467,13 +466,13 @@ bool ITEM_MANAGER::ReadEtcDropItemFile(const char * c_pszFileName)
if (!ITEM_MANAGER::instance().GetVnumByOriginalName(szItemName, dwItemVnum)) if (!ITEM_MANAGER::instance().GetVnumByOriginalName(szItemName, dwItemVnum))
{ {
sys_err("No such an item (name: %s)", szItemName); SPDLOG_ERROR("No such an item (name: {})", szItemName);
fclose(fp); fclose(fp);
return false; return false;
} }
m_map_dwEtcItemDropProb[dwItemVnum] = (DWORD) (fProb * 10000.0f); m_map_dwEtcItemDropProb[dwItemVnum] = (DWORD) (fProb * 10000.0f);
sys_log(0, "ETC_DROP_ITEM: %s prob %f", szItemName, fProb); SPDLOG_DEBUG("ETC_DROP_ITEM: {} prob {}", szItemName, fProb);
} }
fclose(fp); fclose(fp);
@ -515,14 +514,14 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
if (!loader.GetTokenString("type", &strType)) if (!loader.GetTokenString("type", &strType))
{ {
sys_err("ReadMonsterDropItemGroup : Syntax error %s : no type (kill|drop), node %s", c_pszFileName, stName.c_str()); SPDLOG_ERROR("ReadMonsterDropItemGroup : Syntax error {} : no type (kill|drop), node {}", c_pszFileName, stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
return false; return false;
} }
if (!loader.GetTokenInteger("mob", &iMobVnum)) if (!loader.GetTokenInteger("mob", &iMobVnum))
{ {
sys_err("ReadMonsterDropItemGroup : Syntax error %s : no mob vnum, node %s", c_pszFileName, stName.c_str()); SPDLOG_ERROR("ReadMonsterDropItemGroup : Syntax error {} : no mob vnum, node {}", c_pszFileName, stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
return false; return false;
} }
@ -531,7 +530,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
{ {
if (!loader.GetTokenInteger("kill_drop", &iKillDrop)) if (!loader.GetTokenInteger("kill_drop", &iKillDrop))
{ {
sys_err("ReadMonsterDropItemGroup : Syntax error %s : no kill drop count, node %s", c_pszFileName, stName.c_str()); SPDLOG_ERROR("ReadMonsterDropItemGroup : Syntax error {} : no kill drop count, node {}", c_pszFileName, stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
return false; return false;
} }
@ -545,7 +544,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
{ {
if ( !loader.GetTokenInteger("level_limit", &iLevelLimit) ) if ( !loader.GetTokenInteger("level_limit", &iLevelLimit) )
{ {
sys_err("ReadmonsterDropItemGroup : Syntax error %s : no level_limit, node %s", c_pszFileName, stName.c_str()); SPDLOG_ERROR("ReadmonsterDropItemGroup : Syntax error {} : no level_limit, node {}", c_pszFileName, stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
return false; return false;
} }
@ -555,7 +554,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
iLevelLimit = 0; iLevelLimit = 0;
} }
sys_log(0,"MOB_ITEM_GROUP %s [%s] %d %d", stName.c_str(), strType.c_str(), iMobVnum, iKillDrop); SPDLOG_DEBUG("MOB_ITEM_GROUP {} [{}] {} {}", stName.c_str(), strType.c_str(), iMobVnum, iKillDrop);
if (iKillDrop == 0) if (iKillDrop == 0)
{ {
@ -576,7 +575,6 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
if (loader.GetTokenVector(buf, &pTok)) if (loader.GetTokenVector(buf, &pTok))
{ {
//sys_log(1, " %s %s", pTok->at(0).c_str(), pTok->at(1).c_str());
std::string& name = pTok->at(0); std::string& name = pTok->at(0);
DWORD dwVnum = 0; DWORD dwVnum = 0;
@ -585,7 +583,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
str_to_number(dwVnum, name.c_str()); str_to_number(dwVnum, name.c_str());
if (!ITEM_MANAGER::instance().GetTable(dwVnum)) if (!ITEM_MANAGER::instance().GetTable(dwVnum))
{ {
sys_err("ReadMonsterDropItemGroup : there is no item %s : node %s : vnum %d", name.c_str(), stName.c_str(), dwVnum); SPDLOG_ERROR("ReadMonsterDropItemGroup : there is no item {} : node {} : vnum {}", name.c_str(), stName.c_str(), dwVnum);
return false; return false;
} }
} }
@ -595,7 +593,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
if (iCount<1) if (iCount<1)
{ {
sys_err("ReadMonsterDropItemGroup : there is no count for item %s : node %s : vnum %d, count %d", name.c_str(), stName.c_str(), dwVnum, iCount); SPDLOG_ERROR("ReadMonsterDropItemGroup : there is no count for item {} : node {} : vnum {}, count {}", name.c_str(), stName.c_str(), dwVnum, iCount);
return false; return false;
} }
@ -604,7 +602,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
if (iPartPct == 0) if (iPartPct == 0)
{ {
sys_err("ReadMonsterDropItemGroup : there is no drop percent for item %s : node %s : vnum %d, count %d, pct %d", name.c_str(), stName.c_str(), iPartPct); SPDLOG_ERROR("ReadMonsterDropItemGroup : there is no drop percent for item {} : node {} : vnum {}, count {}, pct {}", name.c_str(), stName.c_str(), iPartPct);
return false; return false;
} }
@ -612,7 +610,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
str_to_number(iRarePct, pTok->at(3).c_str()); str_to_number(iRarePct, pTok->at(3).c_str());
iRarePct = std::clamp(iRarePct, 0, 100); iRarePct = std::clamp(iRarePct, 0, 100);
sys_log(0," %s count %d rare %d", name.c_str(), iCount, iRarePct); SPDLOG_TRACE(" {} count {} rare {}", name.c_str(), iCount, iRarePct);
pkGroup->AddItem(dwVnum, iCount, iPartPct, iRarePct); pkGroup->AddItem(dwVnum, iCount, iPartPct, iRarePct);
continue; continue;
} }
@ -652,7 +650,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
str_to_number(dwVnum, name.c_str()); str_to_number(dwVnum, name.c_str());
if (!ITEM_MANAGER::instance().GetTable(dwVnum)) if (!ITEM_MANAGER::instance().GetTable(dwVnum))
{ {
sys_err("ReadDropItemGroup : there is no item %s : node %s", name.c_str(), stName.c_str()); SPDLOG_ERROR("ReadDropItemGroup : there is no item {} : node {}", name.c_str(), stName.c_str());
M2_DELETE(pkGroup); M2_DELETE(pkGroup);
return false; return false;
@ -664,7 +662,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
if (iCount < 1) if (iCount < 1)
{ {
sys_err("ReadMonsterDropItemGroup : there is no count for item %s : node %s", name.c_str(), stName.c_str()); SPDLOG_ERROR("ReadMonsterDropItemGroup : there is no count for item {} : node {}", name.c_str(), stName.c_str());
M2_DELETE(pkGroup); M2_DELETE(pkGroup);
return false; return false;
@ -674,7 +672,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
DWORD dwPct = (DWORD)(10000.0f * fPercent); DWORD dwPct = (DWORD)(10000.0f * fPercent);
sys_log(0," name %s pct %d count %d", name.c_str(), dwPct, iCount); SPDLOG_TRACE(" name {} pct {} count {}", name.c_str(), dwPct, iCount);
pkGroup->AddItem(dwVnum, dwPct, iCount); pkGroup->AddItem(dwVnum, dwPct, iCount);
continue; continue;
@ -751,7 +749,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
str_to_number(dwVnum, name.c_str()); str_to_number(dwVnum, name.c_str());
if (!ITEM_MANAGER::instance().GetTable(dwVnum)) if (!ITEM_MANAGER::instance().GetTable(dwVnum))
{ {
sys_err("ReadDropItemGroup : there is no item %s : node %s", name.c_str(), stName.c_str()); SPDLOG_ERROR("ReadDropItemGroup : there is no item {} : node {}", name.c_str(), stName.c_str());
M2_DELETE(pkGroup); M2_DELETE(pkGroup);
return false; return false;
@ -763,7 +761,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
if (iCount < 1) if (iCount < 1)
{ {
sys_err("ReadMonsterDropItemGroup : there is no count for item %s : node %s", name.c_str(), stName.c_str()); SPDLOG_ERROR("ReadMonsterDropItemGroup : there is no count for item {} : node {}", name.c_str(), stName.c_str());
M2_DELETE(pkGroup); M2_DELETE(pkGroup);
return false; return false;
@ -773,7 +771,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
DWORD dwPct = (DWORD)(10000.0f * fPercent); DWORD dwPct = (DWORD)(10000.0f * fPercent);
sys_log(0," name %s pct %d count %d", name.c_str(), dwPct, iCount); SPDLOG_TRACE(" name {} pct {} count {}", name.c_str(), dwPct, iCount);
pkGroup->AddItem(dwVnum, dwPct, iCount); pkGroup->AddItem(dwVnum, dwPct, iCount);
continue; continue;
@ -786,7 +784,7 @@ bool ITEM_MANAGER::ReadMonsterDropItemGroup(const char * c_pszFileName)
} }
else else
{ {
sys_err("ReadMonsterDropItemGroup : Syntax error %s : invalid type %s (kill|drop), node %s", c_pszFileName, strType.c_str(), stName.c_str()); SPDLOG_ERROR("ReadMonsterDropItemGroup : Syntax error {} : invalid type {} (kill|drop), node {}", c_pszFileName, strType.c_str(), stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
return false; return false;
} }
@ -817,19 +815,19 @@ bool ITEM_MANAGER::ReadDropItemGroup(const char * c_pszFileName)
if (!loader.GetTokenInteger("vnum", &iVnum)) if (!loader.GetTokenInteger("vnum", &iVnum))
{ {
sys_err("ReadDropItemGroup : Syntax error %s : no vnum, node %s", c_pszFileName, stName.c_str()); SPDLOG_ERROR("ReadDropItemGroup : Syntax error {} : no vnum, node {}", c_pszFileName, stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
return false; return false;
} }
if (!loader.GetTokenInteger("mob", &iMobVnum)) if (!loader.GetTokenInteger("mob", &iMobVnum))
{ {
sys_err("ReadDropItemGroup : Syntax error %s : no mob vnum, node %s", c_pszFileName, stName.c_str()); SPDLOG_ERROR("ReadDropItemGroup : Syntax error {} : no mob vnum, node {}", c_pszFileName, stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
return false; return false;
} }
sys_log(0,"DROP_ITEM_GROUP %s %d", stName.c_str(), iMobVnum); SPDLOG_DEBUG("DROP_ITEM_GROUP {} {}", stName.c_str(), iMobVnum);
TTokenVector * pTok; TTokenVector * pTok;
@ -857,7 +855,7 @@ bool ITEM_MANAGER::ReadDropItemGroup(const char * c_pszFileName)
str_to_number(dwVnum, name.c_str()); str_to_number(dwVnum, name.c_str());
if (!ITEM_MANAGER::instance().GetTable(dwVnum)) if (!ITEM_MANAGER::instance().GetTable(dwVnum))
{ {
sys_err("ReadDropItemGroup : there is no item %s : node %s", name.c_str(), stName.c_str()); SPDLOG_ERROR("ReadDropItemGroup : there is no item {} : node {}", name.c_str(), stName.c_str());
if (it == m_map_pkDropItemGroup.end()) if (it == m_map_pkDropItemGroup.end())
M2_DELETE(pkGroup); M2_DELETE(pkGroup);
@ -876,7 +874,7 @@ bool ITEM_MANAGER::ReadDropItemGroup(const char * c_pszFileName)
if (iCount < 1) if (iCount < 1)
{ {
sys_err("ReadDropItemGroup : there is no count for item %s : node %s", name.c_str(), stName.c_str()); SPDLOG_ERROR("ReadDropItemGroup : there is no count for item {} : node {}", name.c_str(), stName.c_str());
if (it == m_map_pkDropItemGroup.end()) if (it == m_map_pkDropItemGroup.end())
M2_DELETE(pkGroup); M2_DELETE(pkGroup);
@ -884,7 +882,7 @@ bool ITEM_MANAGER::ReadDropItemGroup(const char * c_pszFileName)
return false; return false;
} }
sys_log(0," %s %d %d", name.c_str(), dwPct, iCount); SPDLOG_TRACE(" {} {} {}", name.c_str(), dwPct, iCount);
pkGroup->AddItem(dwVnum, dwPct, iCount); pkGroup->AddItem(dwVnum, dwPct, iCount);
continue; continue;
} }

View File

@ -32,7 +32,7 @@ const char * locale_find(const char *string)
static char s_line[1024] = "@0949"; static char s_line[1024] = "@0949";
strlcpy(s_line + 5, string, sizeof(s_line) - 5); strlcpy(s_line + 5, string, sizeof(s_line) - 5);
sys_err("LOCALE_ERROR: \"%s\";", string); SPDLOG_ERROR("LOCALE_ERROR: \"{}\";", string);
return s_line; return s_line;
} }
@ -157,8 +157,8 @@ void locale_init(const char *filename)
if (!buf) if (!buf)
{ {
sys_err("locale_read: no file %s", filename); SPDLOG_ERROR("locale_read: no file {}", filename);
exit(1); exit(EXIT_FAILURE);
} }
tmp = buf; tmp = buf;
@ -185,7 +185,7 @@ void locale_init(const char *filename)
if (*tmp != '"') if (*tmp != '"')
{ {
sys_err("locale_init: invalid format filename %s", filename); SPDLOG_ERROR("locale_init: invalid format filename {}", filename);
break; break;
} }
} }

View File

@ -67,10 +67,7 @@ int is_twobyte_big5(const char * str)
if ((b12 < 0xa440 || b12 > 0xc67e) && (b12 < 0xc940 || b12 > 0xf9d5)) if ((b12 < 0xa440 || b12 > 0xc67e) && (b12 < 0xc940 || b12 > 0xf9d5))
{ {
if (test_server) SPDLOG_TRACE("twobyte_big5 {} {}", b1, b2);
{
sys_log(0, "twobyte_big5 %x %x", b1, b2);
}
return 0; return 0;
} }
@ -204,9 +201,7 @@ int check_name_big5(const char * str )
if ((b12 < 0xa440 || b12 > 0xc67e) && (b12 < 0xc940 || b12 > 0xf9d5)) if ((b12 < 0xa440 || b12 > 0xc67e) && (b12 < 0xc940 || b12 > 0xf9d5))
{ {
if (test_server) SPDLOG_TRACE("check_name_big5[{}][{}] {} {} {}", i - 2, str, b1, b2, b12);
sys_log(0, "check_name_big5[%d][%s] %x %x %x", i - 2, str, b1, b2, b12);
return 0; return 0;
} }
} }
@ -377,7 +372,7 @@ void LocaleService_LoadLocaleStringFile()
if (g_bAuthServer) if (g_bAuthServer)
return; return;
fprintf(stderr, "LocaleService %s\n", g_stLocaleFilename.c_str()); SPDLOG_INFO("LocaleService {}", g_stLocaleFilename);
locale_init(g_stLocaleFilename.c_str()); locale_init(g_stLocaleFilename.c_str());
} }
@ -389,7 +384,7 @@ void LocaleService_LoadEmpireTextConvertTables()
for (int iEmpire = 1; iEmpire <= 3; ++iEmpire) for (int iEmpire = 1; iEmpire <= 3; ++iEmpire)
{ {
snprintf(szFileName, sizeof(szFileName), "%s/lang%d.cvt", LocaleService_GetBasePath().c_str(), iEmpire); snprintf(szFileName, sizeof(szFileName), "%s/lang%d.cvt", LocaleService_GetBasePath().c_str(), iEmpire);
sys_log(0, "Load %s", szFileName); SPDLOG_INFO("Load {}", szFileName);
LoadEmpireTextConvertTable(iEmpire, szFileName); LoadEmpireTextConvertTable(iEmpire, szFileName);
} }
@ -987,8 +982,8 @@ static void __CheckPlayerSlot(const std::string& service_name)
{ {
if (PLAYER_PER_ACCOUNT != 4) if (PLAYER_PER_ACCOUNT != 4)
{ {
printf("<ERROR> PLAYER_PER_ACCOUNT = %d\n", PLAYER_PER_ACCOUNT); SPDLOG_CRITICAL("<ERROR> PLAYER_PER_ACCOUNT = {}", (int) PLAYER_PER_ACCOUNT);
exit(0); exit(EXIT_FAILURE);
} }
} }
@ -996,7 +991,7 @@ bool LocaleService_Init(const std::string& c_rstServiceName)
{ {
if (!g_stServiceName.empty()) if (!g_stServiceName.empty())
{ {
sys_err("ALREADY exist service"); SPDLOG_ERROR("ALREADY exist service");
return false; return false;
} }
@ -1139,7 +1134,7 @@ bool LocaleService_Init(const std::string& c_rstServiceName)
__LocaleService_Init_DEFAULT(); __LocaleService_Init_DEFAULT();
} }
fprintf(stdout, "Setting Locale \"%s\" (Path: %s)\n", g_stServiceName.c_str(), g_stServiceBasePath.c_str()); SPDLOG_INFO("Setting Locale \"{}\" (Path: {})", g_stServiceName.c_str(), g_stServiceBasePath.c_str());
__CheckPlayerSlot(g_stServiceName); __CheckPlayerSlot(g_stServiceName);
@ -1161,7 +1156,7 @@ void LocaleService_TransferDefaultSetting()
exp_table = exp_table_common; exp_table = exp_table_common;
if (!CTableBySkill::instance().Check()) if (!CTableBySkill::instance().Check())
exit(1); exit(EXIT_FAILURE);
if (!aiPercentByDeltaLevForBoss) if (!aiPercentByDeltaLevForBoss)
aiPercentByDeltaLevForBoss = aiPercentByDeltaLevForBoss_euckr; aiPercentByDeltaLevForBoss = aiPercentByDeltaLevForBoss_euckr;

View File

@ -35,8 +35,7 @@ void LogManager::Query(const char * c_pszFormat, ...)
vsnprintf(szQuery, sizeof(szQuery), c_pszFormat, args); vsnprintf(szQuery, sizeof(szQuery), c_pszFormat, args);
va_end(args); va_end(args);
if (test_server) SPDLOG_TRACE("LOG: {}", szQuery);
sys_log(0, "LOG: %s", szQuery);
m_sql.AsyncQuery(szQuery); m_sql.AsyncQuery(szQuery);
} }
@ -58,7 +57,7 @@ void LogManager::ItemLog(LPCHARACTER ch, LPITEM item, const char * c_pszText, co
{ {
if (NULL == ch || NULL == item) if (NULL == ch || NULL == item)
{ {
sys_err("character or item nil (ch %p item %p text %s)", get_pointer(ch), get_pointer(item), c_pszText); SPDLOG_ERROR("character or item nil (ch {} item {} text {})", (void*) get_pointer(ch), (void*) get_pointer(item), c_pszText);
return; return;
} }
@ -99,7 +98,7 @@ void LogManager::MoneyLog(BYTE type, DWORD vnum, int gold)
{ {
if (type == MONEY_LOG_RESERVED || type >= MONEY_LOG_TYPE_MAX_NUM) if (type == MONEY_LOG_RESERVED || type >= MONEY_LOG_TYPE_MAX_NUM)
{ {
sys_err("TYPE ERROR: type %d vnum %u gold %d", type, vnum, gold); SPDLOG_ERROR("TYPE ERROR: type {} vnum {} gold {}", type, vnum, gold);
return; return;
} }

View File

@ -92,7 +92,7 @@ const char * CLoginData::GetIP()
void CLoginData::SetRemainSecs(int l) void CLoginData::SetRemainSecs(int l)
{ {
m_lRemainSecs = l; m_lRemainSecs = l;
sys_log(0, "SetRemainSecs %s %d type %u", m_stLogin.c_str(), m_lRemainSecs, m_bBillType); SPDLOG_DEBUG("SetRemainSecs {} {} type {}", m_stLogin, m_lRemainSecs, m_bBillType);
} }
int CLoginData::GetRemainSecs() int CLoginData::GetRemainSecs()
@ -104,11 +104,11 @@ void CLoginData::SetBilling(bool bOn)
{ {
if (bOn) if (bOn)
{ {
sys_log(0, "BILLING: ON %s key %u ptr %p", m_stLogin.c_str(), m_dwKey, this); SPDLOG_DEBUG("BILLING: ON {} key {} ptr {}", m_stLogin, m_dwKey, (void*) this);
SetLogonTime(); SetLogonTime();
} }
else else
sys_log(0, "BILLING: OFF %s key %u ptr %p", m_stLogin.c_str(), m_dwKey, this); SPDLOG_DEBUG("BILLING: OFF {} key {} ptr {}", m_stLogin, m_dwKey, (void*) this);
m_bBilling = bOn; m_bBilling = bOn;
} }

View File

@ -19,7 +19,7 @@ class CLoginSim
void AddPlayer(DWORD dwID) void AddPlayer(DWORD dwID)
{ {
vecID.push_back(dwID); vecID.push_back(dwID);
sys_log(0, "AddPlayer %lu", dwID); SPDLOG_DEBUG("AddPlayer {}", dwID);
} }
bool IsCheck() bool IsCheck()

View File

@ -5,7 +5,7 @@ LZOManager::LZOManager()
{ {
if (lzo_init() != LZO_E_OK) if (lzo_init() != LZO_E_OK)
{ {
fprintf(stderr, "lzo_init() failed\n"); SPDLOG_CRITICAL("lzo_init() failed");
abort(); abort();
} }

View File

@ -152,9 +152,9 @@ void ContinueOnFatalError()
free(symbols); free(symbols);
sys_err("FatalError on %s", oss.str().c_str()); SPDLOG_ERROR("FatalError on {}", oss.str().c_str());
#else #else
sys_err("FatalError"); SPDLOG_ERROR("FatalError");
#endif #endif
} }
@ -572,11 +572,11 @@ int start(int argc, char **argv)
case '?': case '?':
if (strchr("Ipln", optopt)) if (strchr("Ipln", optopt))
fprintf(stderr, "Option -%c requires an argument.\n", optopt); SPDLOG_ERROR("Option -{} requires an argument.", optopt);
else if (isprint (optopt)) else if (isprint (optopt))
fprintf(stderr, "Unknown option `-%c'.\n", optopt); SPDLOG_ERROR("Unknown option `-{}'.", optopt);
else else
fprintf(stderr, "Unknown option character `\\x%x'.\n", optopt); SPDLOG_ERROR("Unknown option character `\\x{}'.", optopt);
default: default:
usage(); usage();
return 1; return 1;

View File

@ -18,7 +18,7 @@ bool CMapLocation::Get(int iIndex, LONG & lAddr, WORD & wPort)
{ {
if (iIndex == 0) if (iIndex == 0)
{ {
sys_log(0, "CMapLocation::Get - Error MapIndex[%d]", iIndex); SPDLOG_ERROR("CMapLocation::Get - Error MapIndex[{}]", iIndex);
return false; return false;
} }
@ -26,11 +26,11 @@ bool CMapLocation::Get(int iIndex, LONG & lAddr, WORD & wPort)
if (m_map_address.end() == it) if (m_map_address.end() == it)
{ {
sys_log(0, "CMapLocation::Get - Error MapIndex[%d]", iIndex); SPDLOG_ERROR("CMapLocation::Get - Error MapIndex[{}]", iIndex);
std::map<int, TLocation>::iterator i; std::map<int, TLocation>::iterator i;
for ( i = m_map_address.begin(); i != m_map_address.end(); ++i) for ( i = m_map_address.begin(); i != m_map_address.end(); ++i)
{ {
sys_log(0, "Map(%d): Server(%x:%d)", i->first, i->second.addr, i->second.port); SPDLOG_ERROR("Map({}): Server({}:{})", i->first, i->second.addr, i->second.port);
} }
return false; return false;
} }
@ -48,6 +48,6 @@ void CMapLocation::Insert(int lIndex, const char * c_pszHost, WORD wPort)
loc.port = wPort; loc.port = wPort;
m_map_address.insert(std::make_pair(lIndex, loc)); m_map_address.insert(std::make_pair(lIndex, loc));
sys_log(0, "MapLocation::Insert : %d %s %d", lIndex, c_pszHost, wPort); SPDLOG_DEBUG("MapLocation::Insert : {} {} {}", lIndex, c_pszHost, wPort);
} }

View File

@ -253,7 +253,7 @@ namespace marriage
{ {
d1->ChatPacket(CHAT_TYPE_COMMAND, "lover_login"); d1->ChatPacket(CHAT_TYPE_COMMAND, "lover_login");
d2->ChatPacket(CHAT_TYPE_COMMAND, "lover_login"); d2->ChatPacket(CHAT_TYPE_COMMAND, "lover_login");
sys_log(0, "lover_login %u %u", m_pid1, m_pid2); SPDLOG_DEBUG("lover_login {} {}", m_pid1, m_pid2);
} }
} }
} }
@ -329,7 +329,7 @@ namespace marriage
StopNearCheckEvent(); StopNearCheckEvent();
return; return;
} }
sys_log(0, "NearCheck %u %u %d %d %d", m_pid1, m_pid2, IsNear(), isLastNear, byLastLovePoint, GetMarriagePoint()); SPDLOG_DEBUG("NearCheck {} {} {} {} {}", m_pid1, m_pid2, IsNear(), isLastNear, byLastLovePoint, GetMarriagePoint());
if (IsNear() && !isLastNear) if (IsNear() && !isLastNear)
{ {
@ -372,7 +372,7 @@ namespace marriage
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "near_check_event> <Factor> Null pointer" ); SPDLOG_ERROR("near_check_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -399,7 +399,7 @@ namespace marriage
void TMarriage::Save() void TMarriage::Save()
{ {
sys_log(0, "TMarriage::Save() - RequestUpdate.bSave=%d", bSave); SPDLOG_DEBUG("TMarriage::Save() - RequestUpdate.bSave={}", bSave);
if (bSave) if (bSave)
{ {
CManager::instance().RequestUpdate(m_pid1, m_pid2, love_point, is_married); CManager::instance().RequestUpdate(m_pid1, m_pid2, love_point, is_married);
@ -459,7 +459,7 @@ namespace marriage
PIXEL_POSITION pos; PIXEL_POSITION pos;
if (!SECTREE_MANAGER::instance().GetRecallPositionByEmpire(pWeddingInfo->dwMapIndex/10000, 0, pos)) if (!SECTREE_MANAGER::instance().GetRecallPositionByEmpire(pWeddingInfo->dwMapIndex/10000, 0, pos))
{ {
sys_err("cannot get warp position"); SPDLOG_ERROR("cannot get warp position");
return; return;
} }
ch->SaveExitLocation(); ch->SaveExitLocation();
@ -561,7 +561,7 @@ namespace marriage
{ {
if (IsEngagedOrMarried(dwPID1) || IsEngagedOrMarried(dwPID2)) if (IsEngagedOrMarried(dwPID1) || IsEngagedOrMarried(dwPID2))
{ {
sys_err("cannot marry already married character. %d - %d", dwPID1, dwPID2); SPDLOG_ERROR("cannot marry already married character. {} - {}", dwPID1, dwPID2);
return; return;
} }
@ -608,7 +608,7 @@ namespace marriage
if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2) if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2)
{ {
sys_err("not under marriage : %u %u", dwPID1, dwPID2); SPDLOG_ERROR("not under marriage : {} {}", dwPID1, dwPID2);
return; return;
} }
@ -631,7 +631,7 @@ namespace marriage
TMarriage* pMarriage = Get(dwPID1); TMarriage* pMarriage = Get(dwPID1);
if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2) if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2)
{ {
sys_err("not under marriage : %u %u", dwPID1, dwPID2); SPDLOG_ERROR("not under marriage : {} {}", dwPID1, dwPID2);
return; return;
} }
@ -673,7 +673,7 @@ namespace marriage
TMarriage* pMarriage = Get(dwPID1); TMarriage* pMarriage = Get(dwPID1);
if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2) if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2)
{ {
sys_err("wrong marriage %u, %u", dwPID1, dwPID2); SPDLOG_ERROR("wrong marriage {}, {}", dwPID1, dwPID2);
return; return;
} }
@ -694,7 +694,7 @@ namespace marriage
TMarriage* pMarriage = Get(dwPID1); TMarriage* pMarriage = Get(dwPID1);
if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2) if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2)
{ {
sys_err("wrong marriage %u, %u", dwPID1, dwPID2); SPDLOG_ERROR("wrong marriage {}, {}", dwPID1, dwPID2);
return; return;
} }
@ -716,13 +716,13 @@ namespace marriage
TMarriage* pMarriage = Get(dwPID1); TMarriage* pMarriage = Get(dwPID1);
if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2) if (!pMarriage || pMarriage->GetOther(dwPID1) != dwPID2)
{ {
sys_err("wrong marriage %u, %u", dwPID1, dwPID2); SPDLOG_ERROR("wrong marriage {}, {}", dwPID1, dwPID2);
return; return;
} }
if (!pMarriage->pWeddingInfo) if (!pMarriage->pWeddingInfo)
{ {
sys_err("not under wedding %u, %u", dwPID1, dwPID2); SPDLOG_ERROR("not under wedding {}, {}", dwPID1, dwPID2);
return; return;
} }
@ -730,7 +730,7 @@ namespace marriage
if (map_allow_find(WEDDING_MAP_INDEX)) if (map_allow_find(WEDDING_MAP_INDEX))
if (!WeddingManager::instance().End(pMarriage->pWeddingInfo->dwMapIndex)) if (!WeddingManager::instance().End(pMarriage->pWeddingInfo->dwMapIndex))
{ {
sys_err("wedding map error: map_index=%d", pMarriage->pWeddingInfo->dwMapIndex); SPDLOG_ERROR("wedding map error: map_index={}", pMarriage->pWeddingInfo->dwMapIndex);
return; return;
} }

View File

@ -89,7 +89,7 @@ bool ChkCoordinate(const unsigned int rows, const unsigned int cols, const char*
if (max_lens != MAX_LENS || answer_lens != ASLENGTH) if (max_lens != MAX_LENS || answer_lens != ASLENGTH)
{ {
sys_err("MATRIX_CARD: length error matrix %d answer %d", max_lens, answer_lens); SPDLOG_ERROR("MATRIX_CARD: length error matrix {} answer {}", max_lens, answer_lens);
return false; return false;
} }
@ -117,7 +117,7 @@ bool MatrixCardCheck(const char * src, const char * answer, unsigned int rows, u
char decode_result[MAX_LENS+1]; char decode_result[MAX_LENS+1];
DecodeMatrix(src, szpasswd, decode_result, sizeof(decode_result)); DecodeMatrix(src, szpasswd, decode_result, sizeof(decode_result));
sys_log(0, "MatrixCardCheck %c%d %c%d %c%d %c%d answer %s", SPDLOG_DEBUG("MatrixCardCheck {}{} {}{} {}{} {}{} answer {}",
MATRIX_CARD_ROW(rows, 0) + 'A', MATRIX_CARD_ROW(rows, 0) + 'A',
MATRIX_CARD_COL(cols, 0) + 1, MATRIX_CARD_COL(cols, 0) + 1,
MATRIX_CARD_ROW(rows, 1) + 'A', MATRIX_CARD_ROW(rows, 1) + 'A',

View File

@ -62,7 +62,7 @@ void MessengerManager::LoadList(SQLMsg * msg)
std::string account; std::string account;
sys_log(1, "Messenger::LoadList"); SPDLOG_DEBUG("Messenger::LoadList");
for (uint i = 0; i < msg->Get()->uiNumRows; ++i) for (uint i = 0; i < msg->Get()->uiNumRows; ++i)
{ {
@ -149,7 +149,7 @@ void MessengerManager::AuthToAdd(MessengerManager::keyA account, MessengerManage
if (m_set_requestToAdd.find(dwComplex) == m_set_requestToAdd.end()) if (m_set_requestToAdd.find(dwComplex) == m_set_requestToAdd.end())
{ {
sys_log(0, "MessengerManager::AuthToAdd : request not exist %s -> %s", companion.c_str(), account.c_str()); SPDLOG_ERROR("MessengerManager::AuthToAdd : request not exist {} -> {}", companion.c_str(), account.c_str());
return; return;
} }
@ -191,7 +191,7 @@ void MessengerManager::AddToList(MessengerManager::keyA account, MessengerManage
if (m_Relation[account].find(companion) != m_Relation[account].end()) if (m_Relation[account].find(companion) != m_Relation[account].end())
return; return;
sys_log(0, "Messenger Add %s %s", account.c_str(), companion.c_str()); SPDLOG_DEBUG("Messenger Add {} {}", account.c_str(), companion.c_str());
DBManager::instance().Query("INSERT INTO messenger_list%s VALUES ('%s', '%s')", DBManager::instance().Query("INSERT INTO messenger_list%s VALUES ('%s', '%s')",
get_table_postfix(), account.c_str(), companion.c_str()); get_table_postfix(), account.c_str(), companion.c_str());
@ -222,7 +222,7 @@ void MessengerManager::RemoveFromList(MessengerManager::keyA account, MessengerM
if (companion.size() == 0) if (companion.size() == 0)
return; return;
sys_log(1, "Messenger Remove %s %s", account.c_str(), companion.c_str()); SPDLOG_DEBUG("Messenger Remove {} {}", account.c_str(), companion.c_str());
DBManager::instance().Query("DELETE FROM messenger_list%s WHERE account='%s' AND companion = '%s'", DBManager::instance().Query("DELETE FROM messenger_list%s WHERE account='%s' AND companion = '%s'",
get_table_postfix(), account.c_str(), companion.c_str()); get_table_postfix(), account.c_str(), companion.c_str());

View File

@ -124,7 +124,7 @@ namespace mining
if (iFractionCount == 0) if (iFractionCount == 0)
{ {
sys_err("Wrong ore fraction count"); SPDLOG_ERROR("Wrong ore fraction count");
return; return;
} }
@ -132,7 +132,7 @@ namespace mining
if (!item) if (!item)
{ {
sys_err("cannot create item vnum %d", dwRawOreVnum); SPDLOG_ERROR("cannot create item vnum {}", dwRawOreVnum);
return; return;
} }
@ -231,7 +231,7 @@ namespace mining
if (!Pick_Check(*item)) if (!Pick_Check(*item))
{ {
sys_err("REFINE_PICK_HACK pid(%u) item(%s:%d) type(%d)", ch->GetPlayerID(), item->GetName(), item->GetID(), item->GetType()); SPDLOG_ERROR("REFINE_PICK_HACK pid({}) item({}:{}) type({})", ch->GetPlayerID(), item->GetName(), item->GetID(), item->GetType());
rkLogMgr.RefineLog(ch->GetPlayerID(), item->GetName(), item->GetID(), -1, 1, "PICK_HACK"); rkLogMgr.RefineLog(ch->GetPlayerID(), item->GetName(), item->GetID(), -1, 1, "PICK_HACK");
return 2; return 2;
} }
@ -338,7 +338,7 @@ namespace mining
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "mining_event_info> <Factor> Null pointer" ); SPDLOG_ERROR("mining_event_info> <Factor> Null pointer" );
return 0; return 0;
} }
@ -399,13 +399,13 @@ namespace mining
if (item->GetOwner() != ch) if (item->GetOwner() != ch)
{ {
sys_err("wrong owner"); SPDLOG_ERROR("wrong owner");
return false; return false;
} }
if (item->GetCount() < ORE_COUNT_FOR_REFINE) if (item->GetCount() < ORE_COUNT_FOR_REFINE)
{ {
sys_err("not enough count"); SPDLOG_ERROR("not enough count");
return false; return false;
} }

View File

@ -30,7 +30,7 @@ void CMob::AddSkillSplash(int iIndex, DWORD dwTiming, DWORD dwHitDistance)
if (iIndex >= MOB_SKILL_MAX_NUM || iIndex < 0) if (iIndex >= MOB_SKILL_MAX_NUM || iIndex < 0)
return; return;
sys_log(0, "MOB_SPLASH %s idx %d timing %u hit_distance %u", SPDLOG_TRACE("MOB_SPLASH {} idx {} timing {} hit_distance {}",
m_table.szLocaleName, iIndex, dwTiming, dwHitDistance); m_table.szLocaleName, iIndex, dwTiming, dwHitDistance);
m_mobSkillInfo[iIndex].vecSplashAttack.push_back(TMobSplashAttackInfo(dwTiming, dwHitDistance)); m_mobSkillInfo[iIndex].vecSplashAttack.push_back(TMobSplashAttackInfo(dwTiming, dwHitDistance));
@ -76,7 +76,7 @@ bool CMobManager::Initialize(TMobTable * pTable, int iSize)
if (pkMob->m_table.Skills[j].dwVnum) if (pkMob->m_table.Skills[j].dwVnum)
++SkillCount; ++SkillCount;
sys_log(0, "MOB: #%-5d %-30s LEVEL %u HP %u DEF %u EXP %u DROP_ITEM_VNUM %u SKILL_COUNT %d", SPDLOG_TRACE("MOB: #{:5} {:30} LEVEL {} HP {} DEF {} EXP {} DROP_ITEM_VNUM {} SKILL_COUNT {}",
t->dwVnum, t->szLocaleName, t->bLevel, t->dwMaxHP, t->wDef, t->dwExp, t->dwDropItemVnum, SkillCount); t->dwVnum, t->szLocaleName, t->bLevel, t->dwMaxHP, t->wDef, t->dwExp, t->dwDropItemVnum, SkillCount);
if (t->bType == CHAR_TYPE_NPC || t->bType == CHAR_TYPE_WARP || t->bType == CHAR_TYPE_GOTO) if (t->bType == CHAR_TYPE_NPC || t->bType == CHAR_TYPE_WARP || t->bType == CHAR_TYPE_GOTO)
@ -98,17 +98,17 @@ bool CMobManager::Initialize(TMobTable * pTable, int iSize)
if (!LoadGroup(szGroupFileName)) if (!LoadGroup(szGroupFileName))
{ {
sys_err("cannot load %s", szGroupFileName); SPDLOG_ERROR("cannot load {}", szGroupFileName);
thecore_shutdown(); thecore_shutdown();
} }
if (!LoadGroupGroup(szGroupGroupFileName)) if (!LoadGroupGroup(szGroupGroupFileName))
{ {
sys_err("cannot load %s", szGroupGroupFileName); SPDLOG_ERROR("cannot load {}", szGroupGroupFileName);
thecore_shutdown(); thecore_shutdown();
} }
// END_OF_LOCALE_SERVICE // END_OF_LOCALE_SERVICE
//exit(1); //exit(EXIT_FAILURE);
CHARACTER_MANAGER::instance().for_each_pc(std::bind1st(std::mem_fun(&CMobManager::RebindMobProto),this)); CHARACTER_MANAGER::instance().for_each_pc(std::bind1st(std::mem_fun(&CMobManager::RebindMobProto),this));
return true; return true;
} }
@ -264,7 +264,7 @@ bool CMobManager::LoadGroupGroup(const char * c_pszFileName)
if (!loader.GetTokenInteger("vnum", &iVnum)) if (!loader.GetTokenInteger("vnum", &iVnum))
{ {
sys_err("LoadGroupGroup : Syntax error %s : no vnum, node %s", c_pszFileName, stName.c_str()); SPDLOG_ERROR("LoadGroupGroup : Syntax error {} : no vnum, node {}", c_pszFileName, stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
continue; continue;
} }
@ -325,7 +325,7 @@ bool CMobManager::LoadGroup(const char * c_pszFileName)
if (!loader.GetTokenInteger("vnum", &iVnum)) if (!loader.GetTokenInteger("vnum", &iVnum))
{ {
sys_err("LoadGroup : Syntax error %s : no vnum, node %s", c_pszFileName, stName.c_str()); SPDLOG_ERROR("LoadGroup : Syntax error {} : no vnum, node {}", c_pszFileName, stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
continue; continue;
} }
@ -334,14 +334,14 @@ bool CMobManager::LoadGroup(const char * c_pszFileName)
if (!loader.GetTokenVector("leader", &pTok)) if (!loader.GetTokenVector("leader", &pTok))
{ {
sys_err("LoadGroup : Syntax error %s : no leader, node %s", c_pszFileName, stName.c_str()); SPDLOG_ERROR("LoadGroup : Syntax error {} : no leader, node {}", c_pszFileName, stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
continue; continue;
} }
if (pTok->size() < 2) if (pTok->size() < 2)
{ {
sys_err("LoadGroup : Syntax error %s : no leader vnum, node %s", c_pszFileName, stName.c_str()); SPDLOG_ERROR("LoadGroup : Syntax error {} : no leader vnum, node {}", c_pszFileName, stName.c_str());
loader.SetParentNode(); loader.SetParentNode();
continue; continue;
} }
@ -353,8 +353,8 @@ bool CMobManager::LoadGroup(const char * c_pszFileName)
str_to_number(vnum, pTok->at(1).c_str()); str_to_number(vnum, pTok->at(1).c_str());
pkGroup->AddMember(vnum); pkGroup->AddMember(vnum);
sys_log(0, "GROUP: %-5d %s", iVnum, stName.c_str()); SPDLOG_TRACE("GROUP: {:<5} {}", iVnum, stName);
sys_log(0, " %s %s", pTok->at(0).c_str(), pTok->at(1).c_str()); SPDLOG_TRACE(" {} {}", pTok->at(0), pTok->at(1));
for (int k = 1; k < 256; ++k) for (int k = 1; k < 256; ++k)
{ {
@ -363,7 +363,7 @@ bool CMobManager::LoadGroup(const char * c_pszFileName)
if (loader.GetTokenVector(buf, &pTok)) if (loader.GetTokenVector(buf, &pTok))
{ {
sys_log(0, " %s %s", pTok->at(0).c_str(), pTok->at(1).c_str()); SPDLOG_TRACE(" {} {}", pTok->at(0), pTok->at(1));
DWORD vnum = 0; DWORD vnum = 0;
str_to_number(vnum, pTok->at(1).c_str()); str_to_number(vnum, pTok->at(1).c_str());
pkGroup->AddMember(vnum); pkGroup->AddMember(vnum);

View File

@ -4,7 +4,6 @@
#include "char.h" #include "char.h"
#include "sectree_manager.h" #include "sectree_manager.h"
#include "desc_client.h" #include "desc_client.h"
#include "dev_log.h"
extern int test_server; extern int test_server;
extern int passes_per_sec; extern int passes_per_sec;
@ -56,14 +55,14 @@ int CMonarch::HealMyEmpire(LPCHARACTER ch ,DWORD price)
BYTE Empire = ch->GetEmpire(); BYTE Empire = ch->GetEmpire();
DWORD pid = ch->GetPlayerID(); DWORD pid = ch->GetPlayerID();
sys_log(0, "HealMyEmpire[%d] pid:%d price %d", pid, Empire, price); SPDLOG_DEBUG("HealMyEmpire[{}] pid:{} price {}", pid, Empire, price);
if (IsMonarch(pid, Empire) == 0) if (IsMonarch(pid, Empire) == 0)
{ {
if (!ch->IsGM()) if (!ch->IsGM())
{ {
ch->ChatPacket(CHAT_TYPE_INFO ,LC_TEXT("군주의 자격을 가지고 있지 않습니다")); ch->ChatPacket(CHAT_TYPE_INFO ,LC_TEXT("군주의 자격을 가지고 있지 않습니다"));
sys_err("No Monarch pid %d ", pid); SPDLOG_ERROR("No Monarch pid {} ", pid);
return 0; return 0;
} }
} }
@ -113,7 +112,7 @@ bool CMonarch::IsMonarch(DWORD pid, BYTE bEmpire)
bool CMonarch::IsMoneyOk(int price, BYTE bEmpire) bool CMonarch::IsMoneyOk(int price, BYTE bEmpire)
{ {
dev_log(LOG_DEB1, "GetMoney(%d), price = (%d,%d)", bEmpire, GetMoney(bEmpire), price); SPDLOG_TRACE("GetMoney({}), price = ({},{})", bEmpire, GetMoney(bEmpire), price);
return (GetMoney(bEmpire) >= price); return (GetMoney(bEmpire) >= price);
} }
@ -209,8 +208,7 @@ bool CMonarch::CheckPowerUpCT(BYTE Empire)
if (m_PowerUpCT[Empire] > thecore_pulse()) if (m_PowerUpCT[Empire] > thecore_pulse())
{ {
if (test_server) SPDLOG_TRACE("[TEST_ONLY] : CheckPowerUpCT CT{} Now{} 60sec {}", m_PowerUpCT[Empire], thecore_pulse(), PASSES_PER_SEC(60 * 10));
sys_log(0, "[TEST_ONLY] : CheckPowerUpCT CT%d Now%d 60sec %d", m_PowerUpCT[Empire], thecore_pulse(), PASSES_PER_SEC(60 * 10));
return false; return false;
} }
@ -224,8 +222,7 @@ bool CMonarch::CheckDefenseUpCT(BYTE Empire)
if (m_DefenseUpCT[Empire] > thecore_pulse()) if (m_DefenseUpCT[Empire] > thecore_pulse())
{ {
if (test_server) SPDLOG_TRACE("[TEST_ONLY] : CheckPowerUpCT CT{} Now{} 60sec {}", m_PowerUpCT[Empire], thecore_pulse(), PASSES_PER_SEC(60 * 10));
sys_log(0, "[TEST_ONLY] : CheckPowerUpCT CT%d Now%d 60sec %d", m_PowerUpCT[Empire], thecore_pulse(), PASSES_PER_SEC(60 * 10));
return false; return false;
} }

View File

@ -95,7 +95,7 @@ static const char* GetMotionFileName(TMobTable* mobTable, EPublicMotion motion)
default: default:
fclose(fp); fclose(fp);
sys_err("Motion: no process for this motion(%d) vnum(%d)", motion, mobTable->dwVnum); SPDLOG_ERROR("Motion: no process for this motion({}) vnum({})", (int) motion, mobTable->dwVnum);
return NULL; return NULL;
} }
@ -124,7 +124,7 @@ static const char* GetMotionFileName(TMobTable* mobTable, EPublicMotion motion)
} }
else else
{ {
sys_err("Motion: %s have not motlist.txt vnum(%d) folder(%s)", folder, mobTable->dwVnum, mobTable->szFolder); SPDLOG_ERROR("Motion: {} have not motlist.txt vnum({}) folder({})", folder, mobTable->dwVnum, mobTable->szFolder);
} }
return NULL; return NULL;
@ -145,14 +145,14 @@ static void LoadMotion(CMotionSet* pMotionSet, TMobTable* mob_table, EPublicMoti
{ {
if (motion == MOTION_RUN) if (motion == MOTION_RUN)
if (0.0f == pMotion->GetAccumVector().y) if (0.0f == pMotion->GetAccumVector().y)
sys_err("cannot find accumulation data in file '%s'", cpFileName); SPDLOG_ERROR("cannot find accumulation data in file '{}'", cpFileName);
pMotionSet->Insert(MAKE_MOTION_KEY(MOTION_MODE_GENERAL, motion), pMotion); pMotionSet->Insert(MAKE_MOTION_KEY(MOTION_MODE_GENERAL, motion), pMotion);
} }
else else
{ {
M2_DELETE(pMotion); M2_DELETE(pMotion);
sys_err("Motion: Load failed vnum(%d) motion(%d) file(%s)", mob_table->dwVnum, motion, cpFileName); SPDLOG_ERROR("Motion: Load failed vnum({}) motion({}) file({})", mob_table->dwVnum, (int) motion, cpFileName);
} }
} }
@ -189,7 +189,7 @@ static void LoadSkillMotion(CMotionSet* pMotionSet, CMob* pMob, EPublicMotion mo
{ {
if (mob_table->Skills[idx].dwVnum != 0) if (mob_table->Skills[idx].dwVnum != 0)
{ {
sys_err("Motion: Skill exist but no motion data for index %d mob %u skill %u", SPDLOG_ERROR("Motion: Skill exist but no motion data for index {} mob {} skill {}",
idx, mob_table->dwVnum, mob_table->Skills[idx].dwVnum); idx, mob_table->dwVnum, mob_table->Skills[idx].dwVnum);
} }
M2_DELETE(pMotion); M2_DELETE(pMotion);
@ -347,7 +347,7 @@ bool CMotionManager::Build()
// POLYMORPH_BUG_FIX // POLYMORPH_BUG_FIX
float normalAttackDuration = MOB_GetNormalAttackDuration(t); float normalAttackDuration = MOB_GetNormalAttackDuration(t);
sys_log(0, "mob_normal_attack_duration:%d:%s:%.2f", t->dwVnum, t->szFolder, normalAttackDuration); SPDLOG_TRACE("mob_normal_attack_duration:{}:{}:{:.2f}", t->dwVnum, t->szFolder, normalAttackDuration);
m_map_normalAttackDuration.insert(std::map<DWORD, float>::value_type(t->dwVnum, normalAttackDuration)); m_map_normalAttackDuration.insert(std::map<DWORD, float>::value_type(t->dwVnum, normalAttackDuration));
// END_OF_POLYMORPH_BUG_FIX // END_OF_POLYMORPH_BUG_FIX
} }
@ -422,7 +422,7 @@ bool CMotion::LoadMobSkillFromFile(const char * c_pszFileName, CMob* pMob, int i
if (!rkTextFileLoader.GetTokenFloat("motionduration", &m_fDuration)) if (!rkTextFileLoader.GetTokenFloat("motionduration", &m_fDuration))
{ {
sys_err("Motion: no motion duration %s", c_pszFileName); SPDLOG_ERROR("Motion: no motion duration {}", c_pszFileName);
return false; return false;
} }
@ -448,14 +448,14 @@ bool CMotion::LoadMobSkillFromFile(const char * c_pszFileName, CMob* pMob, int i
{ {
if (!rkTextFileLoader.SetChildNode("event", j)) if (!rkTextFileLoader.SetChildNode("event", j))
{ {
sys_err("Motion: no event data %d %s", j, c_pszFileName); SPDLOG_ERROR("Motion: no event data {} {}", j, c_pszFileName);
return false; return false;
} }
int iType; int iType;
if (!rkTextFileLoader.GetTokenInteger("motioneventtype", &iType)) if (!rkTextFileLoader.GetTokenInteger("motioneventtype", &iType))
{ {
sys_err("Motion: no motioneventtype data %s", c_pszFileName); SPDLOG_ERROR("Motion: no motioneventtype data {}", c_pszFileName);
return false; return false;
} }
@ -479,7 +479,7 @@ bool CMotion::LoadMobSkillFromFile(const char * c_pszFileName, CMob* pMob, int i
// 구 데이터는 하나 라고 가정 // 구 데이터는 하나 라고 가정
if (!rkTextFileLoader.SetChildNode("spheredata", 0)) if (!rkTextFileLoader.SetChildNode("spheredata", 0))
{ {
sys_err("Motion: no sphere data %s", c_pszFileName); SPDLOG_ERROR("Motion: no sphere data {}", c_pszFileName);
return false; return false;
} }
@ -487,7 +487,7 @@ bool CMotion::LoadMobSkillFromFile(const char * c_pszFileName, CMob* pMob, int i
//return false; //return false;
if (!rkTextFileLoader.GetTokenPosition("position", &v3Position)) if (!rkTextFileLoader.GetTokenPosition("position", &v3Position))
{ {
sys_err("Motion: no position data %s", c_pszFileName); SPDLOG_ERROR("Motion: no position data {}", c_pszFileName);
return false; return false;
} }
@ -503,7 +503,7 @@ bool CMotion::LoadMobSkillFromFile(const char * c_pszFileName, CMob* pMob, int i
if (!rkTextFileLoader.GetTokenFloat("startingtime", &fStartingTime)) if (!rkTextFileLoader.GetTokenFloat("startingtime", &fStartingTime))
{ {
sys_err("Motion: no startingtime data %s", c_pszFileName); SPDLOG_ERROR("Motion: no startingtime data {}", c_pszFileName);
return false; return false;
} }
@ -527,20 +527,20 @@ bool CMotion::LoadFromFile(const char * c_pszFileName)
if (!loader.Load(c_pszFileName)) if (!loader.Load(c_pszFileName))
{ {
sys_log(0, "Motion: LoadFromFile fail: %s", c_pszFileName); SPDLOG_ERROR("Motion: LoadFromFile fail: {}", c_pszFileName);
return false; return false;
} }
if (!loader.GetTokenFloat("motionduration", &m_fDuration)) if (!loader.GetTokenFloat("motionduration", &m_fDuration))
{ {
sys_err("Motion: %s does not have a duration", c_pszFileName); SPDLOG_ERROR("Motion: {} does not have a duration", c_pszFileName);
return false; return false;
} }
if (loader.GetTokenPosition("accumulation", &m_vec3Accumulation)) if (loader.GetTokenPosition("accumulation", &m_vec3Accumulation))
m_isAccumulation = true; m_isAccumulation = true;
sys_log(1, "%-48s %.3f %f", strchr(c_pszFileName, '/') + 1, GetDuration(), GetAccumVector().y); SPDLOG_TRACE("{:48} {:.3f} {}", strchr(c_pszFileName, '/') + 1, GetDuration(), GetAccumVector().y);
m_isEmpty = false; m_isEmpty = false;
return true; return true;

View File

@ -64,21 +64,21 @@ void P2P_MANAGER::FlushOutput()
void P2P_MANAGER::RegisterAcceptor(LPDESC d) void P2P_MANAGER::RegisterAcceptor(LPDESC d)
{ {
sys_log(0, "P2P Acceptor opened (host %s)", d->GetHostName()); SPDLOG_INFO("P2P Acceptor opened (host {})", d->GetHostName());
m_set_pkPeers.insert(d); m_set_pkPeers.insert(d);
Boot(d); Boot(d);
} }
void P2P_MANAGER::UnregisterAcceptor(LPDESC d) void P2P_MANAGER::UnregisterAcceptor(LPDESC d)
{ {
sys_log(0, "P2P Acceptor closed (host %s)", d->GetHostName()); SPDLOG_INFO("P2P Acceptor closed (host {})", d->GetHostName());
EraseUserByDesc(d); EraseUserByDesc(d);
m_set_pkPeers.erase(d); m_set_pkPeers.erase(d);
} }
void P2P_MANAGER::RegisterConnector(LPDESC d) void P2P_MANAGER::RegisterConnector(LPDESC d)
{ {
sys_log(0, "P2P Connector opened (host %s)", d->GetHostName()); SPDLOG_INFO("P2P Connector opened (host {})", d->GetHostName());
m_set_pkPeers.insert(d); m_set_pkPeers.insert(d);
Boot(d); Boot(d);
@ -95,7 +95,7 @@ void P2P_MANAGER::UnregisterConnector(LPDESC d)
if (it != m_set_pkPeers.end()) if (it != m_set_pkPeers.end())
{ {
sys_log(0, "P2P Connector closed (host %s)", d->GetHostName()); SPDLOG_INFO("P2P Connector closed (host {})", d->GetHostName());
EraseUserByDesc(d); EraseUserByDesc(d);
m_set_pkPeers.erase(it); m_set_pkPeers.erase(it);
} }
@ -157,7 +157,7 @@ void P2P_MANAGER::Login(LPDESC d, const TPacketGGLogin * p)
} }
else else
{ {
sys_err("LOGIN_EMPIRE_ERROR: %d >= MAX(%d)", pkCCI->bEmpire, EMPIRE_MAX_NUM); SPDLOG_ERROR("LOGIN_EMPIRE_ERROR: {} >= MAX({})", pkCCI->bEmpire, (int) EMPIRE_MAX_NUM);
} }
} }
@ -168,7 +168,7 @@ void P2P_MANAGER::Login(LPDESC d, const TPacketGGLogin * p)
pkCCI->lMapIndex = p->lMapIndex; pkCCI->lMapIndex = p->lMapIndex;
pkCCI->pkDesc = d; pkCCI->pkDesc = d;
pkCCI->bChannel = p->bChannel; pkCCI->bChannel = p->bChannel;
sys_log(0, "P2P: Login %s", pkCCI->szName); SPDLOG_INFO("P2P: Login {}", pkCCI->szName);
CGuildManager::instance().P2PLoginMember(pkCCI->dwPID); CGuildManager::instance().P2PLoginMember(pkCCI->dwPID);
CPartyManager::instance().P2PLogin(pkCCI->dwPID, pkCCI->szName); CPartyManager::instance().P2PLogin(pkCCI->dwPID, pkCCI->szName);
@ -189,12 +189,12 @@ void P2P_MANAGER::Logout(CCI * pkCCI)
--m_aiEmpireUserCount[pkCCI->bEmpire]; --m_aiEmpireUserCount[pkCCI->bEmpire];
if (m_aiEmpireUserCount[pkCCI->bEmpire] < 0) if (m_aiEmpireUserCount[pkCCI->bEmpire] < 0)
{ {
sys_err("m_aiEmpireUserCount[%d] < 0", pkCCI->bEmpire); SPDLOG_ERROR("m_aiEmpireUserCount[{}] < 0", pkCCI->bEmpire);
} }
} }
else else
{ {
sys_err("LOGOUT_EMPIRE_ERROR: %d >= MAX(%d)", pkCCI->bEmpire, EMPIRE_MAX_NUM); SPDLOG_ERROR("LOGOUT_EMPIRE_ERROR: {} >= MAX({})", pkCCI->bEmpire, (int) EMPIRE_MAX_NUM);
} }
} }
@ -218,7 +218,7 @@ void P2P_MANAGER::Logout(const char * c_pszName)
return; return;
Logout(pkCCI); Logout(pkCCI);
sys_log(0, "P2P: Logout %s", c_pszName); SPDLOG_INFO("P2P: Logout {}", c_pszName);
} }
CCI * P2P_MANAGER::FindByPID(DWORD pid) CCI * P2P_MANAGER::FindByPID(DWORD pid)

View File

@ -29,14 +29,14 @@ size_t PanamaLoad()
if (!fpIV) if (!fpIV)
{ {
sys_err("cannot open iv file %s", szIVFileName); SPDLOG_ERROR("cannot open iv file {}", szIVFileName);
continue; continue;
} }
BYTE abIV[32]; BYTE abIV[32];
if (32 != fread(abIV, sizeof(BYTE), 32, fpIV)) if (32 != fread(abIV, sizeof(BYTE), 32, fpIV))
sys_err("IV file format error! %s", szIVFileName); SPDLOG_ERROR("IV file format error! {}", szIVFileName);
else else
{ {
char szHex[64 + 1]; char szHex[64 + 1];
@ -44,7 +44,7 @@ size_t PanamaLoad()
for (int i = 0; i < 32; ++i) for (int i = 0; i < 32; ++i)
snprintf(szHex + i * 2, sizeof(szHex) - i * 2, "%02x", abIV[i]); snprintf(szHex + i * 2, sizeof(szHex) - i * 2, "%02x", abIV[i]);
sys_log(0, "PANAMA: %s %s", szPackName, szHex); SPDLOG_DEBUG("PANAMA: {} {}", szPackName, szHex);
s_panamaVector.push_back(std::make_pair(szPackName, M2_NEW BYTE[32])); s_panamaVector.push_back(std::make_pair(szPackName, M2_NEW BYTE[32]));
memcpy(s_panamaVector[s_panamaVector.size() - 1].second, abIV, 32); memcpy(s_panamaVector[s_panamaVector.size() - 1].second, abIV, 32);

View File

@ -80,7 +80,7 @@ void CPartyManager::P2PJoinParty(DWORD leader, DWORD pid, BYTE role)
} }
else else
{ {
sys_err("No such party with leader [%d]", leader); SPDLOG_ERROR("No such party with leader [{}]", leader);
} }
} }
@ -94,7 +94,7 @@ void CPartyManager::P2PQuitParty(DWORD pid)
} }
else else
{ {
sys_err("No such party with member [%d]", pid); SPDLOG_ERROR("No such party with member [{}]", pid);
} }
} }
@ -125,7 +125,7 @@ void CPartyManager::P2PDeleteParty(DWORD pid)
M2_DELETE(it->second); M2_DELETE(it->second);
} }
else else
sys_err("PARTY P2PDeleteParty Cannot find party [%u]", pid); SPDLOG_ERROR("PARTY P2PDeleteParty Cannot find party [{}]", pid);
} }
LPPARTY CPartyManager::CreateParty(LPCHARACTER pLeader) LPPARTY CPartyManager::CreateParty(LPCHARACTER pLeader)
@ -147,7 +147,7 @@ LPPARTY CPartyManager::CreateParty(LPCHARACTER pLeader)
db_clientdesc->DBPacket(HEADER_GD_PARTY_CREATE, 0, &p, sizeof(TPacketPartyCreate)); db_clientdesc->DBPacket(HEADER_GD_PARTY_CREATE, 0, &p, sizeof(TPacketPartyCreate));
sys_log(0, "PARTY: Create %s pid %u", pLeader->GetName(), pLeader->GetPlayerID()); SPDLOG_DEBUG("PARTY: Create {} pid {}", pLeader->GetName(), pLeader->GetPlayerID());
pParty->SetPCParty(true); pParty->SetPCParty(true);
pParty->Join(pLeader->GetPlayerID()); pParty->Join(pLeader->GetPlayerID());
@ -224,7 +224,7 @@ EVENTFUNC(party_update_event)
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "party_update_event> <Factor> Null pointer" ); SPDLOG_ERROR("party_update_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -254,7 +254,7 @@ CParty::~CParty()
void CParty::Initialize() void CParty::Initialize()
{ {
sys_log(2, "Party::Initialize"); SPDLOG_TRACE("Party::Initialize");
m_iExpDistributionMode = PARTY_EXP_DISTRIBUTION_NON_PARITY; m_iExpDistributionMode = PARTY_EXP_DISTRIBUTION_NON_PARITY;
m_pkChrExpCentralize = NULL; m_pkChrExpCentralize = NULL;
@ -293,7 +293,7 @@ void CParty::Initialize()
void CParty::Destroy() void CParty::Destroy()
{ {
sys_log(2, "Party::Destroy"); SPDLOG_TRACE("Party::Destroy");
// PC가 만든 파티면 파티매니저에 맵에서 PID를 삭제해야 한다. // PC가 만든 파티면 파티매니저에 맵에서 PID를 삭제해야 한다.
if (m_bPCParty) if (m_bPCParty)
@ -406,7 +406,7 @@ void CParty::P2PJoin(DWORD dwPID)
if (ch) if (ch)
{ {
sys_log(0, "PARTY: Join %s pid %u leader %u", ch->GetName(), dwPID, m_dwLeaderPID); SPDLOG_DEBUG("PARTY: Join {} pid {} leader {}", ch->GetName(), dwPID, m_dwLeaderPID);
Member.strName = ch->GetName(); Member.strName = ch->GetName();
if (Member.bRole == PARTY_ROLE_LEADER) if (Member.bRole == PARTY_ROLE_LEADER)
@ -420,11 +420,11 @@ void CParty::P2PJoin(DWORD dwPID)
else if (pcci->bChannel == g_bChannel) else if (pcci->bChannel == g_bChannel)
Member.strName = pcci->szName; Member.strName = pcci->szName;
else else
sys_err("member is not in same channel PID: %u channel %d, this channel %d", dwPID, pcci->bChannel, g_bChannel); SPDLOG_ERROR("member is not in same channel PID: {} channel {}, this channel {}", dwPID, pcci->bChannel, g_bChannel);
} }
} }
sys_log(2, "PARTY[%d] MemberCountChange %d -> %d", GetLeaderPID(), GetMemberCount(), GetMemberCount()+1); SPDLOG_TRACE("PARTY[{}] MemberCountChange {} -> {}", GetLeaderPID(), GetMemberCount(), GetMemberCount()+1);
m_memberMap.insert(TMemberMap::value_type(dwPID, Member)); m_memberMap.insert(TMemberMap::value_type(dwPID, Member));
@ -484,7 +484,7 @@ void CParty::P2PQuit(DWORD dwPID)
m_memberMap.erase(it); m_memberMap.erase(it);
sys_log(2, "PARTY[%d] MemberCountChange %d -> %d", GetLeaderPID(), GetMemberCount(), GetMemberCount() - 1); SPDLOG_TRACE("PARTY[{}] MemberCountChange {} -> {}", GetLeaderPID(), GetMemberCount(), GetMemberCount() - 1);
if (bRole < PARTY_ROLE_MAX_NUM) if (bRole < PARTY_ROLE_MAX_NUM)
{ {
@ -492,7 +492,7 @@ void CParty::P2PQuit(DWORD dwPID)
} }
else else
{ {
sys_err("ROLE_COUNT_QUIT_ERROR: INDEX(%d) > MAX(%d)", bRole, PARTY_ROLE_MAX_NUM); SPDLOG_ERROR("ROLE_COUNT_QUIT_ERROR: INDEX({}) > MAX({})", bRole, (int) PARTY_ROLE_MAX_NUM);
} }
if (ch) if (ch)
@ -542,7 +542,7 @@ void CParty::Link(LPCHARACTER pkChr)
if (it == m_memberMap.end()) if (it == m_memberMap.end())
{ {
sys_err("%s is not member of this party", pkChr->GetName()); SPDLOG_ERROR("{} is not member of this party", pkChr->GetName());
return; return;
} }
@ -557,7 +557,7 @@ void CParty::Link(LPCHARACTER pkChr)
if (it->second.bRole == PARTY_ROLE_LEADER) if (it->second.bRole == PARTY_ROLE_LEADER)
m_pkChrLeader = pkChr; m_pkChrLeader = pkChr;
sys_log(2, "PARTY[%d] %s linked to party", GetLeaderPID(), pkChr->GetName()); SPDLOG_TRACE("PARTY[{}] {} linked to party", GetLeaderPID(), pkChr->GetName());
it->second.pCharacter = pkChr; it->second.pCharacter = pkChr;
pkChr->SetParty(this); pkChr->SetParty(this);
@ -579,7 +579,6 @@ void CParty::Link(LPCHARACTER pkChr)
SendParameter(pkChr); SendParameter(pkChr);
//sys_log(0, "PARTY-DUNGEON connect %p %p", this, GetDungeon());
if (GetDungeon() && GetDungeon()->GetMapIndex() == pkChr->GetMapIndex()) if (GetDungeon() && GetDungeon()->GetMapIndex() == pkChr->GetMapIndex())
{ {
pkChr->SetDungeon(GetDungeon()); pkChr->SetDungeon(GetDungeon());
@ -606,7 +605,7 @@ void CParty::P2PSetMemberLevel(DWORD pid, BYTE level)
TMemberMap::iterator it; TMemberMap::iterator it;
sys_log(0, "PARTY P2PSetMemberLevel leader %d pid %d level %d", GetLeaderPID(), pid, level); SPDLOG_DEBUG("PARTY P2PSetMemberLevel leader {} pid {} level {}", GetLeaderPID(), pid, level);
it = m_memberMap.find(pid); it = m_memberMap.find(pid);
if (it != m_memberMap.end()) if (it != m_memberMap.end())
@ -637,7 +636,7 @@ void CParty::Unlink(LPCHARACTER pkChr)
if (it == m_memberMap.end()) if (it == m_memberMap.end())
{ {
sys_err("%s is not member of this party", pkChr->GetName()); SPDLOG_ERROR("{} is not member of this party", pkChr->GetName());
return; return;
} }
@ -804,7 +803,6 @@ void CParty::SendPartyInfoOneToAll(DWORD pid)
{ {
if ((it->second.pCharacter) && (it->second.pCharacter->GetDesc())) if ((it->second.pCharacter) && (it->second.pCharacter->GetDesc()))
{ {
//sys_log(2, "PARTY send info %s[%d] to %s[%d]", ch->GetName(), (DWORD)ch->GetVID(), it->second.pCharacter->GetName(), (DWORD)it->second.pCharacter->GetVID());
it->second.pCharacter->GetDesc()->Packet(&p, sizeof(p)); it->second.pCharacter->GetDesc()->Packet(&p, sizeof(p));
} }
} }
@ -825,7 +823,7 @@ void CParty::SendPartyInfoOneToAll(LPCHARACTER ch)
{ {
if ((it->second.pCharacter) && (it->second.pCharacter->GetDesc())) if ((it->second.pCharacter) && (it->second.pCharacter->GetDesc()))
{ {
sys_log(2, "PARTY send info %s[%d] to %s[%d]", ch->GetName(), (DWORD)ch->GetVID(), it->second.pCharacter->GetName(), (DWORD)it->second.pCharacter->GetVID()); SPDLOG_TRACE("PARTY send info {}[{}] to {}[{}]", ch->GetName(), (DWORD)ch->GetVID(), it->second.pCharacter->GetName(), (DWORD)it->second.pCharacter->GetVID());
it->second.pCharacter->GetDesc()->Packet(&p, sizeof(p)); it->second.pCharacter->GetDesc()->Packet(&p, sizeof(p));
} }
} }
@ -852,7 +850,7 @@ void CParty::SendPartyInfoAllToOne(LPCHARACTER ch)
} }
it->second.pCharacter->BuildUpdatePartyPacket(p); it->second.pCharacter->BuildUpdatePartyPacket(p);
sys_log(2, "PARTY send info %s[%d] to %s[%d]", it->second.pCharacter->GetName(), (DWORD)it->second.pCharacter->GetVID(), ch->GetName(), (DWORD)ch->GetVID()); SPDLOG_TRACE("PARTY send info {}[{}] to {}[{}]", it->second.pCharacter->GetName(), (DWORD)it->second.pCharacter->GetVID(), ch->GetName(), (DWORD)ch->GetVID());
ch->GetDesc()->Packet(&p, sizeof(p)); ch->GetDesc()->Packet(&p, sizeof(p));
} }
} }
@ -861,7 +859,7 @@ void CParty::SendMessage(LPCHARACTER ch, BYTE bMsg, DWORD dwArg1, DWORD dwArg2)
{ {
if (ch->GetParty() != this) if (ch->GetParty() != this)
{ {
sys_err("%s is not member of this party %p", ch->GetName(), this); SPDLOG_ERROR("{} is not member of this party {}", ch->GetName(), (void*) this);
return; return;
} }
@ -892,7 +890,7 @@ void CParty::SendMessage(LPCHARACTER ch, BYTE bMsg, DWORD dwArg1, DWORD dwArg2)
if (pkChr->Goto(x, y)) if (pkChr->Goto(x, y))
{ {
LPCHARACTER victim = pkChr->GetVictim(); LPCHARACTER victim = pkChr->GetVictim();
sys_log(0, "%s %p RETURN victim %p", pkChr->GetName(), get_pointer(pkChr), get_pointer(victim)); SPDLOG_DEBUG("{} {} RETURN victim {}", pkChr->GetName(), (void*) get_pointer(pkChr), (void*) get_pointer(victim));
pkChr->SendMovePacket(FUNC_WAIT, 0, 0, 0, 0); pkChr->SendMovePacket(FUNC_WAIT, 0, 0, 0, 0);
} }
} }
@ -987,7 +985,7 @@ bool CParty::SetRole(DWORD dwPID, BYTE bRole, bool bSet)
} }
else else
{ {
sys_err("ROLE_COUNT_INC_ERROR: INDEX(%d) > MAX(%d)", bRole, PARTY_ROLE_MAX_NUM); SPDLOG_ERROR("ROLE_COUNT_INC_ERROR: INDEX({}) > MAX({})", bRole, (int) PARTY_ROLE_MAX_NUM);
} }
} }
else else
@ -1009,7 +1007,7 @@ bool CParty::SetRole(DWORD dwPID, BYTE bRole, bool bSet)
} }
else else
{ {
sys_err("ROLE_COUNT_DEC_ERROR: INDEX(%d) > MAX(%d)", bRole, PARTY_ROLE_MAX_NUM); SPDLOG_ERROR("ROLE_COUNT_DEC_ERROR: INDEX({}) > MAX({})", bRole, (int) PARTY_ROLE_MAX_NUM);
} }
} }
@ -1222,8 +1220,6 @@ void CParty::ComputeRolePoint(LPCHARACTER ch, BYTE bRole, bool bAdd)
//SKILL_POWER_BY_LEVEL //SKILL_POWER_BY_LEVEL
float k = (float) ch->GetSkillPowerByLevel(std::min<int>(SKILL_MAX_LEVEL, m_iLeadership)) / 100.0f; float k = (float) ch->GetSkillPowerByLevel(std::min<int>(SKILL_MAX_LEVEL, m_iLeadership)) / 100.0f;
//float k = (float) aiSkillPowerByLevel[std::min<int>(SKILL_MAX_LEVEL, m_iLeadership)] / 100.0f; //float k = (float) aiSkillPowerByLevel[std::min<int>(SKILL_MAX_LEVEL, m_iLeadership)] / 100.0f;
//
//sys_log(0,"ComputeRolePoint %fi %d, %d ", k, SKILL_MAX_LEVEL, m_iLeadership );
//END_SKILL_POWER_BY_LEVEL //END_SKILL_POWER_BY_LEVEL
switch (bRole) switch (bRole)
@ -1300,7 +1296,7 @@ void CParty::ComputeRolePoint(LPCHARACTER ch, BYTE bRole, bool bAdd)
void CParty::Update() void CParty::Update()
{ {
sys_log(1, "PARTY::Update"); SPDLOG_DEBUG("PARTY::Update");
LPCHARACTER l = GetLeaderCharacter(); LPCHARACTER l = GetLeaderCharacter();
@ -1329,7 +1325,6 @@ void CParty::Update()
if (it->second.bNear) if (it->second.bNear)
{ {
++iNearMember; ++iNearMember;
//sys_log(0,"NEAR %s", ch->GetName());
} }
} }
@ -1471,11 +1466,9 @@ int CParty::GetFlag(const std::string& name)
if (it != m_map_iFlag.end()) if (it != m_map_iFlag.end())
{ {
//sys_log(0,"PARTY GetFlag %s %d", name.c_str(), it->second);
return it->second; return it->second;
} }
//sys_log(0,"PARTY GetFlag %s 0", name.c_str());
return 0; return 0;
} }
@ -1483,7 +1476,6 @@ void CParty::SetFlag(const std::string& name, int value)
{ {
TFlagMap::iterator it = m_map_iFlag.find(name); TFlagMap::iterator it = m_map_iFlag.find(name);
//sys_log(0,"PARTY SetFlag %s %d", name.c_str(), value);
if (it == m_map_iFlag.end()) if (it == m_map_iFlag.end())
{ {
m_map_iFlag.insert(make_pair(name, value)); m_map_iFlag.insert(make_pair(name, value));
@ -1602,7 +1594,7 @@ void CParty::SetParameter(int iMode)
{ {
if (iMode >= PARTY_EXP_DISTRIBUTION_MAX_NUM) if (iMode >= PARTY_EXP_DISTRIBUTION_MAX_NUM)
{ {
sys_err("Invalid exp distribution mode %d", iMode); SPDLOG_ERROR("Invalid exp distribution mode {}", iMode);
return; return;
} }

View File

@ -49,8 +49,8 @@ class CPartyManager : public singleton<CPartyManager>
//void SendPartyToDB(); //void SendPartyToDB();
void EnablePCParty() { m_bEnablePCParty = true; sys_log(0,"PARTY Enable"); } void EnablePCParty() { m_bEnablePCParty = true; SPDLOG_DEBUG("PARTY Enable"); }
void DisablePCParty() { m_bEnablePCParty = false; sys_log(0,"PARTY Disable"); } void DisablePCParty() { m_bEnablePCParty = false; SPDLOG_DEBUG("PARTY Disable"); }
bool IsEnablePCParty() { return m_bEnablePCParty; } bool IsEnablePCParty() { return m_bEnablePCParty; }
LPPARTY CreateParty(LPCHARACTER pkLeader); LPPARTY CreateParty(LPCHARACTER pkLeader);

View File

@ -135,7 +135,7 @@ bool CPolymorphUtils::GiveBook(LPCHARACTER pChar, DWORD dwMobVnum, DWORD dwPract
if (CMobManager::instance().Get(dwMobVnum) == NULL) if (CMobManager::instance().Get(dwMobVnum) == NULL)
{ {
sys_err("Wrong Polymorph vnum passed: CPolymorphUtils::GiveBook(PID(%d), %d %d %d %d)", SPDLOG_ERROR("Wrong Polymorph vnum passed: CPolymorphUtils::GiveBook(PID({}), {} {} {} {})",
pChar->GetPlayerID(), dwMobVnum, dwPracticeCount, BookLevel, LevelLimit); pChar->GetPlayerID(), dwMobVnum, dwPracticeCount, BookLevel, LevelLimit);
return false; return false;
} }

View File

@ -28,7 +28,7 @@ void CPrivManager::RequestGiveGuildPriv(DWORD guild_id, BYTE type, int value, ti
{ {
if (MAX_PRIV_NUM <= type) if (MAX_PRIV_NUM <= type)
{ {
sys_err("PRIV_MANAGER: RequestGiveGuildPriv: wrong guild priv type(%u)", type); SPDLOG_ERROR("PRIV_MANAGER: RequestGiveGuildPriv: wrong guild priv type({})", type);
return; return;
} }
@ -48,7 +48,7 @@ void CPrivManager::RequestGiveEmpirePriv(BYTE empire, BYTE type, int value, time
{ {
if (MAX_PRIV_NUM <= type) if (MAX_PRIV_NUM <= type)
{ {
sys_err("PRIV_MANAGER: RequestGiveEmpirePriv: wrong empire priv type(%u)", type); SPDLOG_ERROR("PRIV_MANAGER: RequestGiveEmpirePriv: wrong empire priv type({})", type);
return; return;
} }
@ -68,7 +68,7 @@ void CPrivManager::RequestGiveCharacterPriv(DWORD pid, BYTE type, int value)
{ {
if (MAX_PRIV_NUM <= type) if (MAX_PRIV_NUM <= type)
{ {
sys_err("PRIV_MANAGER: RequestGiveCharacterPriv: wrong char priv type(%u)", type); SPDLOG_ERROR("PRIV_MANAGER: RequestGiveCharacterPriv: wrong char priv type({})", type);
return; return;
} }
@ -86,11 +86,11 @@ void CPrivManager::GiveGuildPriv(DWORD guild_id, BYTE type, int value, BYTE bLog
{ {
if (MAX_PRIV_NUM <= type) if (MAX_PRIV_NUM <= type)
{ {
sys_err("PRIV_MANAGER: GiveGuildPriv: wrong guild priv type(%u)", type); SPDLOG_ERROR("PRIV_MANAGER: GiveGuildPriv: wrong guild priv type({})", type);
return; return;
} }
sys_log(0,"Set Guild Priv: guild_id(%u) type(%d) value(%d) duration_sec(%d)", guild_id, type, value, end_time_sec - get_global_time()); SPDLOG_DEBUG("Set Guild Priv: guild_id({}) type({}) value({}) duration_sec({})", guild_id, type, value, end_time_sec - get_global_time());
value = std::clamp(value, 0, 50); value = std::clamp(value, 0, 50);
end_time_sec = std::clamp<time_t>(end_time_sec, 0, get_global_time()+60*60*24*7); end_time_sec = std::clamp<time_t>(end_time_sec, 0, get_global_time()+60*60*24*7);
@ -126,11 +126,11 @@ void CPrivManager::GiveCharacterPriv(DWORD pid, BYTE type, int value, BYTE bLog)
{ {
if (MAX_PRIV_NUM <= type) if (MAX_PRIV_NUM <= type)
{ {
sys_err("PRIV_MANAGER: GiveCharacterPriv: wrong char priv type(%u)", type); SPDLOG_ERROR("PRIV_MANAGER: GiveCharacterPriv: wrong char priv type({})", type);
return; return;
} }
sys_log(0,"Set Character Priv %u %d %d", pid, type, value); SPDLOG_DEBUG("Set Character Priv {} {} {}", pid, type, value);
value = std::clamp(value, 0, 100); value = std::clamp(value, 0, 100);
@ -144,11 +144,11 @@ void CPrivManager::GiveEmpirePriv(BYTE empire, BYTE type, int value, BYTE bLog,
{ {
if (MAX_PRIV_NUM <= type) if (MAX_PRIV_NUM <= type)
{ {
sys_err("PRIV_MANAGER: GiveEmpirePriv: wrong empire priv type(%u)", type); SPDLOG_ERROR("PRIV_MANAGER: GiveEmpirePriv: wrong empire priv type({})", type);
return; return;
} }
sys_log(0, "Set Empire Priv: empire(%d) type(%d) value(%d) duration_sec(%d)", empire, type, value, end_time_sec-get_global_time()); SPDLOG_DEBUG("Set Empire Priv: empire({}) type({}) value({}) duration_sec({})", empire, type, value, end_time_sec-get_global_time());
value = std::clamp(value, 0, 200); value = std::clamp(value, 0, 200);
end_time_sec = std::clamp<time_t>(end_time_sec, 0, get_global_time()+60*60*24*7); end_time_sec = std::clamp<time_t>(end_time_sec, 0, get_global_time()+60*60*24*7);
@ -188,7 +188,7 @@ void CPrivManager::RemoveGuildPriv(DWORD guild_id, BYTE type)
{ {
if (MAX_PRIV_NUM <= type) if (MAX_PRIV_NUM <= type)
{ {
sys_err("PRIV_MANAGER: RemoveGuildPriv: wrong guild priv type(%u)", type); SPDLOG_ERROR("PRIV_MANAGER: RemoveGuildPriv: wrong guild priv type({})", type);
return; return;
} }
@ -200,7 +200,7 @@ void CPrivManager::RemoveEmpirePriv(BYTE empire, BYTE type)
{ {
if (MAX_PRIV_NUM <= type) if (MAX_PRIV_NUM <= type)
{ {
sys_err("PRIV_MANAGER: RemoveEmpirePriv: wrong empire priv type(%u)", type); SPDLOG_ERROR("PRIV_MANAGER: RemoveEmpirePriv: wrong empire priv type({})", type);
return; return;
} }
@ -213,7 +213,7 @@ void CPrivManager::RemoveCharacterPriv(DWORD pid, BYTE type)
{ {
if (MAX_PRIV_NUM <= type) if (MAX_PRIV_NUM <= type)
{ {
sys_err("PRIV_MANAGER: RemoveCharacterPriv: wrong char priv type(%u)", type); SPDLOG_ERROR("PRIV_MANAGER: RemoveCharacterPriv: wrong char priv type({})", type);
return; return;
} }

View File

@ -193,7 +193,7 @@ class CProfiler : public singleton<CProfiler>
if (!GetProfileStackDataPointer(c_szName, &pProfileStackData)) if (!GetProfileStackDataPointer(c_szName, &pProfileStackData))
return; return;
sys_log(0, "%-10s: %3d", pProfileStackData->strName.c_str(), pProfileStackData->iEndTime - pProfileStackData->iStartTime); SPDLOG_DEBUG("{:10}: {:3}", pProfileStackData->strName, pProfileStackData->iEndTime - pProfileStackData->iStartTime);
} }
void PrintOneAccumData(const char * c_szName) void PrintOneAccumData(const char * c_szName)
@ -205,7 +205,7 @@ class CProfiler : public singleton<CProfiler>
TProfileAccumData & rData = it->second; TProfileAccumData & rData = it->second;
sys_log(0, "%-10s : [CollapsedTime : %3d] / [CallingCount : %3d]", SPDLOG_DEBUG("{:10} : [CollapsedTime : {:3}] / [CallingCount : {:3}]",
rData.strName.c_str(), rData.strName.c_str(),
rData.iCollapsedTime, rData.iCollapsedTime,
rData.iCallingCount); rData.iCallingCount);

View File

@ -58,7 +58,7 @@ void CPVP::Packet(bool bDelete)
if (!m_players[0].dwVID || !m_players[1].dwVID) if (!m_players[0].dwVID || !m_players[1].dwVID)
{ {
if (bDelete) if (bDelete)
sys_err("null vid when removing %u %u", m_players[0].dwVID, m_players[0].dwVID); SPDLOG_ERROR("null vid when removing {} {}", m_players[0].dwVID, m_players[0].dwVID);
return; return;
} }
@ -265,7 +265,7 @@ void CPVPManager::GiveUp(LPCHARACTER pkChr, DWORD dwKillerPID) // This method is
if (it == m_map_pkPVPSetByID.end()) if (it == m_map_pkPVPSetByID.end())
return; return;
sys_log(1, "PVPManager::Dead %d", pkChr->GetPlayerID()); SPDLOG_DEBUG("PVPManager::Dead {}", pkChr->GetPlayerID());
std::unordered_set<CPVP*>::iterator it2 = it->second.begin(); std::unordered_set<CPVP*>::iterator it2 = it->second.begin();
while (it2 != it->second.end()) while (it2 != it->second.end())
@ -310,7 +310,7 @@ bool CPVPManager::Dead(LPCHARACTER pkChr, DWORD dwKillerPID)
bool found = false; bool found = false;
sys_log(1, "PVPManager::Dead %d", pkChr->GetPlayerID()); SPDLOG_DEBUG("PVPManager::Dead {}", pkChr->GetPlayerID());
std::unordered_set<CPVP*>::iterator it2 = it->second.begin(); std::unordered_set<CPVP*>::iterator it2 = it->second.begin();
while (it2 != it->second.end()) while (it2 != it->second.end())
@ -616,7 +616,7 @@ void CPVPManager::SendList(LPDESC d)
} }
d->Packet(&pack, sizeof(pack)); d->Packet(&pack, sizeof(pack));
sys_log(1, "PVPManager::SendList %d %d", pack.dwVIDSrc, pack.dwVIDDst); SPDLOG_DEBUG("PVPManager::SendList {} {}", pack.dwVIDSrc, pack.dwVIDDst);
if (pkPVP->m_players[0].dwVID == dwVID) if (pkPVP->m_players[0].dwVID == dwVID)
{ {

View File

@ -26,7 +26,7 @@ namespace quest
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "quest_server_timer_event> <Factor> Null pointer" ); SPDLOG_ERROR("quest_server_timer_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -51,7 +51,7 @@ namespace quest
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "quest_timer_event> <Factor> Null pointer" ); SPDLOG_ERROR("quest_timer_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -73,7 +73,7 @@ END_OF_TIMER_EVENT:
if (pPC) if (pPC)
pPC->RemoveTimerNotCancel(info->name); pPC->RemoveTimerNotCancel(info->name);
else else
sys_err("quest::PC pointer null. player_id: %u", info->player_id); SPDLOG_ERROR("quest::PC pointer null. player_id: {}", info->player_id);
M2_DELETE_ARRAY(info->name); M2_DELETE_ARRAY(info->name);
info->name = NULL; info->name = NULL;
@ -117,7 +117,7 @@ END_OF_TIMER_EVENT:
if (info->name) if (info->name)
strlcpy(info->name, name, nameCapacity); strlcpy(info->name, name, nameCapacity);
sys_log(0, "QUEST timer name %s cycle %d pc %u npc %u loop? %d", name ? name : "<noname>", ltime_cycle, player_id, npc_id, loop ? 1 : 0); SPDLOG_DEBUG("QUEST timer name {} cycle {} pc {} npc {} loop? {}", name ? name : "<noname>", ltime_cycle, player_id, npc_id, loop ? 1 : 0);
info->time_cycle = loop ? ltime_cycle : 0; info->time_cycle = loop ? ltime_cycle : 0;
return event_create(quest_timer_event, info, ltime_cycle); return event_create(quest_timer_event, info, ltime_cycle);

View File

@ -19,13 +19,6 @@
#include "guild_manager.h" #include "guild_manager.h"
#include "sectree_manager.h" #include "sectree_manager.h"
#undef sys_err
#ifndef __WIN32__
#define sys_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define sys_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)
#endif
namespace quest namespace quest
{ {
using namespace std; using namespace std;
@ -44,7 +37,7 @@ namespace quest
} }
else else
{ {
sys_err("LUA ScriptRunError (code:%d src:[%s])", errcode, str.c_str()); quest_err("LUA ScriptRunError (code:%d src:[%s])", errcode, str.c_str());
} }
lua_settop(L,x); lua_settop(L,x);
return retstr; return retstr;
@ -181,7 +174,7 @@ namespace quest
{ {
char buf[100]; char buf[100];
snprintf(buf, sizeof(buf), "LUA ScriptRunError (code:%%d src:[%%%ds])", size); snprintf(buf, sizeof(buf), "LUA ScriptRunError (code:%%d src:[%%%ds])", size);
sys_err(buf, errcode, code); quest_err(buf, errcode, code);
} }
lua_settop(L,x); lua_settop(L,x);
return bStart != 0; return bStart != 0;
@ -265,7 +258,7 @@ namespace quest
{ {
if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3) || !lua_isnumber(L, 4)) if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3) || !lua_isnumber(L, 4))
{ {
sys_err("invalid argument"); quest_err("invalid argument");
return 0; return 0;
} }
@ -280,7 +273,7 @@ namespace quest
count = 1; count = 1;
else if (count > 10) else if (count > 10)
{ {
sys_err("count bigger than 10"); quest_err("count bigger than 10");
count = 10; count = 10;
} }
@ -335,7 +328,7 @@ namespace quest
{ {
if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3) || !lua_isnumber(L, 4) || !lua_isnumber(L, 6)) if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3) || !lua_isnumber(L, 4) || !lua_isnumber(L, 6))
{ {
sys_err("invalid argument"); quest_err("invalid argument");
lua_pushnumber(L, 0); lua_pushnumber(L, 0);
return 1; return 1;
} }
@ -351,7 +344,7 @@ namespace quest
count = 1; count = 1;
else if (count > 10) else if (count > 10)
{ {
sys_err("count bigger than 10"); quest_err("count bigger than 10");
count = 10; count = 10;
} }
@ -428,7 +421,7 @@ namespace quest
if (lua_isnil(L,-1)) if (lua_isnil(L,-1))
{ {
sys_err("QUEST wrong quest state file for quest %s",questName); quest_err("QUEST wrong quest state file for quest %s",questName);
lua_settop(L,x); lua_settop(L,x);
return; return;
} }
@ -536,10 +529,10 @@ namespace quest
snprintf(settingsFileName, sizeof(settingsFileName), "%s/settings.lua", LocaleService_GetBasePath().c_str()); snprintf(settingsFileName, sizeof(settingsFileName), "%s/settings.lua", LocaleService_GetBasePath().c_str());
int settingsLoadingResult = lua_dofile(L, settingsFileName); int settingsLoadingResult = lua_dofile(L, settingsFileName);
sys_log(0, "LoadSettings(%s), returns %d", settingsFileName, settingsLoadingResult); SPDLOG_DEBUG("LoadSettings({}), returns {}", settingsFileName, settingsLoadingResult);
if (settingsLoadingResult != 0) if (settingsLoadingResult != 0)
{ {
sys_err("LOAD_SETTINS_FAILURE(%s)", settingsFileName); quest_err("LOAD_SETTINS_FAILURE(%s)", settingsFileName);
return false; return false;
} }
} }
@ -549,10 +542,10 @@ namespace quest
snprintf(questlibFileName, sizeof(questlibFileName), "%s/questlib.lua", LocaleService_GetQuestPath().c_str()); snprintf(questlibFileName, sizeof(questlibFileName), "%s/questlib.lua", LocaleService_GetQuestPath().c_str());
int questlibLoadingResult = lua_dofile(L, questlibFileName); int questlibLoadingResult = lua_dofile(L, questlibFileName);
sys_log(0, "LoadQuestlib(%s), returns %d", questlibFileName, questlibLoadingResult); SPDLOG_DEBUG("LoadQuestlib({}), returns {}", questlibFileName, questlibLoadingResult);
if (questlibLoadingResult != 0) if (questlibLoadingResult != 0)
{ {
sys_err("LOAD_QUESTLIB_FAILURE(%s)", questlibFileName); quest_err("LOAD_QUESTLIB_FAILURE(%s)", questlibFileName);
return false; return false;
} }
} }
@ -563,10 +556,10 @@ namespace quest
snprintf(translateFileName, sizeof(translateFileName), "%s/translate.lua", LocaleService_GetBasePath().c_str()); snprintf(translateFileName, sizeof(translateFileName), "%s/translate.lua", LocaleService_GetBasePath().c_str());
int translateLoadingResult = lua_dofile(L, translateFileName); int translateLoadingResult = lua_dofile(L, translateFileName);
sys_log(0, "LoadTranslate(%s), returns %d", translateFileName, translateLoadingResult); SPDLOG_DEBUG("LoadTranslate({}), returns {}", translateFileName, translateLoadingResult);
if (translateLoadingResult != 0) if (translateLoadingResult != 0)
{ {
sys_err("LOAD_TRANSLATE_ERROR(%s)", translateFileName); quest_err("LOAD_TRANSLATE_ERROR(%s)", translateFileName);
return false; return false;
} }
} }
@ -583,10 +576,10 @@ namespace quest
} }
int questLocaleLoadingResult = lua_dofile(L, questLocaleFileName); int questLocaleLoadingResult = lua_dofile(L, questLocaleFileName);
sys_log(0, "LoadQuestLocale(%s), returns %d", questLocaleFileName, questLocaleLoadingResult); SPDLOG_DEBUG("LoadQuestLocale({}), returns {}", questLocaleFileName, questLocaleLoadingResult);
if (questLocaleLoadingResult != 0) if (questLocaleLoadingResult != 0)
{ {
sys_err("LoadQuestLocale(%s) FAILURE", questLocaleFileName); quest_err("LoadQuestLocale(%s) FAILURE", questLocaleFileName);
return false; return false;
} }
} }
@ -613,7 +606,7 @@ namespace quest
RegisterQuest(pde->d_name, ++iQuestIdx); RegisterQuest(pde->d_name, ++iQuestIdx);
int ret = lua_dofile(L, (stQuestObjectDir + "/state/" + pde->d_name).c_str()); int ret = lua_dofile(L, (stQuestObjectDir + "/state/" + pde->d_name).c_str());
sys_log(0, "QUEST: loading %s, returns %d", (stQuestObjectDir + "/state/" + pde->d_name).c_str(), ret); SPDLOG_TRACE("QUEST: loading {}, returns {}", (stQuestObjectDir + "/state/" + pde->d_name).c_str(), ret);
BuildStateIndexToName(pde->d_name); BuildStateIndexToName(pde->d_name);
} }
@ -654,8 +647,8 @@ namespace quest
} }
else else
{ {
sys_err("SELECT wrong data %s", lua_typename(qs.co, -1)); quest_err("SELECT wrong data %s", lua_typename(qs.co, -1));
sys_err("here"); quest_err("here");
} }
lua_pop(qs.co,1); lua_pop(qs.co,1);
} }
@ -664,8 +657,7 @@ namespace quest
AddScript(os.str()); AddScript(os.str());
qs.suspend_state = SUSPEND_STATE_SELECT; qs.suspend_state = SUSPEND_STATE_SELECT;
if ( test_server ) SPDLOG_TRACE("{}", m_strScript);
sys_log( 0, "%s", m_strScript.c_str() );
SendScript(); SendScript();
} }
@ -687,7 +679,7 @@ namespace quest
if ( info == NULL ) if ( info == NULL )
{ {
sys_err( "confirm_timeout_event> <Factor> Null pointer" ); quest_err( "confirm_timeout_event> <Factor> Null pointer" );
return 0; return 0;
} }
@ -714,7 +706,7 @@ namespace quest
const char* szMsg = lua_tostring(qs.co, -2); const char* szMsg = lua_tostring(qs.co, -2);
int iTimeout = (int) lua_tonumber(qs.co, -1); int iTimeout = (int) lua_tonumber(qs.co, -1);
sys_log(0, "GotoConfirmState vid %u msg '%s', timeout %d", dwVID, szMsg, iTimeout); SPDLOG_DEBUG("GotoConfirmState vid {} msg '{}', timeout {}", dwVID, szMsg, iTimeout);
// 1. 상대방에게 확인창 띄움 // 1. 상대방에게 확인창 띄움
// 2. 나에게 확인 기다린다고 표시하는 창 띄움 // 2. 나에게 확인 기다린다고 표시하는 창 띄움
@ -843,7 +835,7 @@ namespace quest
} }
else else
{ {
sys_err("LUA_ERROR: %s", lua_tostring(qs.co, 1)); quest_err("LUA_ERROR: %s", lua_tostring(qs.co, 1));
} }
WriteRunningStateToSyserr(); WriteRunningStateToSyserr();

View File

@ -15,7 +15,7 @@ namespace quest
{ {
if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3)) if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3))
{ {
sys_err("invalid argument"); SPDLOG_ERROR("invalid argument");
return 0; return 0;
} }
@ -27,7 +27,7 @@ namespace quest
if (applyOn >= MAX_APPLY_NUM || applyOn < 1) if (applyOn >= MAX_APPLY_NUM || applyOn < 1)
{ {
sys_err("apply is out of range : %d", applyOn); SPDLOG_ERROR("apply is out of range : {}", applyOn);
return 0; return 0;
} }
@ -80,7 +80,7 @@ namespace quest
{ {
if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3)) if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3))
{ {
sys_err("invalid argument"); SPDLOG_ERROR("invalid argument");
return 0; return 0;
} }
@ -92,7 +92,7 @@ namespace quest
if (applyOn >= MAX_APPLY_NUM || applyOn < 1) if (applyOn >= MAX_APPLY_NUM || applyOn < 1)
{ {
sys_err("apply is out of range : %d", applyOn); SPDLOG_ERROR("apply is out of range : {}", applyOn);
return 0; return 0;
} }
@ -131,7 +131,7 @@ namespace quest
if (!lua_isnumber(L, 1)) if (!lua_isnumber(L, 1))
{ {
sys_err("invalid argument"); SPDLOG_ERROR("invalid argument");
return 0; return 0;
} }
@ -152,7 +152,7 @@ namespace quest
{ {
if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3)) if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3))
{ {
sys_err("invalid argument"); SPDLOG_ERROR("invalid argument");
return 0; return 0;
} }
@ -164,7 +164,7 @@ namespace quest
if (applyOn >= MAX_APPLY_NUM || applyOn < 1) if (applyOn >= MAX_APPLY_NUM || applyOn < 1)
{ {
sys_err("apply is out of range : %d", applyOn); SPDLOG_ERROR("apply is out of range : {}", applyOn);
return 0; return 0;
} }
@ -180,7 +180,7 @@ namespace quest
{ {
if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3)) if (!lua_isnumber(L, 1) || !lua_isnumber(L, 2) || !lua_isnumber(L, 3))
{ {
sys_err("invalid argument"); SPDLOG_ERROR("invalid argument");
return 0; return 0;
} }
@ -192,7 +192,7 @@ namespace quest
if (point_type >= POINT_MAX_NUM || point_type < 1) if (point_type >= POINT_MAX_NUM || point_type < 1)
{ {
sys_err("point is out of range : %d", point_type); SPDLOG_ERROR("point is out of range : {}", point_type);
return 0; return 0;
} }

View File

@ -71,11 +71,11 @@ namespace quest
if ( CArenaManager::instance().AddArena(mapIdx, startposAX, startposAY, startposBX, startposBY) == false ) if ( CArenaManager::instance().AddArena(mapIdx, startposAX, startposAY, startposBX, startposBY) == false )
{ {
sys_log(0, "Failed to load arena map info(map:%d AX:%d AY:%d BX:%d BY:%d", mapIdx, startposAX, startposAY, startposBX, startposBY); SPDLOG_ERROR("Failed to load arena map info(map:{} AX:{} AY:{} BX:{} BY:{}", mapIdx, startposAX, startposAY, startposBX, startposBY);
} }
else else
{ {
sys_log(0, "Add Arena Map:%d startA(%d,%d) startB(%d,%d)", mapIdx, startposAX, startposAY, startposBX, startposBY); SPDLOG_DEBUG("Add Arena Map:{} startA({},{}) startB({},{})", mapIdx, startposAX, startposAY, startposBX, startposBY);
} }
return 1; return 1;

Some files were not shown because too many files have changed in this diff Show More