Exemple #1
0
ZCharacterView* ZIDLResource::GetCharacterView(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[4096];

	MWidget* pParentWidget = GetParentWidget(element);
	ZCharacterView* pWidget = new ZCharacterView("", pParentWidget, pParentWidget);
	InsertWidget(element, pWidget);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		GetCommonWidgetProperty(pWidget, childElement, szBuf);

		if(!strcmp(szBuf, "VISIBLEEQUIPMENT")){
			bool bVisibleEquipment = false;
			childElement.GetContents(&bVisibleEquipment);
			pWidget->SetVisibleEquipment(bVisibleEquipment);
		}
	}

	return pWidget;
}
Exemple #2
0
ZBmNumLabel* ZIDLResource::GetBmNumLabel(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[1024];
	MWidget* pParentWidget;	MListener* pListener;

	pListener = pParentWidget = GetParentWidget(element);
	ZBmNumLabel* pBmLabel = new ZBmNumLabel(MINT_ZBMNUMLABEL, pParentWidget, pListener);
	InsertWidget(element, pBmLabel);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		if (GetCommonWidgetProperty(pBmLabel, childElement, szBuf)) continue;
		else if (!strcmp(szBuf, "FONTSIZE"))
		{
			pBmLabel->SetCharSize(GetSize(childElement));
		}
		else if (!strcmp(szBuf, "BITMAP"))
		{
			MBitmap* pBitmap = GetBitmap(childElement);

			if (pBitmap != NULL)
			{
				pBmLabel->SetLabelBitmap(pBitmap);
			}
		}
	}
	return pBmLabel;
}
Exemple #3
0
ZPlayerSelectListBox* ZIDLResource::GetPlayerSelectListBox(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[4096];
//	char szAttr[4096];

	MWidget* pParentWidget = GetParentWidget(element);
	ZPlayerSelectListBox* pWidget = new ZPlayerSelectListBox("SelectPlayer", pParentWidget, pParentWidget);
	pWidget->SetListener(pWidget);
	InsertWidget(element, pWidget);

	int iCount = element.GetChildNodeCount();

	bool bMode1 = false;

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		if(GetCommonWidgetProperty(pWidget, childElement, szBuf)) continue;
		else if(!strcmp(szBuf, "MULTISELECT"))
		{
			pWidget->m_bMultiSelect = true;
		}
	}
	return pWidget;
}
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);
		}
	}
}
Exemple #5
0
ZCharacterViewList* ZIDLResource::GetCharacterViewList(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[4096];

	MWidget* pParentWidget = GetParentWidget(element);
	ZCharacterViewList* pWidget = new ZCharacterViewList("", pParentWidget, pParentWidget);
	InsertWidget(element, pWidget);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		if(GetCommonWidgetProperty(pWidget, childElement, szBuf)) continue;

		if(!strcmp(szBuf, "ITEMWIDTH")){
			int nWidth = 80;
			childElement.GetContents(&nWidth);
			pWidget->SetItemWidth(nWidth);
		}
	}

	return pWidget;
}
Exemple #6
0
ZServerView* ZIDLResource::GetServerView(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[ 4096];

	MWidget* pParentWidget = GetParentWidget( element);
	ZServerView* pWidget = new ZServerView( "", pParentWidget, pParentWidget);
	InsertWidget( element, pWidget);

	int iCount = element.GetChildNodeCount();
	for (int i = 0;  i < iCount;  i++)
	{
		memset(szBuf, 0, sizeof( szBuf));
		childElement = element.GetChildNode( i);
		childElement.GetTagName( szBuf);

		GetCommonWidgetProperty( pWidget, childElement, szBuf);

//		if ( !strcmp( szBuf, "NAME"))
//		{
//			char szName[ 25];
//			childElement.GetContents( szName);
//			pWidget->SetName( szName);
//		}
	}

	return pWidget;
}
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;
}
void MChannelRuleMgr::ParseRule(MXmlElement* pElement)
{
	// Get Rule Node
	int nID = 0;
	pElement->GetAttribute(&nID, MTOK_CHANNELRULE_ATTR_ID);
	char szName[128]="";
	pElement->GetAttribute(szName, MTOK_CHANNELRULE_ATTR_NAME);	

	MChannelRule* pRule = new MChannelRule;
	pRule->Init(nID, szName);

	// Get Map Nodes
	MXmlElement childElement;
	char szTagName[256]=""; char szAttr[256]="";

	int nCount = pElement->GetChildNodeCount();
	for (int i=0; i<nCount; i++) {
		childElement = pElement->GetChildNode(i);

		childElement.GetTagName(szTagName);
		if (szTagName[0] == '#') continue;

		if (!_stricmp(szTagName, MTOK_CHANNELMAP))
		{
			if (childElement.GetAttribute(szAttr, MTOK_CHANNELRULE_ATTR_NAME))
			{
				pRule->AddMap(szAttr);
			}
		}
		else if (!_stricmp(szTagName, MTOK_CHANNELRULE_GAMETYPE))
		{
			int nAttr = -1;
			if (childElement.GetAttribute(&nAttr, MTOK_CHANNELRULE_ATTR_ID))
			{
				pRule->AddGameType(nAttr);
			}
		}
	}

	AddRule(pRule);
}
Exemple #9
0
ZDuelTournamentRankingListBox* ZIDLResource::GetDuelTournamentRankingListBox( MXmlElement& element )
{
	MXmlElement childElement;
	char szBuf[4096];
	//	char szAttr[4096];

	MWidget* pParentWidget = GetParentWidget(element);
	ZDuelTournamentRankingListBox* pWidget = new ZDuelTournamentRankingListBox("", pParentWidget, pParentWidget);
	InsertWidget(element, pWidget);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		if(GetCommonWidgetProperty(pWidget, childElement, szBuf)) continue;
	}
	return pWidget;
}
Exemple #10
0
ZScoreBoardFrame* ZIDLResource::GetScoreBoardFrame(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[4096];
	MWidget* pParentWidget;	MListener* pListener;
	MBFrameLook* pFrameLook = NULL;

	pListener = pParentWidget = GetParentWidget(element);
	ZScoreBoardFrame* pFrame = new ZScoreBoardFrame("", pParentWidget, pListener);
	InsertWidget(element, pFrame);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		if (GetCommonWidgetProperty(pFrame, childElement, szBuf)) continue;

		if (!strcmp(szBuf, "FRAMELOOK"))
		{
			char szItem[256];
			memset(szItem, 0, sizeof(szItem));
			childElement.GetContents(szItem);

			map<string, MBFrameLook*>::iterator itor = m_FrameLookMap.find(szItem);
			if (itor != m_FrameLookMap.end())
			{
				pFrameLook = (MBFrameLook*)(*itor).second;
				pFrame->ChangeCustomLook((MFrameLook*)pFrameLook);
			}
		}
	}


	return pFrame;
}
Exemple #11
0
ZActionKey* ZIDLResource::GetActionKey(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[4096];
	MWidget* pParentWidget;	MListener* pListener;

	pListener = pParentWidget = GetParentWidget(element);
	ZActionKey* pActionKey = (ZActionKey*)Mint::GetInstance()->NewWidget(MINT_ACTIONKEY, "", pParentWidget, pListener);
	InsertWidget(element, pActionKey);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		if (GetCommonWidgetProperty(pActionKey, childElement, szBuf)) continue;

		/*
		if (!strcmp(szBuf, "EDITLOOK"))
		{
			char szItem[256];
			memset(szItem, 0, sizeof(szItem));
			childElement.GetContents(szItem);

			map<string, MBEditLook*>::iterator itor = m_EditLookMap.find(szItem);
			if (itor != m_EditLookMap.end())
			{
				pActionKey->ChangeCustomLook((MBEditLook*)(*itor).second);
			}
		}
		*/

	}

	return pActionKey;
}
Exemple #12
0
ZMapListBox* ZIDLResource::GetMapListBox(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[4096];
	MWidget* pParentWidget;	MListener* pListener;

	pListener = pParentWidget = GetParentWidget(element);
	ZMapListBox* pListBox = new ZMapListBox("", pParentWidget, pListener);
	InsertWidget(element, pListBox);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		GetCommonWidgetProperty(pListBox, childElement, szBuf);
	}

	return pListBox;
}
Exemple #13
0
ZStageInfoBox* ZIDLResource::GetStageInfoBox(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[4096];

	MWidget* pParentWidget = GetParentWidget(element);
	ZStageInfoBox* pWidget = new ZStageInfoBox("", pParentWidget, pParentWidget);
	InsertWidget(element, pWidget);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		if (GetCommonWidgetProperty(pWidget, childElement, szBuf)) continue;
		else if (!strcmp(szBuf, "STAGEINFOITEMLOOK"))
		{
			char szItem[256];
			memset(szItem, 0, sizeof(szItem));
			childElement.GetContents(szItem);

			map<string, MBListBoxLook*>::iterator itor = m_ListBoxLookMap.find(szItem);
			if (itor != m_ListBoxLookMap.end())
			{
				MBListBoxLook* pListBoxLook = NULL;
				pListBoxLook = (*itor).second;
//				pWidget->ChangeCustomLook(pListBoxLook);
				pWidget->SetLook(pListBoxLook);
			}
		}
	}

	return pWidget;
}
Exemple #14
0
ZMeshView* ZIDLResource::GetMeshView(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[4096];

	MWidget* pParentWidget = GetParentWidget(element);
	ZMeshView* pWidget = new ZMeshView("", pParentWidget, pParentWidget);
	InsertWidget(element, pWidget);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		GetCommonWidgetProperty(pWidget, childElement, szBuf);

		if (!strcmp(szBuf, "BUTTONLOOK"))
		{
			char szItem[256];
			memset(szItem, 0, sizeof(szItem));
			childElement.GetContents(szItem);

			map<string, MBButtonLook*>::iterator itor = m_ButtonLookMap.find(szItem);
			if (itor != m_ButtonLookMap.end())
			{
				pWidget->ChangeCustomLook((MButtonLook*)(*itor).second);
			}
			pWidget->SetLook(true);
		}
	}

	return pWidget;
}
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);
}
Exemple #16
0
//////////////////////////////////////////////////////////////////////////
//	InitEnv
//////////////////////////////////////////////////////////////////////////
void ZEmblemList::InitEnv( char* pFileName_ )
{
	MXmlDocument	Data;
	Data.Create();

	MZFile mzf;
	if( !mzf.Open( pFileName_, g_pFileSystem ))
	{
		return;
	}
	char* buffer;
	buffer	= new char[mzf.GetLength() + 1];
	mzf.Read( buffer, mzf.GetLength() );
	buffer[mzf.GetLength()] = 0;

	if( !Data.LoadFromMemory(buffer) )
	{
		delete buffer;
		return;
	}
	delete buffer;
	mzf.Close();

	MXmlElement root, child;
	char TagName[256];
	char Attribute[256];
	root = Data.GetDocumentElement();
	int iCount = root.GetChildNodeCount();	

	for( int i = 0 ; i < iCount; ++i )
	{
		child		= root.GetChildNode(i);
		child.GetTagName( TagName );
		if( TagName[0] == '#' )
		{
			continue;
		}
		child.GetAttribute( Attribute, "NAME" );
		mEmblemMapItor	= mEmblemMap.find( Attribute );
		if( mEmblemMapItor	!= mEmblemMap.end() )
		{
			ZClothEmblem* p		= mEmblemMapItor->second;
			
			if( child.GetAttribute( Attribute, "DIRECTION" ))
			{
				D3DXMATRIX RotMat;
				rvector dir = rvector( 0,1,0 );
				int theta;
				sscanf( Attribute, "%d", &theta );
				D3DXMatrixRotationAxis( &RotMat, &rvector(0,0,1), ((float)theta*D3DX_PI/180) );
				dir = dir*RotMat;
				//p->SetBaseWind( dir );
				p->GetWndGenerator()->SetWindDirection( dir );
			}

			if( child.GetAttribute( Attribute, "POWER" ))
			{
				float power;
				sscanf( Attribute, "%f", &power );
				p->GetWndGenerator()->SetWindPower( power );
			}
			
			MXmlElement dummy;
			int iDummyNum = child.GetChildNodeCount();
			for( int j = 0 ; j < iDummyNum; ++j )
			{
				dummy = child.GetChildNode( j );
				dummy.GetTagName( TagName );
				if( TagName[0] == '#' )
				{
					continue;
				}
				if( stricmp( TagName, "RESTRICTION" ) == 0 )
				{
					sRestriction* rest = new sRestriction;
					int iValue = 0;
					float fValue = 0.f;
					if( dummy.GetAttribute( Attribute, "AXIS" ))
					{
						sscanf( Attribute, "%d", &iValue );
						rest->axis	=(RESTRICTION_AXIS)iValue;
					}				
					if( dummy.GetAttribute( Attribute, "POSITION") )
					{
						sscanf( Attribute, "%f", &fValue );
						rest->position = fValue;
					}
					if( dummy.GetAttribute(Attribute, "COMPARE") )
					{
						sscanf( Attribute, "%d", &iValue );
						rest->compare =(RESTRICTION_COMPARE)iValue;
					}
					p->AddRestriction( rest );
				}
				else if( stricmp( TagName, "WINDTYPE" ) == 0 )
				{
					int iValue = 0;
					if( dummy.GetAttribute( Attribute, "TYPE" ) )
					{
						sscanf( Attribute, "%d", &iValue );
						p->GetWndGenerator()->SetWindType( (WIND_TYPE) iValue );
					}
					if( dummy.GetAttribute( Attribute, "DELAY" ))
					{
						sscanf( Attribute, "%d", &iValue );
						p->GetWndGenerator()->SetDelayTime( iValue );
					}
				}
			}
		}
	}

	for( list<ZClothEmblem*>::iterator iter = begin(); iter != end(); ++iter )
	{
		// 처음 몇 프레임을 계산하고 시작한다..
		for( int i = 0 ; i < 100; ++i )
			(*iter)->update();
	}
}
Exemple #17
0
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;
	}
}
Exemple #18
0
bool MEmblemMgr::LoadCache()
{
	MXmlDocument	xmlDoc;
	xmlDoc.Create();

	if (!xmlDoc.LoadFromFile(GetEmblemDataFile()))
	{
		xmlDoc.Destroy();
		return false;
	}

	MXmlElement rootElement,emblemElement,childElement;
	char szTagName[256];

	rootElement = xmlDoc.GetDocumentElement();
	int iCount = rootElement.GetChildNodeCount();

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

		if (!strcmp(szTagName, MTOK_EMBLEM))
		{
			int nCLID = -1;
			char szURL[256]="";
			int nChecksum = -1;
			time_t tmLastUsed = 0;

			int nEmblemChildCount = emblemElement.GetChildNodeCount();

			MXmlElement chrElement;
			for (int j = 0; j < nEmblemChildCount; j++)
			{
				chrElement = emblemElement.GetChildNode(j);
				chrElement.GetTagName(szTagName);
				if (szTagName[0] == '#') continue;

				if (!strcmp(szTagName, MTOK_EMBLEM_CLID))
				{
					chrElement.GetContents(&nCLID);
				}
				else if (!strcmp(szTagName, MTOK_EMBLEM_URL))
				{
					chrElement.GetContents(szURL);
				}
				else if (!strcmp(szTagName, MTOK_EMBLEM_CHECKSUM))
				{
					chrElement.GetContents(&nChecksum);
				}
			}

			if ((nCLID != -1) && (szURL[0] != 0) && (nChecksum != -1))
			{
				emblemElement.GetChildContents((int*)&tmLastUsed, MTOK_EMBLEM_TIMELASTUSED); // 없어도 로드되게
				RegisterEmblem(nCLID, szURL, nChecksum, tmLastUsed);
			}
		}
	}

	xmlDoc.Destroy();
	return true;
}
Exemple #19
0
void ZIDLResource::Parse(MXmlElement& element)
{
	MIDLResource::Parse(element);

	char szTagName[256];
	element.GetTagName(szTagName);

	// Gunz Customized Widgets...
	if (!strcmp(szTagName, "MAPLISTBOX"))
	{
		GetMapListBox(element);
	}
	else if (!strcmp(szTagName, "CANVAS"))
	{
		GetCanvas(element);
	}
	else if (!strcmp(szTagName, "SCORELISTBOX"))
	{
		GetScoreListBox(element);
	}
	else if (!strcmp(szTagName, "SCOREBOARD"))
	{
		GetScoreBoardFrame(element);
	}
	else if (!strcmp(szTagName, "MESHVIEW"))
	{
		GetMeshView(element);
	}
	else if (!strcmp(szTagName, "MESHVIEWLIST"))
	{
		GetMeshViewList(element);
	}
	else if (!strcmp(szTagName, "CHARACTERVIEW"))
	{
		GetCharacterView(element);
	}
	else if (!strcmp(szTagName, "CHARACTERVIEWLIST"))
	{
		GetCharacterViewList(element);
	}
	else if (!strcmp(szTagName, "EQUIPMENTLISTBOX"))	// 상점 리뉴얼하기 전에 사용하던 리스트위젯
	{
		GetEquipmentListBox(element);
	}
	else if(!strcmp(szTagName, "STAGEINFOBOX"))
	{
		GetStageInfoBox(element);
	}
	else if (!strcmp(szTagName, "ITEMSLOT"))
	{
		GetItemSlot(element);
	}
	else if (!strcmp(szTagName, "ROOMLIST"))
	{
		GetRoomListBox(element);
	}
	else if(!strcmp(szTagName,"PLAYERLISTBOX"))
	{
		GetPlayerListBox(element);
	}
	else if(!strcmp(szTagName,"PLAYERSELECTLISTBOX"))
	{
		GetPlayerSelectListBox(element);
	}
	else if(!strcmp(szTagName,"ZBMNUMLABEL"))
	{
		GetBmNumLabel(element);
	}
	else if (!strcmp(szTagName, "CLANLIST"))
	{
		GetClanListBox(element);
	}
	else if (!strcmp(szTagName, "DUELTOURNAMENTRANKINGLIST"))
	{
		GetDuelTournamentRankingListBox(element);
	}
	else if (!strcmp(szTagName, "SERVERVIEW"))
	{
		GetServerView(element);
	}
	else if (!strcmp(szTagName,"ACTIONKEY"))
	{
		GetActionKey(element);
	}
}
Exemple #20
0
ZItemSlotView* ZIDLResource::GetItemSlot(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[4096];

	MWidget* pParentWidget = GetParentWidget(element);
	ZItemSlotView* pWidget = new ZItemSlotView("", pParentWidget, pParentWidget);
	InsertWidget(element, pWidget);

	pWidget->SetParts(MMCIP_END);
	char szParts[64];
	element.GetAttribute(szParts, "parts", "");

	if (!stricmp(szParts, "head"))				pWidget->SetParts(MMCIP_HEAD);
	else if (!stricmp(szParts, "chest"))		pWidget->SetParts(MMCIP_CHEST);
	else if (!stricmp(szParts, "hands"))		pWidget->SetParts(MMCIP_HANDS);
	else if (!stricmp(szParts, "legs"))			pWidget->SetParts(MMCIP_LEGS);
	else if (!stricmp(szParts, "feet"))			pWidget->SetParts(MMCIP_FEET);
	else if (!stricmp(szParts, "fingerl"))		pWidget->SetParts(MMCIP_FINGERL);
	else if (!stricmp(szParts, "fingerr"))		pWidget->SetParts(MMCIP_FINGERR);
	else if (!stricmp(szParts, "avatar"))		pWidget->SetParts(MMCIP_AVATAR);
	else if (!stricmp(szParts, "melee"))		pWidget->SetParts(MMCIP_MELEE);
	else if (!stricmp(szParts, "primary"))		pWidget->SetParts(MMCIP_PRIMARY);
	else if (!stricmp(szParts, "secondary"))	pWidget->SetParts(MMCIP_SECONDARY);
	else if (!stricmp(szParts, "custom1"))		pWidget->SetParts(MMCIP_CUSTOM1);
	else if (!stricmp(szParts, "custom2"))		pWidget->SetParts(MMCIP_CUSTOM2);
	else if (!stricmp(szParts, "community1"))	pWidget->SetParts(MMCIP_COMMUNITY1);
	else if (!stricmp(szParts, "community2"))	pWidget->SetParts(MMCIP_COMMUNITY2);
	else if (!stricmp(szParts, "longbuff1"))	pWidget->SetParts(MMCIP_LONGBUFF1);
	else if (!stricmp(szParts, "longbuff2"))	pWidget->SetParts(MMCIP_LONGBUFF2);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		GetCommonWidgetProperty(pWidget, childElement, szBuf);

		if (!strcmp(szBuf, "BITMAP"))
		{
			MBitmap* pBitmap = GetBitmap(childElement);
			if (pBitmap != NULL)
			{
				pWidget->SetBackBitmap(pBitmap);
			}
		}
		if( !strcmp(szBuf, "STRETCH") )
		{
			pWidget->SetStretch( true );
		}
		if( !strcmp(szBuf, "HORIZONTALINVERSE"))
		{
			pWidget->SetHorizontalInverse( true );
		}
	}

	return pWidget;

}
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;
		}		
	}
}
Exemple #22
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::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);
		}
	}
}
Exemple #24
0
ZRoomListBox* ZIDLResource::GetRoomListBox( MXmlElement& element )
{
	MXmlElement childElement;
	char szBuf[4096];
	char szAttr[4096];
	
	MWidget* pParentWidget = GetParentWidget(element);
	ZRoomListBox* pWidget = new ZRoomListBox("", pParentWidget, pParentWidget);
	InsertWidget(element, pWidget);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		if(GetCommonWidgetProperty(pWidget, childElement, szBuf)) continue;
		else	if( strcmp(szBuf, "BITMAP") == 0)
		{
			childElement.GetAttribute(szAttr, "type" );
			if( strcmp(szAttr,"frame") == 0)
			{
				pWidget->SetFrameImage( GetBitmap(childElement));				
			}
			else if( strcmp(szAttr, "back") == 0 )
			{
				childElement.GetContents(szAttr);

				MBitmap* pBitmap =GetBitmap(childElement);
				if( pBitmap != 0 )
					pWidget->SetBannerImage( szAttr, pBitmap);
			}
 			else if( stricmp( szAttr,"icon" )==0 )
			{
				int mode;
				childElement.GetAttribute(&mode, "mode");
				childElement.GetContents(szAttr);
				MBitmap* pBitmap = GetBitmap(childElement);
				if( pBitmap != 0 )
					pWidget->SetIconImage( (MMATCH_GAMETYPE)mode, pBitmap );
			}
		}
		else if ( strcmp(szBuf, "SIZE") == 0 )
		{
			childElement.GetAttribute(szAttr, "type" );
			if( strcmp(szAttr,"width") == 0)
			{
				float w;
				childElement.GetContents( &w );
				pWidget->SetWidth( w );
			}
			if( strcmp(szAttr,"height") == 0)
			{
				float h;
				childElement.GetContents( &h );
				pWidget->SetHeight( h );
			}
		}
	}
	return pWidget;
}
Exemple #25
0
ZShopEquipListbox* ZIDLResource::GetEquipmentListBox(MXmlElement& element)
{
	MXmlElement childElement;
	char szBuf[4096];

	MWidget* pParentWidget = GetParentWidget(element);
	ZShopEquipListbox* pWidget = new ZShopEquipListbox("", pParentWidget, pParentWidget);
	pWidget->m_FontAlign = MAM_VCENTER;

	InsertWidget(element, pWidget);

	int iCount = element.GetChildNodeCount();

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		if (GetCommonWidgetProperty(pWidget, childElement, szBuf)) continue;
		else if (!strcmp(szBuf, "LISTBOXLOOK"))
		{
			char szItem[256];
			memset(szItem, 0, sizeof(szItem));
			childElement.GetContents(szItem);

			map<string, MBMultiColListBoxLook*>::iterator itor = m_MultiColListBoxLookMap.find(szItem);
			if (itor != m_MultiColListBoxLookMap.end())
			{
				MBMultiColListBoxLook* pListBoxLook = NULL;
				pListBoxLook = (*itor).second;
				pWidget->ChangeCustomLook(pListBoxLook);
			}
		}else if (!strcmp(szBuf, "SCROLLBARLOOK"))
		{
			char szItem[256];
			memset(szItem, 0, sizeof(szItem));
			childElement.GetContents(szItem);

			map<string, MBScrollBarLook*>::iterator itor = m_ScrollBarLookMap.find(szItem);
			if (itor != m_ScrollBarLookMap.end())
				pWidget->GetScrollBar()->ChangeCustomLook((*itor).second);
		}else if (!strcmp(szBuf, "ARROWLOOK"))
		{
			char szItem[256];
			memset(szItem, 0, sizeof(szItem));
			childElement.GetContents(szItem);

			map<string, MBArrowLook*>::iterator itor = m_ArrowLookMap.find(szItem);
			if (itor != m_ArrowLookMap.end())
				pWidget->GetScrollBar()->ChangeCustomArrowLook((*itor).second);
		}else if (!strcmp(szBuf, "THUMBLOOK"))
		{
			char szItem[256];
			memset(szItem, 0, sizeof(szItem));
			childElement.GetContents(szItem);

			map<string, MBThumbLook*>::iterator itor = m_ThumbLookMap.find(szItem);
			if (itor != m_ThumbLookMap.end())
				pWidget->GetScrollBar()->ChangeCustomThumbLook((*itor).second);
		}else if (!strcmp(szBuf, "NUMCOLUMN"))
		{
			char szItem[256];
			memset(szItem, 0, sizeof(szItem));
			childElement.GetContents(szItem);

			int numColumn = atoi(szItem);
			if (numColumn > 0)
				pWidget->SetNumColumn(numColumn);
		}
	}

	return pWidget;
}
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]);
		}
	}
}
Exemple #27
0
ZPlayerListBox* ZIDLResource::GetPlayerListBox( MXmlElement& element )
{
	MXmlElement childElement;
	char szBuf[4096];
	char szAttr[4096];

	MWidget* pParentWidget = GetParentWidget(element);
	ZPlayerListBox* pWidget = new ZPlayerListBox("", pParentWidget, pParentWidget);
	pWidget->SetListener(pWidget);
	InsertWidget(element, pWidget);

	int iCount = element.GetChildNodeCount();

	bool bMode1 = false;

	for (int i = 0; i < iCount; i++)
	{
		memset(szBuf, 0, sizeof(szBuf));
		childElement = element.GetChildNode(i);
		childElement.GetTagName(szBuf);

		if(GetCommonWidgetProperty(pWidget, childElement, szBuf)) continue;
		/*
		else	if( strcmp(szBuf, "BITMAP") == 0)
		{
			childElement.GetAttribute(szAttr, "type" );
			if( strcmp(szAttr,"slot") == 0)
			{
				childElement.GetContents(szAttr);
				MBitmap* pBitmap =GetBitmap(childElement);
				pWidget->SetBitmap(pBitmap);
			}
		}*/
		else if( strcmp(szBuf, "SIZE" ) == 0 )
		{
			childElement.GetAttribute(szAttr, "type");
			if( strcmp(szAttr,"width") == 0 )
			{
				float temp;
				childElement.GetContents(&temp);
				pWidget->SetWidth( temp );
			}
			else if( strcmp(szAttr,"height") == 0 )
			{
				float temp;
				childElement.GetContents(&temp);
				pWidget->SetHeight( temp );
			}
		}
		else if(strcmp(szBuf, "MODE1" ) == 0 ) {
			bMode1 = true;
		}
	}

	if(bMode1==false)
		pWidget->InitUI(ZPlayerListBox::PLAYERLISTMODE_CHANNEL);
	else
		pWidget->InitUI(ZPlayerListBox::PLAYERLISTMODE_STAGE);

	return pWidget;
}
Exemple #28
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;
}
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 );
					}
				}
			}
		}
	}
}