Untitled


SUBMITTED BY: Guest

DATE: Jan. 1, 2014, 1:35 a.m.

FORMAT: Text only

SIZE: 203.9 kB

HITS: 1545

  1. #include "stdafx.h"
  2. #include "Psapi.h"
  3. #pragma comment( lib, "Psapi.lib" )
  4. #include "./GLAgentServer.h"
  5. #include "./GLItemLMT.h"
  6. #include "../DbActionLogic.h"
  7. #include "../RanClientUILib/Interface/GameTextControl.h"
  8. #include "./GLTaxiStation.h"
  9. #include "./GLClubDeathMatch.h"
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #endif
  13. // Note : ÇÊµå ¼­¹ö º¯°æ½Ã Ŭ¶óÀ̾ðÆ® Á¤º¸ º¯°æ »çÇ× ¹Ý¿µ.
  14. // ºÎÈ°½Ã, gate¸¦ ÅëÇØ ¸Ê À̵¿½Ã È£ÃâµÊ.
  15. BOOL GLAgentServer::ReActionMoveFieldSvr ( DWORD dwClientID, DWORD dwGaeaID )
  16. {
  17. // Note : Ŭ¶óÀ̾ðÆ®ÀÇ Áö¼Ó ½ºÅ³ ¸®¼Â.
  18. //
  19. GLMSG::SNETPC_SKILLHOLD_RS_BRD NetMsgSkillBrd;
  20. NetMsgSkillBrd.dwID = dwGaeaID;
  21. NetMsgSkillBrd.emCrow = CROW_PC;
  22. for ( int i=0; i<SKILLFACT_SIZE; ++i )
  23. {
  24. NetMsgSkillBrd.bRESET[i] = true;
  25. }
  26. SENDTOCLIENT ( dwClientID, &NetMsgSkillBrd );
  27. GLMSG::SNETPC_CURESTATEBLOW_BRD NetMsgBlowBrd;
  28. NetMsgBlowBrd.dwID = dwGaeaID;
  29. NetMsgBlowBrd.dwID = CROW_PC;
  30. NetMsgBlowBrd.dwCUREFLAG = DIS_ALL;
  31. SENDTOCLIENT ( dwClientID, &NetMsgBlowBrd );
  32. GLMSG::SNETPC_QITEMFACT_END_BRD NetMsgQFactEndBrd;
  33. SENDTOCLIENT ( dwClientID, &NetMsgQFactEndBrd );
  34. GLMSG::SNETPC_QITEMFACT_TIMEUPDATE_BRD NetMsgQFactTimeUpdateBrd; //add qbox
  35. NetMsgQFactTimeUpdateBrd.fQBoxTime = 0;
  36. SENDTOCLIENT ( dwClientID, &NetMsgQFactTimeUpdateBrd );
  37. return TRUE;
  38. }
  39. // *****************************************************
  40. // Desc: Çʵ弭¹ö Á¤º¸¸¦ üũÈÄ Á¢¼Ó Á¤º¸ Àü¼Û(Agent->Field)
  41. // *****************************************************
  42. BOOL GLAgentServer::MsgReqFieldSvrCharChkFb ( NET_MSG_GENERIC* nmg, DWORD _dwClientID, DWORD _dwGaeaID )
  43. {
  44. GLMSG::SNETPC_FIELDSVR_CHARCHK_FB *pNetMsg = (GLMSG::SNETPC_FIELDSVR_CHARCHK_FB *) nmg;
  45. PGLCHARAG pChar = GetChar ( pNetMsg->dwGaeaID );
  46. if ( !pChar ) return FALSE;
  47. // Note : üũµÈ Ƚ¼ö LOG.
  48. //
  49. ++pChar->m_dwFIELDCK_NUM;
  50. pChar->m_bFIELD_CK[pNetMsg->nChannel][pNetMsg->dwFIELDID] = true;
  51. if ( pNetMsg->bExist ) ++pChar->m_dwFIELDCK_BEING;
  52. // Note : Çʵå üũ ¿Ï·á ¿©ºÎ ÆÇ´Ü. ¸¸Á· ¾ÈÇÏ¸é ´ë±â.
  53. //
  54. if ( !pChar->IsFieldCheckComplete(&m_bFIELDSVR[0][0]) ) return TRUE;
  55. if ( pChar->m_dwFIELDCK_BEING > 0 )
  56. {
  57. // Çʵ弭¹ö·Î Á¢¼ÓÀÌ ½ÇÆÐÇÔ
  58. /*
  59. DEBUGMSG_WRITE( "Found same character in field server. %d removed exist character. ( name %s )",
  60. pChar->m_dwFIELDCK_BEING, pChar->m_szName );
  61. */
  62. }
  63. // Note : ij¸¯ÅÍ »ý¼ºÀ§Ä¡¸¦ ÁöÁ¤.
  64. //
  65. SNATIVEID sGenMapID = pChar->m_sStartMapID;
  66. DWORD dwGenGateID = pChar->m_dwStartGate;
  67. D3DXVECTOR3 vGenPos = pChar->m_vStartPos;
  68. // ÀúÀåµÈ À§Ä¡°¡ ÀÖÀ» °æ¿ì ¼³Á¤ÇÔ.
  69. if ( pChar->m_sSaveMapID != NATIVEID_NULL() )
  70. {
  71. if ( GLAgentServer::GetInstance().GetFieldServer ( sGenMapID ) != FIELDSERVER_MAX )
  72. {
  73. sGenMapID = pChar->m_sSaveMapID;
  74. dwGenGateID = UINT_MAX;
  75. vGenPos = pChar->m_vSavePos;
  76. // MapList ¿¡ Restart flag °¡ ¼³Á¤µÇ¾î ÀÖÀ¸¸é
  77. // °­Á¦ÀûÀ¸·Î ½ÃÀÛÁöÁ¡À¸·Î À̵¿ÇÏ°Ô µÈ´Ù.
  78. SMAPNODE* pGenMap = m_sMapList.FindMapNode ( sGenMapID );
  79. if ( !pGenMap )
  80. {
  81. DEBUGMSG_WRITE ( "Can't find MapNode in MapsList." );
  82. }
  83. else if ( pGenMap->bRestart )
  84. {
  85. sGenMapID = pChar->m_sStartMapID;
  86. dwGenGateID = pChar->m_dwStartGate;
  87. vGenPos = D3DXVECTOR3(0,0,0);
  88. }
  89. }
  90. }
  91. // Á÷Àü¿¡ Á¾·áÇÑ ¸ÊÀÌ ¼±µµÀü ¸ÊÀÌ¸é ¼±µµÅ¬·´ÀÌ ¾Æ´Ò°æ¿ì ½ÃÀÛ¸ÊÀ¸·Î ÁöÁ¤
  92. GLAGLandMan* pLAND = GetByMapID ( sGenMapID );
  93. if ( pLAND )
  94. {
  95. if ( pLAND->m_bGuidBattleMap )
  96. {
  97. GLGuidance* pGUID = GLGuidanceAgentMan::GetInstance().Find ( pLAND->m_dwClubMapID );
  98. if ( pGUID && pGUID->m_dwGuidanceClub != pChar->m_dwGuild )
  99. {
  100. sGenMapID = pChar->m_sStartMapID;
  101. dwGenGateID = pChar->m_dwStartGate;
  102. }
  103. }
  104. if ( pLAND->m_bClubDeathMatchMap )
  105. {
  106. GLClubDeathMatch* pCDM = GLClubDeathMatchAgentMan::GetInstance().Find ( pLAND->m_dwClubMapID );
  107. if ( pCDM )
  108. {
  109. sGenMapID = pCDM->m_dwClubHallMap;
  110. dwGenGateID = pCDM->m_dwClubHallGate;
  111. }
  112. }
  113. }
  114. // Note : Çʵ弭¹ö Á¤º¸¸¦ °¡Á®¿Í¼­ Çʵ弭¹ö·Î Á¢¼Ó
  115. //
  116. bool bCANNOTFINDMAP(false);
  117. DWORD dwFieldServer = GLAgentServer::GetInstance().GetFieldServer ( sGenMapID );
  118. if ( dwFieldServer == FIELDSERVER_MAX )
  119. {
  120. bCANNOTFINDMAP = true;
  121. // ij¸¯ÅÍ°¡ »ý¼ºµÉ Çʵ弭¹ö¸¦ ãÁö ¸øÇÔ. ±×·¯³ª ÁøÀÔÇÒ ¼ö ÀÖµµ·Ï ÃʱâÈ­ÇÔ ( ij¸¯Åͺ° Çб³ÀÇ 0¹ø °ÔÀÌÆ® )
  122. DEBUGMSG_WRITE ( "Can't find field server associate with character (MID[%d/%d], CID[%d] name %s)",
  123. sGenMapID.wMainID, sGenMapID.wSubID, pChar->m_dwClientID, pChar->m_szName );
  124. // DBAction ÀÛ¾÷ ³¡³ª¸é ¹Ù·Î Á¦°ÅÇÏ°í Å×½ºÆ® Çضó
  125. // return FALSE;
  126. sGenMapID = GLCONST_CHAR::nidSTARTMAP[pChar->m_wSchool];
  127. dwGenGateID = GLCONST_CHAR::dwSTARTGATE[pChar->m_wSchool];
  128. GLAGLandMan* pLandMan = GetByMapID ( sGenMapID );
  129. if ( !pLandMan )
  130. {
  131. DEBUGMSG_WRITE ( "Can't find StartMap ID." );
  132. return FALSE;
  133. }
  134. DxLandGateMan* pGateMan = pLandMan->GetLandGateMan ();
  135. if ( !pGateMan )
  136. {
  137. DEBUGMSG_WRITE ( "Can't Find LandGateManager." );
  138. return FALSE;
  139. }
  140. PDXLANDGATE pGate = pGateMan->FindLandGate ( dwGenGateID );
  141. if ( !pGate )
  142. {
  143. DEBUGMSG_WRITE ( "Can't Find LandGate." );
  144. vGenPos = D3DXVECTOR3(0,0,0);
  145. }
  146. else
  147. {
  148. vGenPos = pGate->GetGenPos ( DxLandGate::GEN_RENDUM );
  149. }
  150. dwFieldServer = GLAgentServer::GetInstance().GetFieldServer ( sGenMapID );
  151. if ( dwFieldServer == FIELDSERVER_MAX )
  152. {
  153. DEBUGMSG_WRITE ( "Can't Find FieldServer associate with character'school." );
  154. return FALSE;
  155. }
  156. pChar->m_sStartMapID = sGenMapID;
  157. pChar->m_dwStartGate = dwGenGateID;
  158. pChar->m_vStartPos = vGenPos;
  159. pChar->m_sSaveMapID = sGenMapID;
  160. pChar->m_vSavePos = vGenPos;
  161. // À̺κп¡¼­ º¯°æµÈ ½ºÅ¸Æ®ÁöÁ¡(MapID, GateID, À§Ä¡) À» DB¿¡ ÀúÀåÇÔ
  162. CSaveChaPos* pDBAction = new CSaveChaPos ( pChar->m_dwClientID,
  163. pChar->m_dwCharID,
  164. dwFieldServer,
  165. pChar->m_sStartMapID.dwID,
  166. pChar->m_dwStartGate,
  167. pChar->m_vStartPos.x,
  168. pChar->m_vStartPos.y,
  169. pChar->m_vStartPos.z,
  170. pChar->m_sSaveMapID.dwID,
  171. pChar->m_vSavePos.x,
  172. pChar->m_vSavePos.y,
  173. pChar->m_vSavePos.z,
  174. pChar->m_sSaveMapID.dwID,
  175. pChar->m_vSavePos.x,
  176. pChar->m_vSavePos.y,
  177. pChar->m_vSavePos.z );
  178. GLDBMan *pDbMan = GLAgentServer::GetInstance().GetDBMan();
  179. if ( pDbMan ) pDbMan->AddJob ( pDBAction );
  180. }
  181. // ¸¸¾à ¸ÊÀ» ¸ø ã¾Ò´Ù¸é ¸ÊÀ» ÃʱâÈ­ ÇÏ°í ´Ù¸¥ °÷¿¡¼­ ij¸¯ÅÍ Á¶ÀÎÁ¤º¸¸¦ Àü¼ÛÇÑ´Ù
  182. if ( bCANNOTFINDMAP ) return true;
  183. if ( m_pMsgServer->ConnectFieldSvr ( pChar->m_dwClientID, dwFieldServer, pChar->m_dwGaeaID, pChar->m_nChannel ) != NET_OK )
  184. {
  185. // ij¸¯ÅÍ°¡ »ý¼ºµÉ Çʵ弭¹ö·Î Á¢¼ÓÀÌ ½ÇÆÐÇÔ
  186. DEBUGMSG_WRITE ( "Can't connect field. FIELDID : %d, CID[%d] name %s",
  187. dwFieldServer, pChar->m_dwClientID, pChar->m_szName );
  188. return FALSE;
  189. }
  190. // ij¸¯ÅÍ Á¶ÀÎ Á¤º¸ Àü¼Û
  191. NET_GAME_JOIN_FIELDSVR NetJoinField;
  192. NetJoinField.emType = EMJOINTYPE_FIRST;
  193. NetJoinField.dwSlotAgentClient = pChar->m_dwClientID;
  194. StringCchCopy ( NetJoinField.szUID, DAUM_MAX_UID_LENGTH+1, pChar->m_szUserName );
  195. NetJoinField.nUserNum = pChar->m_dwUserID;
  196. NetJoinField.dwUserLvl = pChar->m_dwUserLvl;
  197. NetJoinField.nChaNum = pChar->m_dwCharID;
  198. NetJoinField.dwGaeaID = pChar->m_dwGaeaID;
  199. NetJoinField.tPREMIUM = pChar->m_tPREMIUM;
  200. NetJoinField.tCHATBLOCK = pChar->m_tCHATBLOCK;
  201. NetJoinField.sStartMap = sGenMapID;
  202. NetJoinField.dwStartGate = dwGenGateID;
  203. NetJoinField.vStartPos = vGenPos;
  204. NetJoinField.dwActState = pChar->m_dwActState;
  205. NetJoinField.bUseArmSub = pChar->m_bUseArmSub;
  206. NetJoinField.dwThaiCCafeClass = pChar->m_dwThaiCCafeClass;
  207. NetJoinField.nMyCCafeClass = pChar->m_nMyCCafeClass; // ¸»·¹ÀÌ½Ã¾Æ PC¹æ À̺¥Æ®
  208. NetJoinField.sChinaTime = pChar->m_sChinaTime;
  209. NetJoinField.sEventTime = pChar->m_sEventTime;
  210. NetJoinField.sVietnamGainSystem = pChar->m_sVietnamSystem;
  211. //** Add EventTime
  212. SENDTOFIELD ( pChar->m_dwClientID, &NetJoinField );
  213. // Note : Äɸ¯ÅÍÀÇ ÇöÀç Á¢¼Ó Çʵ弭¹ö ¹× ÇöÀç ¸Ê ID ÁöÁ¤.
  214. //
  215. pChar->SetCurrentField ( dwFieldServer, sGenMapID );
  216. return TRUE;
  217. }
  218. BOOL GLAgentServer::MsgReqGenItemAgt ( NET_MSG_GENERIC* nmg, DWORD dwClientID )
  219. {
  220. GLMSG::SNET_REQ_GENITEM_AGT *pNetMsg = (GLMSG::SNET_REQ_GENITEM_AGT *) nmg;
  221. int nCHANNEL = pNetMsg->nCHANNEL;
  222. const SNATIVEID &sNID = pNetMsg->sNID;
  223. SITEM* pITEM = GLItemMan::GetInstance().GetItem ( sNID );
  224. if ( !pITEM ) return FALSE;
  225. SMAPNODE* pMAPNODE = m_sMapList.FindMapNode ( pNetMsg->sMAPID );
  226. if ( !pMAPNODE ) return FALSE;
  227. int nSvrNum = (int) pMAPNODE->dwFieldSID;
  228. if ( GLITEMLMT::GetInstance().DoCheckItemGen ( sNID ) )
  229. {
  230. LONGLONG lnGenCount = GLITEMLMT::GetInstance().RegItemGen ( sNID, pNetMsg->emGENTYPE );
  231. GLMSG::SNET_REQ_GENITEM_FLD_FB NetMsgFb;
  232. NetMsgFb.sNID = pNetMsg->sNID;
  233. NetMsgFb.sMAPID = pNetMsg->sMAPID;
  234. NetMsgFb.emGENTYPE = pNetMsg->emGENTYPE;
  235. NetMsgFb.lnGENCOUNT = lnGenCount;
  236. NetMsgFb.emHoldGroup = pNetMsg->emHoldGroup;
  237. NetMsgFb.dwHoldGID = pNetMsg->dwHoldGID;
  238. NetMsgFb.vPos = pNetMsg->vPos;
  239. SENDTOFIELDSVR ( nCHANNEL, nSvrNum, &NetMsgFb );
  240. }
  241. return TRUE;
  242. }
  243. BOOL GLAgentServer::SendToGMMsg( PGLCHARAG pChar, NET_CHAT_FB NetChatFB )
  244. {
  245. UINT i;
  246. for( i = 0; i < pChar->m_vecGetWhisperList.size(); i++ )
  247. {
  248. PGLCHARAG pSendGMChar = GetChar( pChar->m_vecGetWhisperList[i].dwGaeaID );
  249. if( pSendGMChar == NULL ||
  250. pSendGMChar->m_GmWhisperList.dwClientID != pChar->m_dwClientID ||
  251. pSendGMChar->m_GmWhisperList.dwGaeaID != pChar->m_dwGaeaID ||
  252. pSendGMChar->m_bViewWhisperMSG == FALSE)
  253. {
  254. pChar->m_vecGetWhisperList.erase( pChar->m_vecGetWhisperList.begin() + i );
  255. i--;
  256. continue;
  257. }
  258. SENDTOCLIENT( pChar->m_vecGetWhisperList[i].dwClientID, &NetChatFB );
  259. }
  260. return TRUE;
  261. }
  262. BOOL GLAgentServer::ChatMsgProc ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  263. {
  264. NET_CHAT* pNetMsg = (NET_CHAT*) nmg;
  265. switch ( pNetMsg->emType )
  266. {
  267. case CHAT_TYPE_GLOBAL: // °ü¸®¿ë ±Û·Î¹ú ¸Þ½ÃÁö
  268. {
  269. PGLCHARAG pChar = GetChar ( dwGaeaID );
  270. if ( !pChar ) return FALSE;
  271. if ( pChar->m_dwUserLvl < USER_SPECIAL ) return FALSE;
  272. NET_CHAT_CTRL_FB NetChatFB;
  273. NetChatFB.emType = CHAT_TYPE_GLOBAL;
  274. StringCchCopy ( NetChatFB.szChatMsg, GLOBAL_CHAT_MSG_SIZE+1, pNetMsg->szChatMsg );
  275. //add staffchat
  276. if ( pChar->m_dwUserLvl == USER_SPECIAL )
  277. {
  278. NetChatFB.bStaff =true ;
  279. }
  280. AGCHARNODE *pCharNode = m_PCList.m_pHead;
  281. for ( ; pCharNode; pCharNode=pCharNode->pNext )
  282. {
  283. SENDTOCLIENT ( pCharNode->Data->m_dwClientID, &NetChatFB );
  284. }
  285. if (GLCONST_CHAR::EnableGMLogs )
  286. {
  287. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  288. std::string strTIME = CDebugSet::GetCurTime ();
  289. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Global Chat %s",
  290. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->szChatMsg );
  291. strTIME.clear();
  292. }
  293. }
  294. break;
  295. case CHAT_TYPE_NORMAL: // ÀϹݸ޽ÃÁö
  296. {
  297. PGLCHARAG pChar = GetChar ( dwGaeaID );
  298. if ( !pChar ) return FALSE;
  299. if ( pChar->IsCHATBLOCK() )
  300. {
  301. GLMSG::SNETPC_CHAT_BLOCK NetChatBlock;
  302. StringCchCopy( NetChatBlock.szName, USR_ID_LENGTH+1, pChar->m_szUserName );
  303. NetChatBlock.tChatBlock = pChar->m_tCHATBLOCK;
  304. SENDTOCLIENT ( pChar->m_dwClientID, &NetChatBlock );
  305. return FALSE;
  306. }
  307. // ÇÊµå ¼­¹ö·Î Àü¼Û.
  308. SENDTOFIELD ( pChar->m_dwClientID, nmg );
  309. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  310. if( pChar->m_bTracingUser )
  311. {
  312. CDebugSet::ToTracingFile( pChar->m_szUserName, "**Normal Send**, [%s][%s], %s", pChar->m_szUserName, pChar->m_szName, pNetMsg->szChatMsg );
  313. }
  314. //#endif
  315. }
  316. break;
  317. case CHAT_TYPE_PARTY: // ÆÄƼ¸Þ½ÃÁö
  318. {
  319. PGLCHARAG pChar = GetChar ( dwGaeaID );
  320. if ( !pChar ) return FALSE;
  321. if ( pChar->m_dwPartyID==PARTY_NULL ) return FALSE;
  322. if ( pChar->IsCHATBLOCK() )
  323. {
  324. GLMSG::SNETPC_CHAT_BLOCK NetChatBlock;
  325. StringCchCopy ( NetChatBlock.szName, USR_ID_LENGTH+1, pChar->m_szUserName );
  326. NetChatBlock.tChatBlock = pChar->m_tCHATBLOCK;
  327. SENDTOCLIENT ( pChar->m_dwClientID, &NetChatBlock );
  328. return FALSE;
  329. }
  330. NET_CHAT_FB NetChatFB;
  331. NetChatFB.emType = pNetMsg->emType;
  332. StringCchCopy ( NetChatFB.szName, CHR_ID_LENGTH+1, pChar->m_szName );
  333. StringCchCopy ( NetChatFB.szChatMsg, CHAT_MSG_SIZE+1, pNetMsg->szChatMsg );
  334. SENDTOPARTY ( pChar->m_dwGaeaID, pChar->m_dwPartyID, (NET_MSG_GENERIC*) &NetChatFB );
  335. // ÀÚ½ÅÀÇ ¸Þ½ÃÁö¸¦ º¸³¿
  336. SendToGMMsg( pChar, NetChatFB );
  337. //// »ó´ë¹æÀÇ ¸Þ½ÃÁö¸¦ º¸³¿
  338. //SendToGMMsg( GetChar(pChar->m_dwGaeaID), NetChatFB );
  339. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  340. GLPARTY* pParty = m_cPartyMan.GetParty(pChar->m_dwPartyID);
  341. if( pParty && pParty->ISVAILD() )
  342. {
  343. GLPARTY::MEMBER_ITER iter = pParty->m_cMEMBER.begin();
  344. GLPARTY::MEMBER_ITER iter_end = pParty->m_cMEMBER.end();
  345. PGLCHARAG pMemChar = NULL;
  346. for ( ; iter!=iter_end; ++iter )
  347. {
  348. pMemChar = GLAgentServer::GetInstance().GetChar ( (*iter) );
  349. if ( pMemChar && pMemChar->m_bTracingUser )
  350. {
  351. if( pMemChar->m_dwClientID == pChar->m_dwClientID ) continue;
  352. CDebugSet::ToTracingFile( pMemChar->m_szUserName, "##Party Recv##, [%s][%s]->[%s][%s], %s",
  353. pChar->m_szUserName, pChar->m_szName, pMemChar->m_szUserName, pMemChar->m_szName, pNetMsg->szChatMsg );
  354. }
  355. }
  356. }
  357. if( pChar->m_bTracingUser )
  358. {
  359. CDebugSet::ToTracingFile( pChar->m_szUserName, "##Party Send##, [%s][%s], %s",
  360. pChar->m_szUserName, pChar->m_szName, pNetMsg->szChatMsg );
  361. }
  362. //#endif
  363. }
  364. break;
  365. case CHAT_TYPE_PRIVATE: // °³Àθ޽ÃÁö
  366. {
  367. PGLCHARAG pChar = GetChar ( dwGaeaID );
  368. if ( !pChar ) return FALSE;
  369. if ( pChar->IsCHATBLOCK() )
  370. {
  371. GLMSG::SNETPC_CHAT_BLOCK NetChatBlock;
  372. StringCchCopy ( NetChatBlock.szName, USR_ID_LENGTH+1, pChar->m_szUserName );
  373. NetChatBlock.tChatBlock = pChar->m_tCHATBLOCK;
  374. SENDTOCLIENT ( pChar->m_dwClientID, &NetChatBlock );
  375. return FALSE;
  376. }
  377. CHAR_MAP_ITER iterChar = m_PCNameMap.find ( std::string(pNetMsg->szName) );
  378. if ( iterChar==m_PCNameMap.end() )
  379. {
  380. // ±Ó¼Ó¸»ÀÇ ´ë»óÀÌ ¾øÀ»¶§ FB ¸Þ½ÃÁö.
  381. GLMSG::SNETPC_CHAT_PRIVATE_FAIL NetMsgFail;
  382. StringCchCopy ( NetMsgFail.szName, CHR_ID_LENGTH+1, pNetMsg->szName );
  383. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFail );
  384. return FALSE;
  385. }
  386. // »ó´ë¹æ¿¡°Ô ÀÚ±â ÀÚ½ÅÀÌ ±Ó¼Ó¸» ºí·°µÇ¾î ÀÖ´ÂÁö °Ë»ç.
  387. PGLCHARAG pCHAR_TAR = (*iterChar).second;
  388. int dwFR_FLAG = pCHAR_TAR->GetStateFriend ( pChar->m_szName );
  389. if ( (dwFR_FLAG==EMFRIEND_BLOCK) && (pChar->m_dwUserLvl>USER_GM3) )
  390. {
  391. dwFR_FLAG = EMFRIEND_OFF;
  392. }
  393. if ( dwFR_FLAG==EMFRIEND_BLOCK )
  394. {
  395. // ÇØ´ç »ç¶÷¿¡°Ô ºí·° µÇ¾úÀ»¶§.
  396. // ±Ó¼Ó¸»ÀÇ ´ë»óÀÌ ¾øÀ»¶§ FB ¸Þ½ÃÁö.
  397. GLMSG::SNETPC_CHAT_PRIVATE_FAIL NetMsgFail;
  398. StringCchCopy ( NetMsgFail.szName, CHR_ID_LENGTH+1, pNetMsg->szName );
  399. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFail );
  400. }
  401. else
  402. {
  403. NET_CHAT_FB NetChatFB;
  404. NetChatFB.emType = pNetMsg->emType;
  405. StringCchCopy ( NetChatFB.szName,CHR_ID_LENGTH+1,pChar->m_szName );
  406. StringCchCopy ( NetChatFB.szChatMsg, CHAT_MSG_SIZE+1, pNetMsg->szChatMsg );
  407. PGLCHARAG pGLChar = (*iterChar).second;
  408. SENDTOCLIENT ( pGLChar->m_dwClientID, &NetChatFB );
  409. // ÀÚ½ÅÀÇ ¸Þ½ÃÁö¸¦ º¸³¿
  410. SendToGMMsg( pChar, NetChatFB );
  411. // »ó´ë¹æÀÇ ¸Þ½ÃÁö¸¦ º¸³¿
  412. SendToGMMsg( pGLChar, NetChatFB );
  413. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  414. if( pChar->m_bTracingUser )
  415. {
  416. CDebugSet::ToTracingFile( pChar->m_szUserName, "@@Private Send@@, [%s][%s]->[%s][%s], %s",
  417. pChar->m_szUserName, pChar->m_szName, pGLChar->m_szUserName, pGLChar->m_szName, pNetMsg->szChatMsg );
  418. }
  419. if( pGLChar->m_bTracingUser )
  420. {
  421. CDebugSet::ToTracingFile( pGLChar->m_szUserName, "@@Private Recv@@, [%s][%s]<-[%s][%s], %s",
  422. pGLChar->m_szUserName, pGLChar->m_szName, pChar->m_szUserName, pChar->m_szName, pNetMsg->szChatMsg );
  423. }
  424. //#endif
  425. }
  426. }
  427. break;
  428. case CHAT_TYPE_GUILD : // ±æµå¸Þ½ÃÁö
  429. {
  430. PGLCHARAG pChar = GetChar ( dwGaeaID );
  431. if ( !pChar ) return FALSE;
  432. if ( pChar->m_dwGuild==CLUB_NULL ) return FALSE;
  433. if ( pChar->IsCHATBLOCK() )
  434. {
  435. GLMSG::SNETPC_CHAT_BLOCK NetChatBlock;
  436. StringCchCopy ( NetChatBlock.szName, USR_ID_LENGTH+1, pChar->m_szUserName );
  437. NetChatBlock.tChatBlock = pChar->m_tCHATBLOCK;
  438. SENDTOCLIENT ( pChar->m_dwClientID, &NetChatBlock );
  439. return FALSE;
  440. }
  441. GLCLUB *pCLUB = m_cClubMan.GetClub ( pChar->m_dwGuild );
  442. if ( !pCLUB ) return FALSE;
  443. CLUBMEMBERS_ITER pos = pCLUB->m_mapMembers.begin();
  444. CLUBMEMBERS_ITER end = pCLUB->m_mapMembers.end();
  445. for ( ; pos!=end; ++pos )
  446. {
  447. PGLCHARAG pMEMBER = GetCharID ( (*pos).first );
  448. if ( !pMEMBER ) continue;
  449. NET_CHAT_FB NetChatFB;
  450. NetChatFB.emType = pNetMsg->emType;
  451. StringCchCopy ( NetChatFB.szName,CHR_ID_LENGTH+1,pChar->m_szName );
  452. StringCchCopy ( NetChatFB.szChatMsg, CHAT_MSG_SIZE+1, pNetMsg->szChatMsg );
  453. SENDTOCLIENT ( pMEMBER->m_dwClientID, &NetChatFB );
  454. // »ó´ë¹æÀÇ ¸Þ½ÃÁö¸¦ º¸³¿
  455. SendToGMMsg( pMEMBER, NetChatFB );
  456. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  457. if( pMEMBER->m_bTracingUser )
  458. {
  459. CDebugSet::ToTracingFile( pMEMBER->m_szUserName, "%%Guild Recv%%, [%s][%s]->[%s][%s], %s",
  460. pChar->m_szUserName, pChar->m_szName, pMEMBER->m_szUserName, pMEMBER->m_szName, pNetMsg->szChatMsg );
  461. }
  462. //#endif
  463. }
  464. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  465. if( pChar->m_bTracingUser )
  466. {
  467. CDebugSet::ToTracingFile( pChar->m_szUserName, "%%Guild Send%%, [%s][%s], %s", pChar->m_szUserName, pChar->m_szName, pNetMsg->szChatMsg );
  468. }
  469. //#endif
  470. NET_CHAT_FB NetChatFB;
  471. NetChatFB.emType = pNetMsg->emType;
  472. StringCchCopy ( NetChatFB.szName,CHR_ID_LENGTH+1,pChar->m_szName );
  473. StringCchCopy ( NetChatFB.szChatMsg, CHAT_MSG_SIZE+1, pNetMsg->szChatMsg );
  474. // ÀÚ½ÅÀÇ ¸Þ½ÃÁö¸¦ º¸³¿
  475. // SendToGMMsg( pChar, NetChatFB );
  476. }
  477. break;
  478. case CHAT_TYPE_ALLIANCE:
  479. {
  480. PGLCHARAG pChar = GetChar ( dwGaeaID );
  481. if ( !pChar ) return FALSE;
  482. if ( pChar->m_dwGuild==CLUB_NULL ) return FALSE;
  483. if ( pChar->IsCHATBLOCK() )
  484. {
  485. GLMSG::SNETPC_CHAT_BLOCK NetChatBlock;
  486. StringCchCopy ( NetChatBlock.szName, USR_ID_LENGTH+1, pChar->m_szUserName );
  487. NetChatBlock.tChatBlock = pChar->m_tCHATBLOCK;
  488. SENDTOCLIENT ( pChar->m_dwClientID, &NetChatBlock );
  489. return FALSE;
  490. }
  491. GLCLUB *pCLUB = m_cClubMan.GetClub ( pChar->m_dwGuild );
  492. if ( !pCLUB ) return FALSE;
  493. if ( pCLUB->m_dwAlliance==CLUB_NULL ) return FALSE;
  494. GLCLUB *pCLUB_CHIEF = m_cClubMan.GetClub ( pCLUB->m_dwAlliance );
  495. if ( !pCLUB_CHIEF ) return FALSE;
  496. CLUB_ALLIANCE_ITER pos_alliance = pCLUB_CHIEF->m_setAlliance.begin();
  497. CLUB_ALLIANCE_ITER end_alliance = pCLUB_CHIEF->m_setAlliance.end();
  498. for ( ; pos_alliance!=end_alliance; ++pos_alliance )
  499. {
  500. const GLCLUBALLIANCE &sALLIANCE = (*pos_alliance);
  501. GLCLUB *pCLUB_INDIAN = m_cClubMan.GetClub ( sALLIANCE.m_dwID );
  502. if ( !pCLUB_INDIAN ) continue;
  503. CLUBMEMBERS_ITER pos = pCLUB_INDIAN->m_mapMembers.begin();
  504. CLUBMEMBERS_ITER end = pCLUB_INDIAN->m_mapMembers.end();
  505. for ( ; pos!=end; ++pos )
  506. {
  507. PGLCHARAG pMEMBER = GetCharID ( (*pos).first );
  508. if ( !pMEMBER ) continue;
  509. NET_CHAT_FB NetChatFB;
  510. NetChatFB.emType = pNetMsg->emType;
  511. StringCchCopy ( NetChatFB.szName,CHR_ID_LENGTH+1,pChar->m_szName );
  512. StringCchCopy ( NetChatFB.szChatMsg, CHAT_MSG_SIZE+1, pNetMsg->szChatMsg );
  513. SENDTOCLIENT ( pMEMBER->m_dwClientID, &NetChatFB );
  514. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  515. if( pMEMBER->m_bTracingUser )
  516. {
  517. CDebugSet::ToTracingFile( pMEMBER->m_szUserName, "**Alliance Recv**, [%s][%s]->[%s][%s], %s",
  518. pChar->m_szUserName, pChar->m_szName, pMEMBER->m_szUserName, pMEMBER->m_szName, pNetMsg->szChatMsg );
  519. }
  520. //#endif
  521. }
  522. }
  523. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  524. if( pChar->m_bTracingUser )
  525. {
  526. CDebugSet::ToTracingFile( pChar->m_szUserName, "**Alliance Send**, [%s][%s], %s", pChar->m_szUserName, pChar->m_szName, pNetMsg->szChatMsg );
  527. }
  528. //#endif
  529. }
  530. break;
  531. default:
  532. break;
  533. }
  534. return TRUE;
  535. }
  536. BOOL GLAgentServer::MsgReqCreateInstantMap ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  537. {
  538. GLMSG::SNETREQ_CREATE_INSTANT_MAP_REQ *pNetMsg = (GLMSG::SNETREQ_CREATE_INSTANT_MAP_REQ *) nmg;
  539. GLMSG::SNETREQ_CREATE_INSTANT_MAP_FB NetMsgFB;
  540. PGLCHARAG pChar = GetChar ( pNetMsg->dwGaeaID );
  541. if ( !pChar ) return FALSE;
  542. // Note : ÇöÀç ¸Ê Á¤º¸.
  543. //
  544. GLAGLandMan* pCurLandMan = GetByMapID ( pChar->m_sCurMapID );
  545. if ( !pCurLandMan )
  546. {
  547. CDebugSet::ToLogFile( "EMCHAR_GATEOUT_MAPID %d, %d", pChar->m_dwCharID, pChar->m_sCurMapID );
  548. NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL_MAPID;
  549. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  550. return FALSE;
  551. }
  552. // ÇöÀç °ÔÀÌÆ®
  553. DxLandGateMan* pCurGateMan = pCurLandMan->GetLandGateMan ();
  554. PDXLANDGATE pCurGate = pCurGateMan->FindLandGate ( pNetMsg->dwGateID );
  555. if ( !pCurGate )
  556. {
  557. CDebugSet::ToLogFile( "EMCHAR_GATEOUT_GATEID %d %d %d", pChar->m_dwCharID,
  558. pChar->m_sCurMapID, pNetMsg->dwGateID );
  559. NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL_GATEID;
  560. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  561. return FALSE;
  562. }
  563. // Note : ¸ñÇ¥ ¸Ê.
  564. //
  565. GLAGLandMan* pNextLandMan = GetByMapID ( pCurGate->GetToMapID() );
  566. if ( !pNextLandMan )
  567. {
  568. CDebugSet::ToLogFile( "EMCHAR_GATEOUT_TARMAPID %d %d %d %d",
  569. pChar->m_dwCharID, pChar->m_sCurMapID, pCurGate->GetGateID(), pCurGate->GetToMapID() );
  570. NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL_TARMAPID;
  571. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  572. return FALSE;
  573. }
  574. // Note : ¸ñÇ¥ °ÔÀÌÆ®.
  575. //
  576. DxLandGateMan* pNextGateMan = pNextLandMan->GetLandGateMan ();
  577. PDXLANDGATE pNextGate = pNextGateMan->FindLandGate ( pCurGate->GetToGateID() );
  578. if ( !pNextGate )
  579. {
  580. CDebugSet::ToLogFile( "EMCHAR_GATEOUT_TARGATEID %d, %d %d %d %d",
  581. pChar->m_dwCharID, pChar->m_sCurMapID, pNetMsg->dwGateID, pCurGate->GetToMapID(),
  582. pCurGate->GetToGateID() );
  583. NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL_TARMAPID;
  584. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  585. return FALSE;
  586. }
  587. SMAPNODE* pMapNode = m_sMapList.FindMapNode ( pCurGate->GetToMapID() );
  588. if( !pMapNode->bInstantMap )
  589. {
  590. NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL_NOT;
  591. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  592. return FALSE;
  593. }
  594. DWORD dwNextFieldSvr = GetFieldServer ( pCurGate->GetToMapID() );
  595. if( pChar->m_dwCurFieldSvr != dwNextFieldSvr )
  596. {
  597. NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL;
  598. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  599. return FALSE;
  600. }
  601. /*m_sTestInstantMapCharInfo.dwGaeaID = pNetMsg->dwGaeaID;
  602. m_sTestInstantMapCharInfo.sBaseMapID = pCurGate->GetToMapID();
  603. return TRUE;*/
  604. GLMSG::SNETREQ_CREATE_INSTANT_MAP_FLD NetMsgFld;
  605. SNATIVEID sInstantMapID;
  606. // ÀνºÅÏÆ® ´øÀüÀ» »ý¼ºÇϱâÀü¿¡ Á¤¸» »ý¼ºÀ» ÇؾßÇÏ´ÂÁö ¿©ºÎ¸¦ Çѹø´õ ÆÇ´ÜÇÑ´Ù.
  607. if( pNetMsg->bCreate )
  608. {
  609. /*VEC_INSTANT_MAPID_ITER iter = m_vecInstantMapId.begin();
  610. bool bEnterInstantMap = FALSE;
  611. for( ; iter != m_vecInstantMapId.end(); ++iter )
  612. {
  613. bEnterInstantMap = FALSE;
  614. SNATIVEID sNativeID = *iter;
  615. GLAGLandMan* pLandMan = GetByMapID( sNativeID );
  616. if( !pLandMan ) continue;
  617. if( pLandMan->GetMapID().wMainID == pCurGate->GetToMapID().wMainID && !pLandMan->IsInstantMap() ) continue;
  618. if( pLandMan->IsPartyInstantMap() )
  619. {
  620. if( pLandMan->GetInstantMapHostID() == pChar->GetPartyID() )
  621. bEnterInstantMap = TRUE;
  622. }else if( pChar->GetPartyID() == PARTY_NULL ){
  623. if( pLandMan->GetInstantMapHostID() == pChar->m_dwGaeaID )
  624. bEnterInstantMap = TRUE;
  625. }
  626. if( bEnterInstantMap )
  627. {
  628. pNetMsg->bCreate = FALSE;
  629. pNetMsg->sInstantMapID = sNativeID;
  630. break;
  631. }
  632. }*/
  633. }
  634. if( pNetMsg->bCreate )
  635. {
  636. sInstantMapID.wMainID = pCurGate->GetToMapID().wMainID;
  637. sInstantMapID.wSubID = m_sInsertInstantMapId.InsertInduMapID();
  638. if( sInstantMapID.wSubID == SNATIVEID::ID_NULL )
  639. {
  640. TEXTCONSOLEMSG_WRITE( "[INFO]Create Failed Instant Map! ID reached Max Size! IDSize %d Map ID [%d][%d]",
  641. m_sInsertInstantMapId.useMapSubIDSet.size(), sInstantMapID.wMainID, sInstantMapID.wSubID );
  642. NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL_CREATEMAX;
  643. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  644. return FALSE;
  645. }
  646. DWORD StartTime = ::GetTickCount();
  647. if( CreateInstantMap( pCurGate->GetToMapID(), sInstantMapID, pNetMsg->dwGaeaID, pChar->GetPartyID() ) == E_FAIL )
  648. {
  649. NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL;
  650. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  651. return FALSE;
  652. }
  653. GLAGLandMan* pInLandMan = NULL;
  654. pInLandMan = GetByMapID ( sInstantMapID );
  655. if ( !pInLandMan )
  656. {
  657. NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL;
  658. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  659. return FALSE;
  660. }
  661. DWORD ElspTime = ::GetTickCount() - StartTime;
  662. HANDLE hProcess = GetCurrentProcess();
  663. PROCESS_MEMORY_COUNTERS pmc;
  664. if( GetProcessMemoryInfo( hProcess, &pmc, sizeof(pmc)) )
  665. {
  666. TEXTCONSOLEMSG_WRITE( "[INFO]Create Instant Map Time %d msec. MapInfo: ID [%d][%d] Size %dbytes. PartyMap %d HostID %d WorkingMemory %dbytes.",
  667. ElspTime, sInstantMapID.wMainID, sInstantMapID.wSubID, sizeof(*pInLandMan),
  668. pInLandMan->IsPartyInstantMap(), pInLandMan->GetInstantMapHostID(), pmc.WorkingSetSize );
  669. }
  670. NetMsgFld.bCreate = TRUE;
  671. NetMsgFld.dwGaeaID = pNetMsg->dwGaeaID;
  672. NetMsgFld.dwGateID = pNetMsg->dwGateID;
  673. NetMsgFld.sInstantMapID = sInstantMapID;
  674. NetMsgFld.sBaseMapID = pCurGate->GetToMapID();
  675. }else{
  676. GLAGLandMan* pInLandMan = GetByMapID( pNetMsg->sInstantMapID );
  677. if ( !pInLandMan )
  678. {
  679. NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL;
  680. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  681. return FALSE;
  682. }
  683. HANDLE hProcess = GetCurrentProcess();
  684. PROCESS_MEMORY_COUNTERS pmc;
  685. if( GetProcessMemoryInfo( hProcess, &pmc, sizeof(pmc)) )
  686. {
  687. TEXTCONSOLEMSG_WRITE( "[INFO]Enter Instant Map. MapInfo: ID [%d][%d] Size %dbytes. PartyMap %d HostID %d WorkingMemory %dbytes.",
  688. pNetMsg->sInstantMapID.wMainID, pNetMsg->sInstantMapID.wSubID, sizeof(*pInLandMan),
  689. pInLandMan->IsPartyInstantMap(), pInLandMan->GetInstantMapHostID(), pmc.WorkingSetSize );
  690. }
  691. sInstantMapID = pNetMsg->sInstantMapID;
  692. NetMsgFld.bCreate = FALSE;
  693. NetMsgFld.dwGaeaID = pNetMsg->dwGaeaID;
  694. NetMsgFld.dwGateID = pNetMsg->dwGateID;
  695. NetMsgFld.sInstantMapID = sInstantMapID;
  696. NetMsgFld.sBaseMapID = pCurGate->GetToMapID();
  697. }
  698. // Agent ¼­¹ö¿¡¼­ °®°í ÀÖ´Â Äɸ¯ÅÍ ¸ÊÁ¤º¸ º¯°æ
  699. pChar->SetCurrentField ( pChar->m_dwCurFieldSvr, sInstantMapID );
  700. // Note : ÇÊµå ¼­¹ö º¯°æ ÇÊ¿ä ¾øÀ½. ÇöÀç Çʵ弭¹ö·Î Àδø ¸Ê »ý¼ºÀ» ¿äû
  701. SENDTOFIELDSVR ( pChar->m_nChannel, pChar->m_dwCurFieldSvr, &NetMsgFld );
  702. return TRUE;
  703. }
  704. BOOL GLAgentServer::TestCreateInstantMap( float fElpasedTime )
  705. {
  706. if( m_sTestInstantMapCharInfo.sBaseMapID == NATIVEID_NULL() ) return FALSE;
  707. m_sTestInstantMapCharInfo.fElapsedTime += fElpasedTime;
  708. if( m_sTestInstantMapCharInfo.fElapsedTime < 0.5f ) return FALSE;
  709. m_sTestInstantMapCharInfo.fElapsedTime = 0.0f;
  710. PGLCHARAG pChar = GetChar ( m_sTestInstantMapCharInfo.dwGaeaID );
  711. if ( !pChar )
  712. {
  713. m_sTestInstantMapCharInfo.dwGaeaID = 0;
  714. m_sTestInstantMapCharInfo.fElapsedTime = 0.0f;
  715. m_sTestInstantMapCharInfo.sBaseMapID = NATIVEID_NULL();
  716. return FALSE;
  717. }
  718. SNATIVEID sBaseMapID = m_sTestInstantMapCharInfo.sBaseMapID;
  719. SNATIVEID sInstantMapID;
  720. sInstantMapID.wMainID = sBaseMapID.wMainID;
  721. sInstantMapID.wSubID = m_sInsertInstantMapId.InsertInduMapID();
  722. if( sInstantMapID.wSubID == SNATIVEID::ID_NULL )
  723. {
  724. TEXTCONSOLEMSG_WRITE( "[INFO]Create Failed Instant Map! ID reached Max Size! IDSize %d Map ID [%d][%d]",
  725. m_sInsertInstantMapId.useMapSubIDSet.size(), sInstantMapID.wMainID, sInstantMapID.wSubID );
  726. // NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL_CREATEMAX;
  727. // SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  728. return FALSE;
  729. }
  730. DWORD StartTime = ::GetTickCount();
  731. if( CreateInstantMap( sBaseMapID, sInstantMapID, m_sTestInstantMapCharInfo.dwGaeaID, pChar->GetPartyID() ) == E_FAIL )
  732. {
  733. // NetMsgFB.emFB = EMCHAR_CREATE_INSTANT_MAP_FAIL;
  734. // SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  735. return FALSE;
  736. }
  737. GLAGLandMan* pInLandMan = NULL;
  738. pInLandMan = GetByMapID ( sInstantMapID );
  739. if ( !pInLandMan ) return FALSE;
  740. DWORD ElspTime = ::GetTickCount() - StartTime;
  741. HANDLE hProcess = GetCurrentProcess();
  742. PROCESS_MEMORY_COUNTERS pmc;
  743. if( GetProcessMemoryInfo( hProcess, &pmc, sizeof(pmc)) )
  744. {
  745. TEXTCONSOLEMSG_WRITE( "[INFO]Create Instant Map! Mem %d Time %d msec Size %dbytes. IDSize %d Map ID [%d][%d]",
  746. pmc.WorkingSetSize, ElspTime, sizeof(*pInLandMan), m_sInsertInstantMapId.useMapSubIDSet.size(),
  747. sInstantMapID.wMainID, sInstantMapID.wSubID );
  748. }
  749. GLMSG::SNETREQ_CREATE_INSTANT_MAP_FLD NetMsgFld;
  750. // NetMsgFld.dwGaeaID = pNetMsg->dwGaeaID;
  751. // NetMsgFld.dwGateID = pNetMsg->dwGateID;
  752. NetMsgFld.dwGaeaID = m_sTestInstantMapCharInfo.dwGaeaID;
  753. NetMsgFld.sInstantMapID = sInstantMapID;
  754. NetMsgFld.sBaseMapID = sBaseMapID;
  755. // Agent ¼­¹ö¿¡¼­ °®°í ÀÖ´Â Äɸ¯ÅÍ ¸ÊÁ¤º¸ º¯°æ
  756. // pChar->SetCurrentField ( pChar->m_dwCurFieldSvr, sInstantMapID );
  757. // Note : ÇÊµå ¼­¹ö º¯°æ ÇÊ¿ä ¾øÀ½. ÇöÀç Çʵ弭¹ö·Î Àδø ¸Ê »ý¼ºÀ» ¿äû
  758. SENDTOFIELDSVR ( pChar->m_nChannel, pChar->m_dwCurFieldSvr, &NetMsgFld );
  759. return TRUE;
  760. }
  761. BOOL GLAgentServer::MsgReqDeleteInstantMap( NET_MSG_GENERIC* nmg )
  762. {
  763. GLMSG::SNETREQ_CREATE_INSTANT_MAP_DEL *pNetMsg = (GLMSG::SNETREQ_CREATE_INSTANT_MAP_DEL *) nmg;
  764. GLAGLandMan *pLandMan = GetByMapID ( pNetMsg->sInstantMapID );
  765. if( pLandMan == NULL ) return FALSE;
  766. if( !pLandMan->IsInstantMap() ) return FALSE;
  767. m_sInsertInstantMapId.DeleteInstantMapID( pNetMsg->sInstantMapID.wSubID );
  768. VEC_INSTANT_MAPID_ITER MapID_iter = std::find( m_vecInstantMapId.begin(), m_vecInstantMapId.end(), pNetMsg->sInstantMapID.dwID );
  769. if( MapID_iter != m_vecInstantMapId.end() ) m_vecInstantMapId.erase(MapID_iter);
  770. SAFE_DELETE ( pLandMan );
  771. m_pLandMan[pNetMsg->sInstantMapID.wMainID][pNetMsg->sInstantMapID.wSubID] = NULL;
  772. HANDLE hProcess = GetCurrentProcess();
  773. PROCESS_MEMORY_COUNTERS pmc;
  774. if( GetProcessMemoryInfo( hProcess, &pmc, sizeof(pmc)) )
  775. {
  776. TEXTCONSOLEMSG_WRITE( "[INFO]Delete Instant Map!! ServerMem %d Instant Map ID [%d][%d]", pmc.WorkingSetSize, pNetMsg->sInstantMapID.wMainID, pNetMsg->sInstantMapID.wSubID );
  777. }
  778. return TRUE;
  779. }
  780. // *****************************************************
  781. // Desc: ÀÌÀü°ÔÀÌÆ®·Î À̵¿ ¿äû (Field->Agent)
  782. // *****************************************************
  783. BOOL GLAgentServer::MsgReqGateOut ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  784. {
  785. GLMSG::SNETREQ_GATEOUT *pNetMsg = (GLMSG::SNETREQ_GATEOUT *) nmg;
  786. //if ( dwGaeaID!=GAEAID_NULL ) return FALSE;
  787. PGLCHARAG pChar = GetChar ( pNetMsg->dwGaeaID );
  788. if ( !pChar ) return FALSE;
  789. // Note : ÇöÀç ¸Ê Á¤º¸.
  790. //
  791. GLAGLandMan* pCurLandMan = GetByMapID ( pChar->m_sCurMapID );
  792. if ( !pCurLandMan )
  793. {
  794. CDebugSet::ToLogFile( "EMCHAR_GATEOUT_MAPID %d, %d", pChar->m_dwCharID, pChar->m_sCurMapID );
  795. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  796. NetMsgFB.emFB = EMCHAR_GATEOUT_MAPID;
  797. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  798. return FALSE;
  799. }
  800. // ÇöÀç °ÔÀÌÆ®
  801. DxLandGateMan* pCurGateMan = pCurLandMan->GetLandGateMan ();
  802. PDXLANDGATE pCurGate = pCurGateMan->FindLandGate ( pNetMsg->dwGateID );
  803. if ( !pCurGate )
  804. {
  805. CDebugSet::ToLogFile( "EMCHAR_GATEOUT_GATEID %d %d %d", pChar->m_dwCharID,
  806. pChar->m_sCurMapID, pNetMsg->dwGateID );
  807. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  808. NetMsgFB.emFB = EMCHAR_GATEOUT_GATEID;
  809. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  810. return FALSE;
  811. }
  812. // Note : ¸ñÇ¥ ¸Ê.
  813. //
  814. GLAGLandMan* pNextLandMan = GetByMapID ( pCurGate->GetToMapID() );
  815. if ( !pNextLandMan )
  816. {
  817. CDebugSet::ToLogFile( "EMCHAR_GATEOUT_TARMAPID %d %d %d %d",
  818. pChar->m_dwCharID, pChar->m_sCurMapID, pCurGate->GetGateID(), pCurGate->GetToMapID() );
  819. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  820. NetMsgFB.emFB = EMCHAR_GATEOUT_TARMAPID;
  821. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  822. return FALSE;
  823. }
  824. // ¸ñÇ¥¸ÊÀÌ ¼±µÎŬ·´ ÀüÅõÁ¸Àε¥ ¼±µµÀüÀÌ ³¡³µ°í ¼±µµÅ¬·´ÀÇ ±æ¿øÀÌ ¾Æ´Ï¸é
  825. if ( pNextLandMan->m_bGuidBattleMap )
  826. {
  827. if ( GLCONST_CHAR::bPKLESS )
  828. {
  829. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  830. NetMsgFB.emFB = EMCHAR_GATEOUT_HOLD;
  831. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  832. return FALSE;
  833. }
  834. GLGuidance *pGuid = GLGuidanceAgentMan::GetInstance().Find ( pNextLandMan->m_dwClubMapID );
  835. if ( pGuid )
  836. {
  837. // ¼±µµÀü À϶§ ±æÆ®¹èƲ ÁßÀ̰ųª Á¾·á½Ã°£ ¹Ì´ÞÀ̸é ÃâÀÔ±ÝÁö
  838. GLCLUB* pClub = m_cClubMan.GetClub ( pChar->m_dwGuild );
  839. if ( pClub && pGuid->m_bBattle && ( pClub->GetAllBattleNum() > 0 || !pClub->IsGuidBattle()) )
  840. {
  841. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  842. NetMsgFB.emFB = EMCHAR_GATEOUT_CLUBBATTLE;
  843. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  844. return FALSE;
  845. }
  846. GLCLUB* pGuidanceClub = m_cClubMan.GetClub ( pGuid->m_dwGuidanceClub );
  847. if ( !pGuid->m_bBattle && !pGuid->IsGuidClub(pChar->m_dwGuild) )
  848. {
  849. if ( pGuidanceClub )
  850. {
  851. // ¼±µµÅ¬·´ÀÇ µ¿¸ÍÀÌ ¾Æ´Ï¸é
  852. if ( !pGuidanceClub->IsAllianceGuild ( pChar->m_dwGuild ) )
  853. {
  854. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  855. NetMsgFB.emFB = EMCHAR_GATEOUT_HOLD;
  856. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  857. return FALSE;
  858. }
  859. }
  860. }
  861. }
  862. }
  863. // ¸ñÇ¥¸ÊÀÌ ¼±µÎŬ·´ ÀüÅõÁ¸Àε¥ ¼±µµÀüÀÌ ³¡³µ°í ¼±µµÅ¬·´ÀÇ ±æ¿øÀÌ ¾Æ´Ï¸é
  864. if ( pNextLandMan->m_bClubDeathMatchMap )
  865. {
  866. if ( GLCONST_CHAR::bPKLESS || pChar->m_nChannel != 0)
  867. {
  868. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  869. NetMsgFB.emFB = EMCHAR_GATEOUT_HOLD;
  870. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  871. return FALSE;
  872. }
  873. GLClubDeathMatch *pCDM = GLClubDeathMatchAgentMan::GetInstance().Find ( pNextLandMan->m_dwClubMapID );
  874. if ( pCDM )
  875. {
  876. GLCLUB* pClub = m_cClubMan.GetClub ( pChar->m_dwGuild );
  877. if ( !pCDM->IsEnterMap( pChar->m_dwGuild ) || !pClub )
  878. {
  879. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  880. NetMsgFB.emFB = EMCHAR_GATEOUT_HOLD;
  881. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  882. return FALSE;
  883. }
  884. if ( pClub )
  885. {
  886. // Ŭ·´¹èƲ ÁøÇàÁßÀ϶§´Â ¸øµé¾î°£´Ù.
  887. if ( pClub->GetAllBattleNum() > 0 )
  888. {
  889. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  890. NetMsgFB.emFB = EMCHAR_GATEOUT_CLUBBATTLE2;
  891. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  892. return FALSE;
  893. }
  894. if ( !pClub->IsMemberFlgCDM(pChar->m_dwCharID) )
  895. {
  896. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  897. NetMsgFB.emFB = EMCHAR_GATEOUT_HOLD;
  898. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  899. return FALSE;
  900. }
  901. }
  902. }
  903. }
  904. // Note : ¸ñÇ¥ °ÔÀÌÆ®.
  905. //
  906. DxLandGateMan* pNextGateMan = pNextLandMan->GetLandGateMan ();
  907. PDXLANDGATE pNextGate = pNextGateMan->FindLandGate ( pCurGate->GetToGateID() );
  908. if ( !pNextGate )
  909. {
  910. CDebugSet::ToLogFile( "EMCHAR_GATEOUT_TARGATEID %d, %d %d %d %d",
  911. pChar->m_dwCharID, pChar->m_sCurMapID, pNetMsg->dwGateID, pCurGate->GetToMapID(),
  912. pCurGate->GetToGateID() );
  913. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  914. NetMsgFB.emFB = EMCHAR_GATEOUT_TARGATEID;
  915. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  916. return FALSE;
  917. }
  918. // Note : ÇÊµå ¼­¹ö°¡ °°Àº ¸ÊÁ¾·ù À϶§¿¡´Â ÇÊµå ¼­¹ö º¯°æÀÌ ÇÊ¿ä ¾øÀ½.
  919. //
  920. DWORD dwNextFieldSvr = GetFieldServer ( pCurGate->GetToMapID() );
  921. if ( dwNextFieldSvr==pChar->m_dwCurFieldSvr )
  922. {
  923. // Agent ¼­¹ö¿¡¼­ °®°í ÀÖ´Â Äɸ¯ÅÍ ¸ÊÁ¤º¸ º¯°æ
  924. pChar->SetCurrentField ( pChar->m_dwCurFieldSvr, pCurGate->GetToMapID() );
  925. // Note : ÇÊµå ¼­¹ö º¯°æ ÇÊ¿ä ¾øÀ½. ÇöÀç Çʵ弭¹ö·Î ¸ÊÀ̵¿À» ¿äû.
  926. //
  927. SENDTOFIELDSVR ( pChar->m_nChannel, pChar->m_dwCurFieldSvr, nmg );
  928. }
  929. // Note : ÇÊµå ¼­¹ö º¯°æ ÇÊ¿ä.
  930. //
  931. else
  932. {
  933. // Note : ÇÊµå ¼­¹ö°¡ Á¤»óÀÎÁö °Ë»ç.
  934. //
  935. BOOL bSVR_OK = m_pMsgServer->IsSlotOnline ( dwNextFieldSvr );
  936. if ( !bSVR_OK )
  937. {
  938. GLMSG::SNETREQ_GATEOUT_FB NetMsgFB;
  939. NetMsgFB.emFB = EMCHAR_GATEOUT_FIELDSVR;
  940. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgFB );
  941. return FALSE;
  942. }
  943. // Note : ÇÊµå ¼­¹ö º¯°æ½Ã Ŭ¶óÀ̾ðÆ® Á¤º¸ º¯°æ »çÇ× ¹Ý¿µ.
  944. //
  945. ReActionMoveFieldSvr ( pChar->m_dwClientID, pChar->m_dwGaeaID );
  946. // ÇöÀç ÇÊµå ¼­¹ö¿¡ ÀÚ½ÅÀÌ ¶°³ª°¥ ¿¹Á¤ÀÓÀ» Å뺸.
  947. GLMSG::SNETPC_FIELDSVR_OUT NetMsg;
  948. SENDTOFIELD ( pChar->m_dwClientID, &NetMsg );
  949. // À̵¿ÇÒ ¸Ê ID ÀúÀå.
  950. pChar->SetNextFieldSvr ( pCurGate->GetToMapID(), pCurGate->GetToGateID(), D3DXVECTOR3(FLT_MAX,FLT_MAX,FLT_MAX), dwNextFieldSvr );
  951. }
  952. return TRUE;
  953. }
  954. BOOL GLAgentServer::CheckStartMap( DWORD dwGaeaID )
  955. {
  956. PGLCHARAG pChar = GetChar ( dwGaeaID );
  957. if ( !pChar ) return FALSE;
  958. GLAGLandMan *pLandMan=NULL;
  959. DWORD dwGenGate = 0;
  960. pLandMan = GetByMapID ( pChar->m_sStartMapID );
  961. if ( pLandMan && pLandMan->m_bClubDeathMatchMap )
  962. {
  963. if ( GLCONST_CHAR::bPKLESS ) return FALSE;
  964. if ( pChar->m_nChannel != 0 ) return FALSE;
  965. GLClubDeathMatch *pCDM = GLClubDeathMatchAgentMan::GetInstance().Find ( pLandMan->m_dwClubMapID );
  966. if ( pCDM && !pCDM->IsEnterMap( pChar->m_dwGuild ) ) return FALSE;
  967. GLCLUB* pClub = m_cClubMan.GetClub ( pChar->m_dwGuild );
  968. if ( !pClub ) return FALSE;
  969. // Ŭ·´¹èƲ ÁøÇàÁßÀ϶§´Â ¸øµé¾î°£´Ù.
  970. if ( pClub->GetAllBattleNum() > 0 ) return FALSE;
  971. if ( !pClub->IsMemberFlgCDM(pChar->m_dwCharID) ) return FALSE;
  972. }
  973. if ( !pLandMan )
  974. {
  975. return FALSE;
  976. }
  977. else if ( !pLandMan->GetLandGateMan()->FindLandGate(pChar->m_dwStartGate) )
  978. {
  979. PDXLANDGATE pLandGate = pLandMan->GetLandGateMan()->GetListLandGate();
  980. if ( !pLandGate ) return FALSE; // Gate°¡ Çϳªµµ ¾ø´Â °÷¿£ ºÎÈ°ÇÒ ¼ö ¾øÀ½.
  981. }
  982. return TRUE;
  983. }
  984. // *****************************************************
  985. // Desc: ºÎÈ°¿äû ó¸®
  986. // *****************************************************
  987. BOOL GLAgentServer::MsgReqReBirth ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  988. {
  989. PGLCHARAG pChar = GetChar ( dwGaeaID );
  990. if ( !pChar ) return FALSE;
  991. // ºÎÈ° ÁöÁ¡À¸·Î ÁøÀÔ ºÒ°¡½Ã ºÎÈ° ÁöÁ¡À» ÃʱâÈ­ÇÑ´Ù.
  992. GLMSG::SNETPC_REQ_REBIRTH *pNetMsg = (GLMSG::SNETPC_REQ_REBIRTH *) nmg;
  993. bool bStartMap = false;
  994. // ºÎÈ°.
  995. GLAGLandMan *pLandMan=NULL;
  996. DWORD dwGenGate = 0;
  997. // ½ÃÀÛÀ§Ä¡°¡ º¯°æµÇ¾î¾ß ÇÏ´Â °æ¿ì
  998. if ( pNetMsg->bRegenEntryFailed || !CheckStartMap( dwGaeaID ) )
  999. {
  1000. pChar->m_sStartMapID = GLCONST_CHAR::nidSTARTMAP[pChar->m_wSchool];
  1001. pChar->m_dwStartGate = GLCONST_CHAR::dwSTARTGATE[pChar->m_wSchool];
  1002. pChar->m_vStartPos = D3DXVECTOR3(0.0f,0.0f,0.0f);
  1003. SNATIVEID nidSTARTMAP = pChar->m_sStartMapID;
  1004. DWORD dwSTARTGATE = pChar->m_dwStartGate;
  1005. pLandMan = GetByMapID ( nidSTARTMAP );
  1006. if ( pLandMan )
  1007. {
  1008. DxLandGateMan* pLandGateMan = pLandMan->GetLandGateMan();
  1009. if ( !pLandGateMan->FindLandGate ( dwSTARTGATE ) )
  1010. {
  1011. DEBUGMSG_WRITE ( "(Revive) - Default gate is a failure. school %d", pChar->m_wSchool );
  1012. return FALSE;
  1013. }
  1014. else
  1015. {
  1016. dwGenGate = dwSTARTGATE;
  1017. }
  1018. }
  1019. else
  1020. {
  1021. DEBUGMSG_WRITE( "GLAgentServer::MsgReqReBirth Default map is a failure. school %d", pChar->m_wSchool );
  1022. return FALSE;
  1023. }
  1024. }
  1025. else
  1026. {
  1027. pLandMan = GetByMapID ( pChar->m_sStartMapID );
  1028. // ¿©±â ÀÌ¿ÜÀÇ »óȲÀº À§¿¡¼­ ´Ù °É·¯Áø´Ù.
  1029. if ( pLandMan )
  1030. {
  1031. if ( !pLandMan->GetLandGateMan()->FindLandGate(pChar->m_dwStartGate) )
  1032. {
  1033. PDXLANDGATE pLandGate = pLandMan->GetLandGateMan()->GetListLandGate();
  1034. if ( pLandGate ) dwGenGate = pLandGate->GetGateID(); // ù¹ø° Gate ¿¡¼­ »ý±è.
  1035. else
  1036. {
  1037. // ÀϾ¼ö ¾ø´Â »óȲ
  1038. DEBUGMSG_WRITE( "GLAgentServer::MsgReqReBirth Error Logic No Gate" );
  1039. return FALSE;
  1040. }
  1041. }
  1042. else dwGenGate = pChar->m_dwStartGate;
  1043. }
  1044. else
  1045. {
  1046. // ÀϾ¼ö ¾ø´Â »óȲ
  1047. DEBUGMSG_WRITE( "GLAgentServer::MsgReqReBirth Error Logic No LandMan" );
  1048. return FALSE;
  1049. }
  1050. }
  1051. /*
  1052. if( pNetMsg->bRegenEntryFailed )
  1053. {
  1054. pChar->m_sStartMapID = GLCONST_CHAR::nidSTARTMAP[pChar->m_wSchool];
  1055. pChar->m_dwStartGate = GLCONST_CHAR::dwSTARTGATE[pChar->m_wSchool];
  1056. pChar->m_vStartPos = D3DXVECTOR3(0.0f,0.0f,0.0f);
  1057. }
  1058. // ºÎÈ°.
  1059. GLAGLandMan *pLandMan=NULL;
  1060. DWORD dwGenGate = 0;
  1061. // ºÎÈ°ÇÒ Map°ú Gate À¯È¿¼º °Ë»ç.
  1062. if ( pChar->m_sStartMapID!=NATIVEID_NULL() )
  1063. {
  1064. pLandMan = GetByMapID ( pChar->m_sStartMapID );
  1065. if ( pLandMan )
  1066. {
  1067. DxLandGateMan* pLandGateMan = pLandMan->GetLandGateMan();
  1068. if ( pLandGateMan->FindLandGate(pChar->m_dwStartGate)==NULL )
  1069. {
  1070. PDXLANDGATE pLandGate = pLandGateMan->GetListLandGate();
  1071. if ( !pLandGate ) pLandMan = NULL; // Gate°¡ Çϳªµµ ¾ø´Â °÷¿£ ºÎÈ°ÇÒ ¼ö ¾øÀ½.
  1072. else dwGenGate = pLandGate->GetGateID(); // ù¹ø° Gate ¿¡¼­ »ý±è.
  1073. }
  1074. else dwGenGate = pChar->m_dwStartGate;
  1075. }
  1076. }
  1077. if ( !pLandMan )
  1078. {
  1079. SNATIVEID nidSTARTMAP = GLCONST_CHAR::nidSTARTMAP[pChar->m_wSchool];
  1080. DWORD dwSTARTGATE = GLCONST_CHAR::dwSTARTGATE[pChar->m_wSchool];
  1081. pLandMan = GetByMapID ( nidSTARTMAP );
  1082. if ( pLandMan )
  1083. {
  1084. DxLandGateMan* pLandGateMan = pLandMan->GetLandGateMan();
  1085. if ( !pLandGateMan->FindLandGate ( dwSTARTGATE ) )
  1086. {
  1087. DEBUGMSG_WRITE ( "(Revive) - Default gate is a failure. school %d", pChar->m_wSchool );
  1088. return FALSE;
  1089. }
  1090. else
  1091. {
  1092. dwGenGate = dwSTARTGATE;
  1093. }
  1094. }
  1095. }
  1096. if ( !pLandMan )
  1097. {
  1098. DEBUGMSG_WRITE(
  1099. "GLAgentServer::MsgReqReBirth Default map is a failure. school %d",
  1100. pChar->m_wSchool );
  1101. return FALSE;
  1102. }
  1103. */
  1104. SNATIVEID sBirthMapID = pLandMan->GetMapID ();
  1105. DWORD dwNextFieldSvr = GetFieldServer ( sBirthMapID );
  1106. if ( dwNextFieldSvr==pChar->m_dwCurFieldSvr )
  1107. {
  1108. pChar->SetCurrentField ( pChar->m_dwCurFieldSvr, sBirthMapID );
  1109. // Note : ÇÊµå ¼­¹ö º¯°æÀÌ ÇÊ¿ä ¾øÀ»¶§. ÇöÀç Çʵ弭¹ö·Î ºÎÈ°À» ¿äû.
  1110. //
  1111. SENDTOFIELD ( dwClientID, nmg );
  1112. }
  1113. else
  1114. {
  1115. // Note : ÇÊµå ¼­¹öÀÇ º¯°æÀÌ ÇÊ¿äÇÒ °æ¿ì.
  1116. //
  1117. // Note : ÇÊµå ¼­¹ö º¯°æ½Ã Ŭ¶óÀ̾ðÆ® Á¤º¸ º¯°æ »çÇ× ¹Ý¿µ.
  1118. //
  1119. ReActionMoveFieldSvr ( dwClientID, dwGaeaID );
  1120. // ÇöÁ¦ ÇÊµå ¼­¹ö¿¡ ÀÚ½ÅÀÌ ´Ù¸¥ °÷¿¡¼­ ºÎÈ°ÇÒ ¿¹Á¤ÀÓÀ» Å뺸.
  1121. GLMSG::SNETPC_REBIRTH_OUT NetMsg;
  1122. SENDTOFIELD ( dwClientID, &NetMsg );
  1123. // À̵¿ÇÒ ¸Ê ID ÀúÀå.
  1124. pChar->SetNextFieldSvr ( sBirthMapID, dwGenGate, D3DXVECTOR3(FLT_MAX,FLT_MAX,FLT_MAX), dwNextFieldSvr );
  1125. }
  1126. return TRUE;
  1127. }
  1128. BOOL GLAgentServer::MsgReqReGenGate ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1129. {
  1130. GLMSG::SNETPC_REQ_REGEN_GATE_FB *pNetMsg = (GLMSG::SNETPC_REQ_REGEN_GATE_FB *)nmg;
  1131. PGLCHARAG pChar = GetChar ( dwGaeaID );
  1132. if ( !pChar ) return FALSE;
  1133. // Note : º¯°æµÈ ½ºÅ¸Æ® ¸ã, ½ºÅ¸Æ® °ÔÀÌÆ®ÀÇ Á¤º¸¸¦ Àû¿ë.
  1134. //
  1135. pChar->m_sStartMapID = pNetMsg->sMapID;
  1136. pChar->m_dwStartGate = pNetMsg->dwGateID;
  1137. SENDTOCLIENT ( pChar->m_dwClientID, nmg );
  1138. return TRUE;
  1139. }
  1140. // *****************************************************
  1141. // Desc: Çʵ弭¹ö¿¡ Á¢¼ÓÁ¤º¸ Àü¼Û(Çʵ弭¹ö°¡ ¹Ù²ð°æ¿ì)
  1142. // *****************************************************
  1143. BOOL GLAgentServer::MsgFieldSvrOutFb ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1144. {
  1145. if( dwGaeaID < 0 || dwGaeaID >= m_dwMaxClient )
  1146. return FALSE;
  1147. PGLCHARAG pChar = GetChar ( dwGaeaID );
  1148. if ( !pChar ) return FALSE;
  1149. if ( pChar->m_sNextMapID==SNATIVEID(MAXLANDMID,MAXLANDSID) ) return FALSE;
  1150. // Note : ÇöÀç ÇÊµå ¼­¹ö ¹× ¸Ê ID ÁöÁ¤.
  1151. pChar->SetCurrentField ( pChar->m_dwNextFieldSvr, pChar->m_sNextMapID );
  1152. // Note : ¸Ê¿¡ »õ·Î ÁøÀÔÇϱâ À§Çؼ­ Field¼­¹ö¿¡ ¸Þ½ÃÁö ¼Û½Å.
  1153. //
  1154. NET_GAME_JOIN_FIELDSVR NetJoinField;
  1155. NetJoinField.emType = EMJOINTYPE_MOVEMAP;
  1156. NetJoinField.dwSlotAgentClient = pChar->m_dwClientID;
  1157. StringCchCopy ( NetJoinField.szUID, DAUM_MAX_UID_LENGTH+1, pChar->m_szUserName );
  1158. NetJoinField.nUserNum = pChar->m_dwUserID;
  1159. NetJoinField.dwUserLvl = pChar->m_dwUserLvl;
  1160. NetJoinField.nChaNum = pChar->m_dwCharID;
  1161. NetJoinField.dwGaeaID = pChar->m_dwGaeaID;
  1162. NetJoinField.tPREMIUM = pChar->m_tPREMIUM;
  1163. NetJoinField.tCHATBLOCK = pChar->m_tCHATBLOCK;
  1164. NetJoinField.sStartMap = pChar->m_sNextMapID;
  1165. NetJoinField.dwStartGate = pChar->m_dwNextGateID;
  1166. NetJoinField.vStartPos = pChar->m_vNextPos;
  1167. NetJoinField.dwActState = pChar->m_dwActState;
  1168. NetJoinField.bUseArmSub = pChar->m_bUseArmSub;
  1169. NetJoinField.dwThaiCCafeClass = pChar->m_dwThaiCCafeClass;
  1170. NetJoinField.nMyCCafeClass = pChar->m_nMyCCafeClass; // ¸»·¹ÀÌ½Ã¾Æ PC¹æ À̺¥Æ®
  1171. NetJoinField.sChinaTime = pChar->m_sChinaTime;
  1172. NetJoinField.sEventTime = pChar->m_sEventTime;
  1173. NetJoinField.sVietnamGainSystem = pChar->m_sVietnamSystem;
  1174. //** Add EventTime
  1175. pChar->ResetNextFieldSvr ();
  1176. SENDTOFIELD ( dwClientID, &NetJoinField );
  1177. return TRUE;
  1178. }
  1179. BOOL GLAgentServer::MsgReBirthOutFb ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1180. {
  1181. PGLCHARAG pChar = GetChar ( dwGaeaID );
  1182. if ( !pChar ) return FALSE;
  1183. if ( pChar->m_sNextMapID==SNATIVEID(MAXLANDMID,MAXLANDSID) ) return FALSE;
  1184. // Note : ÇöÀç ÇÊµå ¼­¹ö ¹× ¸Ê ID ÁöÁ¤.
  1185. pChar->SetCurrentField ( pChar->m_dwNextFieldSvr, pChar->m_sNextMapID );
  1186. // Note : ¸Ê¿¡ »õ·Î ÁøÀÔÇϱâ À§Çؼ­ Field¼­¹ö¿¡ ¸Þ½ÃÁö ¼Û½Å.
  1187. //
  1188. NET_GAME_JOIN_FIELDSVR NetJoinField;
  1189. NetJoinField.emType = EMJOINTYPE_REBIRTH;
  1190. NetJoinField.dwSlotAgentClient = pChar->m_dwClientID;
  1191. NetJoinField.nUserNum = pChar->m_dwUserID;
  1192. StringCchCopy ( NetJoinField.szUID, DAUM_MAX_UID_LENGTH+1, pChar->m_szUserName );
  1193. NetJoinField.dwUserLvl = pChar->m_dwUserLvl;
  1194. NetJoinField.nChaNum = pChar->m_dwCharID;
  1195. NetJoinField.dwGaeaID = pChar->m_dwGaeaID;
  1196. NetJoinField.tPREMIUM = pChar->m_tPREMIUM;
  1197. NetJoinField.tCHATBLOCK = pChar->m_tCHATBLOCK;
  1198. NetJoinField.sStartMap = pChar->m_sNextMapID;
  1199. NetJoinField.dwStartGate = pChar->m_dwNextGateID;
  1200. NetJoinField.vStartPos = D3DXVECTOR3(0,0,0);
  1201. NetJoinField.dwActState = pChar->m_dwActState;
  1202. NetJoinField.bUseArmSub = pChar->m_bUseArmSub;
  1203. NetJoinField.dwThaiCCafeClass = pChar->m_dwThaiCCafeClass;
  1204. NetJoinField.nMyCCafeClass = pChar->m_nMyCCafeClass; // ¸»·¹ÀÌ½Ã¾Æ PC¹æ À̺¥Æ®
  1205. NetJoinField.sChinaTime = pChar->m_sChinaTime;
  1206. NetJoinField.sEventTime = pChar->m_sEventTime;
  1207. NetJoinField.sVietnamGainSystem = pChar->m_sVietnamSystem;
  1208. //** Add EventTime
  1209. pChar->ResetNextFieldSvr ();
  1210. SENDTOFIELD ( dwClientID, &NetJoinField );
  1211. return TRUE;
  1212. }
  1213. // *****************************************************
  1214. // Desc: ·¹º§ ¾÷½Ã ÇöÀç ¸Ê¿¡ ¸Ó¹°·¯ ÀÖÁö ¾Ê¾Æ¾ß ÇÏ´Â °æ¿ì
  1215. // *****************************************************
  1216. BOOL GLAgentServer::MsgLvUpMustLeaveMap( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1217. {
  1218. PGLCHARAG pChar = GetChar ( dwGaeaID );
  1219. if ( !pChar ) return FALSE;
  1220. GLMSG::SNETPC_REQ_MUST_LEAVE_MAP_AG *pNetMsg = (GLMSG::SNETPC_REQ_MUST_LEAVE_MAP_AG *) nmg;
  1221. // Note : ¸ñÇ¥ ¸Ê.
  1222. //
  1223. GLAGLandMan* pNextLandMan = GetByMapID ( pNetMsg->sMAPID );
  1224. if ( !pNextLandMan )
  1225. {
  1226. GLMSG::SNETPC_REQ_MUST_LEAVE_MAP_FB NetMsgFB;
  1227. NetMsgFB.emFB = EMREQ_MUST_LEAVE_MAP_FB_FAIL;
  1228. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1229. return FALSE;
  1230. }
  1231. // Note : À̵¿ À§Ä¡ Á¤º¸ À¯È¿¼º °Ë»ç.
  1232. //
  1233. if ( pNetMsg->dwGATEID==UINT_MAX && pNetMsg->vPOS==D3DXVECTOR3(FLT_MAX,FLT_MAX,FLT_MAX) )
  1234. {
  1235. GLMSG::SNETPC_REQ_MUST_LEAVE_MAP_FB NetMsgFB;
  1236. NetMsgFB.emFB = EMREQ_MUST_LEAVE_MAP_FB_FAIL;
  1237. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1238. return FALSE;
  1239. }
  1240. // ¸ÊÀÌ ÀÖ´ÂÁö
  1241. SMAPNODE* pMapNode = m_sMapList.FindMapNode ( pNetMsg->sMAPID );
  1242. if ( !pMapNode )
  1243. {
  1244. GLMSG::SNETPC_REQ_MUST_LEAVE_MAP_FB NetMsgFB;
  1245. NetMsgFB.emFB = EMREQ_MUST_LEAVE_MAP_FB_FAIL;
  1246. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1247. return FALSE;
  1248. }
  1249. DWORD dwNextFieldSvr = pMapNode->dwFieldSID;
  1250. // Çʵ弭¹ö¸¦ ¿Å°Ü¾ß ÇÒ °æ¿ì
  1251. {
  1252. // Note : Çʵ弭¹ö°¡ Á¤»óÀÎÁö °Ë»ç.
  1253. //
  1254. BOOL bSVR_OK = m_pMsgServer->IsSlotOnline ( dwNextFieldSvr );
  1255. if ( !bSVR_OK )
  1256. {
  1257. GLMSG::SNETPC_REQ_MUST_LEAVE_MAP_FB NetMsgFB;
  1258. NetMsgFB.emFB = EMREQ_MUST_LEAVE_MAP_FB_FAIL;
  1259. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1260. return FALSE;
  1261. }
  1262. // Note : ÇÊµå ¼­¹ö º¯°æ½Ã Ŭ¶óÀ̾ðÆ® Á¤º¸ º¯°æ »çÇ× ¹Ý¿µ.
  1263. //
  1264. ReActionMoveFieldSvr ( dwClientID, dwGaeaID );
  1265. // ÇöÀç ÇÊµå ¼­¹ö¿¡ ÀÚ½ÅÀÌ ¶°³ª°¥ ¿¹Á¤ÀÓÀ» Å뺸.
  1266. GLMSG::SNETPC_FIELDSVR_OUT NetMsg;
  1267. SENDTOFIELD ( pChar->m_dwClientID, &NetMsg );
  1268. // À̵¿ÇÒ ¸Ê ID ÀúÀå.
  1269. pChar->SetNextFieldSvr ( pNetMsg->sMAPID, pNetMsg->dwGATEID, pNetMsg->vPOS, dwNextFieldSvr );
  1270. }
  1271. return TRUE;
  1272. }
  1273. // *****************************************************
  1274. // Desc: ¼Òȯ¿äû ó¸® (´Ù¸¥ Çʵ弭¹öÀÏ °æ¿ì)
  1275. // *****************************************************
  1276. BOOL GLAgentServer::MsgReCallAg ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1277. {
  1278. PGLCHARAG pChar = GetChar ( dwGaeaID );
  1279. if ( !pChar ) return FALSE;
  1280. GLMSG::SNETPC_REQ_RECALL_AG *pNetMsg = (GLMSG::SNETPC_REQ_RECALL_AG *) nmg;
  1281. // Note : ¸ñÇ¥ ¸Ê.
  1282. //
  1283. GLAGLandMan* pNextLandMan = GetByMapID ( pNetMsg->sMAPID );
  1284. if ( !pNextLandMan )
  1285. {
  1286. GLMSG::SNETPC_REQ_RECALL_FB NetMsgFB;
  1287. NetMsgFB.emFB = EMREQ_RECALL_FB_FAIL;
  1288. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1289. return FALSE;
  1290. }
  1291. // Note : À̵¿ À§Ä¡ Á¤º¸ À¯È¿¼º °Ë»ç.
  1292. //
  1293. if ( pNetMsg->dwGATEID==UINT_MAX && pNetMsg->vPOS==D3DXVECTOR3(FLT_MAX,FLT_MAX,FLT_MAX) )
  1294. {
  1295. GLMSG::SNETPC_REQ_RECALL_FB NetMsgFB;
  1296. NetMsgFB.emFB = EMREQ_RECALL_FB_FAIL;
  1297. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1298. return FALSE;
  1299. }
  1300. // ¸ÊÀÌ ÀÖ´ÂÁö
  1301. SMAPNODE* pMapNode = m_sMapList.FindMapNode ( pNetMsg->sMAPID );
  1302. if ( !pMapNode )
  1303. {
  1304. GLMSG::SNETPC_REQ_RECALL_FB NetMsgFB;
  1305. NetMsgFB.emFB = EMREQ_RECALL_FB_FAIL;
  1306. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1307. return FALSE;
  1308. }
  1309. DWORD dwNextFieldSvr = pMapNode->dwFieldSID;
  1310. // Çʵ弭¹ö¸¦ ¿Å°Ü¾ß ÇÒ °æ¿ì
  1311. {
  1312. // Note : Çʵ弭¹ö°¡ Á¤»óÀÎÁö °Ë»ç.
  1313. //
  1314. BOOL bSVR_OK = m_pMsgServer->IsSlotOnline ( dwNextFieldSvr );
  1315. if ( !bSVR_OK )
  1316. {
  1317. GLMSG::SNETPC_REQ_RECALL_FB NetMsgFB;
  1318. NetMsgFB.emFB = EMREQ_RECALL_FB_FAIL;
  1319. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1320. return FALSE;
  1321. }
  1322. // Note : ÇÊµå ¼­¹ö º¯°æ½Ã Ŭ¶óÀ̾ðÆ® Á¤º¸ º¯°æ »çÇ× ¹Ý¿µ.
  1323. //
  1324. ReActionMoveFieldSvr ( dwClientID, dwGaeaID );
  1325. // ÇöÀç ÇÊµå ¼­¹ö¿¡ ÀÚ½ÅÀÌ ¶°³ª°¥ ¿¹Á¤ÀÓÀ» Å뺸.
  1326. GLMSG::SNETPC_FIELDSVR_OUT NetMsg;
  1327. SENDTOFIELD ( pChar->m_dwClientID, &NetMsg );
  1328. // À̵¿ÇÒ ¸Ê ID ÀúÀå.
  1329. pChar->SetNextFieldSvr ( pNetMsg->sMAPID, pNetMsg->dwGATEID, pNetMsg->vPOS, dwNextFieldSvr );
  1330. }
  1331. return TRUE;
  1332. }
  1333. BOOL GLAgentServer::MsgTeleportAg ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1334. {
  1335. PGLCHARAG pChar = GetChar ( dwGaeaID );
  1336. if ( !pChar ) return FALSE;
  1337. GLMSG::SNETPC_REQ_TELEPORT_AG *pNetMsg = (GLMSG::SNETPC_REQ_TELEPORT_AG *) nmg;
  1338. // Note : ¸ñÇ¥ ¸Ê.
  1339. //
  1340. GLAGLandMan* pNextLandMan = GetByMapID ( pNetMsg->sMAPID );
  1341. if ( !pNextLandMan )
  1342. {
  1343. GLMSG::SNETPC_REQ_TELEPORT_FB NetMsgFB;
  1344. NetMsgFB.emFB = EMREQ_TELEPORT_FB_FAIL;
  1345. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1346. return FALSE;
  1347. }
  1348. // Note : À̵¿ À§Ä¡ Á¤º¸ À¯È¿¼º °Ë»ç.
  1349. //
  1350. if ( pNetMsg->vPOS==D3DXVECTOR3(FLT_MAX,FLT_MAX,FLT_MAX) )
  1351. {
  1352. GLMSG::SNETPC_REQ_TELEPORT_FB NetMsgFB;
  1353. NetMsgFB.emFB = EMREQ_TELEPORT_FB_FAIL;
  1354. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1355. return FALSE;
  1356. }
  1357. // ¸ÊÀÌ ÀÖ´ÂÁö
  1358. SMAPNODE* pMapNode = m_sMapList.FindMapNode ( pNetMsg->sMAPID );
  1359. if ( !pMapNode )
  1360. {
  1361. GLMSG::SNETPC_REQ_TELEPORT_FB NetMsgFB;
  1362. NetMsgFB.emFB = EMREQ_TELEPORT_FB_FAIL;
  1363. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1364. return FALSE;
  1365. }
  1366. DWORD dwNextFieldSvr = pMapNode->dwFieldSID;
  1367. // Çʵ弭¹ö¸¦ ¿Å°Ü¾ß ÇÒ °æ¿ì
  1368. {
  1369. // Note : Çʵ弭¹ö°¡ Á¤»óÀÎÁö °Ë»ç.
  1370. //
  1371. BOOL bSVR_OK = m_pMsgServer->IsSlotOnline ( dwNextFieldSvr );
  1372. if ( !bSVR_OK )
  1373. {
  1374. GLMSG::SNETPC_REQ_TELEPORT_FB NetMsgFB;
  1375. NetMsgFB.emFB = EMREQ_TELEPORT_FB_FAIL;
  1376. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1377. return FALSE;
  1378. }
  1379. // Note : ÇÊµå ¼­¹ö º¯°æ½Ã Ŭ¶óÀ̾ðÆ® Á¤º¸ º¯°æ »çÇ× ¹Ý¿µ.
  1380. //
  1381. ReActionMoveFieldSvr ( dwClientID, dwGaeaID );
  1382. // ÇöÀç ÇÊµå ¼­¹ö¿¡ ÀÚ½ÅÀÌ ¶°³ª°¥ ¿¹Á¤ÀÓÀ» Å뺸.
  1383. GLMSG::SNETPC_FIELDSVR_OUT NetMsg;
  1384. SENDTOFIELD ( pChar->m_dwClientID, &NetMsg );
  1385. // À̵¿ÇÒ ¸Ê ID ÀúÀå.
  1386. pChar->SetNextFieldSvr ( pNetMsg->sMAPID, UINT_MAX, pNetMsg->vPOS, dwNextFieldSvr );
  1387. }
  1388. return TRUE;
  1389. }
  1390. BOOL GLAgentServer::MsgPartyLure ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1391. {
  1392. GLMSG::SNET_PARTY_LURE* pNetMsg = (GLMSG::SNET_PARTY_LURE*) nmg;
  1393. PGLCHARAG pCharMaster = GetChar ( dwGaeaID );
  1394. if ( !pCharMaster ) return FALSE;
  1395. DWORD dwPartyID = pCharMaster->m_dwPartyID;
  1396. PGLCHARAG pCharTar = GetChar ( pNetMsg->dwGaeaID );
  1397. if ( !pCharTar ) return FALSE;
  1398. if ( !pNetMsg->sOption.VALID_OPT() )
  1399. {
  1400. GLMSG::SNET_PARTY_LURE_FB NetMsgFB;
  1401. NetMsgFB.dwGaeaID = dwGaeaID;
  1402. NetMsgFB.emAnswer = EMPARTY_LURE_OPT;
  1403. SENDTOCLIENT ( pCharMaster->m_dwClientID, &NetMsgFB );
  1404. return FALSE;
  1405. }
  1406. // Note : ´ë»óÀÌ ÀÌ¹Ì ÆÄƼ¿¡ °¡ÀԵǾî ÀÖÀ½.
  1407. //
  1408. if ( pCharTar->m_dwPartyID!=PARTY_NULL )
  1409. {
  1410. GLMSG::SNET_PARTY_LURE_FB NetMsgFB;
  1411. NetMsgFB.dwGaeaID = dwGaeaID;
  1412. NetMsgFB.emAnswer = EMPARTY_LURE_OTHER;
  1413. SENDTOCLIENT ( pCharMaster->m_dwClientID, &NetMsgFB );
  1414. return FALSE;
  1415. }
  1416. //////////////cannot pt in battle royal map
  1417. GLAGLandMan* pLandMan = GetByMapID ( pCharMaster->m_sCurMapID );
  1418. if ( pLandMan->IsRedZone() )
  1419. {
  1420. GLMSG::SNET_PARTY_LURE_FB NetMsgFB;
  1421. NetMsgFB.dwGaeaID = dwGaeaID;
  1422. NetMsgFB.emAnswer = EMPARTY_LURE_OTHER;
  1423. SENDTOCLIENT ( pCharMaster->m_dwClientID, &NetMsgFB );
  1424. return FALSE;
  1425. }
  1426. ////////////////////////////
  1427. GLClubMan& cClubMan = GLAgentServer::GetInstance().GetClubMan();
  1428. GLCLUB *pCLUB = cClubMan.GetClub ( pCharTar->m_dwGuild );
  1429. GLCLUB *pCLUB_M = cClubMan.GetClub ( pCharMaster->m_dwGuild );
  1430. if ( pCLUB )
  1431. {
  1432. bool bClubBattle = false;
  1433. // ÆÄƼ°¡ ¾øÀ»°æ¿ì ( ÀڽŸ¸ üũ )
  1434. if ( dwPartyID==PARTY_NULL )
  1435. {
  1436. if ( pCLUB->IsBattle( pCharMaster->m_dwGuild ) ) bClubBattle = true;
  1437. if ( pCLUB_M && pCLUB->IsBattleAlliance( pCLUB_M->m_dwAlliance ) ) bClubBattle = true;
  1438. }
  1439. // ÀÖÀ»°æ¿ì ¸ðµç ¸â¹ö¶û üũ
  1440. else
  1441. {
  1442. GLPARTY* pParty = m_cPartyMan.GetParty ( dwPartyID );
  1443. if( pParty && pParty->ISVAILD() )
  1444. {
  1445. GLPARTY::MEMBER_ITER iter = pParty->m_cMEMBER.begin();
  1446. GLPARTY::MEMBER_ITER iter_end = pParty->m_cMEMBER.end();
  1447. PGLCHARAG pMemChar = NULL;
  1448. for ( ; iter!=iter_end; ++iter )
  1449. {
  1450. pMemChar = GLAgentServer::GetInstance().GetChar ( (*iter) );
  1451. if ( !pMemChar ) continue;
  1452. if ( pCLUB->IsBattle(pMemChar->m_dwGuild) )
  1453. {
  1454. bClubBattle = true;
  1455. break;
  1456. }
  1457. GLCLUB* pClub_Mem = cClubMan.GetClub( pMemChar->m_dwGuild );
  1458. if( pClub_Mem && pCLUB->IsBattleAlliance( pClub_Mem->m_dwAlliance ))
  1459. {
  1460. bClubBattle = true;
  1461. break;
  1462. }
  1463. }
  1464. }
  1465. }
  1466. if ( bClubBattle )
  1467. {
  1468. GLMSG::SNET_PARTY_LURE_FB NetMsgFB;
  1469. NetMsgFB.dwGaeaID = dwGaeaID;
  1470. NetMsgFB.emAnswer = EMPARTY_LURE_CLUBBATTLE;
  1471. SENDTOCLIENT ( pCharMaster->m_dwClientID, &NetMsgFB );
  1472. return FALSE;
  1473. }
  1474. }
  1475. // Note : ´Ù¸¥ Çпø»ý°ú ÆÄƼ °á¼º Á¦ÇÑ ¿É¼ÇÀÌ ÀÖÀ» °æ¿ì Á¦ÇÑÇÔ.
  1476. if ( !GLCONST_CHAR::bPARTY_2OTHERSCHOOL )
  1477. {
  1478. if ( pCharTar->m_wSchool!=pCharMaster->m_wSchool )
  1479. {
  1480. GLMSG::SNET_PARTY_LURE_FB NetMsgFB;
  1481. NetMsgFB.dwGaeaID = dwGaeaID;
  1482. NetMsgFB.emAnswer = EMPARTY_LURE_OTHERSCHOOL;
  1483. SENDTOCLIENT ( pCharMaster->m_dwClientID, &NetMsgFB );
  1484. return FALSE;
  1485. }
  1486. }
  1487. // Note : ¾ÆÁ÷ ÀÚ½ÅÀÇ ÆÄƼ°¡ ¸¸µé¾î ÁöÁö ¾Ê¾ÒÀ» °æ¿ì. ´ë»ó¿¡°Ô ÆÄƼ Âü°¡ ¿äû.
  1488. //
  1489. if ( dwPartyID==PARTY_NULL )
  1490. {
  1491. pCharMaster->m_sReqPartyOpt = pNetMsg->sOption;
  1492. GLMSG::SNET_PARTY_LURE_TAR NetMsgLureTar;
  1493. NetMsgLureTar.dwMasterID = dwGaeaID;
  1494. NetMsgLureTar.dwPartyID = PARTY_NULL;
  1495. NetMsgLureTar.sOption = pCharMaster->m_sReqPartyOpt;
  1496. SENDTOCLIENT ( pCharTar->m_dwClientID, &NetMsgLureTar );
  1497. return TRUE;
  1498. }
  1499. GLPARTY* pParty = m_cPartyMan.GetParty ( dwPartyID );
  1500. if ( !pParty ) return FALSE;
  1501. if ( !pParty->ISMASTER(dwGaeaID) ) return FALSE;
  1502. if ( pParty->ISFULL() )
  1503. {
  1504. GLMSG::SNET_PARTY_LURE_FB NetMsgFB;
  1505. NetMsgFB.dwGaeaID = dwGaeaID;
  1506. NetMsgFB.emAnswer = EMPARTY_LURE_FULL;
  1507. SENDTOCLIENT ( pCharMaster->m_dwClientID, &NetMsgFB );
  1508. return FALSE;
  1509. }
  1510. // Note : ´ë»óÀÚ¸¦ ¸ðÁý ´ë»ó¿¡ µî·ÏÇÔ.
  1511. //
  1512. pParty->PREADDMEMBER ( pCharTar->m_dwGaeaID );
  1513. // Note : ´ë»ó¿¡°Ô ÆÄƼ Âü°¡ ¿äû.
  1514. //
  1515. GLMSG::SNET_PARTY_LURE_TAR NetMsgLureTar;
  1516. NetMsgLureTar.dwMasterID = dwGaeaID;
  1517. NetMsgLureTar.dwPartyID = dwPartyID;
  1518. NetMsgLureTar.sOption = pCharMaster->m_sReqPartyOpt;
  1519. SENDTOCLIENT ( pCharTar->m_dwClientID, &NetMsgLureTar );
  1520. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  1521. if( pCharMaster->m_bTracingUser )
  1522. {
  1523. CDebugSet::ToTracingFile( pCharMaster->m_szUserName, "Party Request, [%s][%s], Target Char: [%s][%s]",
  1524. pCharMaster->m_szUserName, pCharMaster->m_szName, pCharTar->m_szUserName, pCharTar->m_szName );
  1525. }
  1526. //#endif
  1527. return TRUE;
  1528. }
  1529. BOOL GLAgentServer::MsgPartyLureTarAns ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1530. {
  1531. GLMSG::SNET_PARTY_LURE_TAR_ANS* pNetMsg = (GLMSG::SNET_PARTY_LURE_TAR_ANS*) nmg;
  1532. PGLCHARAG pCharMaster = GetChar ( pNetMsg->dwMasterID );
  1533. if ( !pCharMaster ) return FALSE;
  1534. // ÆÄƼ°¡ ÃÖÃÊ·Î ±¸¼ºµÉ¶§
  1535. if ( pNetMsg->dwPartyID == PARTY_NULL && pCharMaster->GetPartyID() == PARTY_NULL )
  1536. {
  1537. PGLCHARAG pCharTar = GetChar ( dwGaeaID );
  1538. if ( !pCharTar ) return FALSE;
  1539. if ( pCharTar->GetPartyID()!=PARTY_NULL ) return FALSE;
  1540. if ( pNetMsg->emAnswer != EMPARTY_LURE_OK )
  1541. {
  1542. if ( pCharMaster->m_sReqPartyOpt!=pNetMsg->sOption )
  1543. {
  1544. GLMSG::SNET_PARTY_LURE_FB NetMsgFB;
  1545. NetMsgFB.dwGaeaID = dwGaeaID;
  1546. NetMsgFB.emAnswer = EMPARTY_LURE_OPT;
  1547. SENDTOCLIENT ( pCharMaster->GetPartyID(), &NetMsgFB );
  1548. return FALSE;
  1549. }
  1550. GLMSG::SNET_PARTY_LURE_FB NetMsgFB;
  1551. NetMsgFB.dwGaeaID = dwGaeaID;
  1552. NetMsgFB.emAnswer = pNetMsg->emAnswer;
  1553. SENDTOCLIENT ( pCharMaster->m_dwClientID, &NetMsgFB );
  1554. return FALSE;
  1555. }
  1556. // Note : ÆÄƼ »ý¼º.
  1557. //
  1558. GLPARTY* pParty = m_cPartyMan.NewParty ( pNetMsg->dwMasterID );
  1559. if ( !pParty ) return FALSE;
  1560. // Note : ÆÄƼ ¿É¼Ç ÁöÁ¤.
  1561. //
  1562. pParty->m_sOPTION = pNetMsg->sOption;
  1563. // Note : ÆÄƼ ±¸¼º¿ø¿¡ Ãß°¡. ( ù¹øÂÅ ±¸¼º¿ø )
  1564. //
  1565. pCharTar->SetPartyID ( pParty->m_dwPARTYID );
  1566. pParty->ADDMEMBER ( dwGaeaID );
  1567. // Note : ÆÄƼ »ý¼ºÀ» Çʵ忡 ¾Ë¸². ( ÇÊµå ¼­¹ö´Â ÆÄƼ Á¤º¸À» ¹ÞÀ¸¸é »õ·ÎÀÌ ÆÄƼ¸¦ ±¸¼ºÇÑ´Ù. )
  1568. //
  1569. GLMSG::SNET_PARTY_FNEW NetPartyInfo;
  1570. NetPartyInfo.SETINFO ( pParty->m_dwPARTYID, pParty->m_dwMASTER );
  1571. NetPartyInfo.sOption = pParty->m_sOPTION;
  1572. GLPARTY::MEMBER_ITER iter = pParty->m_cMEMBER.begin();
  1573. GLPARTY::MEMBER_ITER iter_end = pParty->m_cMEMBER.end();
  1574. for ( ; iter!=iter_end; ++iter )
  1575. {
  1576. PGLCHARAG pCharMem = GetChar ( (*iter) );
  1577. NetPartyInfo.ADDMEMBER ( GLPARTY_FNET(pCharMem->m_dwGaeaID,pCharMem->m_szName,pCharMem->m_emClass,pCharMem->m_sCurMapID) );
  1578. }
  1579. SENDTOALLCHANNEL ( &NetPartyInfo );
  1580. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  1581. if( pCharTar->m_bTracingUser )
  1582. {
  1583. CDebugSet::ToTracingFile( pCharTar->m_szUserName, "Create Party Answer OK, [%s][%s], Master Char: [%s][%s]",
  1584. pCharTar->m_szUserName, pCharTar->m_szName, pCharMaster->m_szUserName, pCharMaster->m_szName );
  1585. }
  1586. //#endif
  1587. return TRUE;
  1588. }
  1589. // ÆÄƼ¿øÀ» Ãß°¡ÇÒ¶§
  1590. else if ( pNetMsg->dwMasterID == pCharMaster->m_dwGaeaID )
  1591. {
  1592. GLPARTY* pParty = m_cPartyMan.GetParty ( pCharMaster->GetPartyID() );
  1593. if ( !pParty ) return FALSE;
  1594. if ( pParty->ISFULL() ) return FALSE;
  1595. // ÆÄƼ°¡ °á¼ºµÇÁö ¾ÊÀº »óȲ¿¡¼­´Â ¿¹ºñ¸â¹öµéÀ» Ãß°¡ ÇÒ¼ö ¾ø´Â
  1596. // °æ¿ì°¡ ¹ß»ýÇÒ ¼ö ÀÖÀ¸¹Ç·Î ¿©±â¼­ ¾Æ·¡ Äڵ带 ó¸®ÇÏÁö ¾Ê´Â´Ù!
  1597. // if ( !pParty->ISPREMEMBER ( dwGaeaID ) ) return FALSE;
  1598. // Note : ´ë»óÀÚ¸¦ ¸ðÁý ´ë»ó¿¡¼­ Á¦¿ÜÇÔ.
  1599. //
  1600. pParty->PREDELMEMBER ( dwGaeaID );
  1601. if ( pNetMsg->emAnswer == EMPARTY_LURE_OK )
  1602. {
  1603. PGLCHARAG pCharTar = GetChar ( dwGaeaID );
  1604. if ( !pCharTar ) return FALSE;
  1605. if ( pCharTar->GetPartyID()!=PARTY_NULL ) return FALSE;
  1606. // Note : ÆÄƼ ±¸¼º¿ø¿¡ Ãß°¡.
  1607. //
  1608. pCharTar->SetPartyID ( pCharMaster->GetPartyID() );
  1609. pParty->ADDMEMBER ( dwGaeaID );
  1610. // Note : ÇÊµå ¼­¹ö¿¡ ÆÄƼ¿øÀÌ Ãß°¡µÊÀ» ¾Ë¸².
  1611. //
  1612. GLMSG::SNET_PARTY_ADD NetPartyAdd;
  1613. NetPartyAdd.dwPartyID = pCharMaster->GetPartyID();
  1614. NetPartyAdd.sPartyInfo = GLPARTY_FNET(pCharTar->m_dwGaeaID,pCharTar->m_szName,pCharTar->m_emClass,pCharTar->m_sCurMapID);
  1615. SENDTOALLCHANNEL ( &NetPartyAdd );
  1616. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  1617. if( pCharTar->m_bTracingUser )
  1618. {
  1619. CDebugSet::ToTracingFile( pCharTar->m_szUserName, "Add Party Answer OK, [%s][%s], Master Char: [%s][%s]",
  1620. pCharTar->m_szUserName, pCharTar->m_szName, pCharMaster->m_szUserName, pCharMaster->m_szName );
  1621. }
  1622. //#endif
  1623. }
  1624. // Note : ÆÄƼ ¸ðÁý ¿äû ÀÀ´äÀ» master¿¡°Ô ¾Ë¸².
  1625. //
  1626. GLMSG::SNET_PARTY_LURE_FB NetMsgFB;
  1627. NetMsgFB.dwGaeaID = dwGaeaID;
  1628. NetMsgFB.emAnswer = pNetMsg->emAnswer;
  1629. SENDTOCLIENT ( pCharMaster->m_dwClientID, &NetMsgFB );
  1630. }
  1631. return TRUE;
  1632. }
  1633. BOOL GLAgentServer::MsgPartySecede ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1634. {
  1635. GLMSG::SNET_PARTY_SECEDE* pNetMsg = (GLMSG::SNET_PARTY_SECEDE*) nmg;
  1636. GLPARTY* pParty = m_cPartyMan.GetParty ( pNetMsg->dwPartyID );
  1637. if ( !pParty ) return FALSE;
  1638. if ( !pParty->ISMEMBER(pNetMsg->dwGaeaID) ) return FALSE;
  1639. // Note : ÀڽŠÀÌ¿ÜÀÇ »ç¶÷ÀÌ Å»ÅðµÉ °æ¿ì´Â ÆÄƼÀåÀÇ ±ÇÇÑÀÌ ÀÖ¾î¾ß °¡´É.
  1640. //
  1641. if ( ( pNetMsg->dwGaeaID != dwGaeaID ) && !pParty->ISMASTER(dwGaeaID) ) return FALSE;
  1642. PGLCHARAG pCharTar = GetChar ( pNetMsg->dwGaeaID );
  1643. if ( !pCharTar ) return FALSE;
  1644. // Note : ÆÄƼ¿øÀÌ Å»Åð ÇÔÀ» ÆÄƼ¿øµé¿¡°Ô ¾Ë¸².
  1645. //
  1646. GLMSG::SNET_PARTY_DEL NetMsgDel;
  1647. NetMsgDel.dwPartyID = pNetMsg->dwPartyID;
  1648. NetMsgDel.dwDelMember = pNetMsg->dwGaeaID;
  1649. SENDTOPARTY ( pNetMsg->dwPartyID, (NET_MSG_GENERIC*) &NetMsgDel );
  1650. // Note : ÆÄƼ¿øÀÌ Å»Åð ÇÔÀ» ÇÊµå ¼­¹ö¿¡ ¾Ë¸².
  1651. //
  1652. SENDTOALLCHANNEL ( &NetMsgDel );
  1653. // Note : ÆÄƼ Å»Åð ó¸®.
  1654. //
  1655. pCharTar->ReSetPartyID ();
  1656. pParty->DELMEMBER ( pNetMsg->dwGaeaID );
  1657. return TRUE;
  1658. }
  1659. BOOL GLAgentServer::MsgPartyAuthority( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1660. {
  1661. GLMSG::SNET_PARTY_AUTHORITY* pNetMsg = ( GLMSG::SNET_PARTY_AUTHORITY* ) nmg;
  1662. GLPARTY* pParty = m_cPartyMan.GetParty ( pNetMsg->dwPartyID );
  1663. if ( !pParty ) return FALSE;
  1664. if ( !pParty->ISMEMBER( pNetMsg->dwGaeaID ) ) return FALSE;
  1665. if ( ( pNetMsg->dwGaeaID != dwGaeaID ) && !pParty->ISMASTER( dwGaeaID ) ) return FALSE;
  1666. PGLCHARAG pCharTar = GetChar ( pNetMsg->dwGaeaID );
  1667. if ( !pCharTar ) return FALSE;
  1668. // Note : ÆÄƼÀåÀÌ ¹Ù²ï °ÍÀ» ÆÄƼ¿øµé¿¡°Ô ¾Ë¸².
  1669. //
  1670. GLMSG::SNET_PARTY_AUTHORITY NetMsgAuth;
  1671. NetMsgAuth.dwPartyID = pNetMsg->dwPartyID;
  1672. NetMsgAuth.dwGaeaID = pNetMsg->dwGaeaID;
  1673. SENDTOPARTY ( pNetMsg->dwPartyID, ( NET_MSG_GENERIC* ) &NetMsgAuth );
  1674. // Note : ÆÄƼÀåÀÌ ¹Ù²ï °ÍÀ»À» ÇÊµå ¼­¹ö¿¡ ¾Ë¸².
  1675. //
  1676. SENDTOALLCHANNEL ( &NetMsgAuth );
  1677. pParty->CHANGEMASTER( pNetMsg->dwGaeaID );
  1678. return TRUE;
  1679. }
  1680. BOOL GLAgentServer::MsgPartyDissolve ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1681. {
  1682. GLMSG::SNET_PARTY_DISSOLVE* pNetMsg = (GLMSG::SNET_PARTY_DISSOLVE*) nmg;
  1683. GLPARTY* pParty = m_cPartyMan.GetParty ( pNetMsg->dwPartyID );
  1684. if ( !pParty ) return FALSE;
  1685. if ( !pParty->ISMASTER(dwGaeaID) ) return FALSE;
  1686. // Note : ÆÄƼ¸¦ ÇØü ÇÑ´Ù.
  1687. //
  1688. m_cPartyMan.DelParty ( pNetMsg->dwPartyID );
  1689. return TRUE;
  1690. }
  1691. BOOL GLAgentServer::MsgReqGateOutFB ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1692. {
  1693. GLMSG::SNETREQ_GATEOUT_FB *pNetMsg = (GLMSG::SNETREQ_GATEOUT_FB *) nmg;
  1694. // Note : Ŭ¶óÀ̾ðÆ®¿¡ Àü¼ÛÇÑ´Ù.
  1695. SENDTOCLIENT ( dwClientID, nmg );
  1696. return TRUE;
  1697. }
  1698. BOOL GLAgentServer::MsgReqReBirthFB ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1699. {
  1700. GLMSG::SNETPC_REQ_REBIRTH_FB *pNetMsg = (GLMSG::SNETPC_REQ_REBIRTH_FB *) nmg;
  1701. // Note : Ŭ¶óÀ̾ðÆ®¿¡ Àü¼ÛÇÑ´Ù.
  1702. SENDTOCLIENT ( dwClientID, nmg );
  1703. return TRUE;
  1704. }
  1705. BOOL GLAgentServer::MsgReqCreateInstantMapFB ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1706. {
  1707. GLMSG::SNETREQ_CREATE_INSTANT_MAP_FB *pNetMsg = (GLMSG::SNETREQ_CREATE_INSTANT_MAP_FB *) nmg;
  1708. // Note : Ŭ¶óÀ̾ðÆ®¿¡ Àü¼ÛÇÑ´Ù.
  1709. SENDTOCLIENT ( dwClientID, nmg );
  1710. return TRUE;
  1711. }
  1712. BOOL GLAgentServer::MsgReqConfront ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1713. {
  1714. GLMSG::SNETPC_REQ_CONFRONT *pNetMsg = (GLMSG::SNETPC_REQ_CONFRONT *) nmg;
  1715. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  1716. if ( !pMyChar ) return FALSE;
  1717. GLAGLandMan* pLandMan = GetByMapID ( pMyChar->m_sCurMapID );
  1718. if ( !pLandMan )
  1719. {
  1720. // Note : ÀÏ¹Ý ¿À·ù.
  1721. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1722. NetMsgFB.emFB = EMCONFRONT_FAIL;
  1723. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1724. return FALSE;
  1725. }
  1726. if ( pLandMan->m_bGuidBattleMap )
  1727. {
  1728. // Note : ÀÏ¹Ý ¿À·ù.
  1729. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1730. NetMsgFB.emFB = EMCONFRONT_FAIL;
  1731. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1732. return FALSE;
  1733. }
  1734. if ( pLandMan->m_bClubDeathMatchMap )
  1735. {
  1736. // Note : ÀÏ¹Ý ¿À·ù.
  1737. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1738. NetMsgFB.emFB = EMCONFRONT_FAIL;
  1739. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1740. return FALSE;
  1741. }
  1742. PGLCHARAG pTarChar = GetChar ( pNetMsg->dwID );
  1743. if ( !pTarChar )
  1744. {
  1745. // Note : ÀÏ¹Ý ¿À·ù.
  1746. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1747. NetMsgFB.emFB = EMCONFRONT_FAIL;
  1748. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1749. return FALSE;
  1750. }
  1751. if ( !pNetMsg->sOption.VALID_OPT() )
  1752. {
  1753. // Note : ÀÏ¹Ý ¿À·ù.
  1754. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1755. NetMsgFB.emFB = EMCONFRONT_OPTION;
  1756. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1757. return FALSE;
  1758. }
  1759. if ( pLandMan->IsPeaceZone() )
  1760. {
  1761. // Note : ÆòÈ­ Áö¿ª¿¡¼­´Â ´ë·Ã ºÒ°¡.
  1762. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1763. NetMsgFB.emFB = EMCONFRONT_PEACE;
  1764. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1765. return FALSE;
  1766. }
  1767. if ( pLandMan->IsRedZone() )
  1768. {
  1769. // Note : ÆòÈ­ Áö¿ª¿¡¼­´Â ´ë·Ã ºÒ°¡.
  1770. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1771. NetMsgFB.emFB = EMCONFRONT_PEACE;
  1772. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1773. return FALSE;
  1774. }
  1775. DWORD dwMY_PARTYID = pMyChar->GetPartyID();
  1776. if ( PARTY_NULL!=dwMY_PARTYID )
  1777. {
  1778. GLPARTY* pPARTY = m_cPartyMan.GetParty ( dwMY_PARTYID );
  1779. if ( pPARTY && pPARTY->ISMEMBER(pTarChar->m_dwGaeaID) )
  1780. {
  1781. // Note : °°Àº ÆÄƼ ¸â¹ö ³¢¸®´Â ´ë·Ã ºÒ°¡.
  1782. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1783. NetMsgFB.emFB = EMCONFRONT_PARTY;
  1784. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1785. }
  1786. }
  1787. const SCONFTING &sMYCONFTING = pMyChar->GETCONFRONTING();
  1788. if ( sMYCONFTING.IsCONFRONTING() )
  1789. {
  1790. // Note : (ÀÚ½ÅÀÌ) ÀÌ¹Ì ´ë·Ã ÁßÀÔ´Ï´Ù.
  1791. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1792. NetMsgFB.emFB = EMCONFRONT_ALREADY_ME;
  1793. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1794. return FALSE;
  1795. }
  1796. const SCONFTING &sTARCONFTING = pTarChar->GETCONFRONTING ();
  1797. if ( sTARCONFTING.IsCONFRONTING() )
  1798. {
  1799. // Note : (»ó´ë¹æÀÌ) ÀÌ¹Ì ´ë·Ã ÁßÀÔ´Ï´Ù.
  1800. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1801. NetMsgFB.emFB = EMCONFRONT_ALREADY_TAR;
  1802. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1803. return FALSE;
  1804. }
  1805. switch ( pNetMsg->emTYPE )
  1806. {
  1807. case EMCONFT_ONE:
  1808. {
  1809. // Note : ´ë·Ã Á¤º¸´Â "´ë·Ã" Á¾·á½Ã ¾çÀÚ ¸ðµÎ ·Î±×¸¦ ³²±â¹Ç·Î GaeaID Çϳª¸¸ È®ÀÎÇϸé Áߺ¹ ´ë·Ã üũ°¡ °¡´É.
  1810. //
  1811. DWORD dwCHARID = pMyChar->m_dwCharID;
  1812. const SCONFT_LOG* pCONFT = pTarChar->GETCONFRONT_LOG ( dwCHARID );
  1813. if ( pCONFT )
  1814. {
  1815. // Note : ÀÏÁ¤ ½Ã°£¾È¿¡ ÁöÁ¤È½¼ö ÀÌ»ó ´ë·Ã ¹æÁö.
  1816. if ( pCONFT->dwCOUNT >= GLCONST_CHAR::dwCONFRONT_MAX )
  1817. {
  1818. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1819. NetMsgFB.emFB = EMCONFRONT_MAX;
  1820. NetMsgFB.fTIME = GLCONST_CHAR::fCONFRONT_RESET - pCONFT->fTIMER; // ´ë·Ã °¡´É¿¡ ³²Àº½Ã°£ : <¿¬¼Ó´ë·Ã¹æÁö>¸®¼Â½Ã°£ - °æ°ú½Ã°£.
  1821. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1822. return FALSE;
  1823. }
  1824. // Note : Á¾Àü ´ë·ÃÈÄ ÀÏÁ¤½Ã°£ °æ°ú ÀÌÀü¿¡ ´ë·Ã ¹æÁö.
  1825. if ( pCONFT->fTIMER < GLCONST_CHAR::fCONFRONT_ELAP )
  1826. {
  1827. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1828. NetMsgFB.emFB = EMCONFRONT_ELAP;
  1829. NetMsgFB.fTIME = GLCONST_CHAR::fCONFRONT_ELAP - pCONFT->fTIMER; // ´ë·Ã °¡´É¿¡ ³²Àº½Ã°£ : <¿¬¼Ó´ë·Ã¹æÁö>¸®¼Â½Ã°£ - °æ°ú½Ã°£.
  1830. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1831. return FALSE;
  1832. }
  1833. }
  1834. // Note : ´ë·Ã ¿ÀûÇÑ Á¤º¸ ÀúÀå.
  1835. //
  1836. pMyChar->m_sREQCONFTING.RESET();
  1837. pMyChar->m_sREQCONFTING.emTYPE = EMCONFT_ONE;
  1838. pMyChar->m_sREQCONFTING.dwTAR_ID = pTarChar->m_dwGaeaID;
  1839. pMyChar->m_sREQCONFTING.sOption = pNetMsg->sOption;
  1840. // Note : ´ë·Ã (»ó´ë¹æ¿¡°Ô) ¿äû.
  1841. //
  1842. GLMSG::SNETPC_REQ_CONFRONT_TAR NetMsgTAR;
  1843. NetMsgTAR.dwID = dwGaeaID; // ÀÚ½ÅÀÇ ID.
  1844. NetMsgTAR.sOption = pNetMsg->sOption;
  1845. SENDTOCLIENT ( pTarChar->m_dwClientID, &NetMsgTAR );
  1846. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  1847. if( pMyChar->m_bTracingUser )
  1848. {
  1849. CDebugSet::ToTracingFile( pMyChar->m_szUserName, "Confront1 Request, [%s][%s], Target Char: [%s][%s]",
  1850. pMyChar->m_szUserName, pMyChar->m_szName, pTarChar->m_szUserName, pTarChar->m_szName );
  1851. }
  1852. //#endif
  1853. }
  1854. break;
  1855. case EMCONFT_PARTY:
  1856. {
  1857. DWORD dwMyPartyID = pMyChar->GetPartyID();
  1858. DWORD dwTarPartyID = pTarChar->GetPartyID();
  1859. if ( dwMyPartyID==GAEAID_NULL )
  1860. {
  1861. // Note : (ÀÚ½ÅÀÌ) ÆÄƼ¸¦ °á¼ºÇÏÁö ¾Ê¾Ò½À´Ï´Ù.
  1862. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1863. NetMsgFB.emFB = EMCONFRONT_MENOTPARTY;
  1864. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1865. return FALSE;
  1866. }
  1867. GLPARTY *pMyParty = m_cPartyMan.GetParty(dwMyPartyID);
  1868. if ( NULL==pMyParty )
  1869. {
  1870. // Note : (ÀÚ½ÅÀÌ) ÆÄƼ¸¦ °á¼ºÇÏÁö ¾Ê¾Ò½À´Ï´Ù.
  1871. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1872. NetMsgFB.emFB = EMCONFRONT_MENOTPARTY;
  1873. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1874. return FALSE;
  1875. }
  1876. if ( FALSE==pMyParty->ISMASTER(pMyChar->m_dwGaeaID) )
  1877. {
  1878. // Note : (ÀÚ½ÅÀÌ) ÆÄƼ ¸¶½ºÅÍ°¡ ¾Æ´Õ´Ï´Ù.
  1879. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1880. NetMsgFB.emFB = EMCONFRONT_MENOTMASTER;
  1881. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1882. return FALSE;
  1883. }
  1884. if ( dwTarPartyID==GAEAID_NULL )
  1885. {
  1886. // Note : (»ó´ë¹æÀÌ) ÆÄƼ¸¦ °á¼ºÇÏÁö ¾Ê¾Ò½À´Ï´Ù.
  1887. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1888. NetMsgFB.emFB = EMCONFRONT_TARMASTER;
  1889. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1890. return FALSE;
  1891. }
  1892. GLPARTY *pTarParty = m_cPartyMan.GetParty(dwTarPartyID);
  1893. if ( NULL==pTarParty )
  1894. {
  1895. // Note : (»ó´ë¹æÀÌ) ÆÄƼ¸¦ °á¼ºÇÏÁö ¾Ê¾Ò½À´Ï´Ù.
  1896. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1897. NetMsgFB.emFB = EMCONFRONT_TARMASTER;
  1898. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1899. return FALSE;
  1900. }
  1901. if ( FALSE==pTarParty->ISMASTER(pTarChar->m_dwGaeaID) )
  1902. {
  1903. // Note : (»ó´ë¹æÀÌ) ÆÄƼ ¸¶½ºÅÍ°¡ ¾Æ´Õ´Ï´Ù.
  1904. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1905. NetMsgFB.emFB = EMCONFRONT_TARMASTER;
  1906. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1907. return FALSE;
  1908. }
  1909. // Note : ´ë·Ã ¿ÀûÇÑ Á¤º¸ ÀúÀå.
  1910. //
  1911. pMyChar->m_sREQCONFTING.RESET();
  1912. pMyChar->m_sREQCONFTING.emTYPE = EMCONFT_PARTY;
  1913. pMyChar->m_sREQCONFTING.dwTAR_ID = pTarChar->m_dwGaeaID;
  1914. pMyChar->m_sREQCONFTING.sOption = pNetMsg->sOption;
  1915. // Note : ´ë·Ã (»ó´ë¹æ¿¡°Ô) ¿äû.
  1916. //
  1917. GLMSG::SNETPC_REQ_CONFRONT_TAR NetMsgTAR;
  1918. NetMsgTAR.emTYPE = EMCONFT_PARTY;
  1919. NetMsgTAR.dwID = dwGaeaID; // ÀÚ½ÅÀÇ ID.
  1920. NetMsgTAR.sOption = pNetMsg->sOption;
  1921. SENDTOCLIENT ( pTarChar->m_dwClientID, &NetMsgTAR );
  1922. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  1923. if( pMyChar->m_bTracingUser )
  1924. {
  1925. CDebugSet::ToTracingFile( pMyChar->m_szUserName, "Confront2 Request, [%s][%s], Target Char: [%s][%s]",
  1926. pMyChar->m_szUserName, pMyChar->m_szName, pTarChar->m_szUserName, pTarChar->m_szName );
  1927. }
  1928. //#endif
  1929. }
  1930. break;
  1931. case EMCONFT_GUILD:
  1932. {
  1933. DWORD dwMyClubID = pMyChar->m_dwGuild;
  1934. DWORD dwTarClubID = pTarChar->m_dwGuild;
  1935. if ( dwTarClubID==CLUB_NULL )
  1936. {
  1937. // Note : Ŭ·´ ¸¶½ºÅÍ°¡ ¾Æ´Õ´Ï´Ù.
  1938. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1939. NetMsgFB.emFB = EMCONFRONT_FAIL;
  1940. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1941. return FALSE;
  1942. }
  1943. GLCLUB *pTarClub = m_cClubMan.GetClub ( dwTarClubID );
  1944. if ( !pTarClub || pTarClub->m_dwMasterID!=pTarChar->m_dwCharID )
  1945. {
  1946. // Note : Ŭ·´ ¸¶½ºÅÍ°¡ ¾Æ´Õ´Ï´Ù.
  1947. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1948. NetMsgFB.emFB = EMCONFRONT_FAIL;
  1949. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1950. return FALSE;
  1951. }
  1952. if ( dwMyClubID==CLUB_NULL )
  1953. {
  1954. // Note : Ŭ·´ ¸¶½ºÅÍ°¡ ¾Æ´Õ´Ï´Ù.
  1955. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1956. NetMsgFB.emFB = EMCONFRONT_FAIL;
  1957. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1958. return FALSE;
  1959. }
  1960. GLCLUB *pMyClub = m_cClubMan.GetClub ( dwMyClubID );
  1961. if ( !pMyClub || pMyClub->m_dwMasterID!=pMyChar->m_dwCharID )
  1962. {
  1963. // Note : Ŭ·´ ¸¶½ºÅÍ°¡ ¾Æ´Õ´Ï´Ù.
  1964. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  1965. NetMsgFB.emFB = EMCONFRONT_FAIL;
  1966. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  1967. return FALSE;
  1968. }
  1969. // Note : ´ë·Ã ¿ÀûÇÑ Á¤º¸ ÀúÀå.
  1970. //
  1971. pMyChar->m_sREQCONFTING.RESET();
  1972. pMyChar->m_sREQCONFTING.emTYPE = EMCONFT_GUILD;
  1973. pMyChar->m_sREQCONFTING.dwTAR_ID = pTarChar->m_dwGaeaID;
  1974. pMyChar->m_sREQCONFTING.sOption = pNetMsg->sOption;
  1975. // Note : ´ë·Ã (»ó´ë¹æ¿¡°Ô) ¿äû.
  1976. //
  1977. GLMSG::SNETPC_REQ_CONFRONT_TAR NetMsgTAR;
  1978. NetMsgTAR.emTYPE = EMCONFT_GUILD;
  1979. NetMsgTAR.dwID = dwGaeaID; // ÀÚ½ÅÀÇ ID.
  1980. NetMsgTAR.sOption = pNetMsg->sOption;
  1981. SENDTOCLIENT ( pTarChar->m_dwClientID, &NetMsgTAR );
  1982. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  1983. if( pMyChar->m_bTracingUser )
  1984. {
  1985. CDebugSet::ToTracingFile( pMyChar->m_szUserName, "Confront3 Request, [%s][%s], Target Char: [%s][%s]",
  1986. pMyChar->m_szUserName, pMyChar->m_szName, pTarChar->m_szUserName, pTarChar->m_szName );
  1987. }
  1988. //#endif
  1989. }
  1990. break;
  1991. };
  1992. return TRUE;
  1993. }
  1994. BOOL GLAgentServer::MsgAnsConfront ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  1995. {
  1996. GLMSG::SNETPC_REQ_CONFRONT_ANS *pNetMsg = (GLMSG::SNETPC_REQ_CONFRONT_ANS *) nmg;
  1997. // Absolute Non-PK State Check. ´ë·Ã ¾ÈµÊ.
  1998. if ( GLCONST_CHAR::bPKLESS ) return FALSE;
  1999. if ( pNetMsg->emFB == EMCONFRONT_REFUSE )
  2000. {
  2001. PGLCHARAG pReqChar = GetChar ( pNetMsg->dwID );
  2002. if ( !pReqChar ) return FALSE;
  2003. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  2004. NetMsgFB.emTYPE = pNetMsg->emTYPE;
  2005. NetMsgFB.dwID = dwGaeaID;
  2006. NetMsgFB.emFB = EMCONFRONT_REFUSE;
  2007. SENDTOCLIENT ( pReqChar->m_dwClientID, &NetMsgFB );
  2008. }
  2009. else if ( pNetMsg->emFB == EMCONFRONT_NO_BET )
  2010. {
  2011. PGLCHARAG pReqChar = GetChar ( pNetMsg->dwID );
  2012. if ( !pReqChar ) return FALSE;
  2013. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  2014. NetMsgFB.emTYPE = pNetMsg->emTYPE;
  2015. NetMsgFB.dwID = dwGaeaID;
  2016. NetMsgFB.emFB = EMCONFRONT_NO_BET;
  2017. SENDTOCLIENT ( pReqChar->m_dwClientID, &NetMsgFB );
  2018. }
  2019. else if ( pNetMsg->emFB == EMCONFRONT_CANT_BET_MONEY )
  2020. {
  2021. PGLCHARAG pReqChar = GetChar ( pNetMsg->dwID );
  2022. if ( !pReqChar ) return FALSE;
  2023. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  2024. NetMsgFB.emTYPE = pNetMsg->emTYPE;
  2025. NetMsgFB.dwID = dwGaeaID;
  2026. NetMsgFB.emFB = EMCONFRONT_CANT_BET_MONEY;
  2027. SENDTOCLIENT ( pReqChar->m_dwClientID, &NetMsgFB );
  2028. }
  2029. else if ( pNetMsg->emFB == EMCONFRONT_CANT_BET_VOTEP )
  2030. {
  2031. PGLCHARAG pReqChar = GetChar ( pNetMsg->dwID );
  2032. if ( !pReqChar ) return FALSE;
  2033. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  2034. NetMsgFB.emTYPE = pNetMsg->emTYPE;
  2035. NetMsgFB.dwID = dwGaeaID;
  2036. NetMsgFB.emFB = EMCONFRONT_CANT_BET_VOTEP;
  2037. SENDTOCLIENT ( pReqChar->m_dwClientID, &NetMsgFB );
  2038. }
  2039. else if ( pNetMsg->emFB == EMCONFRONT_CANT_BET_PREMP )
  2040. {
  2041. PGLCHARAG pReqChar = GetChar ( pNetMsg->dwID );
  2042. if ( !pReqChar ) return FALSE;
  2043. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  2044. NetMsgFB.emTYPE = pNetMsg->emTYPE;
  2045. NetMsgFB.dwID = dwGaeaID;
  2046. NetMsgFB.emFB = EMCONFRONT_CANT_BET_PREMP;
  2047. SENDTOCLIENT ( pReqChar->m_dwClientID, &NetMsgFB );
  2048. }
  2049. else if ( pNetMsg->emFB == EMCONFRONT_CANT_BET )
  2050. {
  2051. PGLCHARAG pReqChar = GetChar ( pNetMsg->dwID );
  2052. if ( !pReqChar ) return FALSE;
  2053. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  2054. NetMsgFB.emTYPE = pNetMsg->emTYPE;
  2055. NetMsgFB.dwID = dwGaeaID;
  2056. NetMsgFB.emFB = EMCONFRONT_CANT_BET;
  2057. SENDTOCLIENT ( pReqChar->m_dwClientID, &NetMsgFB );
  2058. }
  2059. else if ( pNetMsg->emFB == EMCONFRONT_AGREE )
  2060. {
  2061. // ´ë·Ã ±âº» Á¤º¸.
  2062. const EMCONFT_TYPE emTYPE = pNetMsg->emTYPE;
  2063. const DWORD dwMY_ID = dwGaeaID;
  2064. const DWORD dwREQ_ID = pNetMsg->dwID;
  2065. const SCONFT_OPTION _sOption = pNetMsg->sOption;
  2066. // ´ë·Ã »ó´ë¹æ ID µé.
  2067. const DWORD dwMY_TAR = dwREQ_ID;
  2068. const DWORD dwREQ_TAR = dwMY_ID;
  2069. PGLCHARAG pMyChar = GetChar ( dwMY_ID );
  2070. if ( !pMyChar ) return FALSE;
  2071. PGLCHARAG pReqChar = GetChar ( dwREQ_ID );
  2072. if ( !pReqChar ) return FALSE;
  2073. const SCONFTING& sMY_CONFTING = pMyChar->GETCONFRONTING();
  2074. const SCONFTING& sREQ_CONFTING = pReqChar->GETCONFRONTING();
  2075. if ( sMY_CONFTING.IsCONFRONTING() || sREQ_CONFTING.IsCONFRONTING() )
  2076. return FALSE;
  2077. // Note : ´ë·Ã Á¶°Ç ¹«°á¼º °Ë»ç.
  2078. //
  2079. if ( emTYPE != pReqChar->m_sREQCONFTING.emTYPE ) return FALSE;
  2080. if ( dwREQ_TAR != pReqChar->m_sREQCONFTING.dwTAR_ID ) return FALSE;
  2081. if ( _sOption != pReqChar->m_sREQCONFTING.sOption ) return FALSE;
  2082. //#if defined(_RELEASED) || defined(TW_PARAM) || defined(TH_PARAM) || defined(HK_PARAM) // ***Tracing Log print
  2083. if( pMyChar->m_bTracingUser )
  2084. {
  2085. CDebugSet::ToTracingFile( pMyChar->m_szUserName, "Confront Answer OK, [%s][%s], Request Char: [%s][%s]",
  2086. pMyChar->m_szUserName, pMyChar->m_szName, pReqChar->m_szUserName, pReqChar->m_szName );
  2087. }
  2088. //#endif
  2089. // Note : ´ë·Ã ½ÃÀÛ.
  2090. //
  2091. switch ( emTYPE )
  2092. {
  2093. case EMCONFT_ONE:
  2094. {
  2095. SCONFT_OPTION sREQOption = _sOption; // A ( ¿äûÀÚ )
  2096. SCONFT_OPTION sMYOption = _sOption; // B ( ¼ö¶ôÀÚ )
  2097. sMYOption.fHP_RATE = _sOption.fTAR_HP_RATE; // ( ¼ö¶ôÀÚ ) ´Â ü·Â Áõ°¡À² ´Ù¸£°³ °¡Áü.
  2098. pMyChar->StartConfront ( emTYPE, dwMY_TAR, sMYOption );
  2099. pReqChar->StartConfront ( emTYPE, dwREQ_TAR, sREQOption );
  2100. }
  2101. break;
  2102. case EMCONFT_PARTY:
  2103. {
  2104. bool bmyparty(false), breqparty(false);
  2105. DWORD dwMyPartyID = pMyChar->GetPartyID();
  2106. DWORD dwReqPartyID = pReqChar->GetPartyID();
  2107. if ( dwMyPartyID!=GAEAID_NULL )
  2108. {
  2109. GLPARTY *pMyParty = m_cPartyMan.GetParty(dwMyPartyID);
  2110. if ( pMyParty && pMyParty->ISMASTER(pMyChar->m_dwGaeaID) )
  2111. {
  2112. bmyparty = true;
  2113. }
  2114. }
  2115. if ( dwReqPartyID!=GAEAID_NULL )
  2116. {
  2117. GLPARTY *pReqParty = m_cPartyMan.GetParty(dwReqPartyID);
  2118. if ( pReqParty && pReqParty->ISMASTER(pReqChar->m_dwGaeaID) )
  2119. {
  2120. breqparty = true;
  2121. }
  2122. }
  2123. // Note : ÆÄƼ À¯È¿ÇÒ¶§ ´ë·Ã ½ÃÀÛµÊ.
  2124. //
  2125. if ( bmyparty && breqparty )
  2126. {
  2127. // Note : ´ë·Ã½ÃÀÛÀü Âü¿© ¸â¹ö üũ.
  2128. //
  2129. GLMSG::SNETPC_CONFRONTPTY_CHECKMBR2_FLD NetMsgCheck;
  2130. NetMsgCheck.sMapID = pReqChar->m_sCurMapID;
  2131. NetMsgCheck.dwPARTY_A = dwReqPartyID;
  2132. NetMsgCheck.dwPARTY_B = dwMyPartyID;
  2133. NetMsgCheck.sOption = _sOption;
  2134. SENDTOFIELDSVR ( pMyChar->m_nChannel, pMyChar->m_dwCurFieldSvr, &NetMsgCheck );
  2135. }
  2136. else
  2137. {
  2138. // Note : ÆÄƼ°¡ ¾Æ´Ï¿©¼­ ´ë·Ã ºÒ°¡´É.
  2139. //
  2140. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  2141. NetMsgFB.emTYPE = emTYPE;
  2142. NetMsgFB.dwID = dwGaeaID;
  2143. NetMsgFB.emFB = EMCONFRONT_FAIL;
  2144. SENDTOCLIENT ( pMyChar->m_dwClientID, &NetMsgFB );
  2145. SENDTOCLIENT ( pReqChar->m_dwClientID, &NetMsgFB );
  2146. }
  2147. }
  2148. break;
  2149. case EMCONFT_GUILD:
  2150. {
  2151. bool bmyclub(false), breqclub(false);
  2152. DWORD dwMyClubID = pMyChar->m_dwGuild;
  2153. DWORD dwReqClubID = pReqChar->m_dwGuild;
  2154. if ( dwMyClubID!=CLUB_NULL )
  2155. {
  2156. GLCLUB *pCLUB = m_cClubMan.GetClub ( dwMyClubID );
  2157. if ( pCLUB && pCLUB->m_dwMasterID==pMyChar->m_dwCharID )
  2158. {
  2159. bmyclub = true;
  2160. }
  2161. }
  2162. if ( dwReqClubID!=GAEAID_NULL )
  2163. {
  2164. GLCLUB *pCLUB = m_cClubMan.GetClub ( dwReqClubID );
  2165. if ( pCLUB && pCLUB->m_dwMasterID==pReqChar->m_dwCharID )
  2166. {
  2167. breqclub = true;
  2168. }
  2169. }
  2170. // Note : Ŭ·´ À¯È¿ÇÒ¶§ ´ë·Ã ½ÃÀÛµÊ.
  2171. //
  2172. if ( bmyclub && breqclub )
  2173. {
  2174. // Note : ´ë·Ã½ÃÀÛÀü Âü¿© ¸â¹ö üũ.
  2175. //
  2176. GLMSG::SNET_CONFRONTCLB_CHECKMBR_FLD NetMsgCheck;
  2177. NetMsgCheck.sMapID = pReqChar->m_sCurMapID;
  2178. NetMsgCheck.dwCLUB_A = dwReqClubID;
  2179. NetMsgCheck.dwCLUB_B = dwMyClubID;
  2180. NetMsgCheck.sOption = _sOption;
  2181. SENDTOFIELDSVR ( pMyChar->m_nChannel, pMyChar->m_dwCurFieldSvr, &NetMsgCheck );
  2182. }
  2183. else
  2184. {
  2185. // Note : Ŭ·´ÀÌ ¾Æ´Ï¿©¼­ ´ë·Ã ºÒ°¡´É.
  2186. //
  2187. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  2188. NetMsgFB.emTYPE = emTYPE;
  2189. NetMsgFB.dwID = dwGaeaID;
  2190. NetMsgFB.emFB = EMCONFRONT_FAIL;
  2191. SENDTOCLIENT ( pMyChar->m_dwClientID, &NetMsgFB );
  2192. SENDTOCLIENT ( pReqChar->m_dwClientID, &NetMsgFB );
  2193. }
  2194. }
  2195. break;
  2196. };
  2197. }
  2198. return TRUE;
  2199. }
  2200. BOOL GLAgentServer::MsgConfrontPtyCheckMber ( NET_MSG_GENERIC* nmg )
  2201. {
  2202. GLMSG::SNETPC_CONFRONTPTY_CHECKMBR2_AGT *pNetMsg = (GLMSG::SNETPC_CONFRONTPTY_CHECKMBR2_AGT *) nmg;
  2203. StartPartyConfront ( pNetMsg->dwPARTY_A, pNetMsg->dwPARTY_B, pNetMsg->sMapID, pNetMsg->sOption,
  2204. pNetMsg->dwPARTY_A_MEMBER, pNetMsg->dwPARTY_B_MEMBER, pNetMsg->vPosition );
  2205. return TRUE;
  2206. }
  2207. BOOL GLAgentServer::MsgConfrontClbCheckMber ( NET_MSG_GENERIC* nmg )
  2208. {
  2209. GLMSG::SNET_CONFRONTCLB_CHECKMBR_AGT *pNetMsg = (GLMSG::SNET_CONFRONTCLB_CHECKMBR_AGT *) nmg;
  2210. GLCLUB *pClubA = m_cClubMan.GetClub(pNetMsg->dwCLUB_A);
  2211. GLCLUB *pClubB = m_cClubMan.GetClub(pNetMsg->dwCLUB_B);
  2212. if ( !pClubA || !pClubB ) return FALSE;
  2213. CLUBCONFT_ITER pos, end;
  2214. SCONFT_OPTION sOPT_A = pNetMsg->sOption;
  2215. SCONFT_OPTION sOPT_B = pNetMsg->sOption;
  2216. DWORD i(0);
  2217. // Note : A ÆÀ 'Ŭ·´´ë·Ã' ÃʱâÈ­.
  2218. //
  2219. pClubA->CLEARCONFT();
  2220. for ( i=0; i<pNetMsg->dwCLUB_A_NUM; ++i )
  2221. {
  2222. DWORD dwMBR = pNetMsg->dwCLUB_A_MEMBER[i];
  2223. PGLCHARAG pChar = GetCharID ( dwMBR );
  2224. if ( !pChar ) continue;
  2225. if ( pChar->m_sCurMapID != pNetMsg->sMapID ) continue;
  2226. // Note :Ŭ·´¿øÀÇ ´ë·ÃÁ¤º¸ ¼³Á¤.
  2227. //
  2228. pChar->m_sCONFTING.RESET();
  2229. pChar->m_sCONFTING.emTYPE = EMCONFT_GUILD;
  2230. pChar->m_sCONFTING.dwTAR_ID = pNetMsg->dwCLUB_B;
  2231. pChar->m_sCONFTING.sOption = sOPT_A;
  2232. pClubA->ADDCONFT_MEMBER ( dwMBR );
  2233. }
  2234. if ( pClubA->GETCONFT_NUM()==0 ) return FALSE;
  2235. // Note : B ÆÀ 'Ŭ·´´ë·Ã' ÃʱâÈ­.
  2236. //
  2237. pClubB->CLEARCONFT();
  2238. for ( i=0; i<pNetMsg->dwCLUB_B_NUM; ++i )
  2239. {
  2240. DWORD dwMBR = pNetMsg->dwCLUB_B_MEMBER[i];
  2241. PGLCHARAG pChar = GetCharID ( dwMBR );
  2242. if ( !pChar ) continue;
  2243. if ( pChar->m_sCurMapID != pNetMsg->sMapID ) continue;
  2244. // Note : Ŭ·´¿øÀÇ ´ë·ÃÁ¤º¸ ¼³Á¤.
  2245. //
  2246. pChar->m_sCONFTING.RESET();
  2247. pChar->m_sCONFTING.emTYPE = EMCONFT_GUILD;
  2248. pChar->m_sCONFTING.dwTAR_ID = pNetMsg->dwCLUB_A;
  2249. pChar->m_sCONFTING.sOption = sOPT_B;
  2250. pClubB->ADDCONFT_MEMBER ( dwMBR );
  2251. }
  2252. if ( pClubB->GETCONFT_NUM()==0 ) return FALSE;
  2253. // Note : Ŭ·´´ë·Ã Á¤º¸ ÃʱâÈ­.
  2254. //
  2255. pClubA->m_conftOPT = sOPT_A;
  2256. pClubA->m_dwconftCLUB = pNetMsg->dwCLUB_B;
  2257. pClubA->m_fconftTIMER = 0.0f;
  2258. pClubA->SETCONFT_MEMBER();
  2259. pClubB->m_conftOPT = sOPT_B;
  2260. pClubB->m_dwconftCLUB = pNetMsg->dwCLUB_A;
  2261. pClubB->m_fconftTIMER = 0.0f;
  2262. pClubB->SETCONFT_MEMBER();
  2263. // Note : Çʵ忡 ´ë·Ã ÃʱâÈ­ ¸Þ½ÃÁö.
  2264. // ¸Þ½ÃÁö¿¡ Àü¼ÛµÈ my, tar school Àº »ç¿ëµÇÁö ¾Ê´Â´Ù.
  2265. GLMSG::SNETPC_CONFRONTCLB_START2_FLD NetMsgFld;
  2266. NetMsgFld.sMapID = pNetMsg->sMapID;
  2267. NetMsgFld.dwCLUB_A= pNetMsg->dwCLUB_A;
  2268. NetMsgFld.dwCLUB_B= pNetMsg->dwCLUB_B;
  2269. NetMsgFld.sOption = sOPT_A;
  2270. NetMsgFld.vPos = pNetMsg->vPosition;
  2271. pos = pClubA->m_setConftCURRENT.begin();
  2272. end = pClubA->m_setConftCURRENT.end();
  2273. for ( ; pos!=end; ++pos )
  2274. {
  2275. NetMsgFld.dwCLUB_A_MEMBER[NetMsgFld.dwCLUB_A_NUM++] = (*pos);
  2276. }
  2277. pos = pClubB->m_setConftCURRENT.begin();
  2278. end = pClubB->m_setConftCURRENT.end();
  2279. for ( ; pos!=end; ++pos )
  2280. {
  2281. NetMsgFld.dwCLUB_B_MEMBER[NetMsgFld.dwCLUB_B_NUM++] = (*pos);
  2282. }
  2283. SENDTOALLCHANNEL ( &NetMsgFld );
  2284. return TRUE;
  2285. }
  2286. BOOL GLAgentServer::MsgAnsConfrontFB ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2287. {
  2288. GLMSG::SNETPC_REQ_CONFRONT_FB *pNetMsg = (GLMSG::SNETPC_REQ_CONFRONT_FB *)nmg;
  2289. switch ( pNetMsg->emTYPE )
  2290. {
  2291. case EMCONFT_ONE:
  2292. {
  2293. PGLCHARAG pCHAR = GetChar(pNetMsg->dwID);
  2294. if ( pCHAR->m_sCONFTING.IsCONFRONTING() )
  2295. {
  2296. PGLCHARAG pTAR = GetChar(pCHAR->m_sCONFTING.dwTAR_ID);
  2297. if ( pTAR )
  2298. {
  2299. pTAR->m_sCONFTING.RESET();
  2300. // Note : Ŭ¶óÀ̾ðÆ®¿¡ ´ë·Ã ¿À·ù ¼Û½Å.
  2301. if( pNetMsg->emFB == EMCONFRONT_FAIL )
  2302. SENDTOCLIENT(pTAR->m_dwClientID,pNetMsg);
  2303. }
  2304. }
  2305. pCHAR->m_sCONFTING.RESET();
  2306. // Note : Ŭ¶óÀ̾ðÆ®¿¡ ´ë·Ã ¿À·ù ¼Û½Å.
  2307. SENDTOCLIENT(pCHAR->m_dwClientID,pNetMsg);
  2308. }
  2309. break;
  2310. case EMCONFT_PARTY:
  2311. {
  2312. m_cPartyMan.ConfrontFB ( (NET_MSG_GENERIC*) pNetMsg );
  2313. }
  2314. break;
  2315. case EMCONFT_GUILD:
  2316. {
  2317. GLCLUB *pCLUB = m_cClubMan.GetClub ( pNetMsg->dwID );
  2318. if ( pCLUB )
  2319. {
  2320. pCLUB->CLEARCONFT();
  2321. CLUBMEMBERS_ITER pos = pCLUB->m_mapMembers.begin();
  2322. CLUBMEMBERS_ITER end = pCLUB->m_mapMembers.end();
  2323. for ( ; pos!=end; ++pos )
  2324. {
  2325. PGLCHARAG pCHAR = GetCharID((*pos).first);
  2326. if ( !pCHAR ) continue;
  2327. pCHAR->m_sCONFTING.RESET ();
  2328. // Note : Ŭ¶óÀ̾ðÆ®¿¡ ´ë·Ã ¿À·ù ¼Û½Å.
  2329. //
  2330. GLMSG::SNETPC_REQ_CONFRONT_FB NetMsgFB;
  2331. NetMsgFB.emFB = pNetMsg->emFB;
  2332. SENDTOCLIENT(pCHAR->m_dwClientID,&NetMsgFB);
  2333. }
  2334. }
  2335. }
  2336. break;
  2337. };
  2338. return TRUE;
  2339. }
  2340. BOOL GLAgentServer::MsgConfrontEnd2Agt ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2341. {
  2342. GLMSG::SNETPC_CONFRONT_END2_AGT *pNetMsg = (GLMSG::SNETPC_CONFRONT_END2_AGT *)nmg;
  2343. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  2344. if ( !pMyChar ) return FALSE;
  2345. const SCONFTING &sCONFT = pMyChar->GETCONFRONTING();
  2346. switch ( sCONFT.emTYPE )
  2347. {
  2348. case EMCONFT_ONE:
  2349. {
  2350. DWORD dwTAR_ID = sCONFT.dwTAR_ID;
  2351. pMyChar->ResetConfrontOk ();
  2352. PGLCHARAG pTarChar = GetChar ( dwTAR_ID );
  2353. if ( !pTarChar ) return TRUE;
  2354. pTarChar->ResetConfrontOk ();
  2355. }
  2356. break;
  2357. case EMCONFT_PARTY:
  2358. {
  2359. pMyChar->ResetConfrontOk();
  2360. GLPARTY *pParty = GetParty ( pMyChar->GetPartyID() );
  2361. if ( !pParty ) return FALSE;
  2362. pParty->DELCONFT_MEMBER ( pMyChar->m_dwGaeaID );
  2363. }
  2364. break;
  2365. case EMCONFT_GUILD:
  2366. {
  2367. pMyChar->ResetConfrontOk();
  2368. GLCLUB *pCLUB = m_cClubMan.GetClub ( pMyChar->m_dwGuild );
  2369. if ( !pCLUB ) return FALSE;
  2370. pCLUB->DELCONFT_MEMBER ( pMyChar->m_dwCharID );
  2371. }
  2372. break;
  2373. };
  2374. return TRUE;
  2375. }
  2376. BOOL GLAgentServer::MsgServerCtrlWeather ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2377. {
  2378. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  2379. if ( !pMyChar ) return FALSE;
  2380. if ( pMyChar->m_dwUserLvl < USER_GM3 ) return FALSE;
  2381. SENDTOALLCHANNEL ( nmg );
  2382. if (GLCONST_CHAR::EnableGMLogs )
  2383. {
  2384. std::string strTIME = CDebugSet::GetCurTime ();
  2385. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Overriding Weather",
  2386. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  2387. strTIME.clear();
  2388. }
  2389. return TRUE;
  2390. }
  2391. BOOL GLAgentServer::MsgServerCtrlGenHold ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2392. {
  2393. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  2394. if ( !pMyChar ) return FALSE;
  2395. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  2396. SENDTOALLCHANNEL ( nmg );
  2397. if (GLCONST_CHAR::EnableGMLogs )
  2398. {
  2399. std::string strTIME = CDebugSet::GetCurTime ();
  2400. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Overriding Item Gen Hold",
  2401. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  2402. strTIME.clear();
  2403. }
  2404. return TRUE;
  2405. }
  2406. BOOL GLAgentServer::MsgServerCtrlTime ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2407. {
  2408. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  2409. if ( !pMyChar ) return FALSE;
  2410. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  2411. GLMSG::SNETSERVER_CTRL_TIME *pNetMsg = (GLMSG::SNETSERVER_CTRL_TIME *)nmg;
  2412. GLPeriod::GetInstance().SetHour ( pNetMsg->dwTime );
  2413. SENDTOALLCHANNEL ( pNetMsg );
  2414. if (GLCONST_CHAR::EnableGMLogs )
  2415. {
  2416. std::string strTIME = CDebugSet::GetCurTime ();
  2417. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Overriding Server Time",
  2418. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  2419. strTIME.clear();
  2420. }
  2421. return TRUE;
  2422. }
  2423. BOOL GLAgentServer::MsgServerCtrlMonth ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2424. {
  2425. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  2426. if ( !pMyChar ) return FALSE;
  2427. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  2428. GLMSG::SNETSERVER_CTRL_MONTH *pNetMsg = (GLMSG::SNETSERVER_CTRL_MONTH *)nmg;
  2429. //GLPeriod::GetInstance();
  2430. if (GLCONST_CHAR::EnableGMLogs )
  2431. {
  2432. std::string strTIME = CDebugSet::GetCurTime ();
  2433. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Overriding Month",
  2434. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  2435. strTIME.clear();
  2436. }
  2437. return TRUE;
  2438. }
  2439. BOOL GLAgentServer::MsgBlockDetected ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2440. {
  2441. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  2442. if ( !pMyChar ) return FALSE;
  2443. GLMSG::SNET_BLOCK_DETECTED *pNetMsg = (GLMSG::SNET_BLOCK_DETECTED*) nmg;
  2444. if ( pMyChar->m_dwCharID == pNetMsg->dwCHARID )
  2445. {
  2446. std::string strTIME = CDebugSet::GetCurTime ();
  2447. CDebugSet::ToFile ( "block_detected.txt", "%s userid= %s (%d), charid= %s (%d), detect=%d, %s",
  2448. strTIME.c_str(),
  2449. pMyChar->m_szUserName,
  2450. pMyChar->m_dwUserID, pMyChar->m_szName, pMyChar->m_dwCharID, pNetMsg->dwDETECTED, pNetMsg->szINFO );
  2451. CLogHackProgram *pDbAction = new CLogHackProgram(
  2452. pMyChar->m_dwUserID,
  2453. pMyChar->m_dwCharID,
  2454. (int) pNetMsg->dwDETECTED,
  2455. pNetMsg->szINFO );
  2456. GLDBMan *pDbMan = GLAgentServer::GetInstance().GetDBMan();
  2457. if ( pDbMan ) pDbMan->AddJob ( pDbAction );
  2458. }
  2459. return TRUE;
  2460. }
  2461. // *****************************************************
  2462. // Desc: Äɸ¯ÅÍ °­Á¦ Á¢¼Ó Á¾·á ¿äû ó¸®
  2463. // *****************************************************
  2464. BOOL GLAgentServer::MsgGmKickUser ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2465. {
  2466. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  2467. if ( !pMyChar ) return FALSE;
  2468. if ( pMyChar->m_dwUserLvl < USER_GM3 ) return FALSE;
  2469. GLMSG::SNET_GM_KICK_USER *pNetMsg = (GLMSG::SNET_GM_KICK_USER*) nmg;
  2470. if ( pNetMsg->bName )
  2471. {
  2472. PGLCHARAG pTarChar = GetChar ( pNetMsg->szNAME );
  2473. if ( !pTarChar ) return FALSE;
  2474. GLMSG::SNET_GM_KICK_USER_PROC_FLD NetMsgFld;
  2475. NetMsgFld.dwID = pTarChar->m_dwCharID;
  2476. SENDTOALLCHANNEL ( &NetMsgFld );
  2477. GLMSG::SNET_GM_KICK_USER_PROC NetMsgProc;
  2478. SENDTOCLIENT ( pTarChar->m_dwClientID, &NetMsgProc );
  2479. ReserveDropOutPC ( pTarChar->m_dwGaeaID );
  2480. if (GLCONST_CHAR::EnableGMLogs )
  2481. {
  2482. std::string strTIME = CDebugSet::GetCurTime ();
  2483. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Kick Character userid= %s (%d), charid= %s (%d)",
  2484. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pTarChar->m_szUserName,pTarChar->m_dwUserID,pTarChar->m_szName,pTarChar->m_dwCharID);
  2485. strTIME.clear();
  2486. }
  2487. }
  2488. else
  2489. {
  2490. PGLCHARAG pTarChar = GetCharID ( pNetMsg->dwID );
  2491. if ( !pTarChar ) return FALSE;
  2492. GLMSG::SNET_GM_KICK_USER_PROC_FLD NetMsgFld;
  2493. NetMsgFld.dwID = pNetMsg->dwID;
  2494. SENDTOALLCHANNEL ( &NetMsgFld );
  2495. GLMSG::SNET_GM_KICK_USER_PROC NetMsgProc;
  2496. SENDTOCLIENT ( pTarChar->m_dwClientID, &NetMsgProc );
  2497. ReserveDropOutPC ( pTarChar->m_dwGaeaID );
  2498. if (GLCONST_CHAR::EnableGMLogs )
  2499. {
  2500. std::string strTIME = CDebugSet::GetCurTime ();
  2501. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Kick Character userid= %s (%d), charid= %s (%d)",
  2502. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pTarChar->m_szUserName,pTarChar->m_dwUserID,pTarChar->m_szName,pTarChar->m_dwCharID);
  2503. strTIME.clear();
  2504. }
  2505. }
  2506. return TRUE;
  2507. }
  2508. BOOL GLAgentServer::MsgGMMove2Gate ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2509. {
  2510. PGLCHARAG pCHAR = GetChar ( dwGaeaID );
  2511. if ( !pCHAR ) return FALSE;
  2512. if ( pCHAR->m_dwUserLvl < USER_GM3 ) return FALSE;
  2513. GLMSG::SNET_GM_MOVE2GATE* pNetMsg = (GLMSG::SNET_GM_MOVE2GATE*) nmg;
  2514. GLMSG::SNET_GM_MOVE2GATE_FLD NetMsgFld;
  2515. NetMsgFld.dwGATE = pNetMsg->dwGATE;
  2516. NetMsgFld.dwGaeaID = dwGaeaID;
  2517. SENDTOALLCHANNEL ( &NetMsgFld );
  2518. if (GLCONST_CHAR::EnableGMLogs )
  2519. {
  2520. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  2521. std::string strTIME = CDebugSet::GetCurTime ();
  2522. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Move to Gate Number %d",
  2523. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->dwGATE );
  2524. strTIME.clear();
  2525. }
  2526. return TRUE;
  2527. }
  2528. // *****************************************************
  2529. // Desc: ƯÁ¤¸ÊÀÇ Æ¯Á¤À§Ä¡¿¡ À̵¿ ¿äû ó¸®
  2530. // *****************************************************
  2531. BOOL GLAgentServer::MsgGMMove2Pos ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2532. {
  2533. PGLCHARAG pCHAR = GetChar ( dwGaeaID );
  2534. if ( !pCHAR ) return FALSE;
  2535. if ( pCHAR->m_dwUserLvl < USER_SPECIAL ) return FALSE;
  2536. GLMSG::SNET_GM_MOVE2MAPPOS* pNetMsg = (GLMSG::SNET_GM_MOVE2MAPPOS*) nmg;
  2537. GLMSG::SNET_GM_MOVE2MAPPOS_FLD NetMsgFld;
  2538. NetMsgFld.nidMAP = pNetMsg->nidMAP;
  2539. NetMsgFld.dwGaeaID = dwGaeaID;
  2540. NetMsgFld.dwPOSX = pNetMsg->dwPOSX;
  2541. NetMsgFld.dwPOSY = pNetMsg->dwPOSY;
  2542. SENDTOALLCHANNEL ( &NetMsgFld );
  2543. if (GLCONST_CHAR::EnableGMLogs )
  2544. {
  2545. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  2546. std::string strTIME = CDebugSet::GetCurTime ();
  2547. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Move to MAP MID:%d SID:%d X:%d Y:%d",
  2548. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->nidMAP.wMainID,pNetMsg->nidMAP.wSubID,pNetMsg->dwPOSX,pNetMsg->dwPOSY );
  2549. strTIME.clear();
  2550. }
  2551. return TRUE;
  2552. }
  2553. BOOL GLAgentServer::MsgServerGeneralChat ( NET_MSG_GENERIC* nmg )
  2554. {
  2555. SENDTOALLCLIENT ( nmg );
  2556. return TRUE;
  2557. }
  2558. BOOL GLAgentServer::ChatMsgLoudSpeakerAgt ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2559. {
  2560. GLMSG::SNETPC_CHAT_LOUDSPEAKER_AGT *pNetMsg = (GLMSG::SNETPC_CHAT_LOUDSPEAKER_AGT *) nmg;
  2561. PGLCHARAG pChar = GetChar ( dwGaeaID );
  2562. if ( !pChar ) return FALSE;
  2563. if ( pChar->IsCHATBLOCK() ) return FALSE;
  2564. NET_CHAT_FB NetMsgFB;
  2565. NetMsgFB.emType = CHAT_TYPE_LOUDSPEAKER;
  2566. StringCchCopy ( NetMsgFB.szName, CHAR_SZNAME, pChar->m_szName );
  2567. StringCchCopy ( NetMsgFB.szChatMsg, CHAT_MSG_SIZE, pNetMsg->szMSG );
  2568. if ( pNetMsg->bchannel_all ) SENDTOALLCLIENT ( &NetMsgFB );
  2569. else SENDTOALLCLIENT ( &NetMsgFB, pChar->m_nChannel );
  2570. return TRUE;
  2571. }
  2572. BOOL GLAgentServer::MsgClubNew2Agt ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2573. {
  2574. GLMSG::SNET_CLUB_NEW_2AGT *pNetMsg = (GLMSG::SNET_CLUB_NEW_2AGT *) nmg;
  2575. PGLCHARAG pChar = GetChar ( dwGaeaID );
  2576. if ( !pChar ) return FALSE;
  2577. GLMSG::SNET_CLUB_NEW_FB NetMsgFB;
  2578. NetMsgFB.emFB = EMCLUB_NEW_FB_FAIL;
  2579. StringCchCopy ( NetMsgFB.szClubName, CHAR_SZNAME, pNetMsg->szClubName );
  2580. if ( pChar->m_dwGuild!=CLUB_NULL )
  2581. {
  2582. NetMsgFB.emFB = EMCLUB_NEW_FB_FAIL;
  2583. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2584. return FALSE;
  2585. }
  2586. GLPARTY *pPARTY = m_cPartyMan.GetParty ( pChar->m_dwPartyID );
  2587. if ( !pPARTY || !pPARTY->ISMASTER(pChar->m_dwGaeaID) )
  2588. {
  2589. NetMsgFB.emFB = EMCLUB_NEW_FB_NOTMASTER;
  2590. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2591. return FALSE;
  2592. }
  2593. if ( pPARTY->GETNUMBER() < GLCONST_CHAR::dwCLUB_PARTYNUM )
  2594. {
  2595. NetMsgFB.emFB = EMCLUB_NEW_FB_NOTMEMBER;
  2596. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2597. return S_FALSE;
  2598. }
  2599. GLPARTY::MEMBER_ITER pos = pPARTY->m_cMEMBER.begin();
  2600. GLPARTY::MEMBER_ITER end = pPARTY->m_cMEMBER.end();
  2601. for ( ; pos!=end; ++pos )
  2602. {
  2603. PGLCHARAG pMEMBER = GetChar ( (*pos) );
  2604. if ( !pMEMBER )
  2605. {
  2606. NetMsgFB.emFB = EMCLUB_NEW_FB_NOTEXIST_MEM;
  2607. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2608. return FALSE;
  2609. }
  2610. if ( pMEMBER->m_dwGuild != CLUB_NULL )
  2611. {
  2612. NetMsgFB.emFB = EMCLUB_NEW_FB_MEM_ALREADY;
  2613. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2614. return FALSE;
  2615. }
  2616. }
  2617. // Note : ½ÅûÇÑ Å¬·´ À̸§ÀÌ ÀÌ¹Ì »ç¿ëÁß.
  2618. //
  2619. DWORD dwOLDGLUB = m_cClubMan.FindClub ( pNetMsg->szClubName );
  2620. if ( dwOLDGLUB!=CLUB_NULL )
  2621. {
  2622. NetMsgFB.emFB = EMCLUB_NEW_FB_NAME;
  2623. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2624. return FALSE;
  2625. }
  2626. // Note : DB¿¡ µ¥ÀÌÅÍ ¼³Á¤.
  2627. //
  2628. CCreateClub *pDbAction = new CCreateClub ( dwClientID, pNetMsg->szClubName, pChar->m_dwCharID );
  2629. m_pDBMan->AddJob ( pDbAction );
  2630. return TRUE;
  2631. }
  2632. BOOL GLAgentServer::MsgClubNewDb2Agt ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2633. {
  2634. GLMSG::SNET_CLUB_NEW_DB2AGT *pNetMsg = (GLMSG::SNET_CLUB_NEW_DB2AGT *) nmg;
  2635. PGLCHARAG pChar = GetCharID ( pNetMsg->dwMasterID );
  2636. if ( !pChar )
  2637. {
  2638. // Note : db¿¡ Ŭ·´À» ¸¸µé¾úÀ¸³ª Ŭ·´ ¸¶½ºÅÍ°¡ Á¸Á¦ÇÏÁö ¾ÊÀ» ¶§´Â Ŭ·´À» »èÁ¦ÇÑ´Ù.
  2639. CDeleteClub *pDbAction = new CDeleteClub(pNetMsg->dwClubID,pNetMsg->dwMasterID);
  2640. m_pDBMan->AddJob ( pDbAction );
  2641. return FALSE;
  2642. }
  2643. GLMSG::SNET_CLUB_NEW_FB NetMsgFB;
  2644. if ( pNetMsg->emFB==EMCLUB_NEW_FB_ALREADY )
  2645. {
  2646. NetMsgFB.emFB = EMCLUB_NEW_FB_ALREADY;
  2647. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2648. return FALSE;
  2649. }
  2650. if ( pNetMsg->emFB==EMCLUB_NEW_FB_NAME )
  2651. {
  2652. NetMsgFB.emFB = EMCLUB_NEW_FB_NAME;
  2653. StringCchCopy ( NetMsgFB.szClubName, CHAR_SZNAME, pNetMsg->szClubName );
  2654. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2655. return FALSE;
  2656. }
  2657. if ( pNetMsg->emFB==EMCLUB_NEW_FB_FAIL )
  2658. {
  2659. NetMsgFB.emFB = EMCLUB_NEW_FB_FAIL;
  2660. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2661. return FALSE;
  2662. }
  2663. NetMsgFB.emFB = EMCLUB_NEW_FB_FAIL;
  2664. StringCchCopy ( NetMsgFB.szClubName, CHAR_SZNAME, pNetMsg->szClubName );
  2665. GLPARTY *pPARTY = m_cPartyMan.GetParty ( pChar->m_dwPartyID );
  2666. if ( !pPARTY || !pPARTY->ISMASTER(pChar->m_dwGaeaID) )
  2667. {
  2668. NetMsgFB.emFB = EMCLUB_NEW_FB_NOTMASTER;
  2669. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2670. CDeleteClub *pDbAction = new CDeleteClub(pNetMsg->dwClubID,pNetMsg->dwMasterID);
  2671. m_pDBMan->AddJob ( pDbAction );
  2672. return FALSE;
  2673. }
  2674. if ( pPARTY->GETNUMBER() < GLCONST_CHAR::dwCLUB_PARTYNUM )
  2675. {
  2676. NetMsgFB.emFB = EMCLUB_NEW_FB_NOTMEMBER;
  2677. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2678. CDeleteClub *pDbAction = new CDeleteClub(pNetMsg->dwClubID,pNetMsg->dwMasterID);
  2679. m_pDBMan->AddJob ( pDbAction );
  2680. return S_FALSE;
  2681. }
  2682. // Note : Ŭ·´ ¼³Á¤.
  2683. //
  2684. GLCLUB cClubNew;
  2685. cClubNew.m_dwID = pNetMsg->dwClubID;
  2686. StringCchCopy(cClubNew.m_szName,CHAR_SZNAME,pNetMsg->szClubName);
  2687. CTime cTIME_CUR = CTime::GetCurrentTime();
  2688. cClubNew.m_tOrganize = cTIME_CUR.GetTime();
  2689. cClubNew.m_dwMasterID = pChar->m_dwCharID;
  2690. StringCchCopy(cClubNew.m_szMasterName,CHAR_SZNAME,pChar->m_szName);
  2691. // Note : Äɸ¯ÅÍ °³Ã¼¿¡ Ŭ·´ ID ÁöÁ¤.
  2692. //pChar->m_dwGuild = cClubNew.m_dwID;
  2693. CTime cTIME_DIS(1970,2,1,1,1,1);
  2694. cClubNew.m_tDissolution = cTIME_DIS.GetTime();
  2695. // Note : ¸â¹ö¿ø µî·Ï.
  2696. {
  2697. GLPARTY::MEMBER_ITER pos = pPARTY->m_cMEMBER.begin();
  2698. GLPARTY::MEMBER_ITER end = pPARTY->m_cMEMBER.end();
  2699. for ( ; pos!=end; ++pos )
  2700. {
  2701. PGLCHARAG pMEMBER = GetChar ( (*pos) );
  2702. if ( !pMEMBER ) continue;
  2703. if ( pMEMBER->m_dwGuild != CLUB_NULL ) continue;
  2704. // Note : Äɸ¯ÅÍ °³Ã¼¿¡ Ŭ·´ ID ÁöÁ¤.
  2705. pMEMBER->m_dwGuild = cClubNew.m_dwID;
  2706. GLCLUBMEMBER cMEMBER;
  2707. cMEMBER.dwID = pMEMBER->m_dwCharID;
  2708. StringCchCopy ( cMEMBER.m_szName, CHAR_SZNAME, pMEMBER->m_szName );
  2709. cClubNew.m_mapMembers.insert ( std::make_pair(cMEMBER.dwID,cMEMBER) );
  2710. // Note : DB¿¡ ¸â¹ö ¼³Á¤.
  2711. //
  2712. CAddClubMember *pDbAction = new CAddClubMember ( cClubNew.m_dwID, cMEMBER.dwID );
  2713. m_pDBMan->AddJob ( pDbAction );
  2714. }
  2715. }
  2716. m_cClubMan.AddClub ( cClubNew );
  2717. // Note : Ŭ·´ »ý¼º ¼º°ø.
  2718. GLMSG::SNET_CLUB_NEW_2FLD NetMsgFLD;
  2719. NetMsgFLD.emFB = EMCLUB_NEW_FB_OK;
  2720. NetMsgFLD.dwCLUBID = cClubNew.m_dwID;
  2721. StringCchCopy ( NetMsgFLD.szClubName, CHAR_SZNAME, cClubNew.m_szName );
  2722. SENDTOFIELD ( dwClientID, &NetMsgFLD );
  2723. // Note : »ý¼º Á¤º¸ Àü¼Û.
  2724. //
  2725. GLMSG::SNET_CLUB_INFO_2FLD NetMsgInfo;
  2726. NetMsgInfo.dwClubID = cClubNew.m_dwID;
  2727. StringCchCopy ( NetMsgInfo.szClubName, CHAR_SZNAME, cClubNew.m_szName );
  2728. NetMsgInfo.dwMasterID = cClubNew.m_dwMasterID;
  2729. StringCchCopy ( NetMsgInfo.szMasterName, CHAR_SZNAME, cClubNew.m_szMasterName );
  2730. NetMsgInfo.dwCDCertifior = cClubNew.m_dwCDCertifior;
  2731. NetMsgInfo.dwRank = cClubNew.m_dwRank;
  2732. NetMsgInfo.dwMarkVER = cClubNew.m_dwMarkVER;
  2733. NetMsgInfo.tOrganize = cClubNew.m_tOrganize;
  2734. NetMsgInfo.tDissolution = cClubNew.m_tDissolution;
  2735. NetMsgInfo.dwMemberNum = cClubNew.GetNemberNum();
  2736. {
  2737. DWORD i=0;
  2738. CLUBMEMBERS_ITER pos = cClubNew.m_mapMembers.begin();
  2739. CLUBMEMBERS_ITER end = cClubNew.m_mapMembers.end();
  2740. for ( ; pos!=end; ++pos )
  2741. {
  2742. const GLCLUBMEMBER &sCLUBMEMBER = (*pos).second;
  2743. StringCchCopy ( NetMsgInfo.szMemberName[i], CHAR_SZNAME, sCLUBMEMBER.m_szName );
  2744. NetMsgInfo.aMembers[i] = sCLUBMEMBER.dwID;
  2745. ++i;
  2746. // Note : Ŭ·´ °¡ÀÔ ·Î±× ±â·Ï.
  2747. GLITEMLMT::GetInstance().ReqAction
  2748. (
  2749. cClubNew.m_dwMasterID, // ´ç»çÀÚ.
  2750. EMLOGACT_CLUB_JOIN_MEMBER, // ÇàÀ§.
  2751. ID_CHAR, sCLUBMEMBER.dwID, // »ó´ë¹æ.
  2752. 0, // exp
  2753. 0, // bright
  2754. 0, // life
  2755. 0 // money
  2756. );
  2757. }
  2758. }
  2759. SENDTOALLCHANNEL ( &NetMsgInfo );
  2760. return TRUE;
  2761. }
  2762. BOOL GLAgentServer::MsgClubDissolution ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2763. {
  2764. GLMSG::SNET_CLUB_DISSOLUTION *pNetMsg = (GLMSG::SNET_CLUB_DISSOLUTION *) nmg;
  2765. PGLCHARAG pChar = GetChar ( dwGaeaID );
  2766. if ( !pChar ) return FALSE;
  2767. GLMSG::SNET_CLUB_DISSOLUTION_FB NetMsgFB;
  2768. if ( pChar->m_dwGuild == CLUB_NULL )
  2769. {
  2770. NetMsgFB.emFB = EMCLUB_DIS_FB_FAIL;
  2771. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2772. return FALSE;
  2773. }
  2774. GLCLUB* pCLUB = m_cClubMan.GetClub ( pChar->m_dwGuild );
  2775. if ( !pCLUB )
  2776. {
  2777. NetMsgFB.emFB = EMCLUB_DIS_FB_FAIL;
  2778. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2779. return FALSE;
  2780. }
  2781. if ( !pCLUB->IsMaster( pChar->m_dwCharID ) )
  2782. {
  2783. NetMsgFB.emFB = EMCLUB_DIS_FB_FAIL;
  2784. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2785. return FALSE;
  2786. }
  2787. // Memo : µ¿¸Í¿¡ °¡ÀԵǾî ÀÖ´Ù¸é Ãë¼Ò.
  2788. if ( pCLUB->IsAlliance() )
  2789. {
  2790. NetMsgFB.emFB = EMCLUB_DIS_FB_FAIL;
  2791. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2792. return FALSE;
  2793. }
  2794. if ( pCLUB->GetAllBattleNum() > 0 )
  2795. {
  2796. NetMsgFB.emFB = EMCLUB_DIS_FB_CLUBBATTLE;
  2797. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2798. return FALSE;
  2799. }
  2800. if ( pNetMsg->bCANCEL )
  2801. {
  2802. if ( !pCLUB->IsRegDissolution() )
  2803. {
  2804. NetMsgFB.emFB = EMCLUB_DIS_FB_FAIL;
  2805. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2806. return FALSE;
  2807. }
  2808. pCLUB->DoDissolutionCancel ();
  2809. // Note : DB¿¡ Ŭ·´ ÇØ»ê ½Ã°£ ¼³Á¤.
  2810. CSetClubDissolutionTime *pDbAction = new CSetClubDissolutionTime(pCLUB->m_dwID,pCLUB->m_tDissolution);
  2811. m_pDBMan->AddJob ( pDbAction );
  2812. // Note : ÇØü Ãë¼Ò to FIELD
  2813. //
  2814. GLMSG::SNET_CLUB_DISSOLUTION_2FLD NetMsgFld;
  2815. NetMsgFld.dwClubID = pCLUB->m_dwID;
  2816. CTime tDisTime(1970,2,1,1,1,1);
  2817. NetMsgFld.tDissolution = tDisTime.GetTime();
  2818. SENDTOALLCHANNEL ( &NetMsgFld );
  2819. // Note : ÇØü Ãë¼Ò FB
  2820. //
  2821. NetMsgFB.emFB = EMCLUB_DIS_FB_CANCEL;
  2822. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2823. }
  2824. else
  2825. {
  2826. // Note : ÇØü ¿¹Á¤ÀÏ ÁöÁ¤.
  2827. CTime tDisTime = CTime::GetCurrentTime();
  2828. CTimeSpan tADD(GLCONST_CHAR::dwCLUB_DISSOLUTION_DAY,0,10,0);
  2829. tDisTime += tADD;
  2830. pCLUB->DoDissolution(tDisTime.GetTime());
  2831. // Note : DB¿¡ Ŭ·´ ÇØ»ê ½Ã°£ ¼³Á¤.
  2832. CSetClubDissolutionTime *pDbAction = new CSetClubDissolutionTime(pCLUB->m_dwID,pCLUB->m_tDissolution);
  2833. m_pDBMan->AddJob ( pDbAction );
  2834. // Note : ÇØü FB.
  2835. //
  2836. NetMsgFB.emFB = EMCLUB_DIS_FB_OK;
  2837. NetMsgFB.tDissolution = pCLUB->m_tDissolution;
  2838. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  2839. // Note : ÇØü to FIELD
  2840. //
  2841. GLMSG::SNET_CLUB_DISSOLUTION_2FLD NetMsgFld;
  2842. NetMsgFld.dwClubID = pCLUB->m_dwID;
  2843. NetMsgFld.tDissolution = pCLUB->m_tDissolution;
  2844. SENDTOALLCHANNEL ( &NetMsgFld );
  2845. }
  2846. return TRUE;
  2847. }
  2848. BOOL GLAgentServer::MsgClubCertified ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2849. {
  2850. GLMSG::SNET_CLUB_CERTIFIED_AGT *pNetMsg = (GLMSG::SNET_CLUB_CERTIFIED_AGT *) nmg;
  2851. bool bOK = GLGuidanceAgentMan::GetInstance().ChangeGuidClub ( pNetMsg->dwID, pNetMsg->dwCLUBID );
  2852. if ( !bOK ) return FALSE;
  2853. // Note : Çʵ弭¹ö¿¡ ¾Ë¸².
  2854. //
  2855. GLMSG::SNET_CLUB_CERTIFIED_FLD NetMsgFld;
  2856. NetMsgFld.dwID = pNetMsg->dwID;
  2857. NetMsgFld.dwCLUBID = pNetMsg->dwCLUBID;
  2858. SENDTOALLCHANNEL ( &NetMsgFld );
  2859. // Note : Ŭ¶óÀ̾ðƮƲ¿¡°Ô ¾Ë¸².
  2860. //
  2861. std::string strGuidName, strClubName;
  2862. GLGuidance *pGuid = GLGuidanceAgentMan::GetInstance().Find ( pNetMsg->dwID );
  2863. if ( pGuid ) strGuidName = pGuid->m_strName;
  2864. GLCLUB *pCLUB = m_cClubMan.GetClub ( pNetMsg->dwCLUBID );
  2865. if ( pCLUB ) strClubName = pCLUB->m_szName;
  2866. // Note : Ŭ¶óÀ̾ðÆ®¿¡ ¾Ë¸².
  2867. CString strTEXT;
  2868. strTEXT.Format ( ID2SERVERTEXT("EMGUIDCLUB_CERTIFIED"), strClubName.c_str(), strGuidName.c_str() );
  2869. GLMSG::SNET_SERVER_GENERALCHAT NetMsg;
  2870. NetMsg.SETTEXT ( strTEXT.GetString() );
  2871. SENDTOALLCLIENT ( &NetMsg );
  2872. return TRUE;
  2873. }
  2874. BOOL GLAgentServer::MsgClubIncomeMoney ( NET_MSG_GENERIC* nmg )
  2875. {
  2876. GLMSG::SNET_CLUB_INCOME_MONEY_AGT *pNetMsg = (GLMSG::SNET_CLUB_INCOME_MONEY_AGT *) nmg;
  2877. GLCLUB *pCLUB = m_cClubMan.GetClub ( pNetMsg->dwID );
  2878. if ( !pCLUB ) return FALSE;
  2879. if ( pNetMsg->lnMoney < 0 ) return FALSE;
  2880. // Note : Ŭ·´ÀÇ ¼öÀÍÀ» ¹Ý¿µ.
  2881. pCLUB->m_lnIncomeMoney += LONGLONG ( pNetMsg->lnMoney * GLCONST_CHAR::fEARNING_RATE + 0.1f );
  2882. GLITEMLMT::GetInstance().ReqMoneyExc( ID_CLUB, pNetMsg->dwID,
  2883. ID_CLUB, pNetMsg->dwID,
  2884. pNetMsg->lnMoney,
  2885. EMITEM_ROUTE_CLUBINCOME );
  2886. CDebugSet::ToFile ( "club_income_agent.txt", "{MsgClubIncomeMoney}, ClubID[%u], MoneyFromField[%I64d], IncomeMoney[%I64d]",
  2887. pNetMsg->dwID, pNetMsg->lnMoney, pCLUB->m_lnIncomeMoney );
  2888. // Note : Db¿¡ ÀúÀå.
  2889. CSetClubIncomeMoney *pDbAction = new CSetClubIncomeMoney ( pCLUB->m_dwID, pCLUB->m_lnIncomeMoney );
  2890. m_pDBMan->AddJob ( pDbAction );
  2891. return TRUE;
  2892. }
  2893. BOOL GLAgentServer::MsgClubIncomeMoneyUp ( NET_MSG_GENERIC* nmg )
  2894. {
  2895. GLMSG::SNET_CLUB_INCOME_UP *pNetMsg = (GLMSG::SNET_CLUB_INCOME_UP *) nmg;
  2896. GLCLUB *pCLUB = m_cClubMan.GetClub ( pNetMsg->dwClubID );
  2897. if ( !pCLUB ) return FALSE;
  2898. // Note : Ŭ·´ÀÇ ¼öÀÍÀ» ¹Ý¿µ.
  2899. if ( pCLUB->m_lnIncomeMoney > 0 )
  2900. {
  2901. GLMSG::SNET_CLUB_INCOME_DN NetMsgDn;
  2902. NetMsgDn.dwClubID = pCLUB->m_dwID;
  2903. NetMsgDn.lnInComeMoney = pCLUB->m_lnIncomeMoney;
  2904. SENDTOALLCHANNEL ( &NetMsgDn );
  2905. pCLUB->m_lnIncomeMoney = 0;
  2906. CDebugSet::ToFile ( "club_income_agent.txt", "{MsgClubIncomeMoneyUp}, ClubID[%u], IncomeMoney[%I64d]",
  2907. pCLUB->m_dwID, NetMsgDn.lnInComeMoney );
  2908. // Note : Db¿¡ ÀúÀå.
  2909. CSetClubIncomeMoney *pDbAction = new CSetClubIncomeMoney ( pCLUB->m_dwID, pCLUB->m_lnIncomeMoney );
  2910. m_pDBMan->AddJob ( pDbAction );
  2911. }
  2912. return TRUE;
  2913. }
  2914. // *****************************************************
  2915. // Desc: Ŭ·´¼öÀÍ¿¡¼­ µ·À» »©°£´Ù incomemoney->storagemoney
  2916. // *****************************************************
  2917. //BOOL GLAgentServer::MsgClubIncomeMoneyFb ( NET_MSG_GENERIC* nmg )
  2918. //{
  2919. // GLMSG::SNET_CLUB_INCOME_FB *pNetMsg = (GLMSG::SNET_CLUB_INCOME_FB *) nmg;
  2920. //
  2921. // GLCLUB *pCLUB = m_cClubMan.GetClub ( pNetMsg->dwClubID );
  2922. // if ( !pCLUB ) return FALSE;
  2923. //
  2924. // if( pNetMsg->lnInComeMoney <= 0 ) return FALSE;
  2925. //
  2926. // // µ·À» ´õ ¸¹ÀÌ »©°¡·Á±¸ ½ÃµµÇؼ­ DB¿¡¼­ Overflow »ý±è
  2927. // if ( pCLUB->m_lnIncomeMoney < pNetMsg->lnInComeMoney ) return FALSE;
  2928. //
  2929. // // Note : Ŭ·´ÀÇ ¼öÀÍÀÌ ¹Ý¿µµÈµÚ Á¤»ê.
  2930. // pCLUB->m_lnIncomeMoney -= pNetMsg->lnInComeMoney;
  2931. //
  2932. // //m_pConsoleMsg->Write( LOG_CONSOLE, "m_lnIncomeMoney : %d", pCLUB->m_lnIncomeMoney );
  2933. //
  2934. // // Note : Db¿¡ ÀúÀå.
  2935. // CSetClubIncomeMoney *pDbAction = new CSetClubIncomeMoney ( pCLUB->m_dwID, pCLUB->m_lnIncomeMoney );
  2936. // m_pDBMan->AddJob ( pDbAction );
  2937. //
  2938. // return TRUE;
  2939. //}
  2940. BOOL GLAgentServer::MsgClubMemberDb2Del ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  2941. {
  2942. GLMSG::SNET_CLUB_MEMBER_DB2DEL *pNetMsg = (GLMSG::SNET_CLUB_MEMBER_DB2DEL *) nmg;
  2943. if ( pNetMsg->dwClub==CLUB_NULL )
  2944. {
  2945. return S_FALSE;
  2946. }
  2947. GLClubMan &sClubMan = GLAgentServer::GetInstance().GetClubMan();
  2948. GLCLUB *pCLUB = sClubMan.GetClub ( pNetMsg->dwClub );
  2949. if ( !pCLUB )
  2950. {
  2951. return S_FALSE;
  2952. }
  2953. if ( pCLUB->m_dwMasterID==pNetMsg->dwMember )
  2954. {
  2955. return S_FALSE;
  2956. }
  2957. bool bFOUND = pCLUB->IsMember ( pNetMsg->dwMember );
  2958. if ( !bFOUND )
  2959. {
  2960. return S_FALSE;
  2961. }
  2962. // Note : Ŭ·´ ¸É¹ö Å»Åð ·Î±× ±â·Ï.
  2963. GLITEMLMT::GetInstance().ReqAction
  2964. (
  2965. pCLUB->m_dwMasterID, // ´ç»çÀÚ.
  2966. EMLOGACT_CLUB_SECEDE_MEMBER,// ÇàÀ§.
  2967. ID_CHAR, pNetMsg->dwMember, // »ó´ë¹æ.
  2968. 0, // exp
  2969. 0, // bright
  2970. 0, // life
  2971. 0 // money
  2972. );
  2973. // Note : DB¿¡¼­ »èÁ¦.
  2974. CDeleteClubMember *pDbAction = new CDeleteClubMember(pNetMsg->dwMember);
  2975. GLAgentServer::GetInstance().GetDBMan()->AddJob ( pDbAction );
  2976. // Note : Á¾Àü ÀÎÁõ ±ÇÇÑÀÚ ¹é¾÷.
  2977. DWORD dwCD_OLD = pCLUB->m_dwCDCertifior;
  2978. // CDM ±ÇÇÑ ÀÖÀ»°æ¿ì Á¦°Å
  2979. pCLUB->SetMemberCDMFlag( pNetMsg->dwMember, FALSE );
  2980. // Note : Ŭ·´ ¸ñ·Ï¿¡¼­ Á¦°Å.
  2981. pCLUB->DelMember ( pNetMsg->dwMember );
  2982. // Note : ¼±µµÅ¬·´ ÀÎÁõÀÚ º¯°æ½Ã.
  2983. if ( dwCD_OLD!=pCLUB->m_dwCDCertifior )
  2984. {
  2985. // Note : ¼­¹ö¿¡ ÀÎÁõ ±ÇÇÑÀÚ ÀúÀå.
  2986. CDbAction *pDbAction = new CSetClubDeputy ( pCLUB->m_dwID, pCLUB->m_dwCDCertifior );
  2987. GLDBMan* pDbMan = GLAgentServer::GetInstance().GetDBMan();
  2988. if ( pDbMan ) pDbMan->AddJob ( pDbAction );
  2989. // Note : ÀÚ±â Ŭ·´¿ø¿¡°Ô ÀÎÁõ±ÇÇÑ ¾Ë¸².
  2990. GLMSG::SNET_CLUB_SUBMASTER_BRD NetMsgBrd;
  2991. NetMsgBrd.dwCharID = pCLUB->m_dwMasterID; // ( ¸¶½ºÅÍ ID ¸¦ »ç¿ë. )
  2992. NetMsgBrd.dwFlags = NULL;
  2993. NetMsgBrd.dwCDCertifior = pCLUB->m_dwCDCertifior;
  2994. GLAgentServer::GetInstance().SENDTOCLUBCLIENT ( pCLUB->m_dwID, &NetMsgBrd );
  2995. }
  2996. // Note : ¸É¹ö¿¡¼­ »èÁ¦ Çʵ忡 ¾Ë¸².
  2997. GLMSG::SNET_CLUB_MEMBER_DEL_2FLD NetMsgFld;
  2998. NetMsgFld.dwClub = pNetMsg->dwClub;
  2999. NetMsgFld.dwMember = pNetMsg->dwMember;
  3000. SENDTOALLCHANNEL ( &NetMsgFld );
  3001. return TRUE;
  3002. }
  3003. BOOL GLAgentServer::MsgGmViewWorkEvent ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3004. {
  3005. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3006. if ( !pMyChar ) return FALSE;
  3007. if ( pMyChar->m_dwUserLvl < USER_GM3 ) return FALSE;
  3008. GLMSG::SNET_GM_VIEWWORKEVENT_FB NetMsgFB;
  3009. if( m_WorkEvent.bWorkEvent[0] ) // °æÇèÄ¡
  3010. {
  3011. sprintf( NetMsgFB.szWorkEventInfo, "Event Type : Exp, Event Rate : %.2f", m_WorkEvent.exp_Event.fSCALE );
  3012. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3013. }
  3014. if( m_WorkEvent.bWorkEvent[1] ) // ¾ÆÀÌÅÛ
  3015. {
  3016. sprintf( NetMsgFB.szWorkEventInfo, "Event Type : Item, Event Rate : %.2f", m_WorkEvent.item_Event.fRATE );
  3017. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3018. }
  3019. if( m_WorkEvent.bWorkEvent[2] ) // µ· µå¶øÀ²
  3020. {
  3021. sprintf( NetMsgFB.szWorkEventInfo, "Event Type : Money, Event Rate : %.2f", m_WorkEvent.money_Event.fRATE );
  3022. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3023. }
  3024. if( m_WorkEvent.bWorkEvent[3] ) // EX À̺¥Æ®
  3025. {
  3026. char szTempChar[32] = {0,};
  3027. if( m_WorkEvent.ex_Event.emType & EMGM_EVENT_SPEED )
  3028. strcat( szTempChar, "SPEED,");
  3029. if( m_WorkEvent.ex_Event.emType & EMGM_EVENT_ASPEED )
  3030. strcat( szTempChar, "ATTACK SPEED,");
  3031. if( m_WorkEvent.ex_Event.emType & EMGM_EVENT_ATTACK )
  3032. strcat( szTempChar, "ATTACK RATE,");
  3033. szTempChar[strlen(szTempChar)-1] = '\0';
  3034. sprintf( NetMsgFB.szWorkEventInfo, "Event Type : Ex Event[%s] Event Rate : %d", szTempChar, m_WorkEvent.ex_Event.wValue );
  3035. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3036. }
  3037. if( m_WorkEvent.bWorkEvent[4] ) // ¸®¹ÌÆ® À̺¥Æ®
  3038. {
  3039. sprintf( NetMsgFB.szWorkEventInfo, "Event Type : LimitEvent, Start_LV %d, End_LV %d, Play_Time %d, Buster_Time %d, Item Rate : %.2f Exp Rate : %.2f, EventMinute %d, Attack Rate : %.2f,",
  3040. m_WorkEvent.limit_Event.start_Lv, m_WorkEvent.limit_Event.end_Lv, m_WorkEvent.limit_Event.play_Time, m_WorkEvent.limit_Event.buster_Time,
  3041. m_WorkEvent.limit_Event.expGain_Rate, m_WorkEvent.limit_Event.itemGain_Rate, m_WorkEvent.limit_Event.dwEventMinute ,m_WorkEvent.limit_Event.attackGain_Rate );
  3042. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3043. }
  3044. for( int i = 0; i < 3; i++ )
  3045. {
  3046. if( !m_WorkEvent.bWorkEvent[5+i] ) continue;// Ŭ·¡½ºº° °æÇèÄ¡ À̺¥Æ®
  3047. char szTempChar[128] = {0,};
  3048. char szTempChar2[32] = {0,};
  3049. //if( m_WorkEvent.class_Event[i].dwClassIndex == GLCC_ALL_NEWSEX )
  3050. //add class
  3051. if( m_WorkEvent.class_Event[i].dwClassIndex == GLCC_ALL_2012 )
  3052. {
  3053. strcpy( szTempChar, "ALL," );
  3054. }else{
  3055. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_FIGHTER_M )
  3056. {
  3057. strcat( szTempChar, "FIGHT_M," );
  3058. }
  3059. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_ARMS_M )
  3060. {
  3061. strcat( szTempChar, "ARMS_M," );
  3062. }
  3063. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_ARCHER_W )
  3064. {
  3065. strcat( szTempChar, "ARCHER_W," );
  3066. }
  3067. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_SPIRIT_W )
  3068. {
  3069. strcat( szTempChar, "SPIRIT_W," );
  3070. }
  3071. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_EXTREME_M )
  3072. {
  3073. strcat( szTempChar, "EXTREME_M," );
  3074. }
  3075. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_EXTREME_W )
  3076. {
  3077. strcat( szTempChar, "EXTREME_W," );
  3078. }
  3079. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_FIGHTER_W )
  3080. {
  3081. strcat( szTempChar, "FIGHTER_W," );
  3082. }
  3083. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_ARMS_W )
  3084. {
  3085. strcat( szTempChar, "ARMS_W," );
  3086. }
  3087. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_ARCHER_M )
  3088. {
  3089. strcat( szTempChar, "ARCHER_M," );
  3090. }
  3091. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_SPIRIT_M )
  3092. {
  3093. strcat( szTempChar, "SPIRIT_M," );
  3094. }
  3095. //add class
  3096. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_SCIENCE_M )
  3097. {
  3098. strcat( szTempChar, "GUNNER_M," );
  3099. }
  3100. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_SCIENCE_W )
  3101. {
  3102. strcat( szTempChar, "GUNNER_W," );
  3103. }
  3104. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_ASSASIN_M )
  3105. {
  3106. strcat( szTempChar, "ASSASIN_M," );
  3107. }
  3108. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_ASSASIN_W )
  3109. {
  3110. strcat( szTempChar, "ASSASIN_W," );
  3111. }
  3112. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_TESTING_M )
  3113. {
  3114. strcat( szTempChar, "TESTING_M," );
  3115. }
  3116. if( m_WorkEvent.class_Event[i].dwClassIndex&GLCC_TESTING_W )
  3117. {
  3118. strcat( szTempChar, "TESTING_W," );
  3119. }
  3120. }
  3121. szTempChar[strlen(szTempChar)-1] = '\0';
  3122. if( i == 0 )
  3123. strcpy( szTempChar2, "Exp" );
  3124. else if( i == 1 )
  3125. strcpy( szTempChar2, "Item" );
  3126. else if( i == 2 )
  3127. strcpy( szTempChar2, "Money" );
  3128. sprintf( NetMsgFB.szWorkEventInfo, "Event Type : Class %s Event[%s], Event Rate : %.2f, start_LV %d, end_LV %d", szTempChar2, szTempChar,
  3129. m_WorkEvent.class_Event[i].fEventRate, m_WorkEvent.class_Event[i].start_Lv, m_WorkEvent.class_Event[i].end_Lv );
  3130. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3131. }
  3132. if (GLCONST_CHAR::EnableGMLogs )
  3133. {
  3134. std::string strTIME = CDebugSet::GetCurTime ();
  3135. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Check Running Events Created by GM commands",
  3136. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3137. strTIME.clear();
  3138. }
  3139. return TRUE;
  3140. }
  3141. BOOL GLAgentServer::MsgGmEventEx ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3142. {
  3143. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3144. if ( !pMyChar ) return FALSE;
  3145. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3146. GLMSG::SNET_GM_EVENT_EX *pNetMsg = (GLMSG::SNET_GM_EVENT_EX *)nmg;
  3147. //if( pNetMsg->wValue < 1 ) pNetMsg->wValue = 1;
  3148. //else if( pNetMsg->wValue > 200 ) pNetMsg->wValue = 200;
  3149. SENDTOALLCHANNEL ( pNetMsg );
  3150. m_WorkEvent.bWorkEvent[3] = TRUE;
  3151. m_WorkEvent.ex_Event = *pNetMsg;
  3152. if (GLCONST_CHAR::EnableGMLogs )
  3153. {
  3154. if ( pNetMsg->emType == EMGM_EVENT_SPEED)
  3155. {
  3156. if( pNetMsg->wValue < 1 ) pNetMsg->wValue = 1;
  3157. else if( pNetMsg->wValue > GLCONST_CHAR::wMaxEventSpeed ) pNetMsg->wValue = GLCONST_CHAR::wMaxEventSpeed;
  3158. std::string strTIME = CDebugSet::GetCurTime ();
  3159. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Started Movement Speed Event, Rate :%d",
  3160. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->wValue );
  3161. strTIME.clear();
  3162. }
  3163. else if ( pNetMsg->emType == EMGM_EVENT_ASPEED)
  3164. {
  3165. if( pNetMsg->wValue < 1 ) pNetMsg->wValue = 1;
  3166. else if( pNetMsg->wValue > GLCONST_CHAR::wMaxEventAspeed ) pNetMsg->wValue = GLCONST_CHAR::wMaxEventAspeed;
  3167. std::string strTIME = CDebugSet::GetCurTime ();
  3168. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Started Attack Speed Event, Rate :%d",
  3169. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->wValue );
  3170. strTIME.clear();
  3171. }
  3172. else if ( pNetMsg->emType == EMGM_EVENT_ATTACK)
  3173. {
  3174. if( pNetMsg->wValue < 1 ) pNetMsg->wValue = 1;
  3175. else if( pNetMsg->wValue > GLCONST_CHAR::wMaxEventAttack ) pNetMsg->wValue = GLCONST_CHAR::wMaxEventAttack;
  3176. std::string strTIME = CDebugSet::GetCurTime ();
  3177. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Started Attack Damage Event, Rate :%d",
  3178. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->wValue );
  3179. strTIME.clear();
  3180. }
  3181. }
  3182. return TRUE;
  3183. }
  3184. BOOL GLAgentServer::MsgGmEventExEnd ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3185. {
  3186. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3187. if ( !pMyChar ) return FALSE;
  3188. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3189. GLMSG::SNET_GM_EVENT_EX_END *pNetMsg = (GLMSG::SNET_GM_EVENT_EX_END *)nmg;
  3190. SENDTOALLCHANNEL ( nmg );
  3191. m_WorkEvent.bWorkEvent[3] = FALSE;
  3192. if (GLCONST_CHAR::EnableGMLogs )
  3193. {
  3194. if ( pNetMsg->emType == EMGM_EVENT_SPEED)
  3195. {
  3196. std::string strTIME = CDebugSet::GetCurTime ();
  3197. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=END Movement Speed Event",
  3198. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3199. strTIME.clear();
  3200. }
  3201. else if ( pNetMsg->emType == EMGM_EVENT_ASPEED)
  3202. {
  3203. std::string strTIME = CDebugSet::GetCurTime ();
  3204. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=END Attack Speed Event",
  3205. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3206. strTIME.clear();
  3207. }
  3208. else if ( pNetMsg->emType == EMGM_EVENT_ATTACK)
  3209. {
  3210. std::string strTIME = CDebugSet::GetCurTime ();
  3211. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=END Attack Damage Event",
  3212. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3213. strTIME.clear();
  3214. }
  3215. }
  3216. return TRUE;
  3217. }
  3218. BOOL GLAgentServer::MsgGmEventExp( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3219. {
  3220. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3221. if ( !pMyChar ) return FALSE;
  3222. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3223. GLMSG::SNET_GM_EVENT_EXP *pNetMsg = (GLMSG::SNET_GM_EVENT_EXP *)nmg;
  3224. //if( pNetMsg->fSCALE < 1.0f ) pNetMsg->fSCALE = 1.0f;
  3225. //if( pNetMsg->fSCALE > 40.0f ) pNetMsg->fSCALE = 40.0f;
  3226. SENDTOALLCHANNEL ( nmg );
  3227. m_WorkEvent.bWorkEvent[0] = TRUE;
  3228. m_WorkEvent.exp_Event = *pNetMsg;
  3229. if (GLCONST_CHAR::EnableGMLogs )
  3230. {
  3231. std::string strTIME = CDebugSet::GetCurTime ();
  3232. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=EXP Event + %f to EXP RATE",
  3233. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->fSCALE );
  3234. strTIME.clear();
  3235. }
  3236. return TRUE;
  3237. }
  3238. BOOL GLAgentServer::MsgGmEventExpEnd( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3239. {
  3240. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3241. if ( !pMyChar ) return FALSE;
  3242. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3243. SENDTOALLCHANNEL ( nmg );
  3244. m_WorkEvent.bWorkEvent[0] = FALSE;
  3245. if (GLCONST_CHAR::EnableGMLogs )
  3246. {
  3247. std::string strTIME = CDebugSet::GetCurTime ();
  3248. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=EXP Event End",
  3249. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3250. strTIME.clear();
  3251. }
  3252. return TRUE;
  3253. }
  3254. // À̺¥Æ® ½ÃÀÛ!!
  3255. BOOL GLAgentServer::MsgGmLimitEventBegin ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3256. {
  3257. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3258. if ( !pMyChar ) return FALSE;
  3259. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3260. //** Add EventTime
  3261. GLMSG::SNET_GM_LIMIT_EVENT_BEGIN *pNetMsg = (GLMSG::SNET_GM_LIMIT_EVENT_BEGIN *)nmg;
  3262. m_sEventState.bEventStart = TRUE;
  3263. m_sEventState.EventBusterTime = pNetMsg->buster_Time * 60;
  3264. m_sEventState.EventPlayTime = pNetMsg->play_Time * 60;
  3265. m_sEventState.fExpGainRate = pNetMsg->expGain_Rate;
  3266. m_sEventState.fItemGainRate = pNetMsg->itemGain_Rate;
  3267. m_sEventState.MinEventLevel = pNetMsg->start_Lv;
  3268. m_sEventState.MaxEventLevel = pNetMsg->end_Lv;
  3269. m_sEventState.dwEventEndMinute = pNetMsg->dwEventMinute;
  3270. m_sEventState.EventStartTime = CTime::GetCurrentTime();
  3271. //add btg attack
  3272. m_sEventState.fAttackGainRate = pNetMsg->attackGain_Rate;
  3273. CTime crtTime = CTime::GetCurrentTime();
  3274. for ( DWORD i=0; i<m_dwMaxClient; ++i )
  3275. {
  3276. PGLCHARAG pChar = m_PCArray[i];
  3277. if ( pChar )
  3278. {
  3279. pChar->m_sEventTime.loginTime = crtTime.GetTime();
  3280. }
  3281. }
  3282. SENDTOALLCHANNEL ( pNetMsg );
  3283. m_WorkEvent.bWorkEvent[4] = TRUE;
  3284. m_WorkEvent.limit_Event = *pNetMsg;
  3285. if (GLCONST_CHAR::EnableGMLogs )
  3286. {
  3287. std::string strTIME = CDebugSet::GetCurTime ();
  3288. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Started Bonus Time Event From Level: %d ~ %d, Wait Time: %d, Bonus Time: %d ExpGainRate: %f ItemGainRate: %f EventMinute %d AttackGainRate: %f",
  3289. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID, pMyChar->m_szName, pMyChar->m_dwCharID,pNetMsg->start_Lv,pNetMsg->end_Lv,pNetMsg->play_Time,pNetMsg->buster_Time,pNetMsg->expGain_Rate,pNetMsg->itemGain_Rate,pNetMsg->dwEventMinute,pNetMsg->attackGain_Rate );
  3290. strTIME.clear();
  3291. }
  3292. return TRUE;
  3293. }
  3294. // À̺¥Æ® Á¾·á!!
  3295. BOOL GLAgentServer::MsgGmLimitEventEnd ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3296. {
  3297. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3298. if ( !pMyChar ) return FALSE;
  3299. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3300. m_sEventState.bEventStart = false;
  3301. GLMSG::SNET_GM_LIMIT_EVENT_END *pNetMsg = (GLMSG::SNET_GM_LIMIT_EVENT_END *)nmg;
  3302. SENDTOALLCHANNEL ( nmg );
  3303. m_WorkEvent.bWorkEvent[4] = FALSE;
  3304. if (GLCONST_CHAR::EnableGMLogs )
  3305. {
  3306. std::string strTIME = CDebugSet::GetCurTime ();
  3307. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=End Bonus Time Event",
  3308. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3309. strTIME.clear();
  3310. }
  3311. return TRUE;
  3312. }
  3313. BOOL GLAgentServer::MsgGmLimitEventRestart ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3314. {
  3315. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3316. if ( !pMyChar ) return FALSE;
  3317. GLMSG::SNET_GM_LIMIT_EVENT_RESTART *pNetMsg = (GLMSG::SNET_GM_LIMIT_EVENT_RESTART *)nmg;
  3318. pMyChar->m_sEventTime.loginTime = pNetMsg->restartTime;
  3319. return TRUE;
  3320. }
  3321. BOOL GLAgentServer::MsgGmLimitEventTimeReq( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3322. {
  3323. // GLMSG::SNET_GM_LIMIT_EVENT_TIME_REQ *pNetMsg = (GLMSG::SNET_GM_LIMIT_EVENT_TIME_REQ *)nmg;;
  3324. PGLCHARAG pCHAR = GetChar ( dwGaeaID );
  3325. if ( !pCHAR ) return FALSE;
  3326. GLMSG::SNET_GM_LIMIT_EVENT_TIME_REQ_FB NetSendMsg;
  3327. if( m_sEventState.bEventStart == FALSE )
  3328. {
  3329. NetSendMsg.bEventStart = FALSE;
  3330. }else{
  3331. NetSendMsg.bEventStart = TRUE;
  3332. NetSendMsg.buster_Time = m_sEventState.EventBusterTime;
  3333. NetSendMsg.play_Time = m_sEventState.EventPlayTime;
  3334. NetSendMsg.start_Lv = m_sEventState.MinEventLevel;
  3335. NetSendMsg.end_Lv = m_sEventState.MaxEventLevel;
  3336. // ¸¸¾à óÀ½ °ÔÀÓÀ» ½ÃÀÛÇÑ´Ù¸é ·Î±×ÀÎ ½Ã°£À» RESETÇÑ´Ù.
  3337. if( pCHAR->m_bReciveEventTime == FALSE )
  3338. {
  3339. CTime crtTime = CTime::GetCurrentTime();
  3340. pCHAR->m_sEventTime.loginTime = crtTime.GetTime();
  3341. NetSendMsg.loginTime = pCHAR->m_sEventTime.loginTime;
  3342. GLMSG::SNET_GM_LIMIT_EVENT_TIME_RESET NetResetMsg;
  3343. NetResetMsg.dwGaeaID = pCHAR->m_dwGaeaID;
  3344. NetResetMsg.loginTime = crtTime.GetTime();
  3345. SENDTOFIELD ( pCHAR->m_dwClientID, &NetResetMsg );
  3346. pCHAR->m_bReciveEventTime = TRUE;
  3347. }else{
  3348. NetSendMsg.loginTime = pCHAR->m_sEventTime.loginTime;
  3349. }
  3350. }
  3351. SENDTOCLIENT ( pCHAR->m_dwClientID, &NetSendMsg );
  3352. return TRUE;
  3353. }
  3354. BOOL GLAgentServer::MsgCyberCafeClassUpdate( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3355. {
  3356. PGLCHARAG pCHAR = GetChar ( dwGaeaID );
  3357. if ( !pCHAR ) return FALSE;
  3358. GLMSG::SNET_CYBERCAFECLASS_UPDATE *pNetMsg = (GLMSG::SNET_CYBERCAFECLASS_UPDATE *)nmg;
  3359. pCHAR->m_dwThaiCCafeClass = pNetMsg->dwCyberCafeClass;
  3360. pCHAR->m_nMyCCafeClass = pNetMsg->dwCyberCafeClass;
  3361. SENDTOFIELD ( pCHAR->m_dwClientID, pNetMsg );
  3362. SENDTOCLIENT ( pCHAR->m_dwClientID, pNetMsg );
  3363. return TRUE;
  3364. }
  3365. BOOL GLAgentServer::MsgGmEventItemGen ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3366. {
  3367. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3368. if ( !pMyChar ) return FALSE;
  3369. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3370. GLMSG::SNET_GM_EVEN_ITEM_GEN *pNetMsg = (GLMSG::SNET_GM_EVEN_ITEM_GEN *)nmg;
  3371. //if ( pNetMsg->fRATE > 50.0f ) pNetMsg->fRATE = 50.0f;
  3372. SENDTOALLCHANNEL ( pNetMsg );
  3373. m_WorkEvent.bWorkEvent[1] = TRUE;
  3374. m_WorkEvent.item_Event = *pNetMsg;
  3375. if (GLCONST_CHAR::EnableGMLogs )
  3376. {
  3377. std::string strTIME = CDebugSet::GetCurTime ();
  3378. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=ITEM DROP RATE Event, + %f to ITEMDROP RATE",
  3379. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->fRATE );
  3380. strTIME.clear();
  3381. }
  3382. return TRUE;
  3383. }
  3384. BOOL GLAgentServer::MsgGmEventItemGenEnd ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3385. {
  3386. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3387. if ( !pMyChar ) return FALSE;
  3388. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3389. SENDTOALLCHANNEL ( nmg );
  3390. m_WorkEvent.bWorkEvent[1] = FALSE;
  3391. if (GLCONST_CHAR::EnableGMLogs )
  3392. {
  3393. std::string strTIME = CDebugSet::GetCurTime ();
  3394. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=ITEM DROP RATE Event ENDED",
  3395. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3396. strTIME.clear();
  3397. }
  3398. return TRUE;
  3399. }
  3400. BOOL GLAgentServer::MsgGmEventClassEvent ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3401. {
  3402. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3403. if ( !pMyChar ) return FALSE;
  3404. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3405. GLMSG::SNET_GM_CLASS_EVENT *pNetMsg = (GLMSG::SNET_GM_CLASS_EVENT *)nmg;
  3406. if ( pNetMsg->fEventRate > 50.0f ) pNetMsg->fEventRate = 50.0f;
  3407. SENDTOALLCHANNEL ( pNetMsg );
  3408. m_WorkEvent.bWorkEvent[5+pNetMsg->dwEventType] = pNetMsg->bStart;
  3409. m_WorkEvent.class_Event[pNetMsg->dwEventType] = *pNetMsg;
  3410. return TRUE;
  3411. }
  3412. BOOL GLAgentServer::MsgGmEventMoneyGen ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3413. {
  3414. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3415. if ( !pMyChar ) return FALSE;
  3416. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3417. GLMSG::SNET_GM_EVEN_MONEY_GEN *pNetMsg = (GLMSG::SNET_GM_EVEN_MONEY_GEN *)nmg;
  3418. //if ( pNetMsg->fRATE > 50.0f ) pNetMsg->fRATE = 50.0f;
  3419. SENDTOALLCHANNEL ( pNetMsg );
  3420. m_WorkEvent.bWorkEvent[2] = TRUE;
  3421. m_WorkEvent.money_Event = *pNetMsg;
  3422. if (GLCONST_CHAR::EnableGMLogs )
  3423. {
  3424. std::string strTIME = CDebugSet::GetCurTime ();
  3425. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=MONEY DROP RATE Event + %f to MONEYDROP RATE",
  3426. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->fRATE );
  3427. strTIME.clear();
  3428. }
  3429. return TRUE;
  3430. }
  3431. BOOL GLAgentServer::MsgGmEventMoneyGenEnd ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3432. {
  3433. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3434. if ( !pMyChar ) return FALSE;
  3435. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3436. SENDTOALLCHANNEL ( nmg );
  3437. m_WorkEvent.bWorkEvent[2] = FALSE;
  3438. if (GLCONST_CHAR::EnableGMLogs )
  3439. {
  3440. std::string strTIME = CDebugSet::GetCurTime ();
  3441. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=MONEY DROP RATE Event ENDED",
  3442. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3443. strTIME.clear();
  3444. }
  3445. return TRUE;
  3446. }
  3447. BOOL GLAgentServer::MsgGmBigHead ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3448. {
  3449. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3450. if ( !pMyChar ) return FALSE;
  3451. if ( pMyChar->m_dwUserLvl < USER_GM2 ) return FALSE;
  3452. GLMSG::SNET_GM_BIGHEAD* pNetMsg = (GLMSG::SNET_GM_BIGHEAD*) nmg;
  3453. // Note : ¸ðµç ÇÊµå ¼­¹ö¿¡ ¼Û½Å.
  3454. //
  3455. SENDTOALLCHANNEL ( nmg );
  3456. // Note : ¸ðµç Ŭ¶óÀ̾ðÆ®¿¡ ¼Û½Å.
  3457. //
  3458. GLMSG::SNET_GM_BIGHEAD_BRD NetMsgBrd;
  3459. NetMsgBrd.bBIGHEAD = pNetMsg->bBIGHEAD;
  3460. SENDTOALLCLIENT ( &NetMsgBrd );
  3461. if (GLCONST_CHAR::EnableGMLogs )
  3462. {
  3463. if (pNetMsg->bBIGHEAD)
  3464. {
  3465. std::string strTIME = CDebugSet::GetCurTime ();
  3466. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Enable BIG HEAD",
  3467. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3468. strTIME.clear();
  3469. }
  3470. else
  3471. {
  3472. std::string strTIME = CDebugSet::GetCurTime ();
  3473. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Disable BIG HEAD",
  3474. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3475. strTIME.clear();
  3476. }
  3477. }
  3478. return TRUE;
  3479. }
  3480. BOOL GLAgentServer::MsgGmBigHand ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3481. {
  3482. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3483. if ( !pMyChar ) return FALSE;
  3484. if ( pMyChar->m_dwUserLvl < USER_GM2 ) return FALSE;
  3485. GLMSG::SNET_GM_BIGHAND* pNetMsg = (GLMSG::SNET_GM_BIGHAND*) nmg;
  3486. // Note : ¸ðµç ÇÊµå ¼­¹ö¿¡ ¼Û½Å.
  3487. //
  3488. SENDTOALLCHANNEL ( nmg );
  3489. // Note : ¸ðµç Ŭ¶óÀ̾ðÆ®¿¡ ¼Û½Å.
  3490. //
  3491. GLMSG::SNET_GM_BIGHAND_BRD NetMsgBrd;
  3492. NetMsgBrd.bBIGHAND = pNetMsg->bBIGHAND;
  3493. SENDTOALLCLIENT ( &NetMsgBrd );
  3494. if (GLCONST_CHAR::EnableGMLogs )
  3495. {
  3496. if (pNetMsg->bBIGHAND)
  3497. {
  3498. std::string strTIME = CDebugSet::GetCurTime ();
  3499. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Enable BIG HAND",
  3500. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3501. strTIME.clear();
  3502. }
  3503. else
  3504. {
  3505. std::string strTIME = CDebugSet::GetCurTime ();
  3506. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Disable BIG HAND",
  3507. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3508. strTIME.clear();
  3509. }
  3510. }
  3511. return TRUE;
  3512. }
  3513. BOOL GLAgentServer::MsgGmFreePK ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3514. {
  3515. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3516. if ( !pMyChar ) return FALSE;
  3517. if ( pMyChar->m_dwUserLvl < USER_GM2 ) return FALSE;
  3518. GLMSG::SNET_GM_FREEPK* pNetMsg = ( GLMSG::SNET_GM_FREEPK*) nmg;
  3519. m_cFreePK.StartFREEPKMODE ( pNetMsg->dwPKTIME );
  3520. SENDTOALLCHANNEL ( nmg );
  3521. GLMSG::SNET_GM_FREEPK_BRD NetMsgBrd;
  3522. NetMsgBrd.dwPKTIME = pNetMsg->dwPKTIME;
  3523. SENDTOALLCLIENT ( &NetMsgBrd );
  3524. if (GLCONST_CHAR::EnableGMLogs )
  3525. {
  3526. if (pNetMsg->dwPKTIME !=0)
  3527. {
  3528. std::string strTIME = CDebugSet::GetCurTime ();
  3529. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Enable Free PK to Everyone in %d Seconds Duration",
  3530. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->dwPKTIME );
  3531. strTIME.clear();
  3532. }
  3533. else
  3534. {
  3535. std::string strTIME = CDebugSet::GetCurTime ();
  3536. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Disable Free PK",
  3537. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3538. strTIME.clear();
  3539. }
  3540. }
  3541. return TRUE;
  3542. }
  3543. BOOL GLAgentServer::MsgGmViewAllPlayer ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3544. {
  3545. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3546. if ( !pMyChar ) return FALSE;
  3547. if ( pMyChar->m_dwUserLvl < USER_GM3 ) return FALSE;
  3548. GLMSG::SNET_GM_VIEWALLPLAYER_FLD_REQ NetMsgFld;
  3549. NetMsgFld.dwID = dwGaeaID;
  3550. // Çʵ弭¹ö¿¡ ¿äû
  3551. SENDTOFIELD ( pMyChar->m_dwClientID, &NetMsgFld );
  3552. if (GLCONST_CHAR::EnableGMLogs )
  3553. {
  3554. std::string strTIME = CDebugSet::GetCurTime ();
  3555. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=View all Player Names IN MAP",
  3556. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3557. strTIME.clear();
  3558. }
  3559. return TRUE;
  3560. }
  3561. // *****************************************************
  3562. // Desc: ÁöÁ¤µÈ Äɸ¯Å͸¦ Àڱ⠿·À¸·Î ¼Òȯ
  3563. // *****************************************************
  3564. BOOL GLAgentServer::MsgGmGenChar ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3565. {
  3566. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3567. if ( !pMyChar ) return FALSE;
  3568. if ( pMyChar->m_dwUserLvl < USER_GM3 ) return FALSE;
  3569. GLMSG::SNETPC_GM_GENCHAR* pNetMsg = (GLMSG::SNETPC_GM_GENCHAR*) nmg;
  3570. GLMSG::SNETPC_GM_GENCHAR_FB NetMsgFB;
  3571. PGLCHARAG pGenCHAR;
  3572. if ( pNetMsg->dwCHARID != 0 )
  3573. {
  3574. pGenCHAR = GetCharID ( pNetMsg->dwCHARID );
  3575. }
  3576. else
  3577. {
  3578. pGenCHAR = GetChar ( pNetMsg->szNAME );
  3579. }
  3580. if ( !pGenCHAR )
  3581. {
  3582. NetMsgFB.emFB = EMGM_MOVE2CHAR_FB_FAIL;
  3583. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3584. return FALSE;
  3585. }
  3586. if ( pGenCHAR->m_dwCurFieldSvr==FIELDSERVER_MAX )
  3587. {
  3588. NetMsgFB.emFB = EMGM_MOVE2CHAR_FB_TO_CONDITION;
  3589. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3590. return FALSE;
  3591. }
  3592. if ( pGenCHAR->m_nChannel!=pMyChar->m_nChannel )
  3593. {
  3594. NetMsgFB.emFB = EMGM_MOVE2CHAR_FB_CHANNEL;
  3595. NetMsgFB.nChannel = pGenCHAR->m_nChannel;
  3596. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3597. return FALSE;
  3598. }
  3599. // GMÀÇ À§Ä¡¸¦ È®ÀÎÇÑ´Ù.
  3600. GLMSG::SNETPC_GM_MOVE2CHAR_POS NetMsgCK;
  3601. NetMsgCK.dwCOMMAND_CHARID = pGenCHAR->m_dwCharID;
  3602. NetMsgCK.dwTO_CHARID = pMyChar->m_dwCharID;
  3603. SENDTOFIELDSVR ( pMyChar->m_nChannel, pMyChar->m_dwCurFieldSvr, &NetMsgCK );
  3604. NetMsgFB.emFB = EMGM_MOVE2CHAR_FB_OK;
  3605. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3606. if (GLCONST_CHAR::EnableGMLogs )
  3607. {
  3608. std::string strTIME = CDebugSet::GetCurTime ();
  3609. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=(Pull)Call Character userid= %s (%d), charid= %s (%d)",
  3610. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pGenCHAR->m_szUserName,pGenCHAR->m_dwUserID,pGenCHAR->m_szName,pGenCHAR->m_dwCharID);
  3611. strTIME.clear();
  3612. }
  3613. return TRUE;
  3614. }
  3615. BOOL GLAgentServer::MsgGmPrintCrowList ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3616. {
  3617. PGLCHARAG pCHAR = GetChar ( dwGaeaID );
  3618. if ( !pCHAR ) return FALSE;
  3619. if ( pCHAR->m_dwUserLvl < USER_GM3 ) return FALSE;
  3620. GLMSG::SNET_GM_PRINT_CROWLIST* pNetMsg = (GLMSG::SNET_GM_PRINT_CROWLIST*) nmg;
  3621. GLMSG::SNET_GM_PRINT_CROWLIST_FLD NetMsgFld;
  3622. NetMsgFld.dwFindMob = pNetMsg->dwFindMob;
  3623. NetMsgFld.dwGaeaID = dwGaeaID;
  3624. SENDTOALLCHANNEL ( &NetMsgFld );
  3625. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3626. if ( GLCONST_CHAR::EnableGMLogs )
  3627. {
  3628. CString strFindMob;
  3629. if ( pNetMsg->dwFindMob == 1 )
  3630. {
  3631. strFindMob.Format ("MOB");
  3632. }
  3633. else if ( pNetMsg->dwFindMob == 2 )
  3634. {
  3635. strFindMob.Format ("NPC");
  3636. }
  3637. else
  3638. {
  3639. strFindMob.Format ("UnKnown");
  3640. }
  3641. std::string strTIME = CDebugSet::GetCurTime ();
  3642. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Retrieve List of %s",
  3643. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,strFindMob.GetString());
  3644. strFindMob.Empty();
  3645. strTIME.clear();
  3646. }
  3647. return TRUE;
  3648. }
  3649. BOOL GLAgentServer::MsgGmGenMob ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3650. {
  3651. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3652. if ( !pMyChar ) return FALSE;
  3653. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3654. GLMSG::SNET_GM_MOB_GEN* pNetMsg = (GLMSG::SNET_GM_MOB_GEN*) nmg;
  3655. GLMSG::SNET_GM_MOB_GEN_FLD NetMsgFld;
  3656. NetMsgFld.dwGaeaID = dwGaeaID;
  3657. NetMsgFld.wMainID = pNetMsg->wMainID;
  3658. NetMsgFld.wSubID = pNetMsg->wSubID;
  3659. NetMsgFld.wPosX = pNetMsg->wPosX;
  3660. NetMsgFld.wPosY = pNetMsg->wPosY;
  3661. SENDTOALLCHANNEL ( &NetMsgFld );
  3662. if (GLCONST_CHAR::EnableGMLogs )
  3663. {
  3664. std::string strTIME = CDebugSet::GetCurTime ();
  3665. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Summon Single CROW MOB [MID:%d SID:%d] Coordinates [X:%d Y:%d]",
  3666. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->wMainID,pNetMsg->wSubID,pNetMsg->wPosX,pNetMsg->wPosY );
  3667. strTIME.clear();
  3668. }
  3669. return TRUE;
  3670. }
  3671. BOOL GLAgentServer::MsgGmGenMobEx ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3672. {
  3673. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3674. if ( !pMyChar ) return FALSE;
  3675. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3676. GLMSG::SNET_GM_MOB_GEN_EX* pNetMsg = (GLMSG::SNET_GM_MOB_GEN_EX*) nmg;
  3677. SNATIVEID sMapID(pNetMsg->wMapMID,pNetMsg->wMapSID);
  3678. GLMapList::FIELDMAP MapsList = m_sMapList.GetMapList ();
  3679. GLMapList::FIELDMAP_ITER iter = MapsList.find ( sMapID.dwID );
  3680. if ( iter==MapsList.end() ) return FALSE;
  3681. GLMSG::SNET_GM_MOB_GEN_EX_FLD NetMsgFld;
  3682. NetMsgFld.wMobMID = pNetMsg->wMobMID;
  3683. NetMsgFld.wMobSID = pNetMsg->wMobSID;
  3684. NetMsgFld.wMapMID = pNetMsg->wMapMID;
  3685. NetMsgFld.wMapSID = pNetMsg->wMapSID;
  3686. NetMsgFld.wPosX = pNetMsg->wPosX;
  3687. NetMsgFld.wPosY = pNetMsg->wPosY;
  3688. NetMsgFld.wRange = pNetMsg->wRange;
  3689. NetMsgFld.wNum = pNetMsg->wNum;
  3690. NetMsgFld.dwGaeaID = dwGaeaID;
  3691. if ( pNetMsg->bThisChannel ) SENDTOCHANNEL ( &NetMsgFld, pMyChar->m_nChannel );
  3692. else SENDTOALLCHANNEL ( &NetMsgFld );
  3693. if (GLCONST_CHAR::EnableGMLogs )
  3694. {
  3695. std::string strTIME = CDebugSet::GetCurTime ();
  3696. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Summon Multiple CROW MOB [MID:%d SID:%d] in MAP [MID:%d SID:%d] Coordinates [X:%d Y:%d] , Range Of %d , Mob Count:%d",
  3697. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->wMobMID,pNetMsg->wMobSID,pNetMsg->wMapMID,pNetMsg->wMapSID,pNetMsg->wPosX,pNetMsg->wPosY,pNetMsg->wRange,pNetMsg->wNum );
  3698. strTIME.clear();
  3699. }
  3700. return TRUE;
  3701. }
  3702. BOOL GLAgentServer::MsgGmDelMobEx ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3703. {
  3704. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3705. if ( !pMyChar ) return FALSE;
  3706. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3707. GLMSG::SNET_GM_MOB_DEL_EX* pNetMsg = (GLMSG::SNET_GM_MOB_DEL_EX*) nmg;
  3708. SNATIVEID sMapID(pNetMsg->wMapMID,pNetMsg->wMapSID);
  3709. GLMapList::FIELDMAP MapsList = m_sMapList.GetMapList ();
  3710. GLMapList::FIELDMAP_ITER iter = MapsList.find ( sMapID.dwID );
  3711. if ( iter==MapsList.end() ) return FALSE;
  3712. GLMSG::SNET_GM_MOB_DEL_EX_FLD NetMsgFld;
  3713. NetMsgFld.wMobMID = pNetMsg->wMobMID;
  3714. NetMsgFld.wMobSID = pNetMsg->wMobSID;
  3715. NetMsgFld.wMapMID = pNetMsg->wMapMID;
  3716. NetMsgFld.wMapSID = pNetMsg->wMapSID;
  3717. if ( pNetMsg->bThisChannel ) SENDTOCHANNEL ( &NetMsgFld, pMyChar->m_nChannel );
  3718. else SENDTOALLCHANNEL ( &NetMsgFld );
  3719. if (GLCONST_CHAR::EnableGMLogs )
  3720. {
  3721. std::string strTIME = CDebugSet::GetCurTime ();
  3722. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Delete Multiple CROW MOB [MID:%d SID:%d] in MAP [MID:%d SID:%d]",
  3723. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->wMobMID,pNetMsg->wMobSID,pNetMsg->wMapMID,pNetMsg->wMapSID );
  3724. strTIME.clear();
  3725. }
  3726. return TRUE;
  3727. }
  3728. BOOL GLAgentServer::MsgGmDelMob( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3729. {
  3730. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3731. if ( !pMyChar ) return FALSE;
  3732. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  3733. GLMSG::SNET_GM_MOB_DEL* pNetMsg = (GLMSG::SNET_GM_MOB_DEL*) nmg;
  3734. GLMSG::SNET_GM_MOB_DEL_FLD NetMsgFld;
  3735. NetMsgFld.dwGaeaID = dwGaeaID;
  3736. NetMsgFld.sMobID = pNetMsg->sMobID;
  3737. NetMsgFld.bMaterial = pNetMsg->bMaterial;
  3738. SENDTOALLCHANNEL ( &NetMsgFld );
  3739. if (GLCONST_CHAR::EnableGMLogs )
  3740. {
  3741. std::string strTIME = CDebugSet::GetCurTime ();
  3742. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Delete Single CROW MOB [MID:%d SID:%d]",
  3743. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->sMobID.wMainID,pNetMsg->sMobID.wSubID);
  3744. strTIME.clear();
  3745. }
  3746. return TRUE;
  3747. }
  3748. BOOL GLAgentServer::MsgGmMobLevel ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3749. {
  3750. PGLCHARAG pCHAR = GetChar ( dwGaeaID );
  3751. if ( !pCHAR ) return FALSE;
  3752. if ( pCHAR->m_dwUserLvl < USER_GM1 ) return FALSE;
  3753. SENDTOALLCHANNEL ( nmg );
  3754. if (GLCONST_CHAR::EnableGMLogs )
  3755. {
  3756. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3757. std::string strTIME = CDebugSet::GetCurTime ();
  3758. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), Call Level File",
  3759. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3760. strTIME.clear();
  3761. }
  3762. return TRUE;
  3763. }
  3764. BOOL GLAgentServer::MsgGmMobLevelClear ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3765. {
  3766. PGLCHARAG pCHAR = GetChar ( dwGaeaID );
  3767. if ( !pCHAR ) return FALSE;
  3768. if ( pCHAR->m_dwUserLvl < USER_GM1 ) return FALSE;
  3769. SENDTOALLCHANNEL ( nmg );
  3770. if (GLCONST_CHAR::EnableGMLogs )
  3771. {
  3772. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3773. std::string strTIME = CDebugSet::GetCurTime ();
  3774. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), Unload Level File",
  3775. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  3776. strTIME.clear();
  3777. }
  3778. return TRUE;
  3779. }
  3780. BOOL GLAgentServer::MsgGmWhereNPC ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3781. {
  3782. PGLCHARAG pCHAR = GetChar ( dwGaeaID );
  3783. if ( !pCHAR ) return FALSE;
  3784. if ( pCHAR->m_dwUserLvl < USER_GM3 ) return FALSE;
  3785. GLMSG::SNET_GM_WHERE_NPC* pNetMsg = (GLMSG::SNET_GM_WHERE_NPC*) nmg;
  3786. GLMSG::SNET_GM_WHERE_NPC_FLD NetMsgFld;
  3787. NetMsgFld.nidNPC = pNetMsg->nidNPC;
  3788. NetMsgFld.dwGaeaID = dwGaeaID;
  3789. SENDTOALLCHANNEL ( &NetMsgFld );
  3790. if (GLCONST_CHAR::EnableGMLogs )
  3791. {
  3792. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3793. std::string strTIME = CDebugSet::GetCurTime ();
  3794. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), Search Crow Position MID:%d SID:%d",
  3795. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pNetMsg->nidNPC.wMainID,pNetMsg->nidNPC.wSubID );
  3796. strTIME.clear();
  3797. }
  3798. return TRUE;
  3799. }
  3800. // *****************************************************
  3801. // Desc: Ä£±¸À§Ä¡ È®ÀÎÈÄ Çʵ弭¹ö¿¡ À̵¿ ¿äû (field->Agent)
  3802. // *****************************************************
  3803. BOOL GLAgentServer::Msg2FriendAG ( NET_MSG_GENERIC* nmg )
  3804. {
  3805. GLMSG::SNETPC_2_FRIEND_AG *pNetMsg = (GLMSG::SNETPC_2_FRIEND_AG *) nmg;
  3806. GLMSG::SNETPC_2_FRIEND_FB NetMsgFB;
  3807. PGLCHARAG pCHAR = GetCharID ( pNetMsg->dwCOMMAND_CHARID );
  3808. if ( !pCHAR ) return FALSE;
  3809. if ( pNetMsg->emFB==EM2FRIEND_FB_OK )
  3810. {
  3811. GLMSG::SNETPC_2_FRIEND_FLD NetMsgFld;
  3812. NetMsgFld.sFriendMapID = pNetMsg->sFriendMapID;
  3813. NetMsgFld.vFriendPos = pNetMsg->vFriendPos;
  3814. NetMsgFld.wItemPosX = pNetMsg->wItemPosX;
  3815. NetMsgFld.wItemPosY = pNetMsg->wItemPosY;
  3816. SENDTOFIELD ( pCHAR->m_dwClientID, &NetMsgFld );
  3817. }
  3818. else
  3819. {
  3820. // Note : Ä£±¸¿¡°Ô À̵¿ ½ÇÆÐ ¹Ýȯ.
  3821. NetMsgFB.emFB = pNetMsg->emFB;
  3822. SENDTOCLIENT ( pCHAR->m_dwClientID, &NetMsgFB );
  3823. }
  3824. return TRUE;
  3825. }
  3826. // *****************************************************
  3827. // Desc: Ä£±¸À̵¿ ¿äû ó¸®
  3828. // *****************************************************
  3829. BOOL GLAgentServer::Msg2FriendReq ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3830. {
  3831. GLMSG::SNETPC_2_FRIEND_REQ* pNetMsg = (GLMSG::SNETPC_2_FRIEND_REQ*) nmg;
  3832. GLMSG::SNETPC_2_FRIEND_FB NetMsgFB;
  3833. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3834. if ( !pMyChar ) return FALSE;
  3835. GLCHARAG_DATA::MAPFRIEND_ITER pos = pMyChar->m_mapFriend.find ( pNetMsg->szFRIEND_NAME );
  3836. if ( pos==pMyChar->m_mapFriend.end() )
  3837. {
  3838. NetMsgFB.emFB = EM2FRIEND_FB_FAIL;
  3839. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3840. return FALSE;
  3841. }
  3842. // SFRIEND * pFRIEND = (*pos).second;
  3843. // if( !pFRIEND ) return FALSE;
  3844. SFRIEND &sFRIEND = (*pos).second;
  3845. if ( !sFRIEND.bONLINE )
  3846. // if ( !pFRIEND->bONLINE )
  3847. {
  3848. NetMsgFB.emFB = EM2FRIEND_FB_FRIEND_CONDITION;
  3849. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3850. return FALSE;
  3851. }
  3852. // PGLCHARAG pCHAR_FRIEND = GetCharID ( pFRIEND->nCharID );
  3853. PGLCHARAG pCHAR_FRIEND = GetCharID ( sFRIEND.nCharID );
  3854. if ( !pCHAR_FRIEND )
  3855. {
  3856. NetMsgFB.emFB = EM2FRIEND_FB_FRIEND_CONDITION;
  3857. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3858. return FALSE;
  3859. }
  3860. // Memo : »ó´ë°¡ ³ª¸¦ »èÁ¦Ç߰ųª Â÷´ÜÇÑ »óÅÂÀ̸é À̵¿ÀÌ Ãë¼ÒµÈ´Ù.
  3861. //
  3862. pos = pCHAR_FRIEND->m_mapFriend.find( pMyChar->m_szName );
  3863. if ( pos==pCHAR_FRIEND->m_mapFriend.end() )
  3864. {
  3865. NetMsgFB.emFB = EM2FRIEND_FB_FAIL;
  3866. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3867. return FALSE;
  3868. }
  3869. SFRIEND &sFRIEND2 = (*pos).second;
  3870. // if( !pMe ) return FALSE;
  3871. if( sFRIEND2.IsBLOCK() )
  3872. {
  3873. NetMsgFB.emFB = EM2FRIEND_FB_FRIEND_BLOCK;
  3874. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3875. return FALSE;
  3876. }
  3877. if( sFRIEND2.IsOFF() )
  3878. {
  3879. NetMsgFB.emFB = EM2FRIEND_FB_FRIEND_OFF;
  3880. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3881. return FALSE;
  3882. }
  3883. if ( pCHAR_FRIEND->m_dwCurFieldSvr==FIELDSERVER_MAX )
  3884. {
  3885. NetMsgFB.emFB = EM2FRIEND_FB_FRIEND_CONDITION;
  3886. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3887. return FALSE;
  3888. }
  3889. if ( pCHAR_FRIEND->m_nChannel!=pMyChar->m_nChannel )
  3890. {
  3891. NetMsgFB.emFB = EM2FRIEND_FB_FRIEND_CHANNEL;
  3892. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3893. return FALSE;
  3894. }
  3895. // Note : Ä£±¸ÀÇ À§Ä¡ Á¡°Ë ¿äû.
  3896. GLMSG::SNETPC_2_FRIEND_CK NetMsgCK;
  3897. NetMsgCK.dwCOMMAND_CHARID = pMyChar->m_dwCharID;
  3898. NetMsgCK.dwFRIEND_CHARID = pCHAR_FRIEND->m_dwCharID;
  3899. NetMsgCK.wItemPosX = pNetMsg->wItemPosX;
  3900. NetMsgCK.wItemPosY = pNetMsg->wItemPosY;
  3901. SENDTOFIELDSVR ( pCHAR_FRIEND->m_nChannel, pCHAR_FRIEND->m_dwCurFieldSvr, &NetMsgCK );
  3902. return TRUE;
  3903. }
  3904. // *****************************************************
  3905. // Desc: ÁöÁ¤ÇÑ Ä³¸¯ÅÍÀÇ ±Ó¼Ó¸»À» ¿³µè´Â´Ù.
  3906. // *****************************************************
  3907. BOOL GLAgentServer::MsgGetWhisperMsg( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3908. {
  3909. GLMSG::SNETPC_GM_GETWHISPERMSG* pNetMsg = (GLMSG::SNETPC_GM_GETWHISPERMSG*) nmg;
  3910. PGLCHARAG pMyChar = GetChar( dwGaeaID );
  3911. if( !pMyChar ) return FALSE;
  3912. if( pMyChar->m_dwUserLvl < USER_GM1 )
  3913. {
  3914. return FALSE;
  3915. }
  3916. if( strlen( pNetMsg->szNAME ) != 0 )
  3917. {
  3918. PGLCHARAG pTo_CHAR;
  3919. pTo_CHAR = GetChar( pNetMsg->szNAME );
  3920. if( pTo_CHAR )
  3921. {
  3922. UINT i;
  3923. bool bAdd = TRUE;
  3924. for( i = 0; i < pTo_CHAR->m_vecGetWhisperList.size(); i++ )
  3925. {
  3926. if( dwClientID == pTo_CHAR->m_vecGetWhisperList[i].dwClientID &&
  3927. dwGaeaID == pTo_CHAR->m_vecGetWhisperList[i].dwGaeaID )
  3928. {
  3929. bAdd = FALSE; break;
  3930. }
  3931. }
  3932. if( bAdd )
  3933. {
  3934. SGETWHISPERLIST WhisperList;
  3935. WhisperList.dwClientID = dwClientID;
  3936. WhisperList.dwGaeaID = dwGaeaID;
  3937. pTo_CHAR->m_vecGetWhisperList.push_back( WhisperList );
  3938. pMyChar->m_GmWhisperList.dwGaeaID = pTo_CHAR->m_dwGaeaID;
  3939. pMyChar->m_GmWhisperList.dwClientID = pTo_CHAR->m_dwClientID;
  3940. pMyChar->m_bViewWhisperMSG = TRUE;
  3941. }
  3942. }
  3943. /*if (GLCONST_CHAR::EnableGMLogs ) // cause crash
  3944. {
  3945. std::string strTIME = CDebugSet::GetCurTime ();
  3946. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=(SPY)Reading Messages from: userid= %s (%d), charid= %s (%d)",
  3947. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID, pMyChar->m_szName, pMyChar->m_dwCharID,pTo_CHAR->m_szUserName,pTo_CHAR->m_dwUserID, pTo_CHAR->m_szName, pTo_CHAR->m_dwCharID);
  3948. }*/
  3949. }
  3950. else
  3951. {
  3952. pMyChar->m_bViewWhisperMSG = FALSE;
  3953. }
  3954. //fix crash
  3955. if (GLCONST_CHAR::EnableGMLogs )
  3956. {
  3957. std::string strTIME = CDebugSet::GetCurTime ();
  3958. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=(SPY)Reading Messages from: Character Name= %s",
  3959. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID, pMyChar->m_szName, pMyChar->m_dwCharID,pNetMsg->szNAME);
  3960. strTIME.clear();
  3961. }
  3962. return TRUE;
  3963. }
  3964. // *****************************************************
  3965. // Desc: ÁöÁ¤µÈ Äɸ¯ÅÍ À§Ä¡·Î À̵¿
  3966. // *****************************************************
  3967. BOOL GLAgentServer::MsgMove2Char ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  3968. {
  3969. GLMSG::SNETPC_GM_MOVE2CHAR* pNetMsg = (GLMSG::SNETPC_GM_MOVE2CHAR*) nmg;
  3970. GLMSG::SNETPC_GM_MOVE2CHAR_FB NetMsgFB;
  3971. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  3972. if ( !pMyChar ) return FALSE;
  3973. if ( pMyChar->m_dwUserLvl < USER_GM3 )
  3974. {
  3975. NetMsgFB.emFB = EMGM_MOVE2CHAR_FB_FAIL;
  3976. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3977. return FALSE;
  3978. }
  3979. PGLCHARAG pTO_CHAR;;
  3980. if ( pNetMsg->dwCHARID != 0 )
  3981. {
  3982. pTO_CHAR = GetCharID ( pNetMsg->dwCHARID );
  3983. }
  3984. else
  3985. {
  3986. pTO_CHAR = GetChar ( pNetMsg->szNAME );
  3987. }
  3988. if ( !pTO_CHAR )
  3989. {
  3990. NetMsgFB.emFB = EMGM_MOVE2CHAR_FB_FAIL;
  3991. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3992. return FALSE;
  3993. }
  3994. if ( pTO_CHAR->m_dwCurFieldSvr==FIELDSERVER_MAX )
  3995. {
  3996. NetMsgFB.emFB = EMGM_MOVE2CHAR_FB_TO_CONDITION;
  3997. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  3998. return FALSE;
  3999. }
  4000. if ( pTO_CHAR->m_nChannel!=pMyChar->m_nChannel )
  4001. {
  4002. NetMsgFB.emFB = EMGM_MOVE2CHAR_FB_CHANNEL;
  4003. NetMsgFB.nChannel = pTO_CHAR->m_nChannel;
  4004. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4005. return FALSE;
  4006. }
  4007. // Note : Ä£±¸ÀÇ À§Ä¡ Á¡°Ë ¿äû.
  4008. GLMSG::SNETPC_GM_MOVE2CHAR_POS NetMsgCK;
  4009. NetMsgCK.dwCOMMAND_CHARID = pMyChar->m_dwCharID;
  4010. NetMsgCK.dwTO_CHARID = pTO_CHAR->m_dwCharID;
  4011. SENDTOFIELDSVR ( pTO_CHAR->m_nChannel, pTO_CHAR->m_dwCurFieldSvr, &NetMsgCK );
  4012. if (GLCONST_CHAR::EnableGMLogs )
  4013. {
  4014. std::string strTIME = CDebugSet::GetCurTime ();
  4015. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Move to Character userid= %s (%d), charid= %s (%d)",
  4016. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pTO_CHAR->m_szUserName,pTO_CHAR->m_dwUserID,pTO_CHAR->m_szName,pTO_CHAR->m_dwCharID);
  4017. strTIME.clear();
  4018. }
  4019. return TRUE;
  4020. }
  4021. // *****************************************************
  4022. // Desc: À¯Àú äÆà ºí·° ó¸® (User Account)
  4023. // *****************************************************
  4024. BOOL GLAgentServer::MsgGmChatBlockUA ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  4025. {
  4026. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  4027. if ( !pMyChar ) return FALSE;
  4028. if ( pMyChar->m_dwUserLvl < USER_GM3 ) return FALSE;
  4029. GLMSG::SNET_GM_CHAT_BLOCK_UACCOUNT *pNetMsg = (GLMSG::SNET_GM_CHAT_BLOCK_UACCOUNT *) nmg;
  4030. GLMSG::SNET_GM_CHAT_BLOCK_FB NetMsgFB;
  4031. PGLCHARAG pCHAR = GetCharUA ( pNetMsg->szUACCOUNT );
  4032. // Á¢¼ÓÁßÀÌ ¾Æ´Ò°æ¿ì
  4033. if ( !pCHAR )
  4034. {
  4035. NetMsgFB.bBLOCK = false;
  4036. StringCchCopy ( NetMsgFB.szUACCOUNT, USR_ID_LENGTH+1, pNetMsg->szUACCOUNT );
  4037. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4038. // äÆÃºí·° ¿¹¾àÀÚ DB¿¡ ÀúÀåÇÑ´Ù.
  4039. return FALSE;
  4040. }
  4041. if ( pNetMsg->dwBLOCK_MINUTE!=0 )
  4042. {
  4043. // ºí·°½Ã°£ ÁöÁ¤.
  4044. CTime cBLOCK = CTime::GetCurrentTime();
  4045. CTimeSpan cSPAN(0,0,pNetMsg->dwBLOCK_MINUTE,0);
  4046. cBLOCK += cSPAN;
  4047. pCHAR->m_tCHATBLOCK = cBLOCK.GetTime();
  4048. }
  4049. else
  4050. {
  4051. // ºí·°½Ã°£ ÇØÁö.
  4052. pCHAR->m_tCHATBLOCK = 0;
  4053. }
  4054. // DB¿¡ ÀúÀå.
  4055. CSetChatBlockTime *pDbAction = new CSetChatBlockTime(pCHAR->m_dwUserID,pCHAR->m_tCHATBLOCK);
  4056. if ( GetDBMan() ) GetDBMan()->AddJob ( pDbAction );
  4057. // FLD¿¡ ¾Ë¸².
  4058. GLMSG::SNET_GM_CHAT_BLOCK_FLD NetMsgFLD;
  4059. NetMsgFLD.dwCHARID = pCHAR->m_dwCharID;
  4060. NetMsgFLD.dwBLOCK_MINUTE = pNetMsg->dwBLOCK_MINUTE;
  4061. SENDTOALLCHANNEL(&NetMsgFLD);
  4062. // FB.
  4063. NetMsgFB.bBLOCK = true;
  4064. NetMsgFB.dwBLOCK_MINUTE = pNetMsg->dwBLOCK_MINUTE;
  4065. StringCchCopy ( NetMsgFB.szCHARNAME, CHAR_SZNAME, pCHAR->m_szName );
  4066. StringCchCopy ( NetMsgFB.szUACCOUNT, USR_ID_LENGTH+1, pCHAR->m_szUserName );
  4067. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4068. if (GLCONST_CHAR::EnableGMLogs )
  4069. {
  4070. std::string strTIME = CDebugSet::GetCurTime ();
  4071. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD= CHATBLOCK[A] userid= %s (%d), charid= %s (%d) in %d Minutes",
  4072. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pCHAR->m_szUserName,pCHAR->m_dwUserID,pCHAR->m_szName,pCHAR->m_dwCharID,pNetMsg->dwBLOCK_MINUTE );
  4073. strTIME.clear();
  4074. }
  4075. return TRUE;
  4076. }
  4077. // *****************************************************
  4078. // Desc: À¯Àú äÆà ºí·° ó¸® (ij¸¯Å͸í)
  4079. // *****************************************************
  4080. BOOL GLAgentServer::MsgGmChatBlockCN ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  4081. {
  4082. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  4083. if ( !pMyChar ) return FALSE;
  4084. if ( pMyChar->m_dwUserLvl < USER_SPECIAL ) return FALSE;
  4085. GLMSG::SNET_GM_CHAT_BLOCK_CHARNAME *pNetMsg = (GLMSG::SNET_GM_CHAT_BLOCK_CHARNAME *) nmg;
  4086. GLMSG::SNET_GM_CHAT_BLOCK_FB NetMsgFB;
  4087. PGLCHARAG pCHAR = GetChar ( pNetMsg->szCHARNAME );
  4088. // Á¢¼ÓÁßÀÌ ¾Æ´Ò°æ¿ì
  4089. if ( !pCHAR )
  4090. {
  4091. NetMsgFB.bBLOCK = false;
  4092. StringCchCopy ( NetMsgFB.szUACCOUNT, USR_ID_LENGTH+1, pNetMsg->szCHARNAME );
  4093. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4094. // äÆÃºí·° ¿¹¾àÀÚ DB¿¡ ÀúÀåÇÑ´Ù.
  4095. return FALSE;
  4096. }
  4097. if ( pNetMsg->dwBLOCK_MINUTE!=0 )
  4098. {
  4099. // ºí·°½Ã°£ ÁöÁ¤.
  4100. CTime cBLOCK = CTime::GetCurrentTime();
  4101. CTimeSpan cSPAN(0,0,pNetMsg->dwBLOCK_MINUTE,0);
  4102. cBLOCK += cSPAN;
  4103. pCHAR->m_tCHATBLOCK = cBLOCK.GetTime();
  4104. }
  4105. else
  4106. {
  4107. // ºí·°½Ã°£ ÇØÁö.
  4108. pCHAR->m_tCHATBLOCK = 0;
  4109. }
  4110. // DB¿¡ ÀúÀå.
  4111. CSetChatBlockTime *pDbAction = new CSetChatBlockTime(pCHAR->m_dwUserID,pCHAR->m_tCHATBLOCK);
  4112. if ( GetDBMan() ) GetDBMan()->AddJob ( pDbAction );
  4113. // FLD¿¡ ¾Ë¸².
  4114. GLMSG::SNET_GM_CHAT_BLOCK_FLD NetMsgFLD;
  4115. NetMsgFLD.dwCHARID = pCHAR->m_dwCharID;
  4116. NetMsgFLD.dwBLOCK_MINUTE = pNetMsg->dwBLOCK_MINUTE;
  4117. SENDTOALLCHANNEL(&NetMsgFLD);
  4118. // FB.
  4119. NetMsgFB.bBLOCK = true;
  4120. NetMsgFB.dwBLOCK_MINUTE = pNetMsg->dwBLOCK_MINUTE;
  4121. StringCchCopy ( NetMsgFB.szCHARNAME, CHAR_SZNAME, pCHAR->m_szName );
  4122. StringCchCopy ( NetMsgFB.szUACCOUNT, USR_ID_LENGTH+1, pCHAR->m_szUserName );
  4123. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4124. if (GLCONST_CHAR::EnableGMLogs )
  4125. {
  4126. std::string strTIME = CDebugSet::GetCurTime ();
  4127. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD= CHATBLOCK[B] userid= %s (%d), charid= %s (%d) in %d Minutes",
  4128. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pCHAR->m_szUserName,pCHAR->m_dwUserID,pCHAR->m_szName,pCHAR->m_dwCharID,pNetMsg->dwBLOCK_MINUTE );
  4129. strTIME.clear();
  4130. }
  4131. return TRUE;
  4132. }
  4133. BOOL GLAgentServer::MsgGmChatBlockCI ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  4134. {
  4135. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  4136. if ( !pMyChar ) return FALSE;
  4137. if ( pMyChar->m_dwUserLvl < USER_GM3 ) return FALSE;
  4138. GLMSG::SNET_GM_CHAT_BLOCK_CHARID *pNetMsg = (GLMSG::SNET_GM_CHAT_BLOCK_CHARID *) nmg;
  4139. GLMSG::SNET_GM_CHAT_BLOCK_FB NetMsgFB;
  4140. PGLCHARAG pCHAR = GetCharID ( pNetMsg->dwCHARID );
  4141. if ( !pCHAR )
  4142. {
  4143. NetMsgFB.bBLOCK = false;
  4144. StringCchCopy ( NetMsgFB.szUACCOUNT, USR_ID_LENGTH+1, "notfound" );
  4145. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4146. return FALSE;
  4147. }
  4148. if ( pNetMsg->dwBLOCK_MINUTE!=0 )
  4149. {
  4150. // ºí·°½Ã°£ ÁöÁ¤.
  4151. pCHAR->m_tCHATBLOCK;
  4152. CTime cBLOCK = CTime::GetCurrentTime();
  4153. CTimeSpan cSPAN(0,0,pNetMsg->dwBLOCK_MINUTE,0);
  4154. cBLOCK += cSPAN;
  4155. pCHAR->m_tCHATBLOCK = cBLOCK.GetTime();
  4156. }
  4157. else
  4158. {
  4159. // ºí·°½Ã°£ ÇØÁö.
  4160. pCHAR->m_tCHATBLOCK = 0;
  4161. }
  4162. // DB¿¡ ÀúÀå.
  4163. CSetChatBlockTime *pDbAction = new CSetChatBlockTime(pCHAR->m_dwUserID,pCHAR->m_tCHATBLOCK);
  4164. if ( GetDBMan() ) GetDBMan()->AddJob ( pDbAction );
  4165. // FLD¿¡ ¾Ë¸².
  4166. GLMSG::SNET_GM_CHAT_BLOCK_FLD NetMsgFLD;
  4167. NetMsgFLD.dwCHARID = pCHAR->m_dwCharID;
  4168. NetMsgFLD.dwBLOCK_MINUTE = pNetMsg->dwBLOCK_MINUTE;
  4169. SENDTOALLCHANNEL(&NetMsgFLD);
  4170. // FB.
  4171. NetMsgFB.bBLOCK = true;
  4172. NetMsgFB.dwBLOCK_MINUTE = pNetMsg->dwBLOCK_MINUTE;
  4173. StringCchCopy ( NetMsgFB.szCHARNAME, CHAR_SZNAME, pCHAR->m_szName );
  4174. StringCchCopy ( NetMsgFB.szUACCOUNT, USR_ID_LENGTH+1, pCHAR->m_szUserName );
  4175. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4176. if (GLCONST_CHAR::EnableGMLogs )
  4177. {
  4178. std::string strTIME = CDebugSet::GetCurTime ();
  4179. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD= CHATBLOCK[C] userid= %s (%d), charid= %s (%d) in %d Minutes",
  4180. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pCHAR->m_szUserName,pCHAR->m_dwUserID,pCHAR->m_szName,pCHAR->m_dwCharID,pNetMsg->dwBLOCK_MINUTE );
  4181. strTIME.clear();
  4182. }
  4183. return TRUE;
  4184. }
  4185. BOOL GLAgentServer::MsgGmWarningMSG ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  4186. {
  4187. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  4188. if ( !pMyChar ) return FALSE;
  4189. if ( pMyChar->m_dwUserLvl < USER_GM1 ) return FALSE;
  4190. GLMSG::SNET_GM_WARNING_MSG *pNetMsg = (GLMSG::SNET_GM_WARNING_MSG*) nmg;
  4191. GLMSG::SNET_GM_WARNING_MSG_FLD NetMsgBrd;
  4192. NetMsgBrd.dwGaeaID = dwGaeaID;
  4193. NetMsgBrd.bOn = pNetMsg->bOn;
  4194. SENDTOALLCHANNEL ( &NetMsgBrd );
  4195. if (GLCONST_CHAR::EnableGMLogs )
  4196. {
  4197. if (pNetMsg->bOn)
  4198. {
  4199. std::string strTIME = CDebugSet::GetCurTime ();
  4200. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Show Warning Message to Everyone",
  4201. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  4202. strTIME.clear();
  4203. }
  4204. else
  4205. {
  4206. std::string strTIME = CDebugSet::GetCurTime ();
  4207. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD=Disable Warning Message to Everyone",
  4208. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID );
  4209. strTIME.clear();
  4210. }
  4211. }
  4212. return TRUE;
  4213. }
  4214. BOOL GLAgentServer::MsgGmShowMeTheMoney ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  4215. {
  4216. #if defined(_RELEASED) || defined(KRT_PARAM)
  4217. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  4218. if ( !pMyChar ) return FALSE;
  4219. if ( pMyChar->m_dwUserLvl < USER_GM3 ) return FALSE;
  4220. GLMSG::SNET_GM_SHOWMETHEMONEY *pNetMsg = (GLMSG::SNET_GM_SHOWMETHEMONEY*) nmg;
  4221. GLMSG::SNET_GM_SHOWMETHEMONEY_FLD NetMsgBrd;
  4222. NetMsgBrd.dwGaeaID = dwGaeaID;
  4223. NetMsgBrd.llMoney = pNetMsg->llMoney;
  4224. SENDTOALLCHANNEL( &NetMsgBrd );
  4225. #endif
  4226. return TRUE;
  4227. }
  4228. BOOL GLAgentServer::MsgUserCharInfo4NAME ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  4229. {
  4230. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  4231. if ( !pMyChar ) return FALSE;
  4232. GLMSG::SNET_USER_CHAR_INFO_4NAME *pNetMsg = (GLMSG::SNET_USER_CHAR_INFO_4NAME *) nmg;
  4233. GLMSG::SNET_USER_CHAR_INFO_AGT_FB NetMsgFB;
  4234. PGLCHARAG pCHAR = GetChar ( pNetMsg->szCHARNAME );
  4235. if ( !pCHAR )
  4236. {
  4237. StringCchCopy ( NetMsgFB.szCHARNAME, CHAR_SZNAME, "not found" );
  4238. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4239. return FALSE;
  4240. }
  4241. // Çʵ忡 »ó¼¼ Á¤º¸ ¿äû.
  4242. GLMSG::SNET_USER_CHAR_INFO_FLD NetMsgFld;
  4243. NetMsgFld.dwCHARID = pCHAR->m_dwCharID;
  4244. NetMsgFld.dwCLIENTID_FB = dwClientID;
  4245. SENDTOALLCHANNEL( &NetMsgFld );
  4246. return TRUE;
  4247. }
  4248. BOOL GLAgentServer::MsgGmCharInfo4NAME ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  4249. {
  4250. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  4251. if ( !pMyChar ) return FALSE;
  4252. if ( pMyChar->m_dwUserLvl < USER_GM3 ) return FALSE;
  4253. GLMSG::SNET_GM_CHAR_INFO_4NAME *pNetMsg = (GLMSG::SNET_GM_CHAR_INFO_4NAME *) nmg;
  4254. GLMSG::SNET_GM_CHAR_INFO_AGT_FB NetMsgFB;
  4255. PGLCHARAG pCHAR = GetChar ( pNetMsg->szCHARNAME );
  4256. if ( !pCHAR )
  4257. {
  4258. StringCchCopy ( NetMsgFB.szCHARNAME, CHAR_SZNAME, "notfound" );
  4259. StringCchCopy ( NetMsgFB.szUACCOUNT, USR_ID_LENGTH+1, "notfound" );
  4260. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4261. return FALSE;
  4262. }
  4263. // Ŭ¶óÀ̾ðÆ®¿¡ agt fb
  4264. StringCchCopy ( NetMsgFB.szCHARNAME, CHAR_SZNAME, pCHAR->m_szName );
  4265. StringCchCopy ( NetMsgFB.szUACCOUNT, USR_ID_LENGTH+1, pCHAR->m_szUserName );
  4266. NetMsgFB.dwSERVER;
  4267. NetMsgFB.dwCHANNEL = (DWORD) pCHAR->m_nChannel;
  4268. NetMsgFB.dwCHARID = pCHAR->m_dwCharID;
  4269. NetMsgFB.dwGAEAID = pCHAR->m_dwGaeaID;
  4270. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4271. // Çʵ忡 »ó¼¼ Á¤º¸ ¿äû.
  4272. GLMSG::SNET_GM_CHAR_INFO_FLD NetMsgFld;
  4273. NetMsgFld.dwCHARID = pCHAR->m_dwCharID;
  4274. NetMsgFld.dwCLIENTID_FB = dwClientID;
  4275. SENDTOALLCHANNEL ( &NetMsgFld );
  4276. if (GLCONST_CHAR::EnableGMLogs )
  4277. {
  4278. std::string strTIME = CDebugSet::GetCurTime ();
  4279. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD= Read Character Info userid= %s (%d), charid= %s (%d)",
  4280. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pCHAR->m_szUserName,pCHAR->m_dwUserID,pCHAR->m_szName,pCHAR->m_dwCharID );
  4281. strTIME.clear();
  4282. }
  4283. return TRUE;
  4284. }
  4285. BOOL GLAgentServer::MsgGmCharInfo4CID ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  4286. {
  4287. PGLCHARAG pMyChar = GetChar ( dwGaeaID );
  4288. if ( !pMyChar ) return FALSE;
  4289. if ( pMyChar->m_dwUserLvl < USER_GM3 ) return FALSE;
  4290. GLMSG::SNET_GM_CHAR_INFO_4CHARID *pNetMsg = (GLMSG::SNET_GM_CHAR_INFO_4CHARID *) nmg;
  4291. GLMSG::SNET_GM_CHAR_INFO_AGT_FB NetMsgFB;
  4292. PGLCHARAG pCHAR = GetCharID ( pNetMsg->dwCHARID );
  4293. if ( !pCHAR )
  4294. {
  4295. StringCchCopy ( NetMsgFB.szCHARNAME, CHAR_SZNAME, "notfound" );
  4296. StringCchCopy ( NetMsgFB.szUACCOUNT, USR_ID_LENGTH+1, "notfound" );
  4297. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4298. return FALSE;
  4299. }
  4300. // Ŭ¶óÀ̾ðÆ®¿¡ agt fb
  4301. StringCchCopy ( NetMsgFB.szCHARNAME, CHAR_SZNAME, pCHAR->m_szName );
  4302. StringCchCopy ( NetMsgFB.szUACCOUNT, USR_ID_LENGTH+1, pCHAR->m_szUserName );
  4303. NetMsgFB.dwSERVER;
  4304. NetMsgFB.dwCHANNEL = (DWORD) pCHAR->m_nChannel;
  4305. NetMsgFB.dwCHARID = pCHAR->m_dwCharID;
  4306. NetMsgFB.dwGAEAID = pCHAR->m_dwGaeaID;
  4307. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4308. // Çʵ忡 »ó¼¼ Á¤º¸ ¿äû.
  4309. GLMSG::SNET_GM_CHAR_INFO_FLD NetMsgFld;
  4310. NetMsgFld.dwCHARID = pCHAR->m_dwCharID;
  4311. NetMsgFld.dwCLIENTID_FB = dwClientID;
  4312. SENDTOALLCHANNEL ( &NetMsgFld );
  4313. if (GLCONST_CHAR::EnableGMLogs )
  4314. {
  4315. std::string strTIME = CDebugSet::GetCurTime ();
  4316. CDebugSet::ToFile ( "GMCMDLOG.txt", "%s userid= %s (%d), charid= %s (%d), CMD= Read Character Info[CID] userid= %s (%d), charid= %s (%d)",
  4317. strTIME.c_str(),pMyChar->m_szUserName,pMyChar->m_dwUserID,pMyChar->m_szName,pMyChar->m_dwCharID,pCHAR->m_szUserName,pCHAR->m_dwUserID,pCHAR->m_szName,pCHAR->m_dwCharID );
  4318. strTIME.clear();
  4319. }
  4320. return TRUE;
  4321. }
  4322. BOOL GLAgentServer::MsgGmCharInfoFldFB ( NET_MSG_GENERIC* nmg )
  4323. {
  4324. GLMSG::SNET_GM_CHAR_INFO_FLD_FB *pNetMsg = (GLMSG::SNET_GM_CHAR_INFO_FLD_FB *) nmg;
  4325. SENDTOCLIENT ( pNetMsg->dwCLIENTID_FB, pNetMsg );
  4326. return TRUE;
  4327. }
  4328. BOOL GLAgentServer::MsgUserCharInfoFldFB ( NET_MSG_GENERIC* nmg )
  4329. {
  4330. GLMSG::SNET_USER_CHAR_INFO_FLD_FB *pNetMsg = (GLMSG::SNET_USER_CHAR_INFO_FLD_FB *) nmg;
  4331. SENDTOCLIENT ( pNetMsg->dwCLIENTID_FB, pNetMsg );
  4332. return TRUE;
  4333. }
  4334. // *****************************************************
  4335. // Desc: Äɸ¯ÅÍ À̵¿À» Çʵ弭¹ö¿¡ ¿äû
  4336. // *****************************************************
  4337. BOOL GLAgentServer::MsgMove2CharAG ( NET_MSG_GENERIC* nmg )
  4338. {
  4339. GLMSG::SNETPC_GM_MOVE2CHAR_AG *pNetMsg = (GLMSG::SNETPC_GM_MOVE2CHAR_AG *) nmg;
  4340. GLMSG::SNETPC_GM_MOVE2CHAR_FB NetMsgFB;
  4341. PGLCHARAG pCHAR = GetCharID ( pNetMsg->dwCOMMAND_CHARID );
  4342. if ( !pCHAR ) return FALSE;
  4343. if ( pNetMsg->emFB==EMGM_MOVE2CHAR_FB_OK )
  4344. {
  4345. GLMSG::SNETPC_GM_MOVE2CHAR_FLD NetMsgFld;
  4346. NetMsgFld.sToMapID = pNetMsg->sToMapID;
  4347. NetMsgFld.vToPos = pNetMsg->vToPos;
  4348. SENDTOFIELD ( pCHAR->m_dwClientID, &NetMsgFld );
  4349. }
  4350. else
  4351. {
  4352. // Note : Ä£±¸¿¡°Ô À̵¿ ½ÇÆÐ ¹Ýȯ.
  4353. NetMsgFB.emFB = pNetMsg->emFB;
  4354. SENDTOCLIENT ( pCHAR->m_dwClientID, &NetMsgFB );
  4355. }
  4356. return TRUE;
  4357. }
  4358. BOOL GLAgentServer::MsgClubBattleRemainTime ( NET_MSG_GENERIC* nmg )
  4359. {
  4360. GLMSG::SNETPC_SERVER_CLUB_BATTLE_REMAIN_AG* pNetMsg =
  4361. (GLMSG::SNETPC_SERVER_CLUB_BATTLE_REMAIN_AG*) nmg;
  4362. PGLCHARAG pChar = GetChar ( pNetMsg->dwGaeaID );
  4363. if ( pChar )
  4364. {
  4365. GLMSG::SNET_CLUB_BATTLE_REMAIN_BRD NetMsgBrd;
  4366. NetMsgBrd.dwTime = GLGuidanceAgentMan().GetInstance().GetRemainTime ();
  4367. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgBrd );
  4368. }
  4369. return TRUE;
  4370. }
  4371. BOOL GLAgentServer::MsgClubDeathMatchRemainTime ( NET_MSG_GENERIC* nmg )
  4372. {
  4373. GLMSG::SNETPC_SERVER_CLUB_DEATHMATCH_REMAIN_AG* pNetMsg =
  4374. (GLMSG::SNETPC_SERVER_CLUB_DEATHMATCH_REMAIN_AG*) nmg;
  4375. PGLCHARAG pChar = GetChar ( pNetMsg->dwGaeaID );
  4376. if ( pChar )
  4377. {
  4378. GLMSG::SNET_CLUB_DEATHMATCH_REMAIN_BRD NetMsgBrd;
  4379. NetMsgBrd.dwTime = GLClubDeathMatchAgentMan().GetInstance().GetRemainTime ();
  4380. SENDTOCLIENT ( pChar->m_dwClientID, &NetMsgBrd );
  4381. }
  4382. return TRUE;
  4383. }
  4384. BOOL GLAgentServer::MsgClubCDCertifyIngBrd ( NET_MSG_GENERIC* nmg )
  4385. {
  4386. SENDTOALLCLIENT ( nmg );
  4387. return TRUE;
  4388. }
  4389. BOOL GLAgentServer::MsgClubCDCertifyBrd ( NET_MSG_GENERIC* nmg )
  4390. {
  4391. SENDTOALLCLIENT ( nmg );
  4392. return TRUE;
  4393. }
  4394. BOOL GLAgentServer::MsgMarketOpenCheck ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  4395. {
  4396. PGLCHARAG pMyChar = GetChar(dwGaeaID);
  4397. if( pMyChar == NULL )
  4398. {
  4399. m_pConsoleMsg->Write( LOG_TEXT_CONSOLE, "%%%% Could not found Character..%d %%%%", dwGaeaID );
  4400. }
  4401. return TRUE;
  4402. }
  4403. BOOL GLAgentServer::MsgClubBattleKillUpdate ( NET_MSG_GENERIC* nmg )
  4404. {
  4405. GLMSG::SNET_CLUB_BATTLE_KILL_UPDATE_AGT* pNetMsg = (GLMSG::SNET_CLUB_BATTLE_KILL_UPDATE_AGT*) nmg;
  4406. GLCLUB* pClub = m_cClubMan.GetClub ( pNetMsg->dwClubID );
  4407. if ( !pClub ) return FALSE;
  4408. pClub->KillBattleClubMem( pNetMsg->dwBattleClubID, pNetMsg->wKillPoint );
  4409. pClub->DeathBattleClubMem( pNetMsg->dwBattleClubID, pNetMsg->wDeathPoint );
  4410. return TRUE;
  4411. }
  4412. BOOL GLAgentServer::MsgClubBattleLastKillUpdate( NET_MSG_GENERIC* nmg )
  4413. {
  4414. GLMSG::SNET_CLUB_BATTLE_LAST_KILL_UPDATE_AGT* pNetMsg = (GLMSG::SNET_CLUB_BATTLE_LAST_KILL_UPDATE_AGT*) nmg;
  4415. GLCLUB* pClub = m_cClubMan.GetClub ( pNetMsg->dwClubID_A );
  4416. if ( !pClub ) return FALSE;
  4417. pClub->SetLastBattlePoint( pNetMsg->dwClubID_B, pNetMsg->wKillPoint, pNetMsg->wDeathPoint );
  4418. return TRUE;
  4419. }
  4420. BOOL GLAgentServer::MsgReqTaxi ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  4421. {
  4422. GLMSG::SNETPC_REQ_TAXI* pNetMsg = (GLMSG::SNETPC_REQ_TAXI*)nmg;
  4423. GLMSG::SNETPC_REQ_TAXI_FB NetMsgFB;
  4424. PGLCHARAG pMyChar = GetChar(dwGaeaID);
  4425. if ( !pMyChar ) return FALSE;
  4426. // Á¤·ùÀå °Ë»ç
  4427. STAXI_MAP* pTaxiMap = GLTaxiStation::GetInstance().GetTaxiMap ( pNetMsg->dwSelectMap );
  4428. if ( !pTaxiMap )
  4429. {
  4430. NetMsgFB.emFB = EMTAXI_TAKE_MAPFAIL;
  4431. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4432. return FALSE;
  4433. }
  4434. // Á¤·ùÀå °Ë»ç
  4435. STAXI_STATION* pStation = pTaxiMap->GetStation( pNetMsg->dwSelectStop );
  4436. if ( !pStation )
  4437. {
  4438. NetMsgFB.emFB = EMTAXI_TAKE_STATIONFAIL;
  4439. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4440. return FALSE;
  4441. }
  4442. SNATIVEID sMAPID(pStation->dwMAPID);
  4443. if ( sMAPID==SNATIVEID(false) )
  4444. {
  4445. NetMsgFB.emFB = EMTAXI_TAKE_MAPFAIL;
  4446. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4447. return FALSE;
  4448. }
  4449. DWORD dwFieldServer = GetFieldServer( sMAPID );
  4450. if ( dwFieldServer == FIELDSERVER_MAX )
  4451. {
  4452. NetMsgFB.emFB = EMTAXI_TAKE_MAPFAIL;
  4453. SENDTOCLIENT ( dwClientID, &NetMsgFB );
  4454. return FALSE;
  4455. }
  4456. // °°Àº ÇʵåÀÌ¸é ±×³É º¸³»°í
  4457. // ´Ù¸¥ ÇʵåÀ̸é ÁÂÇ¥¸¦ ±¸Çؼ­ º¸³»ÁØ´Ù.
  4458. if ( dwFieldServer == pMyChar->m_dwCurFieldSvr )
  4459. {
  4460. SENDTOFIELD( dwClientID, pNetMsg );
  4461. }
  4462. else
  4463. {
  4464. GLMSG::SNETPC_REQ_TAXI_NPCPOS NetMsgPos;
  4465. NetMsgPos.dwSelectMap = pNetMsg->dwSelectMap;
  4466. NetMsgPos.dwSelectStop = pNetMsg->dwSelectStop;
  4467. NetMsgPos.dwGaeaID = pNetMsg->dwGaeaID;
  4468. NetMsgPos.wPosX = pNetMsg->wPosX;
  4469. NetMsgPos.wPosY = pNetMsg->wPosY;
  4470. SENDTOFIELDSVR( pMyChar->m_nChannel, dwFieldServer, &NetMsgPos );
  4471. }
  4472. return TRUE;
  4473. }
  4474. BOOL GLAgentServer::MsgReqTaxiNpcPos ( NET_MSG_GENERIC* nmg )
  4475. {
  4476. GLMSG::SNETPC_REQ_TAXI_NPCPOS_FB* pNetMsg = (GLMSG::SNETPC_REQ_TAXI_NPCPOS_FB*)nmg;
  4477. GLMSG::SNETPC_REQ_TAXI_FB NetMsgFB;
  4478. PGLCHARAG pMyChar = GetChar(pNetMsg->dwGaeaID);
  4479. if ( !pMyChar )
  4480. {
  4481. return FALSE;
  4482. }
  4483. if ( pNetMsg->vPos == D3DXVECTOR3(FLT_MAX,FLT_MAX,FLT_MAX) )
  4484. {
  4485. NetMsgFB.emFB = EMTAXI_TAKE_NPCFAIL;
  4486. SENDTOCLIENT ( pMyChar->m_dwClientID, &NetMsgFB );
  4487. return FALSE;
  4488. }
  4489. GLMSG::SNETPC_REQ_TAXI NetMsg;
  4490. NetMsg.dwSelectMap = pNetMsg->dwSelectMap;
  4491. NetMsg.dwSelectStop = pNetMsg->dwSelectStop;
  4492. NetMsg.wPosX = pNetMsg->wPosX;
  4493. NetMsg.wPosY = pNetMsg->wPosY;
  4494. NetMsg.dwGaeaID = pNetMsg->dwGaeaID;
  4495. NetMsg.vPos = pNetMsg->vPos;
  4496. SENDTOFIELD( pMyChar->m_dwClientID, &NetMsg );
  4497. return TRUE;
  4498. }
  4499. BOOL GLAgentServer::MsgNpcCommission( NET_MSG_GENERIC* nmg, DWORD dwClientID)
  4500. {
  4501. GLMSG::SNET_INVEN_NPC_COMMISSION* pNetMsg = (GLMSG::SNET_INVEN_NPC_COMMISSION*)nmg;
  4502. GLMSG::SNET_INVEN_NPC_COMMISSION_FB NetMsgFB;
  4503. NetMsgFB.dwCharID = pNetMsg->dwCharID;
  4504. NetMsgFB.dwUserID = pNetMsg->dwUserID;
  4505. NetMsgFB.lnCommission = pNetMsg->lnCommission;
  4506. PGLCHARAG pChar = GetCharID(pNetMsg->dwCharID);
  4507. // ij¸¯ÅÍ°¡ Á¢¼ÓÁßÀ϶§ ( ŸÇʵ忡 ÀÖ´Â »óȲ )
  4508. // ºñÁ¢¼ÓÁßÀ϶§ Çʵ忡 ÀúÀåÀ» ¿äûÇÑ´Ù.
  4509. if ( pChar )
  4510. {
  4511. NetMsgFB.emFB = EMREQ_NPC_COMMISSION_CHAR;
  4512. SENDTOFIELDSVR( pChar->m_nChannel, pChar->m_dwCurFieldSvr, &NetMsgFB );
  4513. }
  4514. else
  4515. {
  4516. NetMsgFB.emFB = EMREQ_NPC_COMMISSION_DB;
  4517. SENDTOFIELDSVR( pNetMsg->nCHANNEL, pNetMsg->dwFieldID, &NetMsgFB );
  4518. }
  4519. return TRUE;
  4520. }
  4521. HRESULT GLAgentServer::MsgProcess ( NET_MSG_GENERIC* nmg, DWORD dwClientID, DWORD dwGaeaID )
  4522. {
  4523. switch ( nmg->nType )
  4524. {
  4525. default: break;
  4526. case NET_MSG_GCTRL_REQ_GATEOUT: MsgReqGateOut ( nmg, dwClientID, dwGaeaID ); break;
  4527. case NET_MSG_GCTRL_REQ_GENITEM_AGT: MsgReqGenItemAgt ( nmg, dwClientID ); break;
  4528. case NET_MSG_FIELDSVR_CHARCHK_FB: MsgReqFieldSvrCharChkFb ( nmg, dwClientID, dwGaeaID ); break;
  4529. case NET_MSG_SERVER_GENERALCHAT: MsgServerGeneralChat ( nmg ); break;
  4530. case NET_MSG_GCTRL_CONFRONTPTY_CHECKMBR_AGT: MsgConfrontPtyCheckMber ( nmg ); break;
  4531. case NET_MSG_GCTRL_CONFRONTCLB_CHECKMBR_AGT: MsgConfrontClbCheckMber ( nmg ); break;
  4532. case NET_MSG_GCTRL_CLUB_MEMBER_DB2DEL: MsgClubMemberDb2Del ( nmg, dwClientID, dwGaeaID ); break;
  4533. case NET_MSG_GCTRL_CLUB_CERTIFIED_AGT: MsgClubCertified ( nmg, dwClientID, dwGaeaID ); break;
  4534. case NET_MSG_GCTRL_CLUB_INCOME_MONEY_AGT: MsgClubIncomeMoney ( nmg ); break;
  4535. case NET_MSG_GCTRL_CLUB_INCOME_UP: MsgClubIncomeMoneyUp ( nmg ); break;
  4536. //case NET_MSG_GCTRL_CLUB_INCOME_FB: MsgClubIncomeMoneyFb ( nmg ); break;
  4537. case NET_MSG_GCTRL_2_FRIEND_AG: Msg2FriendAG ( nmg ); break;
  4538. case NET_MSG_GM_MOVE2CHAR_AG: MsgMove2CharAG ( nmg ); break;
  4539. case NET_MSG_GM_CHAR_INFO_FLD_FB: MsgGmCharInfoFldFB ( nmg ); break;
  4540. case NET_MSG_USER_CHAR_INFO_FLD_FB: MsgUserCharInfoFldFB ( nmg ); break;
  4541. case NET_MSG_GCTRL_CLUB_CD_CERTIFY_ING_BRD: MsgClubCDCertifyIngBrd ( nmg ); break;
  4542. case NET_MSG_GCTRL_CLUB_CD_CERTIFY_BRD: MsgClubCDCertifyBrd ( nmg ); break;
  4543. case NET_MSG_GCTRL_CLUB_BATTLE_KILL_UPDATE_AGT: MsgClubBattleKillUpdate ( nmg ); break;
  4544. case NET_MSG_GCTRL_CLUB_BATTLE_LAST_KILL_UPDATE_AGT: MsgClubBattleLastKillUpdate ( nmg ); break;
  4545. case NET_MSG_GCTRL_REQ_TAXI_NPCPOS_FB: MsgReqTaxiNpcPos( nmg ); break;
  4546. case NET_MSG_GCTRL_CREATE_INSTANT_MAP_REQ: MsgReqCreateInstantMap ( nmg, dwClientID, dwGaeaID ); break;
  4547. case NET_MSG_GCTRL_CREATE_INSTANT_MAP_DEL: MsgReqDeleteInstantMap ( nmg ); break;
  4548. case NET_MSG_GCTRL_NPC_COMMISSION: MsgNpcCommission( nmg, dwClientID ); break;
  4549. };
  4550. if ( dwGaeaID == GAEAID_NULL ) return E_FAIL;
  4551. if ( !GetChar(dwGaeaID) ) return E_FAIL;
  4552. switch ( nmg->nType )
  4553. {
  4554. default: break;
  4555. case NET_MSG_REQ_FRIENDLIST:
  4556. case NET_MSG_REQ_FRIENDADD:
  4557. case NET_MSG_REQ_FRIENDADD_ANS:
  4558. case NET_MSG_REQ_FRIENDDEL:
  4559. case NET_MSG_REQ_FRIENDBLOCK:
  4560. case NET_MSG_GCTRL_ACTSTATE:
  4561. case NET_MSG_GCTRL_CLUB_MEMBER_REQ_2AGT:
  4562. case NET_MSG_GCTRL_CLUB_MEMBER_DEL:
  4563. case NET_MSG_GCTRL_CLUB_MEMBER_SECEDE:
  4564. case NET_MSG_GCTRL_CLUB_AUTHORITY_REQ:
  4565. case NET_MSG_GCTRL_CLUB_AUTHORITY_REQ_ANS:
  4566. case NET_MSG_GCTRL_CLUB_MARK_INFO:
  4567. case NET_MSG_GCTRL_CLUB_MARK_CHANGE:
  4568. case NET_MSG_GCTRL_CLUB_RANK_2AGT:
  4569. case NET_MSG_GCTRL_CLUB_COMMISSION:
  4570. case NET_MSG_GCTRL_CLUB_NOTICE_REQ:
  4571. case NET_MSG_GCTRL_CLUB_SUBMASTER:
  4572. case NET_MSG_GCTRL_CLUB_ALLIANCE_REQ:
  4573. case NET_MSG_GCTRL_CLUB_ALLIANCE_REQ_ANS:
  4574. case NET_MSG_GCTRL_CLUB_ALLIANCE_DEL_REQ:
  4575. case NET_MSG_GCTRL_CLUB_ALLIANCE_SEC_REQ:
  4576. case NET_MSG_GCTRL_CLUB_ALLIANCE_DIS_REQ:
  4577. case NET_MSG_GCTRL_CLUB_BATTLE_REQ:
  4578. case NET_MSG_GCTRL_CLUB_BATTLE_REQ_ANS:
  4579. case NET_MSG_GCTRL_CLUB_BATTLE_ARMISTICE_REQ:
  4580. case NET_MSG_GCTRL_CLUB_BATTLE_ARMISTICE_REQ_ANS:
  4581. case NET_MSG_GCTRL_CLUB_BATTLE_SUBMISSION_REQ:
  4582. case NET_MSG_GCTRL_ALLIANCE_BATTLE_REQ:
  4583. case NET_MSG_GCTRL_ALLIANCE_BATTLE_REQ_ANS:
  4584. case NET_MSG_GCTRL_ALLIANCE_BATTLE_ARMISTICE_REQ:
  4585. case NET_MSG_GCTRL_ALLIANCE_BATTLE_ARMISTICE_REQ_ANS:
  4586. case NET_MSG_GCTRL_ALLIANCE_BATTLE_SUBMISSION_REQ:
  4587. case NET_MSG_GCTRL_INVEN_RENAME_AGTBRD:
  4588. case NET_MSG_SMS_PHONE_NUMBER_AGTBRD:
  4589. case NET_MSG_GCTRL_UPDATE_STARTCALL:
  4590. case NET_MSG_GCTRL_SET_SERVER_DELAYTIME_AGT:
  4591. case NET_MSG_GCTRL_SET_SERVER_CRASHTIME_AGT:
  4592. case NET_MSG_GCTRL_SET_SERVER_SKIPPACKET_AGT:
  4593. case NET_MSG_GCTRL_PUTON_CHANGE_AG:
  4594. case NET_MSG_REQ_FRIEND_CLUB_OPEN:
  4595. case NET_QBOX_OPTION_REQ_AG:
  4596. case NET_MSG_REQ_ATTENDLIST:
  4597. case NET_MSG_REQ_ATTENDANCE:
  4598. {
  4599. PGLCHARAG pMyChar = GetChar(dwGaeaID);
  4600. pMyChar->MsgProcess ( nmg );
  4601. }
  4602. break;
  4603. case NET_MSG_CHAT: ChatMsgProc ( nmg, dwClientID, dwGaeaID ); break;
  4604. case NET_MSG_CHAT_LOUDSPEAKER_AGT: ChatMsgLoudSpeakerAgt ( nmg, dwClientID, dwGaeaID );break;
  4605. case NET_MSG_GCTRL_REQ_REBIRTH: MsgReqReBirth ( nmg, dwClientID, dwGaeaID ); break;
  4606. case NET_MSG_GCTRL_REGEN_GATE_FB: MsgReqReGenGate ( nmg, dwClientID, dwGaeaID ); break;
  4607. case NET_MSG_GCTRL_FIELDSVR_OUT_FB: MsgFieldSvrOutFb ( nmg, dwClientID, dwGaeaID ); break;
  4608. case NET_MSG_GCTRL_REBIRTH_OUT_FB: MsgReBirthOutFb ( nmg, dwClientID, dwGaeaID ); break;
  4609. case NET_MSG_GCTRL_REQ_RECALL_AG: MsgReCallAg ( nmg, dwClientID, dwGaeaID ); break;
  4610. case NET_MSG_REQ_MUST_LEAVE_MAP_AG: MsgLvUpMustLeaveMap ( nmg, dwClientID, dwGaeaID ); break;
  4611. case NET_MSG_GCTRL_REQ_TELEPORT_AG: MsgTeleportAg ( nmg, dwClientID, dwGaeaID ); break;
  4612. case NET_MSG_GCTRL_REQ_SERVER_CLUB_BATTLE_REMAIN_AG: MsgClubBattleRemainTime ( nmg ); break;
  4613. case NET_MSG_GCTRL_REQ_SERVER_CLUB_DEATHMATCH_REMAIN_AG: MsgClubDeathMatchRemainTime ( nmg ); break;
  4614. case NET_MSG_GCTRL_PARTY_LURE: MsgPartyLure ( nmg, dwClientID, dwGaeaID ); break;
  4615. case NET_MSG_GCTRL_PARTY_LURE_TAR_ANS: MsgPartyLureTarAns ( nmg, dwClientID, dwGaeaID ); break;
  4616. case NET_MSG_GCTRL_PARTY_SECEDE: MsgPartySecede ( nmg, dwClientID, dwGaeaID ); break;
  4617. case NET_MSG_GCTRL_PARTY_AUTHORITY: MsgPartyAuthority( nmg, dwClientID, dwGaeaID ); break;
  4618. case NET_MSG_GCTRL_PARTY_DISSOLVE: MsgPartyDissolve ( nmg, dwClientID, dwGaeaID ); break;
  4619. case NET_MSG_GCTRL_2_FRIEND_REQ: Msg2FriendReq ( nmg, dwClientID, dwGaeaID ); break;
  4620. case NET_MSG_GM_MOVE2CHAR: MsgMove2Char ( nmg, dwClientID, dwGaeaID ); break;
  4621. case NET_MSG_GCTRL_REQ_GATEOUT_FB: MsgReqGateOutFB ( nmg, dwClientID, dwGaeaID ); break;
  4622. case NET_MSG_GCTRL_REQ_REBIRTH_FB: MsgReqReBirthFB ( nmg, dwClientID, dwGaeaID ); break;
  4623. case NET_MSG_GCTRL_CREATE_INSTANT_MAP_FB: MsgReqCreateInstantMapFB ( nmg, dwClientID, dwGaeaID ); break;
  4624. case NET_MSG_GCTRL_CONFRONT: MsgReqConfront ( nmg, dwClientID, dwGaeaID ); break;
  4625. case NET_MSG_GCTRL_CONFRONT_ANS: MsgAnsConfront ( nmg, dwClientID, dwGaeaID ); break;
  4626. case NET_MSG_GCTRL_CONFRONT_FB: MsgAnsConfrontFB ( nmg, dwClientID, dwGaeaID ); break;
  4627. case NET_MSG_GCTRL_CONFRONT_END2_AGT: MsgConfrontEnd2Agt ( nmg, dwClientID, dwGaeaID ); break;
  4628. case NET_MSG_GCTRL_CLUB_NEW_2AGT: MsgClubNew2Agt ( nmg, dwClientID, dwGaeaID ); break;
  4629. case NET_MSG_GCTRL_CLUB_NEW_DB2AGT: MsgClubNewDb2Agt ( nmg, dwClientID, dwGaeaID ); break;
  4630. case NET_MSG_GCTRL_CLUB_DISSOLUTION: MsgClubDissolution ( nmg, dwClientID, dwGaeaID ); break;
  4631. case NET_MSG_CHARPOS_FROMDB2AGT: GameJoinToFieldSvr ( nmg, dwClientID, dwGaeaID ); break;
  4632. case NET_MSG_SERVER_CTRL_WEATHER:
  4633. case NET_MSG_SERVER_CTRL_WEATHER2: MsgServerCtrlWeather ( nmg, dwClientID, dwGaeaID ); break;
  4634. case NET_MSG_SERVER_CTRL_GENITEMHOLD: MsgServerCtrlGenHold ( nmg, dwClientID, dwGaeaID ); break;
  4635. case NET_MSG_SERVER_CTRL_TIME: MsgServerCtrlTime ( nmg, dwClientID, dwGaeaID ); break;
  4636. case NET_MSG_SERVER_CTRL_MONTH: MsgServerCtrlMonth ( nmg, dwClientID, dwGaeaID ); break;
  4637. case NET_MSG_BLOCK_DETECTED: MsgBlockDetected ( nmg, dwClientID, dwGaeaID ); break;
  4638. case NET_MSG_GM_KICK_USER: MsgGmKickUser ( nmg, dwClientID, dwGaeaID ); break;
  4639. case NET_MSG_GM_MOVE2GATE: MsgGMMove2Gate ( nmg, dwClientID, dwGaeaID ); break;
  4640. case NET_MSG_GM_MOVE2MAPPOS: MsgGMMove2Pos ( nmg, dwClientID, dwGaeaID ); break;
  4641. case NET_MSG_GM_EVENT_ITEM_GEN: MsgGmEventItemGen ( nmg, dwClientID, dwGaeaID ); break;
  4642. case NET_MSG_GM_EVENT_ITEM_GEN_END: MsgGmEventItemGenEnd ( nmg, dwClientID, dwGaeaID ); break;
  4643. case NET_MSG_GM_EVENT_MONEY_GEN: MsgGmEventMoneyGen ( nmg, dwClientID, dwGaeaID ); break;
  4644. case NET_MSG_GM_EVENT_MONEY_GEN_END: MsgGmEventMoneyGenEnd ( nmg, dwClientID, dwGaeaID );break;
  4645. case NET_MSG_GM_CLASS_EVENT: MsgGmEventClassEvent ( nmg, dwClientID, dwGaeaID ); break;
  4646. case NET_MSG_GM_EVENT_EX: MsgGmEventEx ( nmg, dwClientID, dwGaeaID ); break;
  4647. case NET_MSG_GM_EVENT_EX_END: MsgGmEventExEnd ( nmg, dwClientID, dwGaeaID ); break;
  4648. case NET_MSG_GM_EVENT_EXP: MsgGmEventExp( nmg, dwClientID, dwGaeaID ); break;
  4649. case NET_MSG_GM_EVENT_EXP_END: MsgGmEventExpEnd( nmg, dwClientID, dwGaeaID ); break;
  4650. case NET_MSG_GM_VIEWWORKEVENT: MsgGmViewWorkEvent( nmg, dwClientID, dwGaeaID ); break;
  4651. case NET_MSG_GM_LIMIT_EVENT_BEGIN: MsgGmLimitEventBegin ( nmg, dwClientID, dwGaeaID ); break;
  4652. case NET_MSG_GM_LIMIT_EVENT_END: MsgGmLimitEventEnd ( nmg, dwClientID, dwGaeaID ); break;
  4653. case NET_MSG_GM_LIMIT_EVENT_RESTART: MsgGmLimitEventRestart ( nmg, dwClientID, dwGaeaID ); break;
  4654. case NET_MSG_GM_LIMIT_EVENT_TIME_REQ: MsgGmLimitEventTimeReq ( nmg, dwClientID, dwGaeaID ); break;
  4655. case NET_MSG_CYBERCAFECLASS_UPDATE: MsgCyberCafeClassUpdate ( nmg, dwClientID, dwGaeaID ); break;
  4656. case NET_MSG_MARKET_CHECKTIME: MsgMarketOpenCheck( nmg, dwClientID, dwGaeaID ); break;
  4657. case NET_MSG_GM_BIGHEAD: MsgGmBigHead ( nmg, dwClientID, dwGaeaID ); break;
  4658. case NET_MSG_GM_BIGHAND: MsgGmBigHand ( nmg, dwClientID, dwGaeaID ); break;
  4659. case NET_MSG_GM_CHAT_BLOCK_UACCOUNT: MsgGmChatBlockUA ( nmg, dwClientID, dwGaeaID ); break;
  4660. case NET_MSG_GM_CHAT_BLOCK_CHARNAME: MsgGmChatBlockCN ( nmg, dwClientID, dwGaeaID ); break;
  4661. case NET_MSG_GM_CHAT_BLOCK_CHARID: MsgGmChatBlockCI ( nmg, dwClientID, dwGaeaID ); break;
  4662. case NET_MSG_USER_CHAR_INFO_4NAME: MsgUserCharInfo4NAME ( nmg, dwClientID, dwGaeaID ); break;
  4663. case NET_MSG_GM_CHAR_INFO_4NAME: MsgGmCharInfo4NAME ( nmg, dwClientID, dwGaeaID ); break;
  4664. case NET_MSG_GM_CHAR_INFO_4CHARID: MsgGmCharInfo4CID ( nmg, dwClientID, dwGaeaID ); break;
  4665. case NET_MSG_GM_FREEPK: MsgGmFreePK ( nmg, dwClientID, dwGaeaID ); break;
  4666. case NET_MSG_GM_VIEWALLPLAYER: MsgGmViewAllPlayer ( nmg, dwClientID, dwGaeaID ); break;
  4667. case NET_MSG_GM_GENCHAR: MsgGmGenChar ( nmg, dwClientID, dwGaeaID ); break;
  4668. case NET_MSG_GM_MOB_GEN: MsgGmGenMob ( nmg, dwClientID, dwGaeaID ); break;
  4669. case NET_MSG_GM_MOB_GEN_EX: MsgGmGenMobEx ( nmg, dwClientID, dwGaeaID ); break;
  4670. case NET_MSG_GM_MOB_DEL_EX: MsgGmDelMobEx ( nmg, dwClientID, dwGaeaID ); break;
  4671. case NET_MSG_GM_MOB_DEL: MsgGmDelMob ( nmg, dwClientID, dwGaeaID ); break;
  4672. case NET_MSG_GM_MOB_LEVEL: MsgGmMobLevel ( nmg, dwClientID, dwGaeaID ); break;
  4673. case NET_MSG_GM_MOB_LEVEL_CLEAR: MsgGmMobLevelClear ( nmg, dwClientID, dwGaeaID ); break;
  4674. case NET_MSG_GM_WHERE_NPC: MsgGmWhereNPC ( nmg, dwClientID, dwGaeaID ); break;
  4675. case NET_MSG_GM_PRINT_CROWLIST: MsgGmPrintCrowList ( nmg, dwClientID, dwGaeaID ); break;
  4676. case NET_MSG_GM_WARNING_MSG: MsgGmWarningMSG ( nmg, dwClientID, dwGaeaID ); break;
  4677. case NET_MSG_GM_SHOWMETHEMONEY: MsgGmShowMeTheMoney ( nmg, dwClientID, dwGaeaID ); break;
  4678. case NET_MSG_GM_GETWHISPERMSG: MsgGetWhisperMsg( nmg, dwClientID, dwGaeaID ); break;
  4679. case NET_MSG_GCTRL_REQ_TAXI: MsgReqTaxi( nmg, dwClientID, dwGaeaID ); break;
  4680. };
  4681. return S_OK;
  4682. }

comments powered by Disqus