#include "StdAfx.h" #include ".\handler_MW.h" #include "WorldServer.h" #include "MasterServerSession.h" #include "UserManager.h" #include "ChannelManager.h" #include "Channel.h" #include #include #include #include #include //#include #include #include "ServerSessionManager.h" #include HandlerFromMasterServer_IMPL(MW_NOTICE_CMD) { MSG_MW_NOTICE_CMD* pRecvMsg = (MSG_MW_NOTICE_CMD*)pMsg; if(pRecvMsg->dwNoticeLength > MAX_NOTICE_LEN) { MessageOut(eCRITICAL_LOG, "Notice Length Over(%d)", pRecvMsg->dwNoticeLength); return; } SERVER_KEY serverKey = pRecvMsg->dwServerUID; BYTE byChannelID = serverKey.GetChannelID(); BYTE byServerType = serverKey.GetServerType(); //BYTE byServerID = serverKey.GetServerID(); MSG_CW_NOTICE_BRD noticeMsg; noticeMsg.m_byCategory = CW_CHAT; noticeMsg.m_byProtocol = CW_NOTICE_BRD; // CHANGES: f101210.2L, check boundary and consider length with null-terminated position if (size_t str_len = strlen(pRecvMsg->szNotice) + 1) { // NOTE: always true, because wLen need consider with null-terminated position if (str_len >= _countof(pRecvMsg->szNotice)) { str_len = _countof(pRecvMsg->szNotice); } noticeMsg.wLen = static_cast(str_len); strncpy(noticeMsg.szMsg, pRecvMsg->szNotice, _countof(noticeMsg.szMsg)); noticeMsg.szMsg[_countof(noticeMsg.szMsg) - 1] = '\0'; }; // noticeMsg.m_byRed = pRecvMsg->m_byRed; noticeMsg.m_byGreen = pRecvMsg->m_byGreen; noticeMsg.m_byBlue = pRecvMsg->m_byBlue; if(byChannelID == 0) { // ä³Î¹øÈ£°¡ 0ÀÎ °æ¿ì ¿ùµå³» ¸ðµç ä³Î ´ë»ó if(byServerType == 0) { UserManager::Instance()->SendToAll((BYTE*)¬iceMsg, noticeMsg.GetSize()); char szNotice[MAX_NOTICE_LEN + 1]; ZeroMemory(szNotice, sizeof(szNotice)); strncpy(szNotice, noticeMsg.szMsg, pRecvMsg->dwNoticeLength); MessageOut(eCRITICAL_LOG, "-----------------------------<< World Notice >>-----------------------------"); MessageOut(eCRITICAL_LOG, "%s", szNotice); MessageOut(eCRITICAL_LOG, "------------------------------------------------------------------------"); } else { // ¼­¹ö ŸÀÔÀÌ 0ÀÌ ¾Æ´Ñ °æ¿ì ¸ðµç ä³ÎÀÇ Æ¯Á¤ Á¸¿¡¸¸ °øÁö switch(byServerType) { case FIELD_SERVER: { ChannelManager::Instance()->SendToVillages((BYTE*)¬iceMsg, noticeMsg.GetSize()); char szNotice[MAX_NOTICE_LEN + 1]; ZeroMemory(szNotice, sizeof(szNotice)); strncpy(szNotice, noticeMsg.szMsg, pRecvMsg->dwNoticeLength); MessageOut(eCRITICAL_LOG, "------------------------<< World/FieldServer notice >>-------------------------"); MessageOut(eCRITICAL_LOG, "%s", szNotice); MessageOut(eCRITICAL_LOG, "------------------------------------------------------------------------"); } break; case BATTLE_SERVER: { ChannelManager::Instance()->SendToBattleZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); /* ChannelManager::Instance()->SendToLobby((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToMissionZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToHuntingZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToQuestZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToPVPZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToEventZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToGuildZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToSiegeZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); */ char szNotice[MAX_NOTICE_LEN + 1]; ZeroMemory(szNotice, sizeof(szNotice)); strncpy(szNotice, noticeMsg.szMsg, pRecvMsg->dwNoticeLength); MessageOut(eCRITICAL_LOG, "------------------------<< World/BattleServer Notice >>-----------------------"); MessageOut(eCRITICAL_LOG, "%s", szNotice); MessageOut(eCRITICAL_LOG, "------------------------------------------------------------------------"); } break; } } } else { // ä³Î¹øÈ£°¡ 0ÀÌ ¾Æ´Ï¹Ç·Î ƯÁ¤ ä³Î ´ë»ó Channel* pChannel = ChannelManager::Instance()->GetChannel(byChannelID); if(!pChannel) { MessageOut(eCRITICAL_LOG, "Channel Notice Error - No Channel %u!!", byChannelID); return; } if(byServerType == 0) { // ¸¶À», ¹èƲÁ¸ ¸ðµÎ °øÁö pChannel->SendToAll((BYTE*)¬iceMsg, noticeMsg.GetSize()); char szNotice[MAX_NOTICE_LEN + 1]; ZeroMemory(szNotice, sizeof(szNotice)); strncpy(szNotice, noticeMsg.szMsg, pRecvMsg->dwNoticeLength); MessageOut(eCRITICAL_LOG, "----------------------------<< %d Channel Notice >>----------------------------", byChannelID); MessageOut(eCRITICAL_LOG, "%s", szNotice); MessageOut(eCRITICAL_LOG, "------------------------------------------------------------------------"); } else { // ¼­¹ö ŸÀÔÀÌ 0ÀÌ ¾Æ´Ñ °æ¿ì ƯÁ¤ ä³ÎÀÇ Æ¯Á¤ Á¸¿¡¸¸ °øÁö switch(byServerType) { case FIELD_SERVER: { // ¼­¹ö ¾ÆÀ̵𰡠0À̸é ÇØ´ç ¸¶À» Àüü¿¡ °øÁö pChannel->SendToVillages((BYTE*)¬iceMsg, noticeMsg.GetSize()); char szNotice[MAX_NOTICE_LEN + 1]; ZeroMemory(szNotice, sizeof(szNotice)); strncpy(szNotice, noticeMsg.szMsg, pRecvMsg->dwNoticeLength); MessageOut(eCRITICAL_LOG, "---------------------------<< %d Channel/FieldServer Notice >>-------------------------", byChannelID); MessageOut(eCRITICAL_LOG, "%s", szNotice); MessageOut(eCRITICAL_LOG, "------------------------------------------------------------------------"); } break; case BATTLE_SERVER: { pChannel->SendToBattleZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); /* ChannelManager::Instance()->SendToLobby((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToMissionZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToHuntingZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToQuestZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToPVPZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToEventZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToGuildZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); ChannelManager::Instance()->SendToSiegeZones((BYTE*)¬iceMsg, noticeMsg.GetSize()); */ char szNotice[MAX_NOTICE_LEN + 1]; ZeroMemory(szNotice, sizeof(szNotice)); strncpy(szNotice, noticeMsg.szMsg, pRecvMsg->dwNoticeLength); MessageOut(eCRITICAL_LOG, "--------------------------<< %d Channel/BattleServer Notice >>------------------------", byChannelID); MessageOut(eCRITICAL_LOG, "%s", szNotice); MessageOut(eCRITICAL_LOG, "------------------------------------------------------------------------"); } break; } } } } // ¸¶½ºÅÍ¿¡ Á¢¼Ó ¼º°øÇϸé ÀÌÆÐŶÀ» ³»·Á¹Þ´Â´Ù. HandlerFromMasterServer_IMPL(MW_SERVER_INFO_CMD) { MSG_MW_SERVER_INFO_CMD* pRecvMsg = (MSG_MW_SERVER_INFO_CMD*)pMsg; // ¹ÞÀº ¼­¹öŰ ¼ÂÆÃ WorldServer::Instance()->SetServerKey(pRecvMsg->ServerKey); MessageOut(eCRITICAL_LOG, "ServerKey Recved from MasterServer(%d) (%d, %d, %d, %d)", pRecvMsg->ServerKey, pRecvMsg->ServerKey.GetWorldID(), pRecvMsg->ServerKey.GetChannelID(), pRecvMsg->ServerKey.GetServerType(), pRecvMsg->ServerKey.GetServerID()); WorldServer::Instance()->UpdateServerTitle(); WorldServer::Instance()->SetGameDBProxyServerAddr(pRecvMsg->m_szGameDBProxyServerIP, pRecvMsg->m_wGameDBProxyServerPort); // DBProxy¼­¹ö Á¢¼Ó WorldServer::Instance()->ConnectToGameDBProxyServer(); // ¸®½¼ ½ÃÀÛ WorldServer::Instance()->StartListen(pRecvMsg->m_szWorldServerIP, pRecvMsg->m_wWorldServerPort, pRecvMsg->m_szWorldServerInnerIP, pRecvMsg->m_wWorldServerInnerPort); } // ¸¶½ºÅÍ ¼­¹ö°¡ ¹èƲÁ¸ Á¤º¸ ¿äû HandlerFromMasterServer_IMPL(MW_BATTLEZONEINFO_REQ) { MSG_MW_BATTLEZONEINFO_ANS sendMsg; CHANNEL_MAP& mapChannel = ChannelManager::Instance()->GetChannelMap(); if(mapChannel.empty()) { // ä³ÎÀÌ Çϳªµµ ¾øÀ¸¸é ¼Û½Å ºÒ°¡ sendMsg.byCount = 0; pServerSession->Send((BYTE*)&sendMsg, sendMsg.GetSize()); } sendMsg.byCount = (BYTE)mapChannel.size(); CHANNEL_MAP::iterator iter; int nChannelNum = 0; Channel* pChannel; for(iter = mapChannel.begin(); iter != mapChannel.end(); iter++) { pChannel = (*iter).second; sendMsg.ChannelInfo[nChannelNum].byWorldID = (BYTE)WorldServer::Instance()->GetWorldID(); sendMsg.ChannelInfo[nChannelNum].byChannelID = BYTE(pChannel->GetChannelID()); for(USHORT i = eZONETYPE_LOBBY; i < eZONETYPE_MAX; i++) { sendMsg.ChannelInfo[nChannelNum].dwZoneCount[i] = pChannel->GetZoneCount((eZONETYPE)i); // sendMsg.ChannelInfo[nChannelNum].dwZoneUserCount[i] = pChannel->GetZoneUserNum((eZONETYPE)i); // sendMsg.ChannelInfo[nChannelNum].dwZonePCRoomUserCount[i] = pChannel->GetZonePCRoomUserNum((eZONETYPE)i); } /* sendMsg.ChannelInfo[nChannelNum].byChannelID = (BYTE)pChannel->GetChannelID(); sendMsg.ChannelInfo[nChannelNum].dwVillageUserCount = pChannel->GetZoneUserNum(eZONETYPE_VILLAGE) + pChannel->GetZoneUserNum(eZONETYPE_FIELD); sendMsg.ChannelInfo[nChannelNum].dwLobbyZoneCount = pChannel->GetZoneCount(eZONETYPE_LOBBY); sendMsg.ChannelInfo[nChannelNum].dwLobbyUserCount = pChannel->GetZoneUserNum(eZONETYPE_LOBBY); sendMsg.ChannelInfo[nChannelNum].dwHuntingZoneCount = pChannel->GetZoneCount(eZONETYPE_HUNTING); sendMsg.ChannelInfo[nChannelNum].dwHuntingUserCount = pChannel->GetZoneUserNum(eZONETYPE_HUNTING); sendMsg.ChannelInfo[nChannelNum].dwMissionZoneCount = pChannel->GetZoneCount(eZONETYPE_MISSION); sendMsg.ChannelInfo[nChannelNum].dwMissionUserCount = pChannel->GetZoneUserNum(eZONETYPE_MISSION); sendMsg.ChannelInfo[nChannelNum].dwQuestZoneCount = pChannel->GetZoneCount(eZONETYPE_QUEST); sendMsg.ChannelInfo[nChannelNum].dwQuestUserCount = pChannel->GetZoneUserNum(eZONETYPE_QUEST); sendMsg.ChannelInfo[nChannelNum].dwPVPZoneCount = pChannel->GetZoneCount(eZONETYPE_PVP); sendMsg.ChannelInfo[nChannelNum].dwPVPUserCount = pChannel->GetZoneUserNum(eZONETYPE_PVP); sendMsg.ChannelInfo[nChannelNum].dwEventZoneCount = pChannel->GetZoneCount(eZONETYPE_EVENT); sendMsg.ChannelInfo[nChannelNum].dwEventUserCount = pChannel->GetZoneUserNum(eZONETYPE_EVENT); sendMsg.ChannelInfo[nChannelNum].dwGuildZoneCount = pChannel->GetZoneCount(eZONETYPE_GUILD); sendMsg.ChannelInfo[nChannelNum].dwGuildUserCount = pChannel->GetZoneUserNum(eZONETYPE_GUILD); sendMsg.ChannelInfo[nChannelNum].dwSiegeZoneCount = pChannel->GetZoneCount(eZONETYPE_SIEGE); sendMsg.ChannelInfo[nChannelNum].dwSiegeUserCount = pChannel->GetZoneUserNum(eZONETYPE_SIEGE); sendMsg.ChannelInfo[nChannelNum].dwVillageUserCount = pChannel->GetZonePCRoomUserNum(eZONETYPE_VILLAGE) + pChannel->GetZonePCRoomUserNum(eZONETYPE_FIELD); sendMsg.ChannelInfo[nChannelNum].dwLobbyUserCount = pChannel->GetZoneUserNum(eZONETYPE_LOBBY); sendMsg.ChannelInfo[nChannelNum].dwMissionUserCount = pChannel->GetZoneUserNum(eZONETYPE_MISSION); sendMsg.ChannelInfo[nChannelNum].dwQuestUserCount = pChannel->GetZoneUserNum(eZONETYPE_QUEST); sendMsg.ChannelInfo[nChannelNum].dwPVPUserCount = pChannel->GetZoneUserNum(eZONETYPE_PVP); sendMsg.ChannelInfo[nChannelNum].dwEventUserCount = pChannel->GetZoneUserNum(eZONETYPE_EVENT); */ nChannelNum++; } pServerSession->Send((BYTE*)&sendMsg, sendMsg.GetSize()); } HandlerFromMasterServer_IMPL(SERVERCOMMON_SERVERSHUTDOWN_REQ) { // Á¤»óÁ¾·á µé¾î°£´Ù! WorldServer::Instance()->Shutdown(); // Á¾·áÇÑ´Ù°í ¾Ë·ÁÁà~ MSG_SERVERCOMMON_SERVERSHUTDOWN_ANS sendMsg; sendMsg.m_byCategory = SERVERCOMMON; sendMsg.m_byProtocol = SERVERCOMMON_SERVERSHUTDOWN_ANS; pServerSession->Send((BYTE*)&sendMsg, sizeof(MSG_SERVERCOMMON_SERVERSHUTDOWN_ANS)); } //------------------------------------------------------------------------------------------------- #ifdef __WAVERIX_SOLAR_AUTH_SERVER_IMPLEMENTATION__ #include "WorldServer.h" #include #include #include "PacketHandler.h" #include "MasterServerSession.h" HandlerFromMasterServer_IMPL(MW_CONNECTION_DISCONNECT_CMD) { printf("RECEIVED [MW_CONNECTION_DISCONNECT_CMD]\n"); } // MASTER SERVER "SM_CONNECTION_PHASE_SHIFT_CMD" º¯°æ½Ã ÂüÁ¶ÇØ¾ß ÇÑ´Ù. // ¾ÖÃÊ, SM_CONNECTION_PHASE_SHIFT_CMD¸¦ ¼öÁ¤ÇÒ ¶§ ÀϰýÀûÀ¸·Î º¯°æÇØ¾ß ÇÑ´Ù. HandlerFromMasterServer_IMPL(MW_CONNECTION_PHASE_SHIFT_CMD) { MSG_MW_CONNECTION_PHASE_SHIFT_CMD* pCMD = (MSG_MW_CONNECTION_PHASE_SHIFT_CMD*)pMsg; ePHASE_SHIFT ePhase = (ePHASE_SHIFT)pCMD->m_dwPHASE_SHIFT; ePhase = (ePHASE_SHIFT)(ePhase&PHASE_UNLIMITED); // BLOCK CMDÀÏ ¼ö ÀÖ´Ù. WorldServer* pWorldServer = WorldServer::Instance(); ePHASE_SHIFT prevPhase = pWorldServer->GetPhaseStatus(); switch(ePhase) { case PHASE_UNKNOWN: // ÀÎÁõ ´Ü°è¸¦ ´Ù½Ã °ÅÄ¡¶ó´Â ÀÇ¹Ì break; case PHASE_EXCHANGE: { if(PHASE_EXCHANGE == prevPhase) return; pWorldServer->SetPhaseStatus(ePhase); if(PHASE_SERVICE == prevPhase) { // ´Ù½Ã EXCHANGE»óÅ·ΠÀüȯµÇ¾ú´Ù´Â °ÍÀº ¼­¹ö ¿¬°á »óÀÇ ¹®Á¦ ¶§¹®¿¡ Á¦¾àÀ»... // PHASE_SERVICE -> PHASE_EXCHANGE // À̰ÍÀº PROCESS_CONNECTION_PHASE_SHIFT_CMD___ON_START_EXCHANGE°¡ Á¸ÀçÇÑ´Ù´Â ÀÇ¹Ì // µ¥ÀÌÅ͸¦ ´Ù½Ã ¹Þ¾Æ¾ß ÇÏ´ÂÁö µîµîÀ» NOTIFY_SIGNAL·Î ÇØ°áÇØ º¸ÀÚ. eSCRIPT_DATA_CMD cmd = SCRIPT_DATA_CMD::SET | SCRIPT_DATA_CMD::RANGE::ONENODE | SCRIPT_DATA_CMD::STATUS::MOVE2EMPTYDATA; ScriptDataManager::DataStatusCommand(cmd, SCRIPT_NOTIFY_SIGNAL); } else { // // PHASE_UNKNOWN -> PHASE_EXCHANGE // // ¼­ºñ½º·ÎÀÇ ÀüȯÀ̹ǷΠÆÄÀÏ Àü¼Ûµîµî, ¿©·¯°¡ÁöÀÇ SolarAuth°ü·Ã ¼­ºñ½º¸¦ // ¹ÞÀ» ¼ö ÀÖ´Ù. ¶Ç´Â ÁÖ¾îÁø CMD¿¡ ´ëÇÑ Ã³¸®¸¦ ¼öÇàÇÒ ¼ö ÀÖ´Ù. // À̰÷¿¡¼­ WorkLoad¼³Á¤ÇÏ¸é µÈ´Ù. // ÀÌ°Í ÀÌ¿ÜÀÇ »óÅÂÀÏ °æ¿ì´Â °ü·Ã WorkLoad Á¦°ÅÇÏÀÚ. ¾Æ´Ï¸é Á¦°ÅµÇµµ·Ï ±¸¼ºÇÑ´Ù. // // ±âÁ¸¿¡ Á¾·áµÇÁö ¾Ê´Â ÀÛ¾÷ÀÌ ÀÖÀ» ¼ö ÀÖ´Ù. À̸¦ ¾î¶»°Ô ÇØ°áÇÒ °ÍÀΰ¡? //if(WorkLoadManager::c_NotExistKey == // pServerSession->GetWorkLoadContainer().FindWorkKey(scriptCode)) PROCESS_CONNECTION_PHASE_SHIFT_CMD___ON_START_EXCHANGE* pWorkNode = new PROCESS_CONNECTION_PHASE_SHIFT_CMD___ON_START_EXCHANGE(); pWorkNode->SetInformation(pServerSession, pServerSession->GetSyncKey(), (DWORD)PHASE_EXCHANGE); WORK_KEY workKey = WorkLoadManager::RegisterTask(pWorkNode); if(WorkLoadManager::c_NotExistKey != workKey) { pServerSession->GetWorkLoadContainer().RegisterWork(workKey, (DWORD)(__int64)pWorkNode); return; } } } break; case PHASE_SERVICE: { if(PHASE_UNKNOWN == prevPhase) { ASSERT(!"À߸øµÈ Á¦¾î »óÅ´٠ȮÀÎÇÒ °Í"); return; } else if(PHASE_SERVICE == prevPhase) { ASSERT(!"À߸øµÈ Á¦¾î »óÅ´٠ȮÀÎÇÒ °Í - ¹º°¡ Âø°¢ÇÑ °Í ¾Æ´Ñ°¡?"); return; } pWorldServer->SetPhaseStatus(ePhase); } break; }; //printf("RECEIVED {MW_CONNECTION_PHASE_SHIFT_CMD} SEND {MSG_MW_DATA_TRANSFER_PLZ_GIVEME_DATA_SYN}\n"); } HandlerFromMasterServer_IMPL(MW_CONNECTION_BLOCK_CMD) { } // //HandlerFromMasterServer_IMPL(MW_DATA_TRANSFER_PLZ_GIVEME_DATA_SYN) HandlerFromMasterServer_IMPL(SERVERCOMMON_DATA_TRANSFER_PLZ_GIVEME_DATA_ACK) { } HandlerFromMasterServer_IMPL(SERVERCOMMON_DATA_TRANSFER_PLZ_GIVEME_DATA_NAK) { } HandlerFromMasterServer_IMPL(SERVERCOMMON_DATA_TRANSFER_SENDDATA_CMD) { //printf("RECEIVED {_DATA_TRANSFER_SENDDATA_CMD} "); MSG_SERVERCOMMON_DATA_TRANSFER_SENDDATA_CMD* pMsgCMD = (MSG_SERVERCOMMON_DATA_TRANSFER_SENDDATA_CMD*)pMsg; switch((DWORD)pMsgCMD->m_wControlCmd) { case MSG_SERVERCOMMON_DATA_TRANSFER_SENDDATA_CMD::TRANS_CMD_SEND_HEADER: { DWORD dwDataType = (DWORD)pMsgCMD->m_FILE_INFO.m_wDataType; DWORD dwBufferSize = (DWORD)pMsgCMD->m_FILE_INFO.m_dwBufferSize; // // ÇØ´ç 󸮴 ÇöÀç µ¥ÀÌÅÍ ·ÎµùÀ» ¿äûÇÑ ÀÌÈÄ¿¡ ´ëÇÑ Ã¹¹øÂ° ÀÀ´ä¿¡ ´ëÇÑ ¹ÝÀÀÀÌ´Ù. // <1> ÇØ´ç ½ºÅ©¸³Æ® Äڵ尡 ¿Ã¹Ù¸¥ Áö °Ë»ç -> F : NAK // <2> T : ÇØ´ç ½ºÅ©¸³Æ® Äڵ忡 ¹öÆÛ¸¦ ÇÒ´çÇÑ´Ù. // DataStreamCommand (SET blah~ // <3> ±âŸ ŸÀӾƿôµîµîÀÇ º¸¾ÈÁ¤Ã¥À» °­±¸ÇÒ °Í //printf("\n\tHEADER {Data Type=%u, Buffer Size = %u\n", dwDataType, dwBufferSize); BYTE* pSTREAM; eSCRIPT_DATA_CMD cmdSTREAM = SCRIPT_DATA_CMD::SET | SCRIPT_DATA_CMD::BUFFERINFO::BUFFER_SIZE; ScriptDataManager::DataStreamCommand(cmdSTREAM, (eSCRIPT_CODE)dwDataType, pSTREAM, dwBufferSize); eSCRIPT_DATA_CMD cmdSTATUS = SCRIPT_DATA_CMD::SET | SCRIPT_DATA_CMD::RANGE::ONENODE | SCRIPT_DATA_CMD::STATUS::MOVE2LOADING; ScriptDataManager::DataStatusCommand(cmdSTATUS, (eSCRIPT_CODE)dwDataType); } break; case MSG_SERVERCOMMON_DATA_TRANSFER_SENDDATA_CMD::TRANS_CMD_SEND_DATA: { DWORD dwDataType = (DWORD)pMsgCMD->m_TOKEN_INFO.m_Header.m_wDataType; DWORD dwTokenNo = (DWORD)pMsgCMD->m_TOKEN_INFO.m_Header.m_wTokenNo; DWORD dwBufferSize = (DWORD)pMsgCMD->m_TOKEN_INFO.m_Header.m_wBufferSize; // // ÇØ´ç 󸮴 ÇöÀç µ¥ÀÌÅÍ ·ÎµùÀ» ¿äû¿¡ ´ëÇÑ ÀÀ´äÀ» ó¸®Çϸç, ½ÇÀç µ¥ÀÌÅͰ¡ ÀÔ·ÂµÇ¾î ¿Â´Ù. // Á¾°áÀÚ°¡ ¿Ã¶§±îÁö ÇØ´ç ÅäÅ«¿¡ ÇØ´çÇÏ´Â À§Ä¡¿¡ // (ÇØ´ç ½ºÅ©¸³¿¡ ÇÒ´çµÈ ¹öÆÛ¸¦ ¾ò¾î¼­ ±× À§Ä¡¿¡) µ¥ÀÌÅ͸¦ º¹»çÇØ °£´Ù. // DataStreamCommand (SET blah~ ScriptDataManager::SaveDataStreamToken( (eSCRIPT_CODE)dwDataType, dwTokenNo, dwBufferSize, pMsgCMD->m_TOKEN_INFO.m_pSTREAM ); //if(SCRIPT_CODE_KEY(FIELD) == dwDataType) //{ // //printf("\n\tDATA {Data Type=%u, Token no = %u, Buffer Size = %u\n", dwDataType, dwTokenNo, dwBufferSize); // printf((CHAR*)pMsgCMD->m_TOKEN_INFO.m_pSTREAM); // printf("\n\nDELIM %u\n\n", pMsgCMD->m_TOKEN_INFO.m_pSTREAM[dwBufferSize-1]); //} //printf("\n\tDATA {Data Type=%u, Token no = %u, Buffer Size = %u\n", dwDataType, dwTokenNo, dwBufferSize); } break; case MSG_SERVERCOMMON_DATA_TRANSFER_SENDDATA_CMD::TRANS_CMD_SEND_CLOSURE: // À̰ÍÀ¸·Î Á¾·áÇϵµ·Ï ¼öÇàÇÏÀÚ. // ¿Ï·áµÇ¸é, ÇØ´ç ½ºÅ©¸³Æ® µ¥ÀÌÅÍ ¿Ï·á Äݹé(³»ºÎ ¿¬»ê ¸ñÀû)À» ¼öÇàÇÑ´Ù. //AsyncReloadData { DWORD dwDataType = (DWORD)pMsgCMD->m_FILE_CLOSURE.m_wDataType; DWORD dwCRC = (DWORD)pMsgCMD->m_FILE_CLOSURE.m_dwCRC; printf("SCRIPT %u\t RECEIVED\n", dwDataType); eSCRIPT_DATA_CMD cmdSTATUS = SCRIPT_DATA_CMD::SET | SCRIPT_DATA_CMD::RANGE::ONENODE | SCRIPT_DATA_CMD::STATUS::MOVE2LOADED; ScriptDataManager::DataStatusCommand(cmdSTATUS, (eSCRIPT_CODE)dwDataType/*, dwCRC*/); ScriptDataManager::ProcessLoadedData((eSCRIPT_CODE)dwDataType); } break; }; } //HandlerFromMasterServer_IMPL(MW_DATA_TRANSFER_SENDDATA_ACK) //HandlerFromMasterServer_IMPL(MW_DATA_TRANSFER_SENDDATA_NAK) #endif //__WAVERIX_SOLAR_AUTH_SERVER_IMPLEMENTATION__ //------------------------------------------------------------------------------------------------- //{__NA001254_20090109_RTTG_FUNC_ADD HandlerFromMasterServer_IMPL(MW_MULTIMEMO_SEND_SYN) { ////////////////////////////////////////////////////////////////////////// // FlowControl flow; FLOWCONTROL_START() { MSG_MW_MULTIMEMO_SEND_SYN* pRecvMsg = (MSG_MW_MULTIMEMO_SEND_SYN*)pMsg; util::StrArrayForMemo memo_string; _tcsncpy(memo_string, pRecvMsg->m_MMemoInfo.m_szMessage, _countof(memo_string)); memo_string[_countof(memo_string) - 1] = _T('\0'); IfFailThenBreak(ProhibitionWordParser::Instance()->CheckFilter(memo_string), 0); //20070131_¸Þ¸ð Ư¼ö¹®ÀÚ ÆÄ½ÌÇÏ°í ´ÙÀ½¹®ÀÚ ºÙ¿©ÁÖ±â #ifdef _KOREA ProhibitionWordParser::Instance()->CheckIncludeSymbol(memo_string); #endif ServerSession* pGameDBProxy = ServerSessionManager::Instance()->GetGameDBProxy(); IfFailThenBreak(pGameDBProxy, RC::RC_MEMO_NOSERVER); MSG_DW_MULTIMEMO_SEND_SYN sendMsg; sendMsg.m_dwKey = pRecvMsg->m_dwKey; sendMsg.m_MMemoInfo = pRecvMsg->m_MMemoInfo; BOOST_STATIC_ASSERT( (_countof(memo_string) == _countof(pRecvMsg->m_MMemoInfo.m_szMessage)) && (_countof(memo_string) == _countof(sendMsg.m_MMemoInfo.m_szMessage))); CopyMemory(sendMsg.m_MMemoInfo.m_szMessage, memo_string, sizeof(sendMsg.m_MMemoInfo.m_szMessage)); IfFailThenBreak(pGameDBProxy->Send((BYTE*)&sendMsg, sizeof(MSG_DW_MULTIMEMO_SEND_SYN)), RC::RC_MEMO_NOSERVER); return /*RETURN TRUE VALUE*/; } FLOWCONTROL_END; ////////////////////////////////////////////////////////////////////////// // const DWORD errCode = flow.GetErrorCode(); MSG_MW_MULTIMEMO_SEND_SYN* pMsgREQ = (MSG_MW_MULTIMEMO_SEND_SYN*)pMsg; MSG_MW_MULTIMEMO_SEND_ACK AckMsg; AckMsg.m_dwKey = pMsgREQ->m_dwKey; AckMsg.m_dwCount = pMsgREQ->m_MMemoInfo.m_nCount; for(DWORD i = 0; i < AckMsg.m_dwCount; ++i) { AckMsg.m_arrResultInfoList->SetCharName(pMsgREQ->m_MMemoInfo.m_arrUserInfoList[i].m_szRecvCharName); AckMsg.m_arrResultInfoList->SetResult(errCode); } pServerSession->Send((BYTE*)&AckMsg,sizeof(MSG_MW_MULTIMEMO_SEND_ACK)); assert(SAFE_NUMERIC_TYPECAST(DWORD, errCode, BYTE)); } //}__NA001254_20090109_RTTG_FUNC_ADD