@@ -1020,7 +1020,7 @@ void AIServerApp::AllNpcInfo()
10201020 int nZone = 0 ;
10211021 int size = _npcMap.GetSize ();
10221022
1023- int send_index = 0 , zone_index = 0 , packet_size = 0 ;
1023+ int send_index = 0 ;
10241024 int count = 0 , send_count = 0 , send_tot = 0 ;
10251025 char send_buff[2048 ] = {};
10261026
@@ -1036,9 +1036,8 @@ void AIServerApp::AllNpcInfo()
10361036 SetByte (send_buff, AG_SERVER_INFO, send_index);
10371037 SetByte (send_buff, SERVER_INFO_START, send_index);
10381038 SetByte (send_buff, nZone, send_index);
1039- packet_size = Send (send_buff, send_index, nZone);
1039+ Send (send_buff, send_index, nZone);
10401040
1041- zone_index = GetZoneIndex (nZone);
10421041 send_index = 2 ;
10431042 count = 0 ;
10441043 send_count = 0 ;
@@ -1077,9 +1076,10 @@ void AIServerApp::AllNpcInfo()
10771076 send_count = 0 ;
10781077 count = 0 ;
10791078 send_tot++;
1080- // TRACE(_T("AllNpcInfo - send_count=%d, count=%d, zone=%d\n"), send_tot, count, nZone);
1079+ spdlog::trace (" AIServerApp::AllNpcInfo: send_count={}, count={}, zone={}" ,
1080+ send_tot, count, nZone);
10811081 memset (send_buff, 0 , sizeof (send_buff));
1082- Sleep ( 50 );
1082+ std::this_thread::sleep_for (50ms );
10831083 }
10841084 }
10851085
@@ -1092,8 +1092,9 @@ void AIServerApp::AllNpcInfo()
10921092 SetByte (send_buff, (uint8_t ) count, send_count);
10931093 Send (send_buff, send_index, nZone);
10941094 send_tot++;
1095- // TRACE(_T("AllNpcInfo - send_count=%d, count=%d, zone=%d\n"), send_tot, count, nZone);
1096- Sleep (50 );
1095+ spdlog::trace (" AIServerApp::AllNpcInfo: send_count={}, count={}, zone={}" ,
1096+ send_tot, count, nZone);
1097+ std::this_thread::sleep_for (50ms);
10971098 }
10981099
10991100 send_index = 0 ;
@@ -1102,12 +1103,12 @@ void AIServerApp::AllNpcInfo()
11021103 SetByte (send_buff, SERVER_INFO_END, send_index);
11031104 SetByte (send_buff, nZone, send_index);
11041105 SetShort (send_buff, (int16_t ) _totalNpcCount, send_index);
1105- packet_size = Send (send_buff, send_index, nZone);
1106+ Send (send_buff, send_index, nZone);
11061107
11071108 spdlog::debug (" AIServerApp::AllNpcInfo: end for zoneId={}" , nZone);
11081109 }
11091110
1110- Sleep ( 1000 );
1111+ std::this_thread::sleep_for (1s );
11111112}
11121113// ~sungyong 2002.05.23
11131114
@@ -1154,7 +1155,6 @@ void AIServerApp::CheckAliveTest()
11541155{
11551156 int send_index = 0 ;
11561157 char send_buff[256 ] = {};
1157- int iErrorCode = 0 ;
11581158
11591159 SetByte (send_buff, AG_CHECK_ALIVE_REQ, send_index);
11601160
@@ -1291,7 +1291,7 @@ int AIServerApp::Send(const char* pData, int length, int nZone)
12911291 return 0 ;
12921292
12931293 if (length <= 0
1294- || length > sizeof (_SEND_DATA::pBuf))
1294+ || length > static_cast < int >( sizeof (_SEND_DATA::pBuf) ))
12951295 return 0 ;
12961296
12971297 _SEND_DATA* pNewData = new _SEND_DATA;
@@ -1319,7 +1319,6 @@ void AIServerApp::SyncTest()
13191319
13201320 int send_index = 0 ;
13211321 char send_buff[256 ] = {};
1322- int iErrorCode = 0 ;
13231322
13241323 SetByte (send_buff, AG_CHECK_ALIVE_REQ, send_index);
13251324
@@ -1356,7 +1355,7 @@ void AIServerApp::TestCode()
13561355 count_3++;
13571356 }
13581357
1359- // TRACE(_T("$$$ random test == 1=%d, 2=%d, 3=%d,, %d,%hs $$$\n") , count_1, count_2, count_3, __FILE__, __LINE__ );
1358+ spdlog::debug ( " AIServerApp::TestCode: random test 1={} 2={} 3={} " , count_1, count_2, count_3);
13601359}
13611360
13621361bool AIServerApp::GetMagicType1Data ()
@@ -1457,33 +1456,26 @@ void AIServerApp::RegionCheck()
14571456
14581457bool AIServerApp::AddObjectEventNpc (_OBJECT_EVENT* pEvent, int zone_number)
14591458{
1460- int i = 0 , j = 0 , objectid = 0 ;
14611459 model::Npc* pNpcTable = nullptr ;
1462- bool bFindNpcTable = false ;
1463- int offset = 0 ;
14641460 int nServerNum = GetServerNumber (zone_number);
14651461 if (_serverZoneType != nServerNum)
14661462 return false ;
14671463
14681464 pNpcTable = _npcTableMap.GetData (pEvent->sIndex );
14691465 if (pNpcTable == nullptr )
14701466 {
1471- bFindNpcTable = false ;
14721467 spdlog::error (" AIServerApp::AddObjectEventNpc error: eventId={} zoneId={}" ,
14731468 pEvent->sIndex , zone_number);
14741469 return false ;
14751470 }
14761471
1477- bFindNpcTable = true ;
1478-
14791472 CNpc* pNpc = new CNpc ();
14801473
14811474 pNpc->m_sNid = _mapEventNpcCount++; // 서버 내에서의 고유 번호
14821475 pNpc->m_sSid = (int16_t ) pEvent->sIndex ; // MONSTER(NPC) Serial ID
14831476
14841477 pNpc->m_byMoveType = 100 ;
14851478 pNpc->m_byInitMoveType = 100 ;
1486- bFindNpcTable = false ;
14871479
14881480 pNpc->m_byMoveType = 0 ;
14891481 pNpc->m_byInitMoveType = 0 ;
@@ -1518,7 +1510,6 @@ bool AIServerApp::AddObjectEventNpc(_OBJECT_EVENT* pEvent, int zone_number)
15181510 // pNpc->m_ZoneIndex = GetZoneIndex(pNpc->m_sCurZone);
15191511/*
15201512 if(pNpc->m_ZoneIndex == -1) {
1521- AfxMessageBox("Invaild zone Index!!");
15221513 return false;
15231514 } */
15241515
0 commit comments