コード例 #1
0
void MMatchEventFactoryManager::ParseGameType( MXmlElement& chrElement, vector< EventGameType >& vGameType )
{
	EventGameType GameType;
	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_ORDER, szAttrName) )
		{
			GameType.dwOrder = static_cast< DWORD >( atol(szAttrValue) );
			continue;
		}

		if( 0 == stricmp(EL_TYPE, szAttrName) )
		{
			GameType.GameType = static_cast< MMATCH_GAMETYPE >( atoi(szAttrValue) );
			continue;
		}
	}

	vGameType.push_back( GameType );
}
コード例 #2
0
void MQuestScenarioCatalogue::ParseRewardItem(MXmlElement& element, MQuestScenarioInfo* pScenarioInfo)
{
	char szAttrValue[256], szAttrName[64];

	int nIndex = pScenarioInfo->nRewardItemCount;
	pScenarioInfo->nRewardItemCount++;

	int nAttrCount = element.GetAttributeCount();
	for (int i = 0; i < nAttrCount; i++)
	{
		element.GetAttribute(i, szAttrName, szAttrValue);
		if (!_stricmp(szAttrName, MTOK_SCENARIO_TYPE))
		{
			
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_ITEMID))
		{
			pScenarioInfo->nRewardItemID[nIndex] = atoi(szAttrValue);
		}
		else if (!_stricmp(szAttrName, MTOK_SCENARIO_RATE))
		{
			pScenarioInfo->fRewardItemRate[nIndex] = (float)atof(szAttrValue);
		}
	}

}
コード例 #3
0
void MMatchEventFactoryManager::ParseEventPartTime( MXmlElement& chrElement, vector<EventPartTime>& EventPartTimeVec )
{
	EventPartTime ept;

	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_ORDER, szAttrName) )
		{
			continue;
		}
		*/

		if( 0 == stricmp(EL_START_HOUR, szAttrName) )
		{
			ept.btStartHour = static_cast< BYTE >( atoi(szAttrValue) );
			continue;
		}

		if( 0 == stricmp(EL_END_HOUR, szAttrName) )
		{
			ept.btEndHour = static_cast< BYTE >( atoi(szAttrValue) );
			continue;
		}
	}

#ifdef _DEBUG
	// 중복되는 범위가 있는지 검사.
	vector< EventPartTime >::iterator it, end;
	end = EventPartTimeVec.end();
	for( it = EventPartTimeVec.begin(); it != end; ++it )
	{
		if( (it->btStartHour <= ept.btStartHour) && (ept.btStartHour <= it->btEndHour) )
		{
			ASSERT( 0 );
		}
		
		if( (it->btStartHour <= ept.btEndHour) && (ept.btEndHour <= it->btEndHour) )
		{
			ASSERT( 0 );
		}
	}
