void ZConfiguration::ParseLocaleSelectableLanguages(MXmlElement& selectableLangsElem)
{
	char szTag[256];
	char szLanguageID[256];
	char szLanguageName[256];
	MXmlElement elem;
	int numChild = selectableLangsElem.GetChildNodeCount();

	for (int i=0; i<numChild; ++i)
	{
		elem = selectableLangsElem.GetChildNode(i);
		elem.GetTagName(szTag);
		if (strcmp(szTag, ZTOK_LOCALE_LANGUAGE) == 0)
		{
			bool bID	= elem.GetAttribute(szLanguageID, "id");
			bool bName	= elem.GetAttribute(szLanguageName, "name");
			_ASSERT(bID && bName);

			ZCONFIG_SELECTABLE_LANGUAGE langSelectable;
			langSelectable.strLanguage = szLanguageID;
			langSelectable.strLanguageName = szLanguageName;
			m_Locale.vecSelectableLanguage.push_back(langSelectable);
		}
	}
}
bool ZGameTypeList::ParseGameTypeList( int nGameTypeNum, MXmlElement& element)
{
	int iCount = element.GetChildNodeCount();
	MXmlElement chrElement;
	char szTagName[256];

	ZGameTypeConfig* pConfig = new ZGameTypeConfig;

	int nRoundCount			= 0,
		nTimeLimitCount		= 0,
		nMaxPlayersCount	= 0;

	for (int i = 0; i < iCount; i++)
	{
		chrElement = element.GetChildNode(i);
		chrElement.GetTagName( szTagName);
		if ( szTagName[0] == '#') continue;

		if ( !stricmp( szTagName, "ROUNDS"))
		{
			if ( ParseRound( pConfig, chrElement))
				pConfig->m_nDefaultRound = nRoundCount;

			nRoundCount++;
		}

		else if ( !stricmp( szTagName, "LIMITTIME"))
		{
			if ( ParseLimitTime( pConfig, chrElement))
				pConfig->m_nDefaultLimitTime = nTimeLimitCount;

			nTimeLimitCount++;
		}

		else if ( !stricmp( szTagName, "MAXPLAYERS"))
		{
			if ( ParseMaxPlayers( pConfig, chrElement))
				pConfig->m_nDefaultMaxPlayers = nMaxPlayersCount;

			nMaxPlayersCount++;
		}
	}

	m_GameTypeCfg.insert( m_GameTypeCfg.end(), MGAMETYPECFG::value_type( nGameTypeNum, pConfig));


	return true;
}
Exemple #3
0
bool MSpawnManager::ReadSpawnPosition(char* pszMapFile)
{
	MXmlDocument	aXml;
	aXml.Create();
	if (!aXml.LoadFromFile(pszMapFile)) {
		aXml.Destroy();
		return false;
	}

	char szBuf[65535];
	ZeroMemory(szBuf, 65535);

	MXmlElement aRoot;
	aRoot = aXml.GetDocumentElement();

	int nTotalRead = 0;

	int nSpawnListCount = aRoot.GetChildNodeCount();

	for (int i=0; i<nSpawnListCount; i++)
	{
		MXmlElement aSpawnList = aRoot.GetChildNode(i);
		aSpawnList.GetTagName(szBuf);
		if (szBuf[0] == '#') continue;

		if (!stricmp(szBuf, MTOK_SPAWNPOSITIONLIST)) {
			int nSpawnCount = aSpawnList.GetChildNodeCount();
			for (int j=0; j<nSpawnCount; j++) {
				MXmlElement aSpawn = aSpawnList.GetChildNode(j);
				aSpawn.GetTagName(szBuf);
				if (szBuf[0] == '#') continue;

				if (!strcmp(szBuf, MTOK_SPAWNPOSITION))
				{
					char szSpawnName[128];	ZeroMemory(szSpawnName, 128);
					rvector Pos;

					if (!aSpawn.GetAttribute(szSpawnName, MTOK_NAME)) continue;
            
					int nFieldCount = aSpawn.GetChildNodeCount();
					for (int k=0; k<nFieldCount; k++) {
						MXmlElement aField = aSpawn.GetChildNode(k);
						aField.GetTagName(szBuf);
						if (szBuf[0] == '#') continue;

						if (!stricmp(szBuf, MTOK_POSITION)) {
							aField.GetContents(szBuf);
							sscanf(szBuf, "%f %f %f", &Pos.x, &Pos.y, &Pos.z);
						}
					}

					MSpawnData* pSpawnData = FindSpawnByName(szSpawnName);
					if (pSpawnData) {
						LOG("Duplicated spawn name '%s' found in '%s' file", szSpawnName, pszMapFile);
					} else {
						AddSpawnData(szSpawnName, Pos);
						nTotalRead++;
					}
				}
			}
		}	// SPAWNLIST
	}

	aXml.Destroy();

	LOG("Read %d spawn position in map '%s'", nTotalRead, pszMapFile);

	return true;
}
Exemple #4
0
bool MSpawnManager::ReadSpawnData(char* pszSpawnFile)
{
	MXmlDocument	aXml;
	aXml.Create();
	if (!aXml.LoadFromFile(pszSpawnFile)) {
		aXml.Destroy();
		return false;
	}

	char szBuf[65535];
	ZeroMemory(szBuf, 65535);

	MXmlElement aRoot;
	aRoot = aXml.GetDocumentElement();
	
	int nTotalRead = 0;

	int nSpawnCount = aRoot.GetChildNodeCount();
	for (int i=0; i<nSpawnCount; i++)
	{
		MXmlElement aSpawn = aRoot.GetChildNode(i);
		aSpawn.GetTagName(szBuf);
		if (szBuf[0] == '#') continue;

		if (!stricmp(szBuf, MTOK_SPAWNDATA)) {
			char szSpawnName[128];	ZeroMemory(szSpawnName, 128);
			if (!aSpawn.GetAttribute(szSpawnName, "name")) continue;

			int nObjectID = 0;
			int nMaxCount = 0;
			int nRespawnTime = 0;

			int nFieldCount = aSpawn.GetChildNodeCount();
			for (int j=0; j<nFieldCount; j++) {
				MXmlElement aField = aSpawn.GetChildNode(j);
				aField.GetTagName(szBuf);
				if (szBuf[0] == '#') continue;

				if (!stricmp(szBuf, MTOK_OBJECTID))
					aField.GetContents(&nObjectID);
				else if (!stricmp(szBuf, MTOK_MAXCOUNT))
					aField.GetContents(&nMaxCount);
				else if (!stricmp(szBuf, MTOK_RESPAWNTIME))
					aField.GetContents(&nRespawnTime);
			}

			MSpawnData* pSpawnData = FindSpawnByName(szSpawnName);
			if (pSpawnData) {
				pSpawnData->SetObjID(nObjectID);
				pSpawnData->SetMaxCount(nMaxCount);
				pSpawnData->SetRespawnTime(nRespawnTime);
				nTotalRead++;
			} else {
				LOG("SpawnData '%s' has no SpawnPosition. (%s)", szSpawnName, pszSpawnFile);
			}
		}
	}

	aXml.Destroy();

	LOG("Read %d spawn data in file '%s'", nTotalRead, pszSpawnFile);

	return true;
}
void MQuestScenarioCatalogue::ParseMap(MXmlElement& element, MQuestScenarioInfo* pScenarioInfo)
{
	char szTagName[128], szAttrValue[256], szAttrName[64];
	int nAttrCount = element.GetAttributeCount();

	int nDiceNum=0;
	for (int i = 0; i < nAttrCount; i++)
	{
		element.GetAttribute(i, szAttrName, szAttrValue);
		if (!_stricmp(szAttrName, MTOK_SCENARIO_DICE))
		{
			nDiceNum = atoi(szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_KEY_SECTOR))
		{
			pScenarioInfo->Maps[nDiceNum-1].nKeySectorID = atoi(szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_KEY_NPC))
		{
			pScenarioInfo->Maps[nDiceNum-1].nKeyNPCID = atoi(szAttrValue);

			MMatchQuest* pQuest = MMatchServer::GetInstance()->GetQuest();
			if (pQuest) 
			{
				if (!pQuest->GetNPCInfo(MQUEST_NPC(pScenarioInfo->Maps[nDiceNum-1].nKeyNPCID)))
				{
					pScenarioInfo->Maps[nDiceNum-1].nKeyNPCID = 0;
					_ASSERT(0);	// ÇØ´ç npc°¡ ¾ø´Ù.
				}
			}
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_BOSS))
		{
			if (!_stricmp(szAttrValue, "true")) pScenarioInfo->Maps[nDiceNum-1].bKeyNPCIsBoss = true;
			else pScenarioInfo->Maps[nDiceNum-1].bKeyNPCIsBoss = false;
		}

	}

	int nDiceChildCount = element.GetChildNodeCount();

	if ((nDiceNum <= 0) || (nDiceNum > SCENARIO_STANDARD_DICE_SIDES))
	{
		nDiceNum = 1;
		// ÁÖ»çÀ§ ´«ÀÌ À߸øÀԷµǾî ÀÖ´Ù.
		_ASSERT(0);
	}
	MXmlElement chrElement;
	for (int k = 0; k < nDiceChildCount; k++)
	{
		chrElement = element.GetChildNode(k);
		chrElement.GetTagName(szTagName);
		if (szTagName[0] == '#') continue;

		if (!_stricmp(szTagName, MTOK_SCENARIO_NPCSET_ARRAY))
		{
			ParseNPCSetArray(chrElement, pScenarioInfo->Maps[nDiceNum-1].vecNPCSetArray);
		}
		else if (!_stricmp(szTagName, MTOK_SCENARIO_JACO))
		{
			ParseJaco(chrElement, &pScenarioInfo->Maps[nDiceNum-1]);
		}
	}
}
void MQuestScenarioCatalogue::ParseJaco(MXmlElement& element, MQuestScenarioInfoMaps* pMap)
{


	MQuestScenarioInfoMapJaco jaco;
	jaco.nNPCID = NPC_NONE;
	jaco.fRate = 0.0f;

	char szAttrValue[256], szAttrName[64], szTagName[128];

	int nAttrCount = element.GetAttributeCount();
	for (int i = 0; i < nAttrCount; i++)
	{
		element.GetAttribute(i, szAttrName, szAttrValue);

		if (!_stricmp(szAttrName, MTOK_SCENARIO_COUNT))
		{
			pMap->nJacoCount = atoi(szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_TICK))
		{
			pMap->nJacoSpawnTickTime = atoi(szAttrValue) * 1000;
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_MIN_NPC))
		{
			pMap->nJacoMinNPCCount = atoi(szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_MAX_NPC))
		{
			pMap->nJacoMaxNPCCount = atoi(szAttrValue);
		}
	}

	int nChildCount = element.GetChildNodeCount();

	MXmlElement chrElement;
	for (int k = 0; k < nChildCount; k++)
	{
		chrElement = element.GetChildNode(k);
		chrElement.GetTagName(szTagName);
		if (szTagName[0] == '#') continue;

		if (!_stricmp(szTagName, MTOK_SCENARIO_NPC))
		{
			int nAttrCount = chrElement.GetAttributeCount();

			MQuestScenarioInfoMapJaco jaco;
			jaco.nNPCID = NPC_NONE;
			jaco.fRate = 0.0f;

			for (int m = 0; m < nAttrCount; m++)
			{
				chrElement.GetAttribute(m, szAttrName, szAttrValue);

				if (!_stricmp(szAttrName, MTOK_SCENARIO_NPCID))
				{
					jaco.nNPCID = (MQUEST_NPC)atoi(szAttrValue);
				}
				else if (!_stricmp(szAttrName, MTOK_SCENARIO_RATE))
				{
					jaco.fRate = (float)atof(szAttrValue);			
				}
			}

			pMap->vecJacoArray.push_back(jaco);
		}
	}
}
void MQuestScenarioCatalogue::ParseStandardScenario(MXmlElement& element)
{
	char szTemp[256]="";
	int n = 0;
	char szAttrValue[256];
	char szAttrName[64];
	char szTagName[128];

	MQuestScenarioInfo* pScenarioInfo = new MQuestScenarioInfo();
	pScenarioInfo->bSpecialScenario = false;

	int nAttrCount = element.GetAttributeCount();
	for (int i = 0; i < nAttrCount; i++)
	{
		element.GetAttribute(i, szAttrName, szAttrValue);
		if (!_stricmp(szAttrName, MTOK_SCENARIO_TITLE))
		{
			strcpy_safe(pScenarioInfo->szTitle, szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_QL))
		{
			pScenarioInfo->nQL = atoi(szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_DC))
		{
			pScenarioInfo->fDC = (float)atof(szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_MAPSET))
		{
			pScenarioInfo->nMapSet = QuestMapNameToID(szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_XP))
		{
			pScenarioInfo->nXPReward = atoi(szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_BP))
		{
			pScenarioInfo->nBPReward = atoi(szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_SECTOR_XP))
		{
			pScenarioInfo->nSectorXP = atoi(szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_SECTOR_BP))
		{
			pScenarioInfo->nSectorBP = atoi(szAttrValue);
		}
	}

	int iChildCount = element.GetChildNodeCount();

	MXmlElement chrElement;
	for (int i = 0; i < iChildCount; i++)
	{
		chrElement = element.GetChildNode(i);
		chrElement.GetTagName(szTagName);
		if (szTagName[0] == '#') continue;

		if (!_stricmp(szTagName, MTOK_SCENARIO_SACRI_ITEM))
		{
			ParseSacriItem(chrElement, pScenarioInfo);
		}
		else if (!_stricmp(szTagName, MTOK_SCENARIO_REWARD_ITEM))
		{
			ParseRewardItem(chrElement, pScenarioInfo);
		}
		else if (!_stricmp(szTagName, MTOK_SCENARIO_MAP))
		{
			ParseMap(chrElement, pScenarioInfo);
		}

	}

	pScenarioInfo->nID = CalcStandardScenarioID(pScenarioInfo->nMapSet, pScenarioInfo->nQL);
	Insert(pScenarioInfo);
}
bool ZConfiguration::LoadSystem(const char* szFileName)
{
	char			*buffer;
	MZFile			mzFile;
	MXmlDocument	xmlConfig;
	xmlConfig.Create();

	if( !mzFile.Open( szFileName, ZApplication::GetFileSystem())) 
	{
		xmlConfig.Destroy();
		return false;
	} 

	buffer = new char[ mzFile.GetLength()+1];
	buffer[mzFile.GetLength()]=0;
	mzFile.Read( buffer, mzFile.GetLength());

	mlog( "Load XML from memory : %s", FILENAME_SYSTEM );

	if( !xmlConfig.LoadFromMemory( buffer, GetLanguageID(m_Locale.strDefaultLanguage.c_str())) )
	{
		mlog( "- FAIL\n");

		xmlConfig.Destroy();
		return false;
	}
	delete[] buffer;
	mzFile.Close();
	mlog( "- SUCCESS\n");

	MXmlElement		parentElement = xmlConfig.GetDocumentElement();
	MXmlElement		serverElement, childElement;

	int iCount = parentElement.GetChildNodeCount();

	if (!parentElement.IsEmpty())
	{
		m_ServerList.clear();

		m_nServerCount = 0;
		while ( 1)
		{
			char szText[ 256];
			sprintf( szText, "%s%d", ZTOK_SERVER, m_nServerCount);
			if (parentElement.FindChildNode( szText, &serverElement))
			{
				char szServerIP[ 32];
				char szName[ 32];
				int nServerPort;
				int nServerType;
				serverElement.GetChildContents( szServerIP,		ZTOK_IP);
				serverElement.GetChildContents( &nServerPort,	ZTOK_PORT);
				serverElement.GetChildContents( &nServerType,	ZTOK_TYPE);
				serverElement.GetChildContents( szName,			ZTOK_NAME);

                ZSERVERNODE ServerNode;
				strcpy( ServerNode.szAddress, szServerIP);
				strcpy( ServerNode.szName, szName);
				ServerNode.nPort = nServerPort;
				ServerNode.nType = nServerType;

				m_ServerList.insert( map<int,ZSERVERNODE>::value_type( m_nServerCount, ServerNode));

				m_nServerCount++;
			}
			else
				break;
		}

		if (parentElement.FindChildNode(ZTOK_LOCALE_BAREPORT, &childElement))
		{
			childElement.GetChildContents( m_szBAReportAddr, ZTOK_ADDR);
			childElement.GetChildContents( m_szBAReportDir,  ZTOK_DIR);
		}

		if (parentElement.FindChildNode(ZTOK_LOCALE_XMLHEADER, &childElement))
		{
			childElement.GetContents(m_Locale.szXmlHeader);
		}

		if (parentElement.FindChildNode(ZTOK_SKIN, &childElement))
		{
			childElement.GetContents(m_szInterfaceSkinName);
		}

		if (parentElement.FindChildNode(ZTOK_LOCALE_DEFFONT, &childElement))
		{
			childElement.GetContents(m_Locale.szDefaultFont);
		}

		if (parentElement.FindChildNode(ZTOK_LOCALE_IME, &childElement))
		{
 			childElement.GetContents(&m_Locale.bIMESupport);

			MEvent::SetIMESupport( m_Locale.bIMESupport);
		}
		if (parentElement.FindChildNode(ZTOK_LOCALE_HOMEPAGE, &childElement))
		{
			childElement.GetChildContents( m_Locale.szHomepageUrl,		ZTOK_LOCALE_HOMEPAGE_URL);
			childElement.GetChildContents( m_Locale.szHomepageTitle,	ZTOK_LOCALE_HOMEPAGE_TITLE);
		}
		if (parentElement.FindChildNode(ZTOK_LOCALE_EMBLEM_URL, &childElement))
		{
			childElement.GetContents( m_Locale.szEmblemURL);
		}
		if (parentElement.FindChildNode(ZTOK_LOCALE_TEMBLEM_URL, &childElement))
		{
			childElement.GetContents( m_Locale.szTEmblemURL);
		}
		if (parentElement.FindChildNode(ZTOK_LOCALE_CASHSHOP_URL, &childElement))
		{
			childElement.GetContents( m_Locale.szCashShopURL);
		}
		if (parentElement.FindChildNode(ZTOK_LOCATOR_LIST, &childElement))
		{
			m_pLocatorList->ParseLocatorList(childElement);
		}
		if (parentElement.FindChildNode(ZTOK_TLOCATOR_LIST, &childElement))
		{
			m_pTLocatorList->ParseLocatorList(childElement);
		}
	}
	xmlConfig.Destroy();

	m_bIsComplete = true;
	return true;
}
void MMatchEventFactoryManager::ParseEvent( MXmlElement& chrElement )
{
	char szAttrName[ 128 ];
	char szAttrValue[ 256 ];
	
	DWORD						dwEventListID = 0;
	DWORD						dwEventID = 0;
	string						strEventName;
	string						strAnnounce;
	EVENT_TYPE					EventType;
	DWORD						dwElapsedTime = 0;
	DWORD						dwPercent = 0;
	DWORD						dwRate = 0;
	vector< EventServerType >	vServerType;
	vector< EventGameType >		vGameType;
	SYSTEMTIME					Start, End;
	float						fXPBonusRatio = 0.0f;
	float						fBPBonusRatio = 0.0f;
	vector< EventPartTime >		EventPartTimeVec;

	memset( &Start, 0, sizeof(SYSTEMTIME) );
	memset( &End, 0, sizeof(SYSTEMTIME) );

	const int nAttrCnt = chrElement.GetAttributeCount();
	for( int i = 0; i < nAttrCnt; ++i )
	{
		chrElement.GetAttribute( i, szAttrName, szAttrValue );

		if( 0 == stricmp(EL_EVENT_LIST_ID, szAttrName) )
		{
			dwEventListID = static_cast< DWORD >( atoi(szAttrValue) );
			ASSERT( 0 < dwEventListID );
			continue;
		}

		if( 0 == stricmp(EL_EVENTID, szAttrName) )
		{
			dwEventID = static_cast< DWORD >( atol(szAttrValue) );
			if( NULL == MMatchEventDescManager::GetInstance().Find(dwEventID) )
			{
				ASSERT( 0 && "Event.xml에 없는 Event ID입니다." );
				mlog( "MMatchEventFactoryManager::ParseEvent - Event.xml에 없는 Event ID(%u)입니다.\n",
					dwEventID );
				return;
			}
			continue;
		}

		if( 0 == stricmp(EL_NAME, szAttrName) )
		{
			strEventName = MGetStringResManager()->GetString( string(szAttrValue) );
			continue;
		}

		if( 0 == stricmp(EL_EVENTTYPE, szAttrName) )
		{
			EventType = static_cast< EVENT_TYPE >( atoi(szAttrValue) );
			continue;
		}

		if( 0 == stricmp(EL_ELAPSEDTIME, szAttrName) )
		{
			dwElapsedTime = static_cast< DWORD >( atoi(szAttrValue) );
			continue;
		}

		if( 0 == stricmp(EL_PERCENT, szAttrName) )
		{
			dwPercent = static_cast< DWORD >( atol(szAttrValue) );
			continue;
		}

		if( 0 == stricmp(EL_RATE, szAttrName) )
		{
			dwRate = static_cast< DWORD >( atol(szAttrValue) );
			continue;
		}

		if( 0 == stricmp(EL_ANNOUNCE, szAttrName) )
		{
			strAnnounce = MGetStringResManager()->GetString( string(szAttrValue) );
			continue;
		}

		if( 0 == stricmp(EL_XPBONUS_RATIO, szAttrName) )
		{
			fXPBonusRatio = static_cast<float>( atoi(szAttrValue) ) / 100.0f;
			continue;
		}

		if( 0 == stricmp(EL_BPBONUS_RATIO, szAttrName) )
		{
			fBPBonusRatio = static_cast<float>( atoi(szAttrValue) ) / 100.0f;
			continue;
		}
	}

	MXmlElement chrNode;
	char szTag[ 128 ];
	const int nChrNodeCnt = chrElement.GetChildNodeCount();

	EventPartTimeVec.clear();
	
	for( int j = 0; j < nChrNodeCnt; ++j )
	{
		chrNode = chrElement.GetChildNode( j );
		chrNode.GetTagName( szTag );

		if (szTag[0] == '#') continue;

		if( 0 == stricmp(EL_SERVERTYPE, szTag) )
		{
			ParseServerType( chrNode, vServerType );
			continue;
		}

		if( 0 == stricmp(EL_GAMETYPE, szTag) )
		{
			ParseGameType( chrNode, vGameType );
			continue;
		}

		if( 0 == stricmp(EL_STARTTIME, szTag) )
		{
			ParseStartEndTime( chrNode, Start );
			continue;
		}

		if( 0 == stricmp(EL_ENDTIME, szTag) )
		{
			ParseStartEndTime( chrNode, End );
			continue;
		}

		if( 0 == stricmp(EL_PART_TIME, szTag) )
		{
			ParseEventPartTime(chrNode, EventPartTimeVec );
			continue;
		}
	}

	// check start end time.
	if( !CheckUsableEventTimeByEndTime(End) )
	{
#ifdef _DEBUG
		mlog( "Time out Event(%u:%u.%u.%u.%u~%u.%u.%u.%u)\n", 
			dwEventID,
			Start.wYear, Start.wMonth, Start.wDay, Start.wHour,
			End.wYear, End.wMonth, End.wDay, End.wHour );
#endif
		return;
	}
	
	// check server type.
	vector< EventServerType >::iterator itSvrTyp, endSvrTyp;
	bool bUseEvent = false;
	endSvrTyp = vServerType.end();
	for( itSvrTyp = vServerType.begin(); itSvrTyp != endSvrTyp; ++itSvrTyp )
	{
		// 모든 서버에 적용.
		if( MSM_ALL == itSvrTyp->ServerType )
		{
			bUseEvent = true;
			continue;
		}

		// 현제 서버 타입에만 적용.
		if( MGetServerConfig()->GetServerMode() == itSvrTyp->ServerType )
		{
			bUseEvent = true;
			continue;
		}
	}

	ASSERT( (0 < Start.wYear) && (0 < Start.wMonth) && (0 < Start.wDay) && (0 <= Start.wHour) &&
			(0 < End.wYear) && (0 < End.wMonth) && (0 < End.wDay) && (0 <= End.wHour) );

	// check game type.
	if( bUseEvent )
	{
		EventData ed;
		vector< EventGameType >::iterator itGmTyp, endGmTyp;
		endGmTyp = vGameType.end();
		for( itGmTyp = vGameType.begin(); itGmTyp != endGmTyp; ++itGmTyp )
		{
			// insert event.

			ed.dwEventListID	= dwEventListID;
			ed.dwEventID		= dwEventID;
			ed.EventType		= EventType;
			ed.dwGameType			= itGmTyp->GameType;
			ed.ServerType		= MGetServerConfig()->GetServerMode();
			ed.dwElapsedTime	= dwElapsedTime;
			ed.dwPercent		= dwPercent;
			ed.dwRate			= dwRate;
			ed.Start			= Start;
			ed.End				= End;
			ed.strName			= strEventName;
			ed.strAnnounce		= strAnnounce;
			ed.fXPBonusRatio	= fXPBonusRatio;
			ed.fBPBonusRatio	= fBPBonusRatio;

			ed.EventPartTimeVec.swap( EventPartTimeVec );

			InsertEvent( ed );

			++m_LoadEventSize;
		}		
	}
}
void MMatchEventFactoryManager::ParseLocale( MXmlElement& chrElement )
{
	EventData ed;
	char szAttrName[ 128 ];
	char szAttrValue[ 256 ];
	const int nAttrCnt = chrElement.GetAttributeCount();
	for( int i = 0; i < nAttrCnt; ++i )
	{
		chrElement.GetAttribute( i, szAttrName, szAttrValue );
		
		if( 0 == stricmp(EL_COUNTRY, szAttrName) )
		{
			/*  // MBaseLocale.h // 
			enum MCountry
			{
				MC_KOREA			= 82,		// 한국
				MC_US				= 1,		// 미국(인터네셔날)
				MC_JAPAN			= 81,		// 일본
			};
			*/

			string strCountry;
			switch( MGetLocale()->GetCountry() )
			{
			case MC_KOREA :
				{
					strCountry = "kor";
				}
				break;

			case MC_US :
				{
					strCountry = "us";
				}
				break;

			case MC_JAPAN :
				{
					strCountry = "jpn";
				}
				break;

			case MC_BRAZIL :
				{
					strCountry = "brz";
				}
				break;

			case MC_INDIA :
				{
					strCountry = "ind";
				}
				break;

			default :
				{
					ASSERT( 0 );
				}
				break;
			}

			// 현제 서버랑 같은 국가 타입만 파싱함. 
            // if( 0 == stricmp(strCountry.c_str(), szAttrValue) )
			// 국가코드 구분 안함. 이미 국가별로 나눠줘 있음.
			if( true )
			{
				MXmlElement chrNode;
				char szTag[ 128 ];
				const int nChrCnt = chrElement.GetChildNodeCount();
				for( int j = 0; j < nChrCnt; ++j )
				{
					chrNode = chrElement.GetChildNode( j );
					chrNode.GetTagName( szTag );

					if( 0 == stricmp(EL_EVENT, szTag) )
					{
						ParseEvent( chrNode );
					}
				}
			}
		}
	}
}