void CWorld::loadBigpet() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); static BOOL bAPetdata = TRUE; if (m_bLoad == FALSE && !_bWorldEditorApp && bAPetdata) { CallProgressHook_t(0.0f); CTString tWildPetDataLoc; switch( g_iCountry ) { case THAILAND: tWildPetDataLoc.PrintF("data\\bigpet_th.lod"); break; default: tWildPetDataLoc.PrintF("data\\bigpet.lod"); break; } fnTemp = strFullPath + tWildPetDataLoc; if(CWildPetData::loadEx(fnTemp) == false) { MessageBox(NULL, "Apet file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } bAPetdata = FALSE; CallProgressHook_t(1.0f); } }
void CWorld::loadAffinity() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); static BOOL bLoadAffinityData = TRUE; if (m_bLoad == FALSE && bLoadAffinityData && !_bWorldEditorApp && _pNetwork->wo_iNumOfAffinity <= 0) { if( _pNetwork->wo_aAffinityData.Count() == 0 ) { // part of affinity data loading CallProgressHook_t( 0.0f ); switch( g_iCountry ) { case KOREA: fnTemp = strFullPath + "data\\Affinity.lod"; break; case THAILAND: fnTemp = strFullPath + "data\\Affinity.lod"; break; case USA: fnTemp = strFullPath + "data\\Affinity.lod"; break; case GERMANY: case ENGLAND: fnTemp = strFullPath + "data\\Affinity.lod"; break; case SPAIN://FRANCE_SPAIN_CLOSEBETA_NA_20081124 fnTemp = strFullPath + "data\\Affinity.lod"; break; case FRANCE: fnTemp = strFullPath + "data\\Affinity.lod"; break; case POLAND: fnTemp = strFullPath + "data\\Affinity.lod"; break; case RUSSIA: fnTemp = strFullPath + "data\\Affinity.lod"; break; case ITALY: fnTemp = strFullPath + "data\\Affinity.lod"; break; case BRAZIL: fnTemp = strFullPath + "data\\Affinity.lod"; break; case MEXICO: fnTemp = strFullPath + "data\\Affinity.lod"; break; }// end switch( country type ) int iNumOfAffinity = CAffinityData::LoadAffinityDataFromFile( _pNetwork->wo_aAffinityData, fnTemp ); _pNetwork->wo_iNumOfAffinity = iNumOfAffinity; CallProgressHook_t( 1.0f ); LoadStringAffinity(); bLoadAffinityData = FALSE; } } }
void CWorld::loadItemData() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); static BOOL bLoadItemData = TRUE;//0601 FALSE; if (m_bLoad == FALSE && bLoadItemData && !_bWorldEditorApp) { if (_pNetwork->wo_aItemSmcInfo.empty()) { std::string strFilePath = strFullPath.str_String; _pNetwork->wo_aItemSmcInfo.SmcInfoReadBin(strFilePath + "Data\\smc.lod"); } // 아이템 데이터 로딩 부분. CallProgressHook_t(0.0f); switch( g_iCountry ) { case THAILAND: fnTemp = strFullPath + "data\\ItemAll_th.lod"; break; default: fnTemp = strFullPath + "data\\ItemAll.lod"; break; } if (CItemData::loadItemEx(fnTemp) == false) { MessageBox(NULL, "Item ItemAll.lod file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } fnTemp = strFullPath + "data\\JewelCompos.lod"; int iNumJewelGrade = CItemData::LoadJewelItemDataFromFile(_pNetwork->wo_aJewelData, fnTemp); if( iNumJewelGrade == -1 ) { MessageBox(NULL, "result JewelCompos.lod file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } _pNetwork->wo_iNumOfJewelGradeData = iNumJewelGrade; fnTemp = strFullPath + "data\\itemFortune.lod"; if (CFortuneData::loadFortuneEx(fnTemp) == false) { MessageBox(NULL, "result itemFortune.lod file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } CallProgressHook_t(1.0f); LoadStringItem(); bLoadItemData = FALSE; } }
void CWorld::loadSetItemData() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); static BOOL bSetItemLoad = TRUE; //[ttos_2009_5_22]: 세트 아이템 적용 if (m_bLoad == FALSE && !_bWorldEditorApp && bSetItemLoad) { CallProgressHook_t(0.0f); CTString tSetItemDataLoc; switch( g_iCountry ) { case THAILAND: tSetItemDataLoc.PrintF("data\\setItemALL_th.lod"); break; default: tSetItemDataLoc.PrintF("data\\setItemALL.lod"); break; } fnTemp = strFullPath + tSetItemDataLoc; if(CSetItemData::loadSetItemEx(fnTemp) == false) { MessageBox(NULL, "SetItem file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } CallProgressHook_t(1.0f); LoadStringItemSet(); bSetItemLoad = FALSE; } }
void CWorld::loadOption() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); static BOOL bLoadOptionData = TRUE; if (m_bLoad == FALSE && bLoadOptionData && !_bWorldEditorApp ) { CallProgressHook_t(0.0f); switch( g_iCountry ) { case THAILAND: fnTemp = strFullPath + CTString( "data\\Option_th.lod" ); break; default: fnTemp = strFullPath + CTString( "data\\Option.lod" ); break; } if(COptionData::loadEx(fnTemp) == false) { MessageBox(NULL, "Option file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } CallProgressHook_t(1.0f); LoadStringOption(); bLoadOptionData = FALSE; } }
void CWorld::loadShop() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); const BOOL bLoadShopData = TRUE; if(m_bLoad == FALSE && bLoadShopData && !_bWorldEditorApp) { if ( wo_aShopData.Count() == 0 ) { CallProgressHook_t(0.0f); fnTemp = strFullPath + "data\\ShopAll.lod"; int iNumOfShop = CShopData::LoadShopDataFromFile(wo_aShopData, fnTemp); _pNetwork->ga_World.wo_iNumOfShop = iNumOfShop; if(iNumOfShop) { for(int i = 0; i <= iNumOfShop; ++i) { CShopData &SD = wo_aShopData[i]; if(SD.GetIndex() == -1) continue; } } CallProgressHook_t(1.0f); } } }
/* * Load entire world (both brushes and current state). */ void CWorld::Load_t(const CTFileName &fnmWorld) // throw char * { // remember the file wo_fnmFileName = fnmWorld; // open the file CTFileStream strmFile; strmFile.Open_t(fnmWorld); // check engine build allowing reinit BOOL bNeedsReinit; _pNetwork->CheckVersion_t(strmFile, TRUE, bNeedsReinit); // read the world from the file Read_t(&strmFile); // close the file strmFile.Close(); // if reinit is needed if (bNeedsReinit) { // reinitialize SetProgressDescription(TRANS("converting from old version")); CallProgressHook_t(0.0f); ReinitializeEntities(); CallProgressHook_t(1.0f); // reinitialize SetProgressDescription(TRANS("saving converted file")); CallProgressHook_t(0.0f); Save_t(fnmWorld); CallProgressHook_t(1.0f); } }
void CWorld::loadCombo() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); static BOOL bComboData = TRUE; if (m_bLoad == FALSE && !_bWorldEditorApp && bComboData) { CallProgressHook_t(0.0f); CTString tMissionCaseLoc; switch( g_iCountry ) { case THAILAND: tMissionCaseLoc.PrintF("data\\combo_th.lod"); break; default: tMissionCaseLoc.PrintF("data\\combo.lod"); break; } fnTemp = strFullPath + tMissionCaseLoc; if(CMissionCase::loadEx(fnTemp) == false) { MessageBox(NULL, "combo file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } CallProgressHook_t(1.0f); LoadStringCombo(); bComboData = FALSE; } }
void CWorld::loadCatalog() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); { static BOOL bLoadCashShopData = TRUE; if(bLoadCashShopData && !_bWorldEditorApp) { CallProgressHook_t(0.0f); { wo_aCashGoodsData.m_vShopItemArray.clear(); fnTemp = strFullPath + "data\\catalog"; // hardcore if (_pNetwork->m_iServerType == SERVER_TYPE_HARDCORE) fnTemp += "_hardcore"; fnTemp += ".lod"; int iNumOfShop = CCashShopData::LoadShopDataFromFile(wo_aCashGoodsData, fnTemp); } bLoadCashShopData = FALSE; CallProgressHook_t(1.0f); } } }
void CWorld::loadMakeItem() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); static BOOL bMakeItemLoad = TRUE; if (m_bLoad == FALSE && !_bWorldEditorApp && bMakeItemLoad) { CallProgressHook_t(0.0f); CTString tMakeItemDataLoc; switch( g_iCountry ) { case KOREA: tMakeItemDataLoc.PrintF("data\\MakeItem.lod"); break; case THAILAND: tMakeItemDataLoc.PrintF("data\\MakeItem_th.lod"); break; case RUSSIA: tMakeItemDataLoc.PrintF("data\\MakeItem_rus.lod"); break; case USA: tMakeItemDataLoc.PrintF("data\\MakeItem_usa.lod"); break; case GERMANY: case ENGLAND: tMakeItemDataLoc.PrintF("data\\MakeItem_ger.lod"); break; case SPAIN://FRANCE_SPAIN_CLOSEBETA_NA_20081124 tMakeItemDataLoc.PrintF("data\\MakeItem_spn.lod"); break; case FRANCE: tMakeItemDataLoc.PrintF("data\\MakeItem_frc.lod"); break; case POLAND: tMakeItemDataLoc.PrintF("data\\MakeItem_pld.lod"); break; case BRAZIL: tMakeItemDataLoc.PrintF("data\\MakeItem_brz.lod"); break; case ITALY: tMakeItemDataLoc.PrintF("data\\MakeItem_ita.lod"); break; case MEXICO: tMakeItemDataLoc.PrintF("data\\MakeItem_mex.lod"); break; } fnTemp = strFullPath + tMakeItemDataLoc; int iNumOfMakeItemData = CMakeItemData::LoadMakeItemFromFile(_pNetwork->wo_aMakeItemData, fnTemp); _pNetwork->wo_iNomOfMakeItemData = iNumOfMakeItemData; CallProgressHook_t(1.0f); bMakeItemLoad = FALSE; } }
void CWorld::loadLacarette() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); if (m_bLoad == FALSE && !_bWorldEditorApp ) { CallProgressHook_t(0.0f); CTFileName fnmLacaretteData; switch( g_iCountry ) { case KOREA: fnmLacaretteData = strFullPath + CTString( "data\\lacarette.lod" ); break; case THAILAND: fnmLacaretteData = strFullPath + CTString( "data\\lacarette_th.lod" ); break; case USA: fnmLacaretteData = strFullPath + CTString( "data\\lacarette_usa.lod" ); break; case BRAZIL: fnmLacaretteData = strFullPath + CTString( "data\\lacarette_brz.lod" ); break; case GERMANY: case ENGLAND: fnmLacaretteData = strFullPath + CTString( "data\\lacarette_ger.lod" ); break; case SPAIN://FRANCE_SPAIN_CLOSEBETA_NA_20081124 fnmLacaretteData = strFullPath + CTString( "data\\lacarette_spn.lod" ); break; case FRANCE: fnmLacaretteData = strFullPath + CTString( "data\\lacarette_frc.lod" ); break; case POLAND: fnmLacaretteData = strFullPath + CTString( "data\\lacarette_pld.lod" ); break; case RUSSIA: fnmLacaretteData = strFullPath + CTString( "data\\lacarette_rus.lod" ); break; case MEXICO: fnmLacaretteData = strFullPath + CTString( "data\\lacarette_mex.lod" ); break; case ITALY: fnmLacaretteData = strFullPath + CTString( "data\\lacarette_ita.lod" ); break; } CLacarette::LoadLacaretteDataFromFile(_pNetwork->wo_aLacaretteData, fnmLacaretteData ); LoadStringLacarette(); CallProgressHook_t(1.0f); } }
void CWorld::loadMob() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); CTString fnZoneFlag = strFullPath + "data\\ZoneFlag.lod"; static BOOL bLoadMobData = TRUE; const BOOL bWETestGame = (_bWorldEditorApp && _bInTestGame); if ((bLoadMobData && !_bWorldEditorApp) || bWETestGame) { CTString fnMobData; if( ( _pGameState && _pGameState->GetGameMode() != CGameState::GM_NONE ) || bWETestGame ) { CallProgressHook_t(0.0f); switch( g_iCountry ) { case THAILAND: fnMobData.PrintF("data\\mobAll_th.lod"); break; default: fnMobData.PrintF("data\\mobAll.lod"); break; } fnTemp = strFullPath + fnMobData; if(CMobData::loadEx(fnTemp) == false) { MessageBox(NULL, "Npc file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } if(CMobData::LoadZoneData(fnZoneFlag) == false) { MessageBox(NULL, "zoneFlag file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } fnTemp = strFullPath + "data\\npc_channel.bin"; CMobData::LoadChannelData(fnTemp); CallProgressHook_t(1.0f); LoadStringNPCName(); bLoadMobData = FALSE; } } }
void CWorld::loadNPCHelp() { CTString fnTemp; CTString fnTemp2; CTString strFullPath = _fnmApplicationPath.FileDir(); static BOOL bNpcHelpData = TRUE; if (m_bLoad == FALSE && !_bWorldEditorApp && bNpcHelpData) { CallProgressHook_t(0.0f); CTString tNpclistLoc, fMoblistLoc; switch( g_iCountry ) { case THAILAND: tNpclistLoc.PrintF("data\\npchelp_th.lod"); fMoblistLoc.PrintF("data\\mobhelp_th.lod"); break; default: tNpclistLoc.PrintF("data\\npchelp.lod"); fMoblistLoc.PrintF("data\\mobhelp.lod"); break; } fnTemp = strFullPath + tNpclistLoc; fnTemp2 = strFullPath + fMoblistLoc; if(CNpcHelp::loadEx(fnTemp) == false) { MessageBox(NULL, "NpcHelp file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } if(CMobHelp::loadEx(fnTemp2) == false) { MessageBox(NULL, "MobHelp file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } CallProgressHook_t(1.0f); bNpcHelpData = FALSE; } }
void CWorld::loadTitleData() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); static BOOL bTitledata = TRUE; if (m_bLoad == FALSE && !_bWorldEditorApp && bTitledata) { CallProgressHook_t( 0.0f ); fnTemp = strFullPath + CTString( "data\\titletool.lod" ); if(CNickNameData::loadEx(fnTemp) == false) { MessageBox(NULL, "title file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } CallProgressHook_t(1.0f); bTitledata = FALSE; } }
/* * Read world brushes from stream. */ void CWorld::ReadBrushes_t( CTStream *istrm)// throw char * { _pfWorldEditingProfile.StartTimer(CWorldEditingProfile::PTI_READBRUSHES); // must be in 53bit mode when managing brushes CSetFPUPrecision FPUPrecision(FPT_53BIT); ReadInfo_t(istrm, FALSE); SetProgressDescription(TRANS("loading world textures")); CallProgressHook_t(0.0f); // read the brushes from the file _pwoCurrentLoading = this; istrm->DictionaryReadBegin_t(); istrm->DictionaryPreload_t(); CallProgressHook_t(1.0f); SetProgressDescription(TRANS("loading brushes")); CallProgressHook_t(0.0f); wo_baBrushes.Read_t(istrm); CallProgressHook_t(1.0f); // if there are some terrais in world if(istrm->PeekID_t()==CChunkID("TRAR")) { // 'terrain archive' SetProgressDescription(TRANS("loading terrains")); CallProgressHook_t(0.0f); wo_taTerrains.Read_t(istrm); CallProgressHook_t(1.0f); } istrm->DictionaryReadEnd_t(); _pwoCurrentLoading = NULL; _pfWorldEditingProfile.StopTimer(CWorldEditingProfile::PTI_READBRUSHES); }
void CWorld::loadQuest() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); static BOOL bQuestData = TRUE; if (m_bLoad == FALSE && !_bWorldEditorApp && bQuestData) { CallProgressHook_t(0.0f); CTFileName fnmQuestData; switch( g_iCountry ) { case THAILAND: fnmQuestData = strFullPath + "data\\questAll_th.lod"; break; default: fnmQuestData = strFullPath + "data\\questAll.lod"; break; } if (CQuestStaticData::loadEx(fnmQuestData) == false) { MessageBox(NULL, "quest file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } if (CQuestSystem::Instance().Load() == false) { MessageBox(NULL, "quest Setting not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } // 퀘스트는 NPC Name 을 참조함. LoadStringQuest(); CallProgressHook_t(1.0f); bQuestData = FALSE; } }
void CWorld::loadSkill() { CTString fnTemp; CTString strFullPath = _fnmApplicationPath.FileDir(); const BOOL bLoadSkillData = TRUE; if (m_bLoad == FALSE && bLoadSkillData && !_bWorldEditorApp && _pNetwork->wo_iNumOfSkill <= 0 ) { if ( _pNetwork->ga_World.wo_aSkillData.Count() == 0 ) { // 스킬 데이터 로딩 부분. CallProgressHook_t(0.0f); switch( g_iCountry ) { case THAILAND: fnTemp = strFullPath + "data\\Skills_th.lod"; break; default: fnTemp = strFullPath + "data\\Skills.lod"; break; } int iNumOfSkill = CSkill::LoadSkillDataFromFile(_pNetwork->ga_World.wo_aSkillData, fnTemp); if( iNumOfSkill == -1 ) { MessageBox(NULL, "Skill file is not correct", "Error!", MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } _pNetwork->wo_iNumOfSkill = iNumOfSkill; CallProgressHook_t(1.0f); LoadStringSkill(); } } }
void CWorld::loadNotice() { #ifdef IMPROV1107_NOTICESYSTEM if (m_bLoad == FALSE && !_bWorldEditorApp ) { CTString strFullPath = _fnmApplicationPath.FileDir(); CallProgressHook_t( 0.0f ); // [11/18/11 trylord] 자동 공지 시스템 lod CTString tPath = strFullPath + "data\\notice.lod"; if( !CNoticeData::getSingleton()->LoadNoticeDataLOD(tPath) ) { MessageBox(NULL,"Dose not exist or correct event data file!!","ERRROR!!",MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } } #else CNoticeData::getSingleton(); #endif // #ifdef IMPROV1107_NOTICESYSTEM }
/* * Read current world state from stream. */ void CWorld::ReadState_t( CTStream *istr) // throw char * { _pfWorldEditingProfile.StartTimer(CWorldEditingProfile::PTI_READSTATE); // must be in 24bit mode when managing entities CSetFPUPrecision FPUPrecision(FPT_24BIT); CTmpPrecachingNow tpn; _bReadEntitiesByID = FALSE; SetProgressDescription(TRANS("loading models")); CallProgressHook_t(0.0f); wo_slStateDictionaryOffset = istr->DictionaryReadBegin_t(); istr->DictionaryPreload_t(); CallProgressHook_t(1.0f); istr->ExpectID_t("WSTA"); // world state // read the version number INDEX iSavedVersion; (*istr)>>iSavedVersion; // if the version number is the newest if(iSavedVersion==WORLDSTATEVERSION_CURRENT) { // read current version ReadState_new_t(istr); // if the version number is not the newest } else { // if the version can be converted if(iSavedVersion==WORLDSTATEVERSION_CURRENT-1) { // show warning // WarningMessage( // "World state version was %d (old).\n" // "Auto-converting to version %d.", // iSavedVersion, WORLDSTATEVERSION_CURRENT); // read previous version ReadState_old_t(istr); // if the version can be converted } else if(iSavedVersion==WORLDSTATEVERSION_CURRENT-2) { // show warning WarningMessage( TRANS("World state version was %d (very old).\n" "Auto-converting to version %d."), iSavedVersion, WORLDSTATEVERSION_CURRENT); // read previous version ReadState_veryold_t(istr); } else { // report error ThrowF_t( TRANS("World state version is %d (unsupported).\n" "Current supported version is %d."), iSavedVersion, WORLDSTATEVERSION_CURRENT); } } istr->DictionaryReadEnd_t(); SetProgressDescription(TRANS("precaching")); CallProgressHook_t(0.0f); // precache data needed by entities if( gam_iPrecachePolicy==PRECACHE_SMART) { PrecacheEntities_t(); } CallProgressHook_t(1.0f); _pfWorldEditingProfile.StopTimer(CWorldEditingProfile::PTI_READSTATE); }
/* * Open client remote */ void CCommunicationInterface::Client_OpenNet_t(ULONG ulServerAddress) { CTSingleLock slComm(&cm_csComm, TRUE); CPacket* ppaInfoPacket; CPacket* ppaReadPacket; UBYTE ubDummy=65; UBYTE ubReliable; // check for reconnection static ULONG ulLastServerAddress = (ULONG) -1; BOOL bReconnecting = ulServerAddress == ulLastServerAddress; ulLastServerAddress = ulServerAddress; const INDEX iRefresh = 100; // (in miliseconds) // determine connection timeout INDEX ctRetries = bReconnecting?(180*1000/iRefresh):3; // start waiting for server's response if (ctRetries>1) { SetProgressDescription(TRANS("waiting for server")); CallProgressHook_t(0.0f); } // form the connection request packet ppaInfoPacket = new CPacket; ubReliable = UDP_PACKET_RELIABLE | UDP_PACKET_RELIABLE_HEAD | UDP_PACKET_RELIABLE_TAIL | UDP_PACKET_CONNECT_REQUEST; ppaInfoPacket->pa_adrAddress.adr_ulAddress = ulServerAddress; ppaInfoPacket->pa_adrAddress.adr_uwPort = net_iPort; ppaInfoPacket->pa_ubRetryNumber = 0; ppaInfoPacket->WriteToPacket(&ubDummy,1,ubReliable,cm_ciLocalClient.ci_ulSequence++,SLASHSLASH,1); cm_ciLocalClient.ci_pbOutputBuffer.AppendPacket(*ppaInfoPacket,TRUE); // set client destination address to server address cm_ciLocalClient.ci_adrAddress.adr_ulAddress = ulServerAddress; cm_ciLocalClient.ci_adrAddress.adr_uwPort = net_iPort; // for each retry for(INDEX iRetry=0; iRetry<ctRetries; iRetry++) { // send/receive and juggle the buffers if (Client_Update() == FALSE) { break; } // if there is something in the input buffer if (cm_ciLocalClient.ci_pbReliableInputBuffer.pb_ulNumOfPackets > 0) { ppaReadPacket = cm_ciLocalClient.ci_pbReliableInputBuffer.GetFirstPacket(); // and it is a connection confirmation if (ppaReadPacket->pa_ubReliable && UDP_PACKET_CONNECT_RESPONSE) { // the client has succedeed to connect, so read the uwID from the packet cm_ciLocalClient.ci_adrAddress.adr_ulAddress = ulServerAddress; cm_ciLocalClient.ci_adrAddress.adr_uwPort = net_iPort; cm_ciLocalClient.ci_adrAddress.adr_uwID = *((UWORD*) (ppaReadPacket->pa_pubPacketData + MAX_HEADER_SIZE)); cm_ciLocalClient.ci_bUsed = TRUE; cm_ciLocalClient.ci_bClientLocal = FALSE; cm_ciLocalClient.ci_pciOther = NULL; cm_ciLocalClient.ci_pbReliableInputBuffer.RemoveConnectResponsePackets(); delete ppaReadPacket; // finish waiting CallProgressHook_t(1.0f); return; } } _pTimer->Sleep(iRefresh); CallProgressHook_t(FLOAT(iRetry%10)/10); } cci_bBound = FALSE; ThrowF_t(TRANS("Client: Timeout receiving UDP port")); };
void CWorld::loadEvent() { CTString strFullPath = _fnmApplicationPath.FileDir(); if (m_bLoad == FALSE && !_bWorldEditorApp ) { CallProgressHook_t( 0.0f ); // wooss 070228 --------------------------------------->> // kw : WSS_EVENT_LOD // Read Event Lod - event_x.lod FILE* fEvent = NULL; CTString tPath = strFullPath + "data\\event_"; CTString tEventLoc; switch(g_iCountry) { case KOREA: tEventLoc = CTString( "kr.lod" ); break; case THAILAND: tEventLoc = CTString( "th.lod" ); break; case USA: tEventLoc = CTString("usa.lod"); break; case GERMANY: case ENGLAND: tEventLoc = CTString("ger.lod"); break; case BRAZIL: tEventLoc = CTString("brz.lod"); break; case SPAIN: tEventLoc = CTString("spn.lod"); break; case FRANCE: tEventLoc = CTString("frc.lod"); break; case POLAND: tEventLoc = CTString("pld.lod"); break; case RUSSIA: tEventLoc = CTString("rus.lod"); break; case TURKEY: tEventLoc = CTString("tur.lod"); break; case MEXICO: tEventLoc = CTString("mex.lod"); break; case ITALY: tEventLoc = CTString("ita.lod"); break; } tPath += tEventLoc; if( fEvent = fopen(tPath.str_String ,"rb") ) { int eCountry; // EVENT Country int eNum; // EVENT NUMBERS int eIndex; // EVENT INDEX int eValue; // EVENT AVAILUABLE ( x >0 : ENABLE or Event Vailuable , x = 0 : DISABLE ) // 현재 클라이언트 국가코드와 이벤트 국가코드가 맞는지 체크... fread(&eCountry,sizeof(int),1,fEvent); if( _pNetwork->ReturnCCC(eCountry) != g_iCountry) { MessageBox(NULL,"wrong version event data file!!","ERRROR!!",MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } // 이벤트 개수 체크 fread(&eNum,sizeof(int),1,fEvent); g_mapEvent.clear(); // 설정된 이벤트만 생성하여 값 설정하는 방식(동적) for( int i=0;i<eNum;i++) { fread(&eIndex,sizeof(int),1,fEvent); fread(&eValue,sizeof(int),1,fEvent); extern ENGINE_API std::map<int,int> g_mapEvent; // if ENABLE ... if(eValue > 0) { g_mapEvent.insert(std::make_pair(eIndex, eValue)); } } } else { MessageBox(NULL,"Dose not exist or correct event data file!!","ERRROR!!",MB_OK); _pGameState->Running() = FALSE; _pGameState->QuitScreen() = FALSE; } // handle leak detect. fix. [12/22/2009 rumist] if( fEvent ) { fclose( fEvent ); fEvent = NULL; } } }