Esempio n. 1
0
	//------------------------------------------------------------------------
	bool StringParser::LoadStringItems( const string& fileList, const string& directory, bool isEncrypt )
	{
		TiXmlDocument doc;
		if( !FileLoader::LoadFile( &doc, fileList, isEncrypt ) )
		{
			Assert(0);
			_LogError( string("StringParser::LoadStringItems : ") + fileList + "¼ÓÔØʧ°Ü." );
			return false;
		}
		TiXmlElement* root = doc.FirstChildElement( "StringList" );
		if( root == 0 )
		{
			doc.Clear();
			Assert(0);
			_LogError( string("StringParser::LoadStringItems : ") + fileList + "¼ÓÔØʧ°Ü." );
			return false;
		}
		TiXmlElement* entityNode = root->FirstChildElement( "StringFile" );
		for( entityNode; entityNode; entityNode=entityNode->NextSiblingElement("StringFile") )
		{
			const char* fileName = entityNode->Attribute( "File" );
			LoadStringItem( directory + "\\" + fileName, isEncrypt );
		}
		return true;
	}
Esempio n. 2
0
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;
	}
}