#endif

	EventPartTimeVec.push_back( ept );
}
コード例 #4
0
void MQuestScenarioCatalogue::ParseSacriItem(MXmlElement& element, MQuestScenarioInfo* pScenarioInfo)
{
	char szAttrValue[256], szAttrName[64];

	int nIndex = pScenarioInfo->nResSacriItemCount;
	pScenarioInfo->nResSacriItemCount++;

	int nAttrCount = element.GetAttributeCount();
	for (int i = 0; i < nAttrCount; i++)
	{
		element.GetAttribute(i, szAttrName, szAttrValue);
		if (!_stricmp(szAttrName, MTOK_SCENARIO_ITEMID))
		{
			pScenarioInfo->nResSacriItemID[nIndex] = atoi(szAttrValue);
		}
	}
}
コード例 #5
0
void MMatchEventFactoryManager::ParseStartEndTime( MXmlElement& chrElement, SYSTEMTIME& stTime )
{
	memset( &stTime, 0, sizeof(stTime) );

	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_YEAR, szAttrName) )
		{
			stTime.wYear =  static_cast< WORD >( atoi(szAttrValue) );
			continue;
		}

		if( 0 == stricmp(EL_MONTH, szAttrName) )
		{
			stTime.wMonth = static_cast< WORD >( atoi(szAttrValue) );
			continue;
		}

		if( 0 == stricmp(EL_DAY, szAttrName) )
		{
			stTime.wDay = static_cast< WORD >( atoi(szAttrValue) );
			continue;
		}

		if( 0 == stricmp(EL_HOUR, szAttrName) )
		{
			stTime.wHour = static_cast< WORD >( atoi(szAttrValue) );
			continue;
		}
	}
}
コード例 #6
0
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]);
		}
	}
}
コード例 #7
0
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);
		}
	}
}
コード例 #8
0
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);
}
コード例 #9
0
ファイル: ZChatCmd.cpp プロジェクト: MagistrAVSH/node3d
void ZCmdXmlParser::ParseCmd(MXmlElement* pElement)
{
	char szTemp[256]="";
	int n = 0;
	char szAttrValue[256];
	char szAttrName[64];
	char szTagName[128];

	_CmdStr* pCmdStr = new _CmdStr;

	int nID = 0;

	// 속성값 --------------------
	int nAttrCount = pElement->GetAttributeCount();
	for (int i = 0; i < nAttrCount; i++)
	{
		pElement->GetAttribute(i, szAttrName, szAttrValue);
		if (!stricmp(szAttrName, ZCMD_TOK_ATTR_ID))
		{
			nID =  atoi(szAttrValue);
		}
		else if (!stricmp(szAttrName, ZCMD_TOK_ATTR_NAME))
		{
			strcpy(pCmdStr->szName, ZGetStringResManager()->GetStringFromXml(szAttrValue));
		}
		else if (!stricmp(szAttrName, ZCMD_TOK_ATTR_USAGE))
		{
			strcpy(pCmdStr->szUsage, ZGetStringResManager()->GetStringFromXml(szAttrValue));
		}
		else if (!stricmp(szAttrName, ZCMD_TOK_ATTR_HELP))
		{
			strcpy(pCmdStr->szHelp, ZGetStringResManager()->GetStringFromXml(szAttrValue));
		}
	}

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

		// ALIAS 태그 --------------------
		if (!stricmp(szTagName, ZCMD_TOK_ALIAS))
		{
			int nAttrCount = chrElement.GetAttributeCount();
			for (int i = 0; i < nAttrCount; i++)
			{
				chrElement.GetAttribute(i, szAttrName, szAttrValue);
				if (!stricmp(szAttrName, ZCMD_TOK_ATTR_NAME))
				{
					string str = ZGetStringResManager()->GetStringFromXml(szAttrValue);
					if (str.size() > 0)
					{
						pCmdStr->vecAliases.push_back(str);
					}
				}
			}
		}
	}

	if (nID != 0)
	{
		m_CmdMap.insert(map<int, _CmdStr*>::value_type(nID, pCmdStr));
	}
	else
	{
		delete pCmdStr;
	}
}
コード例 #10
0
ファイル: MQuestItem.cpp プロジェクト: MagistrAVSH/node3d
void MQuestItemDescManager::ParseQuestItem( MXmlElement& element )
{
	MQuestItemDesc* pNewQuestItemDesc = new MQuestItemDesc;
	if( 0 == pNewQuestItemDesc )
		return;
	memset( pNewQuestItemDesc, 0, sizeof(MQuestItemDesc) );

	char szAttrName[ 256 ];
	char szAttrValue[ 1024 ];

	int nCount = element.GetAttributeCount();
	for( int i = 0; i < nCount; ++i )
	{
		element.GetAttribute( i, szAttrName, szAttrValue );
		if( 0 == strcmp(MQICTOK_ID, szAttrName) )
		{
			pNewQuestItemDesc->m_nItemID = atoi( szAttrValue );
		}
		else if( 0 == strcmp(MQICTOK_NAME, szAttrName) )
		{
			strcpy( pNewQuestItemDesc->m_szQuestItemName, MGetStringResManager()->GetStringFromXml(szAttrValue) );
		}
		else if( 0 == strcmp(MQICTOK_TYPE, szAttrName) )
		{
			if( 0 == strcmp(szAttrValue, "page") )				pNewQuestItemDesc->m_nType = MMQIT_PAGE;
			else if( 0 == strcmp(szAttrValue, "skull") )		pNewQuestItemDesc->m_nType = MMQIT_SKULL;
			else if( 0 == strcmp(szAttrValue, "fresh") )		pNewQuestItemDesc->m_nType = MMQIT_FRESH;
			else if( 0 == strcmp(szAttrValue, "ring") )			pNewQuestItemDesc->m_nType = MMQIT_RING;
			else if( 0 == strcmp(szAttrValue, "necklace") )		pNewQuestItemDesc->m_nType = MMQIT_NECKLACE;
			else if( 0 == strcmp(szAttrValue, "doll") )			pNewQuestItemDesc->m_nType = MMQIT_DOLL;
			else if( 0 == strcmp(szAttrValue, "book") )			pNewQuestItemDesc->m_nType = MMQIT_BOOK;
			else if( 0 == strcmp(szAttrValue, "object") )		pNewQuestItemDesc->m_nType = MMQIT_OBJECT;
			else if( 0 == strcmp(szAttrValue, "sword") )		pNewQuestItemDesc->m_nType = MMQIT_SWORD;
			else if( 0 == stricmp(szAttrValue, "monbible") )	pNewQuestItemDesc->m_nType = MMQIT_MONBIBLE;
		}
		else if( 0 == strcmp(MQICTOK_DESC, szAttrName) )
		{
			strcpy( pNewQuestItemDesc->m_szDesc, MGetStringResManager()->GetStringFromXml(szAttrValue) );
		}
		else if( 0 == strcmp(MQICTOK_UNIQUE, szAttrName) )
		{
			pNewQuestItemDesc->m_bUnique = (atoi( szAttrValue ) == 0) ? false : true;
		}
		else if( 0 == strcmp(MQICTOK_PRICE, szAttrName) )
		{
			pNewQuestItemDesc->m_nPrice = atoi( szAttrValue );
		}
		else if( 0 == strcmp(MQICTOK_SECRIFICE, szAttrName) )
		{
			pNewQuestItemDesc->m_bSecrifice = (atoi( szAttrValue ) == 0) ? false : true;
		}
		else if( 0 == strcmp(MQICTOK_PARAM, szAttrName) )
		{
			pNewQuestItemDesc->m_nParam = atoi( szAttrValue );
		}

	}

	_ASSERT( find(pNewQuestItemDesc->m_nItemID) == end() );
	insert( value_type(pNewQuestItemDesc->m_nItemID, pNewQuestItemDesc) );

	// Monster bible타입의 퀘스트 아이템은 Param값을 page로 사용함.
	if( MMQIT_MONBIBLE == pNewQuestItemDesc->m_nType )
		m_MonsterBibleMgr.insert( map<int, MQuestItemDesc*>::value_type(pNewQuestItemDesc->m_nParam, pNewQuestItemDesc) );
}
コード例 #11
0
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;
		}		
	}
}
コード例 #12
0
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 );
					}
				}
			}
		}
	}
}