void ZGameClient::RequestCreateClan(char* szClanName, char** ppMemberCharNames)
{
	// 클랜에 이미 가입되어 있으면 안된다.
	if (ZGetMyInfo()->IsClanJoined())
	{
		ZChatOutput(
			ZMsg(MSG_CLAN_JOINED_ALREADY), 
			ZChat::CMT_SYSTEM );
		return;
	}

	// 로비에서만 신청할 수 있다.
	if (ZApplication::GetGameInterface()->GetState() != GUNZ_LOBBY)
	{
		ZChatOutput( ZMsg(MSG_MUST_EXECUTE_LOBBY) );
		return;
	}


	m_nRequestID++;

	memset(&ClanSponsorsTicket, 0, sizeof(Clan_Sponsors_Ticket));
	ClanSponsorsTicket.nRequestID = m_nRequestID;
	strcpy(ClanSponsorsTicket.szClanName, szClanName);
	
	for (int i = 0; i < CLAN_SPONSORS_COUNT; i++)
	{
		strcpy(ClanSponsorsTicket.szSponsorCharName[i], ppMemberCharNames[i]);
	}

	ZPostRequestCreateClan(GetPlayerUID(), m_nRequestID, szClanName, ppMemberCharNames, CLAN_SPONSORS_COUNT);
}
Beispiel #2
0
void ZVoteInterface::DrawVoteTargetlist(MDrawContext* pDC)
{
	if(GetShowTargetList() == false) return;

	MFont *pFont=ZGetGameInterface()->GetCombatInterface()->GetGameFont();
	pDC->SetFont(pFont);

	float y = 0.3f;
	float linespace = (float)pFont->GetHeight() * 1.1 / (float)MGetWorkspaceHeight();

	pDC->SetColor(MCOLOR(0xFFFFFFFF));

	TextRelative( pDC, .05f, y, ZMsg(MSG_VOTE_SELECT_PLAYER_TO_KICK) );

	y+=2.f*linespace;

	for (int i=0; i<(int)m_TargetList.size(); i++) 
	{
		string& strName = m_TargetList[i];

		char szBuffer[256];
		sprintf(szBuffer,"[%c] %s", ConvIndexToKey(i), strName.c_str());

		pDC->SetColor(MCOLOR(0xFFFFFFFF));
		TextRelative(pDC,.05f,y,szBuffer);

		y+=linespace;
	}

	y+=linespace;
	pDC->SetColor(MCOLOR(0xFFFFFFFF));
	
	TextRelative(pDC,.05f,y, ZMsg(MSG_VOTE_SELECT_PLAYER_CANCEL));
}
void ZGameClient::OnResponseProposal(const int nResult, const MMatchProposalMode nProposalMode, const int nRequestID)
{
	// 로비가 아니면 안된다.
	if (ZApplication::GetGameInterface()->GetState() != GUNZ_LOBBY) 
	{
		m_AgreementBuilder.CancelProposal();
		return;
	}


	if (nResult == MOK)
	{
		char szTitle[256];
		char szDesc[512];
		strcpy( szTitle, 
			ZMsg(MSG_LADDER_PROPOSAL_WAIT_TITLE) );

		strcpy(szDesc, 
			ZMsg(MSG_LADDER_PROPOSAL_WAIT_DESC) );
		// 동의할동안 기다리라는 메세지창을 띄운다.
		
		ShowProposalWaitFrame(true, szTitle, szDesc);
	}
	else 
	{
		m_AgreementBuilder.CancelProposal();
		ZApplication::GetGameInterface()->ShowErrorMessage( nResult );
	}
}
void ZGameClient::OnClanMsg(const char* szSenderName, const char* szMsg)
{
	char szText[512];
	sprintf(szText, "%s(%s) : %s", ZMsg( MSG_CHARINFO_CLAN), szSenderName, szMsg);

	if ( ZGetGame())
	{
		if ( (ZGetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_DUEL)	&& !ZGetGame()->m_pMyCharacter->IsDie())
			sprintf(szText, "%s(%s) : %s", ZMsg( MSG_CHARINFO_CLAN), szSenderName, ". . . . .");
	}

	ZChatOutput(MCOLOR(ZCOLOR_CHAT_CLANMSG), szText);

}
Beispiel #5
0
void ZSurvival::OnGameCreate()
{
	if (!ZGetGameTypeManager()->IsQuestDerived(ZGetGameClient()->GetMatchStageSetting()->GetGameType())) return;


	// 여기서 npc.xml 등 퀘스트에 필요한 파일을 읽는다. 만약 이미 이전에 읽었었다면 읽지 않는다.
	// 때문에 ZSurvival::OnDestroyOnce()는 명시적으로 호출하지 않음.
	OnCreateOnce();
	Create();

	// 라운드별 보상 XP BP 카운터를 초기화
	m_nRewardBP = 0;
	m_nRewardXP = 0;

	m_nReachedRound = 0;
	m_nPoint = 0;

	// 서바이벌맵 해킹 감지
	if (m_MapCatalogue.IsHacked())
	{
		ZGetGameInterface()->ShowDisconnectMsg( MERR_FIND_HACKER, 30000 );
		mlog(ZMsg(MSG_HACKING_DETECTED));
		mlog("\nhacked XML.\n");
	}
}
void ZItemMenu::SetupMenu()
{
	RemoveAllMenuItem();

	ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
	ZShopEquipListbox* pItemListBox = (ZShopEquipListbox*)pResource->FindWidget("EquipmentList");

	ZItemMenuItem* pMenuItem = new ZItemMenuItem(ZCMD_ITEMMENU_BRINGBACK_ACCOUNTITEM, ZMsg( MSG_MENUITEM_SENTTOBANK));
	pMenuItem->SetSize(GetFont()->GetWidth(pMenuItem->GetText())+5, GetFont()->GetHeight());
	AddMenuItem(pMenuItem);	// Add하면서 MenuItem Resize됨
}
Beispiel #7
0
bool ZSurvival::OnQuestCombatState(MCommand* pCommand)
{
	char nState;
	pCommand->GetParameter(&nState,		0, MPT_CHAR);

	MQuestCombatState nCombatState = MQuestCombatState(nState);

	m_QuestCombatState = nCombatState; // 보관..

	switch (nCombatState)
	{
	case MQUEST_COMBAT_PREPARE:
		{
		}
		break;
	case MQUEST_COMBAT_PLAY:
		{
			ZGetObjectManager()->GetNPCObjectMap()->ForceInvisibleNewNpc(false);
			ZGetEffectManager()->Clear();
			ZGetEffectManager()->EnableDraw(true);
			ZGetGame()->m_WeaponManager.EnableRender(true);
			ZGetWorldItemManager()->EnableDraw(true);
		}
		break;
	case MQUEST_COMBAT_COMPLETED:
		{
			// 서바이벌이므로 마지막 섹터라도 포탈을 찍어야 한다. 그러나 마지막 반복의 막판이라면 포탈을 없게한다
			if (!m_GameInfo.IsLastSectorInSurvival())
			{
				if (ZGetGame())
				{
					rvector portal_pos;
					int nCurrSectorIndex = m_GameInfo.GetCurrSectorIndex();
					int nLinkIndex = m_GameInfo.GetMapSectorLink(nCurrSectorIndex);
					portal_pos = ZGetGame()->GetMapDesc()->GetQuestSectorLink(nLinkIndex);
					ZGetWorldItemManager()->AddQuestPortal(portal_pos);
					m_GameInfo.SetPortalPos(portal_pos);

					ZChatOutput(MCOLOR(ZCOLOR_CHAT_SYSTEM_GAME), ZMsg(MSG_GAME_OPEN_PORTAL));

					m_tRemainedTime = timeGetTime() + PORTAL_MOVING_TIME;
					m_bIsRoundClear = true;
				}
			}
		}
		break;
	};

	return true;
}
void ZSellCashItemConfirmDlg::Open(const char* szItemName, CCBitmap* pIcon, int price, int count, ISellCashItemConfirmDlgDoneHandler* pHandler)
{
	CCPicture* pPicture = (CCPicture*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame_Thumbnail");
	if (pPicture)
		pPicture->SetBitmap(pIcon);

	CCLabel* pLabel = (CCLabel*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame_ItemName");
	if (pLabel)
		pLabel->SetText(szItemName);

	char szPrice[256];
	sprintf(szPrice, "%d %s", price, ZMsg(MSG_CHARINFO_BOUNTY));
	pLabel = (CCLabel*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame_Bounty");
	if (pLabel)
		pLabel->SetText(szPrice);

	CCTextArea* pTextArea = (CCTextArea*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame_Warning");
	if (pTextArea)
		pTextArea->SetText( ZMsg(MSG_SHOPEQUIP_SELL_CASHITEM_CONFIRM));

	CCFrame* pFrame = (CCFrame*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame");
	if (pFrame)
	{
		pFrame->Show(true, true);
	}

	m_pDoneHandler = pHandler;

	// 유저가 지금 팔고자 하는 캐쉬아이템을 확실히 인지할수 있는 시간을 주기 위해 OK 버튼을 몇초후 활성화시킨다
	CCButton* pButton = (CCButton*)GetIDLResource()->FindWidget("SellCashItemConfirmFrame_Sell");
	if (pButton)
	{
		pButton->Enable(false);
		m_bWaitActivatingOkBtn = true;
		m_nWaitActivatingOkBtnBeginTime = timeGetTime();
	}
}
RRESULT OnError(void *pParam)
{
	cclog("RealSpace::OnError(%d) \n", RGetLastError());

	switch (RGetLastError())
	{
	case RERROR_INVALID_DEVICE:
		{
			D3DADAPTER_IDENTIFIER9 *ai=RGetAdapterID();
			char szLog[512];
			ZTransMsg( szLog, MSG_DONOTSUPPORT_GPCARD, 1, ai->Description);

			int ret=MessageBox(NULL, szLog, ZMsg( MSG_WARNING), MB_YESNO);
			if(ret!=IDYES)
				return R_UNKNOWN;
		}
		break;
	case RERROR_CANNOT_CREATE_D3D:
		{
			ShowCursor(TRUE);

			char szLog[512];
			sprintf(szLog, ZMsg( MSG_DIRECTX_NOT_INSTALL));

			int ret=MessageBox(NULL, szLog, ZMsg( MSG_WARNING), MB_YESNO);
			if(ret==IDYES)
			{
				ShellExecute(g_hWnd, "open", ZMsg( MSG_DIRECTX_DOWNLOAD_URL), NULL, NULL, SW_SHOWNORMAL); 
			}
		}
		break;

	};

	return R_OK;
}
Beispiel #10
0
void ZVoteInterface::DrawVoteMessage(MDrawContext* pDC)		// 투표가 진행중일때 메시지
{
	// 투표 진행중일때 메시지
	if ( (ZGetGameInterface()->GetState() == GUNZ_GAME) &&
		ZGetGameClient() &&
		ZGetGameClient()->IsVoteInProgress() && 
		ZGetGameClient()->CanVote() ) 
	{
		MFont *pFont=ZGetGameInterface()->GetCombatInterface()->GetGameFont();
		pDC->SetFont(pFont);
		pDC->SetColor(MCOLOR(0x80ffffff));
		TextRelative(pDC,300.f/800.f,550/600.f,ZGetGameClient()->GetVoteMessage());

		if(timeGetTime()/500 % 2 == 0 ) {

			TextRelative(pDC,300.f/800.f,565/600.f, ZMsg(MSG_VOTE_YESNO));
		}
	}
}
Beispiel #11
0
void OnClanAskSponsorAgreement_OnExpire()
{
	ZChatOutput( ZMsg(MSG_CANCELED) );
	ZGetGameClient()->AnswerSponsorAgreement(false);
}
Beispiel #12
0
bool ZApplication::OnCreate(ZLoadingProgress *pLoadingProgress)
{	
	string strFileNameZItem(FILENAME_ZITEM_DESC);
	string strFileNameZItemLocale(FILENAME_ZITEM_DESC_LOCALE);
	string strFileNameZBuff(FILENAME_BUFF_DESC);
	string strFileNameWorlditem(FILENAME_WORLDITEM);
	string strFileNameAbuse(FILENAME_ABUSE);

// #ifndef _DEBUG
// 	strFileNameZItem += ".mef";
// 	strFileNameZItemLocale += ".mef";
// 	strFileNameZBuff += ".mef";
// 	strFileNameWorlditem += ".mef";
// 	strFileNameAbuse += ".mef";
// #endif

	MInitProfile();

	// 멀티미디어 타이머 초기화
	TIMECAPS tc;

	mlog("ZApplication::OnCreate : begin\n");

	//ZGetSoundEngine()->Enumerate();
	//for( int i = 0 ; i < ZGetSoundEngine()->GetEnumDeviceCount() ; ++i)
	//{
	//	sprintf(szDesc, "Sound Device %d = %s\n", i, ZGetSoundEngine()->GetDeviceDescription( i ) );
	//	mlog(szDesc);
	//}

	__BP(2000,"ZApplication::OnCreate");

#define MMTIMER_RESOLUTION	1
	if (TIMERR_NOERROR == timeGetDevCaps(&tc,sizeof(TIMECAPS)))
	{
		m_nTimerRes = min(max(tc.wPeriodMin,MMTIMER_RESOLUTION),tc.wPeriodMax);
		timeBeginPeriod(m_nTimerRes);
	}

	// 한국도 서버리스트 선택 과정이 추가된다.
	// IP가 없으면 로그인화면으로 이동, IP가 있으면 바로 캐릭터 선택창으로 이동
	if (ZApplication::GetInstance()->GetLaunchMode() == ZApplication::ZLAUNCH_MODE_NETMARBLE)
		m_nInitialState = GUNZ_DIRECTLOGIN;

	if (ZGameInterface::m_sbRemainClientConnectionForResetApp == true)
		m_nInitialState = GUNZ_LOBBY;	// if during reload client for changing language, pass login step.

	DWORD _begin_time,_end_time;
#define BEGIN_ { _begin_time = timeGetTime(); }
#define END_(x) { _end_time = timeGetTime(); float f_time = (_end_time - _begin_time) / 1000.f; mlog("\n-------------------> %s : %f \n\n", x,f_time ); }

	__BP(2001,"m_SoundEngine.Create");

	ZLoadingProgress soundLoading("Sound",pLoadingProgress,.12f);
	BEGIN_;
#ifdef _BIRDSOUND
	m_SoundEngine.Create(RealSpace2::g_hWnd, 44100, Z_AUDIO_HWMIXING, GetFileSystem());
#else
	m_SoundEngine.Create(RealSpace2::g_hWnd, Z_AUDIO_HWMIXING, &soundLoading );
#endif
	END_("Sound Engine Create");
	soundLoading.UpdateAndDraw(1.f);

	__EP(2001);

	// mlog("ZApplication::OnCreate : m_SoundEngine.Create\n");
	mlog( "sound engine create.\n" );

//	ZGetInitialLoading()->SetPercentage( 15.0f );
//	ZGetInitialLoading()->Draw( MODE_DEFAULT, 0 , true );

//	loadingProgress.UpdateAndDraw(.3f);

	RegisterForbidKey();

	__BP(2002,"m_pInterface->OnCreate()");

	ZLoadingProgress giLoading("GameInterface",pLoadingProgress,.35f);

	BEGIN_;
	m_pGameInterface=new ZGameInterface("GameInterface",Mint::GetInstance()->GetMainFrame(),Mint::GetInstance()->GetMainFrame());
	m_pGameInterface->m_nInitialState = m_nInitialState;
	if(!m_pGameInterface->OnCreate(&giLoading))
	{
		mlog("Failed: ZGameInterface OnCreate\n");
		SAFE_DELETE(m_pGameInterface);
		return false;
	}

	// mlog("Bird : 5\n");

	m_pGameInterface->SetBounds(0,0,MGetWorkspaceWidth(),MGetWorkspaceHeight());
	END_("GameInterface Create");

	giLoading.UpdateAndDraw(1.f);

	m_pStageInterface = new ZStageInterface();
	m_pOptionInterface = new ZOptionInterface;

	__EP(2002);

#ifdef _BIRDTEST
	goto BirdGo;
#endif

//	ZGetInitialLoading()->SetPercentage( 30.0f );
//	ZGetInitialLoading()->Draw( MODE_DEFAULT, 0 , true );
//	loadingProgress.UpdateAndDraw(.7f);

	__BP(2003,"Character Loading");

	ZLoadingProgress meshLoading("Mesh",pLoadingProgress,.41f);
	BEGIN_;
	// zip filesystem 을 사용하기 때문에 꼭 ZGameInterface 다음에 사용한다...
//	if(m_MeshMgr.LoadXmlList("model/character_lobby.xml")==-1) return false;
	if(m_MeshMgr.LoadXmlList("model/character.xml",ZProgressCallBack,&meshLoading)==-1)	
		return false;

	mlog( "Load character.xml success,\n" );

	END_("Character Loading");
	meshLoading.UpdateAndDraw(1.f);

//	ZLoadingProgress npcLoading("NPC",pLoadingProgress,.1f);
#ifdef _QUEST
	//if(m_NPCMeshMgr.LoadXmlList("model/npc.xml",ZProgressCallBack,&npcLoading) == -1)
	if(m_NPCMeshMgr.LoadXmlList("model/npc.xml") == -1)
		return false;
#endif

	__EP(2003);

	// 모션에 연결된 사운드 파일중 없는것을 제거한다.. 
	// 엔진에서는 사운드에 접근할수없어서.. 
	// 파일체크는 부담이크고~

	CheckSound();

//	npcLoading.UpdateAndDraw(1.f);
	__BP(2004,"WeaponMesh Loading");

	BEGIN_;

	string strFileNameWeapon("model/weapon.xml");
// #ifndef _DEBUG
// 	strFileNameWeapon += ".mef";
// #endif
	if(m_WeaponMeshMgr.LoadXmlList((char*)strFileNameWeapon.c_str())==-1) 
		return false;

	END_("WeaponMesh Loading");

	__EP(2004);

	__BP(2005,"Worlditem Loading");

	ZLoadingProgress etcLoading("etc",pLoadingProgress,.02f);
	BEGIN_;

#ifdef	_WORLD_ITEM_
	m_MeshMgr.LoadXmlList((char*)strFileNameWorlditem.c_str());
#endif

	mlog("Load weapon.xml success. \n");

//*/
	END_("Worlditem Loading");
	__EP(2005);


#ifdef _BIRDTEST
BirdGo:
#endif

	__BP(2006,"ETC .. XML");

	BEGIN_;
	CreateConsole(ZGetGameClient()->GetCommandManager());

	// mlog("ZApplication::OnCreate : CreateConsole \n");

	m_pLogFrame = new MCommandLogFrame("Command Log", Mint::GetInstance()->GetMainFrame(), Mint::GetInstance()->GetMainFrame());
	int nHeight = MGetWorkspaceHeight()/3;
	m_pLogFrame->SetBounds(0, MGetWorkspaceHeight()-nHeight-1, MGetWorkspaceWidth()-1, nHeight);
	m_pLogFrame->Show(false);

	m_pGameInterface->SetFocusEnable(true);
	m_pGameInterface->SetFocus();
	m_pGameInterface->Show(true);


	if (!MGetMatchItemDescMgr()->ReadCache())
	{
		if (!MGetMatchItemDescMgr()->ReadXml(GetFileSystem(), strFileNameZItem.c_str()))
		{
			MLog("Error while Read Item Descriptor %s\n", strFileNameZItem.c_str());
		}
		if (!MGetMatchItemDescMgr()->ReadXml(GetFileSystem(), strFileNameZItemLocale.c_str()))
		{
			MLog("Error while Read Item Descriptor %s\n", strFileNameZItemLocale.c_str());
		}

		MGetMatchItemDescMgr()->WriteCache();
	}
	mlog("Load zitem info success.\n");

	if( !MGetMatchBuffDescMgr()->ReadXml(GetFileSystem(), strFileNameZBuff.c_str()) )
	{
		MLog("Error while Read Buff Descriptor %s\n", strFileNameZBuff.c_str());
	}
	mlog("Load zBuff info success.\n");


//	if (!MGetMatchItemEffectDescMgr()->ReadXml(GetFileSystem(), FILENAME_ZITEMEFFECT_DESC))
//	{
//		MLog("Error while Read Item Descriptor %s\n", FILENAME_ZITEMEFFECT_DESC);
//	}
//	mlog("Init effect manager success.\n");

	if (!MGetMatchWorldItemDescMgr()->ReadXml(GetFileSystem(), strFileNameWorlditem.c_str() ))
	{
		MLog("Error while Read Item Descriptor %s\n", strFileNameWorlditem.c_str());
	}
	mlog("Init world item manager success.\n");

	
	if (!MGetMapDescMgr()->Initialize(GetFileSystem(), "system/map.xml"))
	{
		MLog("Error while Read map Descriptor %s\n", "system/map.xml");
	}
	mlog("Init map Descriptor success.\n");


	string strFileChannelRule("system/channelrule.xml");
// #ifndef _DEBUG
// 	strFileChannelRule += ".mef";
// #endif
	if (!ZGetChannelRuleMgr()->ReadXml(GetFileSystem(), strFileChannelRule.c_str()))
	{
		MLog("Error while Read Item Descriptor %s\n", strFileChannelRule.c_str());
	}
	mlog("Init channel rule manager success.\n");
/*
	if (!MGetNPCGroupMgr()->ReadXml(GetFileSystem(), "system/monstergroup.xml"))
	{
		MLog("Error while Read Item Descriptor %s", "system/monstergroup.xml");
	}
	mlog("ZApplication::OnCreate : ZGetNPCGroupMgr()->ReadXml \n");
*/
	// if (!MGetChattingFilter()->Create(GetFileSystem(), "system/abuse.xml"))
	bool bSucceedLoadAbuse = MGetChattingFilter()->LoadFromFile(GetFileSystem(), strFileNameAbuse.c_str());
	if (!bSucceedLoadAbuse || MGetChattingFilter()->GetNumAbuseWords() == 0)
	{
		// 해킹으로 abuse-list 파일자체를 없애거나 내용을 비웠을 경우 실행을 멈추게 하자
		MLog("Error while Read Abuse Filter %s\n", strFileNameAbuse.c_str());
		MessageBox(NULL, ZErrStr(MERR_FIND_INVALIDFILE), ZMsg( MSG_WARNING), MB_OK);	// TODO: 풀스크린에서 메시지 박스는 좀 곤란함;
		return false;
	}
	mlog( "Init abuse manager success.\n" );

	


#ifdef _QUEST_ITEM
	if( !GetQuestItemDescMgr().ReadXml(GetFileSystem(), FILENAME_QUESTITEM_DESC) )
	{
		MLog( "Error while read quest tiem descrition xml file.\n" );
	}
#endif

	mlog("Init chatting filter. success\n");

	if(!m_SkillManager.Create()) {
		MLog("Error while create skill manager\n");
	}

	END_("ETC ..");

#ifndef _BIRDTEST
	etcLoading.UpdateAndDraw(1.f);
#endif

	//CoInitialize(NULL);

//	ZGetInitialLoading()->SetPercentage( 40.0f );
//	ZGetInitialLoading()->Draw( MODE_DEFAULT, 0 , true );
//	loadingProgress.UpdateAndDraw(1.f);

	ZGetEmblemInterface()->Create();

	__EP(2006);

	__EP(2000);

	__SAVEPROFILE("profile_loading.txt");

	if (ZCheckFileHack() == true)
	{
		MLog("File Check Failed\n");
		return false;
	}

	ZSetupDataChecker_Global(&m_GlobalDataChecker);


#ifdef LOCALE_NHNUSA
	GetNHNUSAReport().ReportInitComplete();
#endif


	return true;
}
Beispiel #13
0
void ZObserver::OnDraw(MDrawContext* pDC)
{
	if ( g_pGame->IsReplay() && !g_pGame->IsShowReplayInfo())
		return;

	if ( m_pTargetCharacter == NULL)
		return;

	if ( ZGetCamera()->GetLookMode() == ZCAMERA_MINIMAP)
		return;

	if ( ZGetMyInfo()->IsAdminGrade())
	{
		MFont *pFont=MFontManager::Get("FONTb11b");
		if ( pFont == NULL)
			_ASSERT(0);
		pDC->SetFont(pFont);

		MCOLOR backgroundcolor;
		if ( m_pTargetCharacter->GetTeamID() == MMT_RED)
			backgroundcolor = MCOLOR(100,0,0, 150);
		else if ( m_pTargetCharacter->GetTeamID() == MMT_BLUE)
			backgroundcolor = MCOLOR(0,0,100, 150);
		else 
			backgroundcolor = MCOLOR(0,0,0, 150);

		pDC->SetColor(backgroundcolor);
		pDC->FillRectangle( MGetWorkspaceWidth() / 2 - 170, MGetWorkspaceHeight() * (650.0f/800.0f) - 7, 340, 30);

		backgroundcolor = MCOLOR( 255,255,255, 255);
		pDC->SetColor( backgroundcolor);

		char szName[128];
		sprintf_safe( szName, "%s (HP:%d, AP:%d)", m_pTargetCharacter->GetUserName(), m_pTargetCharacter->GetHP(), m_pTargetCharacter->GetAP());
		TextRelative(pDC, 0.5f, 650.0f/800.0f, szName, true);
	}

	else if ( ZApplication::GetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_DUEL)
	{
		char	charName[3][100];
		charName[0][0] = charName[1][0] = charName[2][0] = 0;
		float	fMaxHP[ 2]={ 0.0f, 0.0f},	fMaxAP[ 2]={ 0.0f, 0.0f};
		int		nHP[ 2]={ 0, 0},			nAP[ 2]={ 0, 0};
		bool	bExistNextChallenger = false;
		bool	bIsChampOserved = false;
		bool	bIsChlngOserved = false;

		ZRuleDuel* pDuel = (ZRuleDuel*)ZGetGameInterface()->GetGame()->GetMatch()->GetRule();

		for (ZCharacterManager::iterator itor = ZGetCharacterManager()->begin(); itor != ZGetCharacterManager()->end(); ++itor)
		{
			ZCharacter* pCharacter = (*itor).second;

			// Champion
			if (pCharacter->GetUID() == pDuel->QInfo.m_uidChampion)
			{
				strcpy_safe(charName[0], pCharacter->GetUserName());
				fMaxHP[ 0] = pCharacter->GetProperty()->fMaxHP;
				fMaxAP[ 0] = pCharacter->GetProperty()->fMaxAP;
				if ( pCharacter->IsDie())
				{
					nHP[ 0] = 0;
					nAP[ 0] = 0;
				}
				else
				{
					nHP[ 0] = pCharacter->GetHP();
					nAP[ 0] = pCharacter->GetAP();
				}

				if ( m_pTargetCharacter)
				{
					if ( pCharacter->GetUID() == m_pTargetCharacter->GetUID())
						bIsChampOserved = true;
				}
			}

			// Challenger
			else if (pCharacter->GetUID() == pDuel->QInfo.m_uidChallenger)
			{
				strcpy_safe(charName[1], pCharacter->GetUserName());
				fMaxHP[ 1] = pCharacter->GetProperty()->fMaxHP;
				fMaxAP[ 1] = pCharacter->GetProperty()->fMaxAP;
				if ( pCharacter->IsDie())
				{
					nHP[ 1] = 0;
					nAP[ 1] = 0;
				}
				else
				{
					nHP[ 1] = pCharacter->GetHP();
					nAP[ 1] = pCharacter->GetAP();
				}

				if ( m_pTargetCharacter)
				{
					if ( pCharacter->GetUID() == m_pTargetCharacter->GetUID())
						bIsChlngOserved = true;
				}
			}

			// Waiting
			else if (pCharacter->GetUID() == pDuel->QInfo.m_WaitQueue[0])
			{
				strcpy_safe(charName[2], pCharacter->GetUserName());
				bExistNextChallenger = true;
			}
		}

		float fRx = (float)MGetWorkspaceWidth()  / 800.0f;
		float fRy = (float)MGetWorkspaceHeight() / 600.0f;

		int nWidth;
		float fPosy;
		float fLength;
		float fHeight;

		// HP
		fPosy = 10.0f*fRy;
		fLength = 163.0f*fRx;
		fHeight = 23.0f*fRy;

		pDC->SetColor( 255, 0, 0, 210);
		nWidth = (int)( (float)nHP[0] / fMaxHP[0] * fLength);
		pDC->FillRectangle( (193.0f+163.0f)*fRx-nWidth, fPosy, nWidth, fHeight);

		nWidth = (int)( (float)nHP[1] / fMaxHP[1] * fLength);
		pDC->FillRectangle( 444.0f*fRx, fPosy, nWidth, fHeight);


		// AP
		pDC->SetColor( 0, 50, 0, 170);
		pDC->FillRectangle( 218.0f*fRx, 37.0f*fRy, 150.0f*fRx, 5.0f*fRy);
		pDC->FillRectangle( 432.0f*fRx, 37.0f*fRy, 150.0f*fRx, 5.0f*fRy);

		pDC->SetColor( 0, 255, 0, 100);
		nWidth = (int)( (float)nAP[0] / fMaxAP[0] * 150.0f * fRx);
		pDC->FillRectangle( (218.0f+150.0f)*fRx-nWidth, 37.0f*fRy, nWidth, 5.0f*fRy);

		nWidth = (int)( (float)nAP[1] / fMaxAP[1] * 150.0f * fRx);
		pDC->FillRectangle( 432.0f*fRx, 37.0f*fRy, nWidth, 5.0f*fRy);


		// °ÔÀÌÁö ÇÁ·¹ÀÓ Ãâ·Â
		MBitmap* pBitmap = MBitmapManager::Get( "duel_score.tga");
		if ( pBitmap)
		{
			pDC->SetBitmap( pBitmap);
			pDC->Draw( 167.0f*fRx, 0, 466.0f*fRx, 49.0f*fRx);
		}


		// À̸§ Ãâ·Â
		MFont *pFont = MFontManager::Get("FONTa10_O2Wht");
		if ( pFont == NULL)
			_ASSERT(0);
		pDC->SetFont( pFont);
		int nTime = GetGlobalTimeMS() % 200;
		if ( bIsChampOserved && (nTime < 100))
			pDC->SetColor(MCOLOR(0xFFFFFF00));
		else
			pDC->SetColor(MCOLOR(0xFFA0A0A0));
		TextRelative(pDC, 0.34f, 0.026f, charName[0], true);

		if ( bIsChlngOserved && (nTime < 100))
			pDC->SetColor(MCOLOR(0xFFFFFF00));
		else
			pDC->SetColor(MCOLOR(0xFFA0A0A0));
		TextRelative(pDC, 0.66f, 0.026f, charName[1], true);

		if ( bExistNextChallenger)
		{
			MBitmap* pBitmap = MBitmapManager::Get( "icon_play.tga");
			if ( pBitmap)
			{
				pDC->SetBitmap( pBitmap);

				int nIcon = 20.0f*fRx;
				pDC->Draw( 646.0f*fRx, 0, nIcon, nIcon);
				pDC->Draw( 640.0f*fRx, 0, nIcon, nIcon);
			}

			pDC->SetColor( MCOLOR(0xFF808080));
			TextRelative( pDC, 0.83f, 0.01f, charName[ 2], false);
		}

		ZGetCombatInterface()->DrawVictory( pDC, 162, 20, pDuel->QInfo.m_nVictory);
	}
	

	else if ( ZApplication::GetGame()->GetMatch()->GetMatchType() != MMATCH_GAMETYPE_DUEL)
	{
		char szName[128];
		sprintf_safe(szName, "%s (HP:%d, AP:%d)", m_pTargetCharacter->GetUserName(), m_pTargetCharacter->GetHP(), m_pTargetCharacter->GetAP());
		if ( m_pTargetCharacter->IsAdmin())
			pDC->SetColor(MCOLOR(ZCOLOR_ADMIN_NAME));
		else
			pDC->SetColor(MCOLOR(0xFFFFFFFF));

		MFont *pFont = MFontManager::Get( "FONTb11b");
		if ( pFont == NULL)
			_ASSERT(0);
		pDC->SetFont( pFont);

		if ( ZApplication::GetGame()->GetMatch()->GetMatchType() == MMATCH_GAMETYPE_DEATHMATCH_TEAM2)
			TextRelative( pDC, 0.5f, 75.0f/800.0f, szName, true);
		else
			TextRelative( pDC, 0.5f, 50.0f/800.0f, szName, true);
	}

	// Ä«¸Þ¶ó Ç¥½Ã
	if ( !ZGetMyInfo()->IsAdminGrade()) {
		ZCamera *pCamera = ZGetGameInterface()->GetCamera();

		const char *szModes[] = { "normal", "user", "free", "minimap" };
//		TextRelative(pDC, 0.9f, 50.0f/800.0f, szModes[pCamera->GetLookMode()], true);

		char szFileName[ 50];
		sprintf_safe( szFileName, "camera_%s.tga", szModes[pCamera->GetLookMode()]);
		pDC->SetBitmap( MBitmapManager::Get( szFileName));

		float fGain = (float)MGetWorkspaceWidth() / 800.0f;
		pDC->Draw( (int)(720.0f * fGain), (int)(7.0f * fGain), (int)(64.0f * fGain), (int)(64.0f * fGain));
	}



	// Admin ¿ÉÁ®¹öÀÏ °æ¿ì¿¡ ³²Àº Àοø¼ö Ç¥½Ã
	if ( ZGetMyInfo()->IsAdminGrade())
	{
		// Àοø¼ö ±¸Çϱâ
		int nNumOfTotal=0, nNumOfRedTeam=0, nNumOfBlueTeam=0;
		ZCharacterManager::iterator itor;
		ZCharacter* pCharacter;
		for (itor = ZGetCharacterManager()->begin(); itor != ZGetCharacterManager()->end(); ++itor)
		{
			pCharacter = (*itor).second;
	
			if ( pCharacter->GetTeamID() == MMT_SPECTATOR)		// ¿ÉÀú¹ö´Â –A´Ù
				continue;

			if(pCharacter->IsAdminHide()) continue;
		
			if ( (pCharacter->GetTeamID()==4) && ( !pCharacter->IsDie()))
				nNumOfTotal++;
			else if ( (pCharacter->GetTeamID()==MMT_RED) && ( !pCharacter->IsDie()))
				nNumOfRedTeam++;
			else if ( (pCharacter->GetTeamID()==MMT_BLUE) && ( !pCharacter->IsDie()))
				nNumOfBlueTeam++;
		}

		// ÆÀ À̹ÌÁö Ç¥½Ã
		float sizex = MGetWorkspaceWidth() / 800.f;
		float sizey = MGetWorkspaceHeight() / 600.f;
		char szText[128];

		// ¹è°æ Ç¥½Ã
		MCOLOR backgroundcolor;

		if (ZApplication::GetGame()->GetMatch()->IsTeamPlay())
		{
			backgroundcolor = MCOLOR(100,0,0, 150);
			pDC->SetColor(backgroundcolor);
			pDC->FillRectangle( 700 * sizex, 37 * sizey, 85 * sizex, 22 * sizey);
			backgroundcolor = MCOLOR(0,0,100, 150);
			pDC->SetColor(backgroundcolor);
			pDC->FillRectangle( 700 * sizex, 62 * sizey, 85 * sizex, 22 * sizey);

			// Àοø¼ö Ç¥½Ã
			backgroundcolor = MCOLOR(255,180,180, 255);
			pDC->SetColor(backgroundcolor);
			sprintf_safe( szText, "%s:%d", ZMsg( MSG_WORD_REDTEAM), nNumOfRedTeam); 
			TextRelative( pDC, 0.92f, 40.0f/600.0f, szText, true);
			backgroundcolor = MCOLOR(180,180,255, 255);
			pDC->SetColor(backgroundcolor);
			sprintf_safe( szText, "%s:%d", ZMsg( MSG_WORD_BLUETEAM), nNumOfBlueTeam); 
			TextRelative( pDC, 0.92f, 65.0f/600.0f, szText, true);
		}
	}

	CheckDeadTarget();
}
void ZShopEquipInterface::DrawCharInfoText(char* szShopOrEquip, int nReqLevel, int nNewWT, int nNewMaxWT, int nNewHP, int nNewAP, int nReqBounty, int nReqCash)
{
	if (szShopOrEquip == NULL) 
	{
		DrawCharInfoText("Shop", nReqLevel, nNewWT, nNewMaxWT, nNewHP, nNewAP, nReqBounty, nReqCash);
		DrawCharInfoText("Equip", nReqLevel, nNewWT, nNewMaxWT, nNewHP, nNewAP, nReqBounty, nReqCash);
		return;
	}

	if (0!=strcmp(szShopOrEquip, "Shop") && 0!=strcmp(szShopOrEquip, "Equip")) return;

	MTextArea* pTextArea[3];
	char sz1[256], sz2[256], szTextArea[64];
	const char* szRed	= "^1";
	const char* szGreen	= "^2";
	const char* szGray	= "^9";
	const char* szColor	= NULL;

	// prefix에 따라서 "Shop_MyInfo1" "Shop_MyInfo2" "Shop_MyInfo3" "Equip_MyInfo1" "Equip_MyInfo2" "Equip_MyInfo3"의 이름을 구성
	// (가로로 늘어놓은 TextArea 세개에 나눠서 표시하기 때문에..)
	for (int i=0; i<3; ++i)
	{
		sprintf(szTextArea, "%s_MyInfo%d", szShopOrEquip, i+1);
		pTextArea[i] = (MTextArea*)GetIDLResource()->FindWidget(szTextArea);
		if (NULL == pTextArea[i])
		{
			_ASSERT(0);
			return;	// 하나라도 못찾으면 리턴해버리자
		}

		pTextArea[i]->Clear();
	}

	// 첫번째 TextArea (레벨, 무게)
	szColor = szGray;
	if (nReqLevel > ZGetMyInfo()->GetLevel())
		szColor = szRed;
	sprintf(sz1, "^9%s : %s%d ^9%s", ZMsg(MSG_CHARINFO_LEVEL), szColor, ZGetMyInfo()->GetLevel(), ZMsg(MSG_CHARINFO_LEVELMARKER));
	pTextArea[0]->AddText(sz1);

	int nCurrMaxWT = ZGetMyInfo()->GetItemList()->GetMaxWeight();
	sprintf(sz1, "^9%s : ", ZMsg(MSG_CHARINFO_WEIGHT));
	szColor = (nNewWT > nNewMaxWT) ? szRed : szGray;
	sprintf(sz2, "%s%d", szColor, nNewWT);
	strcat(sz1, sz2);
	sprintf(sz2, "^9/%d", nCurrMaxWT);
	strcat(sz1, sz2);
	int nDiffMaxWT = nNewMaxWT - nCurrMaxWT;
	if (nDiffMaxWT != 0)
	{
		szColor = (nDiffMaxWT > 0) ? szGreen : szRed;
		sprintf(sz2, "%s%+d", szColor, nDiffMaxWT);
		strcat(sz1, sz2);
	}
	pTextArea[0]->AddText(sz1);



	// 두번째 TextArea (체력, 방어)
	sprintf(sz1, "^9%s : %d ", ZMsg(MSG_CHARINFO_HP), ZGetMyInfo()->GetHP());
	int nDiffHP = nNewHP - ZGetMyInfo()->GetHP();
	if (nDiffHP != 0)
	{
		szColor = (nDiffHP > 0) ? szGreen : szRed;
		sprintf(sz2, "%s%+d", szColor, nDiffHP);
		strcat(sz1, sz2);
	}
	pTextArea[1]->AddText(sz1);

	sprintf(sz1, "^9%s : %d ", ZMsg(MSG_CHARINFO_AP), ZGetMyInfo()->GetAP());
	int nDiffAP = nNewAP - ZGetMyInfo()->GetAP();
	if (nDiffAP != 0)
	{
		szColor = (nDiffAP > 0) ? szGreen : szRed;
		sprintf(sz2, "%s%+d", szColor, nDiffAP);
		strcat(sz1, sz2);
	}
	pTextArea[1]->AddText(sz1);


	// 세번째 TextArea (바운티, 캐시)

	sprintf(sz1, "^9%s : ", ZMsg(MSG_CHARINFO_BOUNTY));
	szColor = (nReqBounty > ZGetMyInfo()->GetBP()) ? szRed : szGray;
	sprintf(sz2, "%s%d", szColor, ZGetMyInfo()->GetBP());
	strcat(sz1, sz2);
	pTextArea[2]->AddText(sz1);

	sprintf(sz1, "^9%s : ", ZMsg(MSG_CHARINFO_CASH));
	szColor = (nReqBounty > ZGetMyInfo()->GetECoins()) ? szRed : szGray;
	sprintf(sz2, "%s%d", szColor, ZGetMyInfo()->GetECoins());
	strcat(sz1, sz2);
	pTextArea[2]->AddText(sz1);

/*	보유 캐쉬는 캐쉬템 구입이 가능해질때 보여주자
	sprintf(sz1, "^9%s : ", ZMsg(MSG_CHARINFO_CASH));
	szColor = (nReqCash > ZGetMyInfo()->GetCash()) ? szRed : szGray;
	sprintf(sz2, "%s%d", szColor, ZGetMyInfo()->GetCash());
	strcat(sz1, sz2);
	pTextArea[2]->AddText(sz1);
	*/
}
bool ZGameClient::OnCommand(MCommand* pCommand)
{
	bool ret = MMatchClient::OnCommand(pCommand);

	switch (pCommand->GetID()) {
	case MC_MATCH_PING_LIST:
	{
		auto Param = pCommand->GetParameter(0);
		if (Param->GetType() != MPT_BLOB) break;
		void* Blob = Param->GetPointer();
		int Count = MGetBlobArrayCount(Blob);
		for (int i = 0; i < Count; i++)
		{
			auto& Ping = *static_cast<MTD_PingInfo*>(MGetBlobArrayElement(Blob, i));
			if (Ping.UID == GetPlayerUID())
			{
				PingToServer = Ping.Ping;
				continue;
			}

			auto Peer = GetPeers()->Find(Ping.UID);
			if (Peer)
				Peer->UpdatePing(GetGlobalTimeMS(), Ping.Ping);

			auto Char = ZGetCharacterManager()->Find(Ping.UID);
			if (Char)
				Char->Ping = Ping.Ping;
		}
	}
	break;
	case MC_MATCH_RESPONSE_LOGIN_FAILED:
	{
		char szReason[4096];
		if (!pCommand->GetParameter(szReason, 0, MPT_STR, sizeof(szReason)))
			break;

		ZGetGameInterface()->ShowErrorMessage(szReason);

		ZPostDisconnect();
	}
	break;
	case MC_MATCH_RESPONSE_CREATE_ACCOUNT:
	{
		char szMessage[128];
		if (!pCommand->GetParameter(szMessage, 0, MPT_STR, sizeof(szMessage)))
			break;

		ZGetGameInterface()->ShowErrorMessage(szMessage);
	}
	break;
	case MC_NET_ONDISCONNECT: break;
	case MC_NET_ONERROR: break;
	case ZC_CHANGESKIN:
	{
		char szSkinName[256];
		pCommand->GetParameter(szSkinName, 0, MPT_STR, sizeof(szSkinName));
		if (ZApplication::GetGameInterface()->ChangeInterfaceSkin(szSkinName))
		{
			MClient::OutputMessage(MZMOM_LOCALREPLY, "Change Skin To %s", szSkinName);
		}
		else
		{
			MClient::OutputMessage(MZMOM_LOCALREPLY, "Change Skin Failed");
		}
	}
	break;
	case MC_ADMIN_TERMINAL:
	{
#ifndef _PUBLISH
		char szText[65535]; szText[0] = 0;
		MUID uidChar;

		pCommand->GetParameter(&uidChar, 0, MPT_UID);
		pCommand->GetParameter(szText, 1, MPT_STR, sizeof(szText));
		OutputToConsole(szText);
#endif
	}
	break;
	case MC_NET_CHECKPING:
	{
		MUID uid;
		if (pCommand->GetParameter(&uid, 0, MPT_UID) == false) break;
		MCommand* pNew = new MCommand(m_CommandManager.GetCommandDescByID(MC_NET_PING), uid, m_This);
		pNew->AddParameter(new MCommandParameterUInt(GetGlobalTimeMS()));
		Post(pNew);
		return true;
	}
	case MC_NET_PING:
	{
		unsigned int nTimeStamp;
		if (pCommand->GetParameter(&nTimeStamp, 0, MPT_UINT) == false) break;
		MCommand* pNew = new MCommand(m_CommandManager.GetCommandDescByID(MC_NET_PONG), pCommand->m_Sender, m_This);
		pNew->AddParameter(new MCommandParameterUInt(nTimeStamp));
		Post(pNew);
		return true;
	}
	case MC_NET_PONG:
	{
		int nTimeStamp;
		pCommand->GetParameter(&nTimeStamp, 0, MPT_UINT);

		MClient::OutputMessage(MZMOM_LOCALREPLY, "Ping from (%u:%u) = %d",
			pCommand->GetSenderUID().High, pCommand->GetSenderUID().Low,
			GetGlobalTimeMS() - nTimeStamp);
	}
	break;
	case ZC_CON_CONNECT:
	{
		char szBuf[256];
		sprintf_safe(szBuf, "Net.Connect %s:%d", ZGetConfiguration()->GetServerIP(),
			ZGetConfiguration()->GetServerPort());
		ConsoleInputEvent(szBuf);
		SetServerAddr(ZGetConfiguration()->GetServerIP(), ZGetConfiguration()->GetServerPort());
	}
	break;
	case ZC_CON_DISCONNECT:
	{
		ConsoleInputEvent("Net.Disconnect");
	}
	break;
	case ZC_CON_CLEAR:
	{
		if (ZGetConsole()) ZGetConsole()->ClearMessage();
	}
	break;
	case ZC_CON_HIDE:
	{
		if (ZGetConsole()) ZGetConsole()->Show(false);
	}
	break;
	case ZC_CON_SIZE:
	{
		if (ZGetConsole())
		{
			int iConWidth, iConHeight;
			pCommand->GetParameter(&iConWidth, 0, MPT_INT);
			pCommand->GetParameter(&iConHeight, 1, MPT_INT);
			if ((iConWidth > 30) && (iConHeight > 30))
			{
				MPOINT point = ZGetConsole()->GetPosition();
				ZGetConsole()->SetBounds(point.x, point.y, iConWidth, iConHeight);
			}
		}
	}
	break;
	case MC_CLOCK_SYNCHRONIZE:
	{
		u32 nGlobalClock;
		pCommand->GetParameter(&nGlobalClock, 0, MPT_UINT);


		u32 nLocalClock = GetClockCount();

		if (nGlobalClock > nLocalClock) m_bIsBigGlobalClock = true;
		else m_bIsBigGlobalClock = false;
		m_nClockDistance = ZGetClockDistance(nGlobalClock, nLocalClock);
	}
	break;
	case MC_MATCH_NOTIFY:
	{
		unsigned int nMsgID = 0;
		if (pCommand->GetParameter(&nMsgID, 0, MPT_UINT) == false) break;

		OnMatchNotify(nMsgID);
	}
	break;
	case MC_MATCH_BRIDGEPEER_ACK:
	{
		MUID uidChar;
		int nCode;
		pCommand->GetParameter(&uidChar, 0, MPT_UID);
		pCommand->GetParameter(&nCode, 1, MPT_INT);
		OnBridgePeerACK(uidChar, nCode);
	}
	break;
	case MC_MATCH_STAGE_RESPONSE_FORCED_ENTRY:
	{
		int nResult;
		pCommand->GetParameter(&nResult, 0, MPT_INT);
		if (nResult == MOK)
		{
			OnForcedEntryToGame();
		}
		else
		{
			ZApplication::GetGameInterface()->ShowMessage("Forced entry rejected");
		}
	}
	break;
	case MC_MATCH_STAGE_JOIN:
	{
		MUID uidChar, uidStage;
		unsigned int nRoomNo = 0;
		char szStageName[256] = "";

		pCommand->GetParameter(&uidChar, 0, MPT_UID);
		pCommand->GetParameter(&uidStage, 1, MPT_UID);
		pCommand->GetParameter(&nRoomNo, 2, MPT_UINT);
		pCommand->GetParameter(szStageName, 3, MPT_STR, sizeof(szStageName));

		OnStageJoin(uidChar, uidStage, nRoomNo, szStageName);
	}
	break;
	case MC_MATCH_STAGE_LEAVE:
	{
		MUID uidChar, uidStage;

		pCommand->GetParameter(&uidChar, 0, MPT_UID);
		pCommand->GetParameter(&uidStage, 1, MPT_UID);

		OnStageLeave(uidChar, uidStage);
	}
	break;
	case MC_MATCH_STAGE_START:
	{
		MUID uidChar, uidStage;
		int nCountdown;

		pCommand->GetParameter(&uidChar, 0, MPT_UID);
		pCommand->GetParameter(&uidStage, 1, MPT_UID);
		pCommand->GetParameter(&nCountdown, 2, MPT_INT);

		OnStageStart(uidChar, uidStage, nCountdown);
	}
	break;
	case MC_MATCH_STAGE_LAUNCH:
	{
		MUID uidStage;
		char szMapName[_MAX_DIR];

		pCommand->GetParameter(&uidStage, 0, MPT_UID);
		pCommand->GetParameter(szMapName, 1, MPT_STR, sizeof(szMapName));
		OnStageLaunch(uidStage, szMapName);
	}
	break;
	case MC_MATCH_STAGE_FINISH_GAME:
	{
		MUID uidStage;
		pCommand->GetParameter(&uidStage, 0, MPT_UID);
		OnStageFinishGame(uidStage);
	}
	break;
	case MC_MATCH_STAGE_MAP:
	{
		MUID uidStage;
		char szMapName[_MAX_DIR];
		pCommand->GetParameter(&uidStage, 0, MPT_UID);
		pCommand->GetParameter(szMapName, 1, MPT_STR, sizeof(szMapName));

		OnStageMap(uidStage, szMapName);
	}
	break;
	case MC_MATCH_STAGE_TEAM:
	{
		MUID uidChar, uidStage;
		unsigned int nTeam;
		pCommand->GetParameter(&uidChar, 0, MPT_UID);
		pCommand->GetParameter(&uidStage, 1, MPT_UID);
		pCommand->GetParameter(&nTeam, 2, MPT_UINT);
		OnStageTeam(uidChar, uidStage, nTeam);
	}
	break;
	case MC_MATCH_STAGE_PLAYER_STATE:
	{
		MUID uidChar, uidStage;
		int nObjectStageState;
		pCommand->GetParameter(&uidChar, 0, MPT_UID);
		pCommand->GetParameter(&uidStage, 1, MPT_UID);
		pCommand->GetParameter(&nObjectStageState, 2, MPT_INT);
		OnStagePlayerState(uidChar, uidStage, MMatchObjectStageState(nObjectStageState));
	}
	break;
	case MC_MATCH_STAGE_MASTER:
	{
		MUID uidChar, uidStage;
		pCommand->GetParameter(&uidStage, 0, MPT_UID);
		pCommand->GetParameter(&uidChar, 1, MPT_UID);

		OnStageMaster(uidStage, uidChar);
	}
	break;
	case MC_MATCH_STAGE_CHAT:
	{
		MUID uidStage, uidChar;
		static char szChat[512];
		pCommand->GetParameter(&uidChar, 0, MPT_UID);
		pCommand->GetParameter(&uidStage, 1, MPT_UID);
		pCommand->GetParameter(szChat, 2, MPT_STR, sizeof(szChat));
		OnStageChat(uidChar, uidStage, szChat);
	}
	break;
	case MC_MATCH_STAGE_LIST:
	{
		char nPrevStageCount, nNextStageCount;
		pCommand->GetParameter(&nPrevStageCount, 0, MPT_CHAR);
		pCommand->GetParameter(&nNextStageCount, 1, MPT_CHAR);

		MCommandParameter* pParam = pCommand->GetParameter(2);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pBlob = pParam->GetPointer();
		int nCount = MGetBlobArrayCount(pBlob);

		OnStageList((int)nPrevStageCount, (int)nNextStageCount, pBlob, nCount);
	}
	break;
	case MC_MATCH_CHANNEL_RESPONSE_PLAYER_LIST:
	{
		unsigned char nTotalPlayerCount, nPage;

		pCommand->GetParameter(&nTotalPlayerCount, 0, MPT_UCHAR);
		pCommand->GetParameter(&nPage, 1, MPT_UCHAR);

		MCommandParameter* pParam = pCommand->GetParameter(2);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pBlob = pParam->GetPointer();
		int nCount = MGetBlobArrayCount(pBlob);

		OnChannelPlayerList((int)nTotalPlayerCount, (int)nPage, pBlob, nCount);

	}
	break;
	case MC_MATCH_CHANNEL_RESPONSE_ALL_PLAYER_LIST:
	{
		MUID uidChannel;

		pCommand->GetParameter(&uidChannel, 0, MPT_UID);

		MCommandParameter* pParam = pCommand->GetParameter(1);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pBlob = pParam->GetPointer();
		int nCount = MGetBlobArrayCount(pBlob);

		OnChannelAllPlayerList(uidChannel, pBlob, nCount);
	}
	break;
	case MC_MATCH_RESPONSE_FRIENDLIST:
	{
		MCommandParameter* pParam = pCommand->GetParameter(0);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pBlob = pParam->GetPointer();
		int nCount = MGetBlobArrayCount(pBlob);

		OnResponseFriendList(pBlob, nCount);
	}
	break;
	case MC_MATCH_RESPONSE_STAGESETTING:
	{
		MUID uidStage;
		pCommand->GetParameter(&uidStage, 0, MPT_UID);

		MCommandParameter* pStageParam = pCommand->GetParameter(1);
		if (pStageParam->GetType() != MPT_BLOB) break;
		void* pStageBlob = pStageParam->GetPointer();
		int nStageCount = MGetBlobArrayCount(pStageBlob);

		MCommandParameter* pCharParam = pCommand->GetParameter(2);
		if (pCharParam->GetType() != MPT_BLOB) break;
		void* pCharBlob = pCharParam->GetPointer();
		int nCharCount = MGetBlobArrayCount(pCharBlob);

		int nStageState;
		pCommand->GetParameter(&nStageState, 3, MPT_INT);

		MUID uidMaster;
		pCommand->GetParameter(&uidMaster, 4, MPT_UID);

		OnResponseStageSetting(uidStage, pStageBlob, nStageCount, pCharBlob,
			nCharCount, static_cast<STAGE_STATE>(nStageState), uidMaster);
	}
	break;
	case MC_MATCH_RESPONSE_PEER_RELAY:
	{
		MUID uidPeer;
		if (pCommand->GetParameter(&uidPeer, 0, MPT_UID) == false) break;

		OnResponsePeerRelay(uidPeer);
	}
	break;
	case MC_MATCH_LOADING_COMPLETE:
	{
		MUID uidChar;
		int nPercent;

		if (pCommand->GetParameter(&uidChar, 0, MPT_UID) == false) break;
		if (pCommand->GetParameter(&nPercent, 1, MPT_INT) == false) break;

		OnLoadingComplete(uidChar, nPercent);
	}
	break;
	case MC_MATCH_ANNOUNCE:
	{
		unsigned int nType;
		char szMsg[256];
		pCommand->GetParameter(&nType, 0, MPT_UINT);
		pCommand->GetParameter(szMsg, 1, MPT_STR, sizeof(szMsg));
		OnAnnounce(nType, szMsg);
	}
	break;
	case MC_MATCH_CHANNEL_RESPONSE_JOIN:
	{
		MUID uidChannel;
		int nChannelType;
		char szChannelName[256];

		pCommand->GetParameter(&uidChannel, 0, MPT_UID);
		pCommand->GetParameter(&nChannelType, 1, MPT_INT);
		pCommand->GetParameter(szChannelName, 2, MPT_STR, sizeof(szChannelName));

		OnChannelResponseJoin(uidChannel, (MCHANNEL_TYPE)nChannelType, szChannelName);
	}
	break;
	case MC_MATCH_CHANNEL_CHAT:
	{
		MUID uidChannel, uidChar;
		char szChat[512];
		char szName[256];
		int nGrade;

		pCommand->GetParameter(&uidChannel, 0, MPT_UID);
		pCommand->GetParameter(szName, 1, MPT_STR, sizeof(szName));
		pCommand->GetParameter(szChat, 2, MPT_STR, sizeof(szChat));
		pCommand->GetParameter(&nGrade, 3, MPT_INT);

		OnChannelChat(uidChannel, szName, szChat, nGrade);
	}
	break;
	case MC_MATCH_CHANNEL_LIST:
	{
		MCommandParameter* pParam = pCommand->GetParameter(0);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pBlob = pParam->GetPointer();
		int nCount = MGetBlobArrayCount(pBlob);
		OnChannelList(pBlob, nCount);
	}
	break;
	case MC_MATCH_CHANNEL_RESPONSE_RULE:
	{
		MUID uidChannel;
		pCommand->GetParameter(&uidChannel, 0, MPT_UID);
		char szRuleName[128];
		pCommand->GetParameter(szRuleName, 1, MPT_STR, sizeof(szRuleName));

		OnChannelResponseRule(uidChannel, szRuleName);
	}
	break;
	case MC_MATCH_RESPONSE_RECOMMANDED_CHANNEL:
	{
		MUID uidChannel;
		pCommand->GetParameter(&uidChannel, 0, MPT_UID);

		OnResponseRecommandedChannel(uidChannel);
	}
	break;
	case MC_ADMIN_ANNOUNCE:
	{
		char szChat[512];
		u32 nMsgType = 0;

		pCommand->GetParameter(szChat, 1, MPT_STR, sizeof(szChat));
		pCommand->GetParameter(&nMsgType, 2, MPT_UINT);

		OnAdminAnnounce(szChat, ZAdminAnnounceType(nMsgType));
	}
	break;
	case MC_MATCH_GAME_LEVEL_UP:
	{
		MUID uidChar;
		pCommand->GetParameter(&uidChar, 0, MPT_UID);

		OnGameLevelUp(uidChar);
	}
	break;
	case MC_MATCH_GAME_LEVEL_DOWN:
	{
		MUID uidChar;
		pCommand->GetParameter(&uidChar, 0, MPT_UID);

		OnGameLevelDown(uidChar);
	}
	break;
	case MC_MATCH_RESPONSE_GAME_INFO:
	{
		MUID uidStage;
		pCommand->GetParameter(&uidStage, 0, MPT_UID);

		MCommandParameter* pParam = pCommand->GetParameter(1);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pGameInfoBlob = pParam->GetPointer();

		pParam = pCommand->GetParameter(2);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pRuleInfoBlob = pParam->GetPointer();

		pParam = pCommand->GetParameter(3);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pPlayerInfoBlob = pParam->GetPointer();

		OnResponseGameInfo(uidStage, pGameInfoBlob, pRuleInfoBlob, pPlayerInfoBlob);
	}
	break;
	case MC_MATCH_OBTAIN_WORLDITEM:
	{
		MUID uidPlayer;
		int nItemUID;

		pCommand->GetParameter(&uidPlayer, 0, MPT_UID);
		pCommand->GetParameter(&nItemUID, 1, MPT_INT);

		OnObtainWorldItem(uidPlayer, nItemUID);
	}
	break;
	case MC_MATCH_SPAWN_WORLDITEM:
	{
		MCommandParameter* pParam = pCommand->GetParameter(0);
		if (pParam->GetType() != MPT_BLOB) break;

		void* pSpawnInfoBlob = pParam->GetPointer();

		OnSpawnWorldItem(pSpawnInfoBlob);
	}
	break;
	case MC_MATCH_REMOVE_WORLDITEM:
	{
		int nItemUID;

		pCommand->GetParameter(&nItemUID, 0, MPT_INT);

		OnRemoveWorldItem(nItemUID);
	}
	break;

	case MC_MATCH_USER_WHISPER:
	{
		char szSenderName[128] = "";
		char szTargetName[128] = "";
		char szMessage[1024] = "";

		pCommand->GetParameter(szSenderName, 0, MPT_STR, sizeof(szSenderName));
		pCommand->GetParameter(szTargetName, 1, MPT_STR, sizeof(szTargetName));
		pCommand->GetParameter(szMessage, 2, MPT_STR, sizeof(szMessage));

		OnUserWhisper(szSenderName, szTargetName, szMessage);
	}
	break;
	case MC_MATCH_CHATROOM_JOIN:
	{
		char szPlayerName[128] = "";
		char szChatRoomName[128] = "";

		pCommand->GetParameter(szPlayerName, 0, MPT_STR, sizeof(szPlayerName));
		pCommand->GetParameter(szChatRoomName, 1, MPT_STR, sizeof(szChatRoomName));

		OnChatRoomJoin(szPlayerName, szChatRoomName);
	}
	break;
	case MC_MATCH_CHATROOM_LEAVE:
	{
		char szPlayerName[128] = "";
		char szChatRoomName[128] = "";

		pCommand->GetParameter(szPlayerName, 0, MPT_STR, sizeof(szPlayerName));
		pCommand->GetParameter(szChatRoomName, 1, MPT_STR, sizeof(szChatRoomName));

		OnChatRoomLeave(szPlayerName, szChatRoomName);
	}
	break;
	case MC_MATCH_CHATROOM_SELECT_WRITE:
	{
		char szChatRoomName[128] = "";
		pCommand->GetParameter(szChatRoomName, 0, MPT_STR, sizeof(szChatRoomName));

		OnChatRoomSelectWrite(szChatRoomName);
	}
	break;
	case MC_MATCH_CHATROOM_INVITE:
	{
		char szSenderName[64] = "";
		char szTargetName[64] = "";
		char szRoomName[128] = "";

		pCommand->GetParameter(szSenderName, 0, MPT_STR, sizeof(szSenderName));
		pCommand->GetParameter(szTargetName, 1, MPT_STR, sizeof(szTargetName));
		pCommand->GetParameter(szRoomName, 2, MPT_STR, sizeof(szRoomName));

		OnChatRoomInvite(szSenderName, szRoomName);
	}
	break;
	case MC_MATCH_CHATROOM_CHAT:
	{
		char szChatRoomName[128] = "";
		char szPlayerName[128] = "";
		char szChat[128] = "";

		pCommand->GetParameter(szChatRoomName, 0, MPT_STR, sizeof(szChatRoomName));
		pCommand->GetParameter(szPlayerName, 1, MPT_STR, sizeof(szPlayerName));
		pCommand->GetParameter(szChat, 2, MPT_STR, sizeof(szChat));

		OnChatRoomChat(szChatRoomName, szPlayerName, szChat);
	}
	break;
	case ZC_REPORT_119:
	{
		OnLocalReport119();
	}
	break;
	case ZC_MESSAGE:
	{
		int nMessageID;
		pCommand->GetParameter(&nMessageID, 0, MPT_INT);
		ZGetGameInterface()->ShowMessage(nMessageID);
	}break;
	case MC_TEST_PEERTEST_PING:
	{
		MUID uidSender = pCommand->GetSenderUID();
		char szLog[128];
		sprintf_safe(szLog, "PEERTEST_PING: from (%d%d)", uidSender.High, uidSender.Low);
		ZChatOutput(szLog, ZChat::CMT_SYSTEM);
	}
	break;
	case MC_TEST_PEERTEST_PONG:
	{
	}
	break;
	case MC_MATCH_CLAN_RESPONSE_CREATE_CLAN:
	{
		int nResult, nRequestID;
		pCommand->GetParameter(&nResult, 0, MPT_INT);
		pCommand->GetParameter(&nRequestID, 1, MPT_INT);

		OnResponseCreateClan(nResult, nRequestID);

	}
	break;
	case MC_MATCH_CLAN_RESPONSE_AGREED_CREATE_CLAN:
	{
		int nResult;
		pCommand->GetParameter(&nResult, 0, MPT_INT);

		OnResponseAgreedCreateClan(nResult);
	}
	break;
	case MC_MATCH_CLAN_ASK_SPONSOR_AGREEMENT:
	{
		int nRequestID;
		char szClanName[256];
		MUID uidMasterObject;
		char szMasterName[256];


		pCommand->GetParameter(&nRequestID, 0, MPT_INT);
		pCommand->GetParameter(szClanName, 1, MPT_STR, sizeof(szClanName));
		pCommand->GetParameter(&uidMasterObject, 2, MPT_UID);
		pCommand->GetParameter(szMasterName, 3, MPT_STR, sizeof(szMasterName));

		OnClanAskSponsorAgreement(nRequestID, szClanName, uidMasterObject, szMasterName);
	}
	break;
	case MC_MATCH_CLAN_ANSWER_SPONSOR_AGREEMENT:
	{
		MUID uidClanMaster;
		int nRequestID;
		bool bAnswer;
		char szCharName[256];

		pCommand->GetParameter(&nRequestID, 0, MPT_INT);
		pCommand->GetParameter(&uidClanMaster, 1, MPT_UID);
		pCommand->GetParameter(szCharName, 2, MPT_STR, sizeof(szCharName));
		pCommand->GetParameter(&bAnswer, 3, MPT_BOOL);

		OnClanAnswerSponsorAgreement(nRequestID, uidClanMaster, szCharName, bAnswer);
	}
	break;
	case MC_MATCH_CLAN_RESPONSE_CLOSE_CLAN:
	{
		int nResult;
		pCommand->GetParameter(&nResult, 0, MPT_INT);

		OnClanResponseCloseClan(nResult);
	}
	break;
	case MC_MATCH_CLAN_RESPONSE_JOIN_CLAN:
	{
		int nResult;
		pCommand->GetParameter(&nResult, 0, MPT_INT);
		OnClanResponseJoinClan(nResult);
	}
	break;
	case MC_MATCH_CLAN_ASK_JOIN_AGREEMENT:
	{
		char szClanName[256], szClanAdmin[256];
		MUID uidClanAdmin;

		pCommand->GetParameter(szClanName, 0, MPT_STR, sizeof(szClanName));
		pCommand->GetParameter(&uidClanAdmin, 1, MPT_UID);
		pCommand->GetParameter(szClanAdmin, 2, MPT_STR, sizeof(szClanAdmin));

		OnClanAskJoinAgreement(szClanName, uidClanAdmin, szClanAdmin);
	}
	break;
	case MC_MATCH_CLAN_ANSWER_JOIN_AGREEMENT:
	{
		MUID uidClanAdmin;
		bool bAnswer;
		char szJoiner[256];

		pCommand->GetParameter(&uidClanAdmin, 0, MPT_UID);
		pCommand->GetParameter(szJoiner, 1, MPT_STR, sizeof(szJoiner));
		pCommand->GetParameter(&bAnswer, 2, MPT_BOOL);

		OnClanAnswerJoinAgreement(uidClanAdmin, szJoiner, bAnswer);
	}
	break;
	case MC_MATCH_CLAN_RESPONSE_AGREED_JOIN_CLAN:
	{
		int nResult;
		pCommand->GetParameter(&nResult, 0, MPT_INT);
		OnClanResponseAgreedJoinClan(nResult);
	}
	break;
	case MC_MATCH_CLAN_UPDATE_CHAR_CLANINFO:
	{
		MCommandParameter* pParam = pCommand->GetParameter(0);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pBlob = pParam->GetPointer();

		OnClanUpdateCharClanInfo(pBlob);
	}
	break;
	case MC_MATCH_CLAN_RESPONSE_LEAVE_CLAN:
	{
		int nResult;
		pCommand->GetParameter(&nResult, 0, MPT_INT);
		OnClanResponseLeaveClan(nResult);
	}
	break;
	case MC_MATCH_CLAN_MASTER_RESPONSE_CHANGE_GRADE:
	{
		int nResult;
		pCommand->GetParameter(&nResult, 0, MPT_INT);
		OnClanResponseChangeGrade(nResult);
	}
	break;
	case MC_MATCH_CLAN_ADMIN_RESPONSE_EXPEL_MEMBER:
	{
		int nResult;
		pCommand->GetParameter(&nResult, 0, MPT_INT);
		OnClanResponseExpelMember(nResult);
	}
	break;
	case MC_MATCH_CLAN_MSG:
	{
		char szSenderName[256];
		char szMsg[512];

		pCommand->GetParameter(szSenderName, 0, MPT_STR, sizeof(szSenderName));
		pCommand->GetParameter(szMsg, 1, MPT_STR, sizeof(szMsg));

		OnClanMsg(szSenderName, szMsg);
	}
	break;
	case MC_MATCH_CLAN_RESPONSE_MEMBER_LIST:
	{
		MCommandParameter* pParam = pCommand->GetParameter(0);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pBlob = pParam->GetPointer();

		OnClanMemberList(pBlob);

	}
	break;
	case MC_MATCH_CLAN_RESPONSE_CLAN_INFO:
	{
		MCommandParameter* pParam = pCommand->GetParameter(0);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pBlob = pParam->GetPointer();

		OnClanResponseClanInfo(pBlob);
	}
	break;
	case MC_MATCH_CLAN_RESPONSE_EMBLEMURL:
	{
		int nCLID = 0;
		int nEmblemChecksum = 0;
		char szURL[4096] = "";

		pCommand->GetParameter(&nCLID, 0, MPT_INT);
		pCommand->GetParameter(&nEmblemChecksum, 1, MPT_INT);
		pCommand->GetParameter(szURL, 2, MPT_STR, sizeof(szURL));

		OnClanResponseEmblemURL(nCLID, nEmblemChecksum, szURL);
	}
	break;
	case MC_MATCH_CLAN_LOCAL_EMBLEMREADY:
	{
		int nCLID = 0;
		char szURL[4096] = "";

		pCommand->GetParameter(&nCLID, 0, MPT_INT);
		pCommand->GetParameter(szURL, 1, MPT_STR, sizeof(szURL));

		OnClanEmblemReady(nCLID, szURL);
	}
	break;
	case MC_MATCH_RESPONSE_RESULT:
	{
		int nResult;
		pCommand->GetParameter(&nResult, 0, MPT_INT);
		if (nResult != MOK)
		{
			ZApplication::GetGameInterface()->ShowErrorMessage(nResult);
		}
	}
	break;
	case MC_MATCH_RESPONSE_CHARINFO_DETAIL:
	{
		MCommandParameter* pParam = pCommand->GetParameter(0);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pBlob = pParam->GetPointer();

		OnResponseCharInfoDetail(pBlob);
	}
	break;
	case MC_MATCH_RESPONSE_PROPOSAL:
	{
		int nResult, nProposalMode, nRequestID;

		pCommand->GetParameter(&nResult, 0, MPT_INT);
		pCommand->GetParameter(&nProposalMode, 1, MPT_INT);
		pCommand->GetParameter(&nRequestID, 2, MPT_INT);

		OnResponseProposal(nResult, MMatchProposalMode(nProposalMode), nRequestID);
	}
	break;
	case MC_MATCH_ASK_AGREEMENT:
	{
		MUID uidProposer;
		int nProposalMode, nRequestID;

		pCommand->GetParameter(&uidProposer, 0, MPT_UID);

		MCommandParameter* pParam = pCommand->GetParameter(1);
		void* pMemberNamesBlob = pParam->GetPointer();

		pCommand->GetParameter(&nProposalMode, 2, MPT_INT);
		pCommand->GetParameter(&nRequestID, 3, MPT_INT);

		OnAskAgreement(uidProposer, pMemberNamesBlob, MMatchProposalMode(nProposalMode), nRequestID);
	}
	break;
	case MC_MATCH_REPLY_AGREEMENT:
	{
		MUID uidProposer, uidChar;
		char szReplierName[256];
		int nProposalMode, nRequestID;
		bool bAgreement;

		pCommand->GetParameter(&uidProposer, 0, MPT_UID);
		pCommand->GetParameter(&uidChar, 1, MPT_UID);
		pCommand->GetParameter(szReplierName, 2, MPT_STR, sizeof(szReplierName));
		pCommand->GetParameter(&nProposalMode, 3, MPT_INT);
		pCommand->GetParameter(&nRequestID, 4, MPT_INT);
		pCommand->GetParameter(&bAgreement, 5, MPT_BOOL);

		OnReplyAgreement(uidProposer, uidChar, szReplierName, MMatchProposalMode(nProposalMode),
			nRequestID, bAgreement);
	}
	break;
	case MC_MATCH_LADDER_SEARCH_RIVAL:
	{
		ZGetGameInterface()->OnArrangedTeamGameUI(true);
	}break;
	case MC_MATCH_LADDER_CANCEL_CHALLENGE:
	{
		ZGetGameInterface()->OnArrangedTeamGameUI(false);

		char szCharName[MATCHOBJECT_NAME_LENGTH];
		pCommand->GetParameter(szCharName, 0, MPT_STR, sizeof(szCharName));

		if (szCharName[0] != 0)
		{
			char szOutput[256];
			ZTransMsg(szOutput, MSG_LADDER_CANCEL, 1, szCharName);
			ZChatOutput(MCOLOR(ZCOLOR_CHAT_SYSTEM), szOutput);
		}
		else
		{
			ZChatOutput(MCOLOR(ZCOLOR_CHAT_SYSTEM),
				ZMsg(MSG_LADDER_FAILED));
		}
	}break;
	case MC_MATCH_LADDER_RESPONSE_CHALLENGE:
	{
		int nResult;
		pCommand->GetParameter(&nResult, 0, MPT_INT);
		OnLadderResponseChallenge(nResult);
	}
	break;
	case MC_MATCH_LADDER_PREPARE:
	{
		MUID uidStage;
		pCommand->GetParameter(&uidStage, 0, MPT_UID);
		int nTeam;
		pCommand->GetParameter(&nTeam, 1, MPT_INT);

		OnLadderPrepare(uidStage, nTeam);
	}break;
	case MC_MATCH_LADDER_LAUNCH:
	{
		MUID uidStage;
		pCommand->GetParameter(&uidStage, 0, MPT_UID);
		char szMapName[128];
		pCommand->GetParameter(szMapName, 1, MPT_STR, sizeof(szMapName));

		OnLadderLaunch(uidStage, szMapName);
	}break;
	case MC_MATCH_CLAN_STANDBY_CLAN_LIST:
	{
		int nPrevStageCount, nNextStageCount;
		pCommand->GetParameter(&nPrevStageCount, 0, MPT_INT);
		pCommand->GetParameter(&nNextStageCount, 1, MPT_INT);

		MCommandParameter* pParam = pCommand->GetParameter(2);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pBlob = pParam->GetPointer();

		OnClanStandbyClanList(nPrevStageCount, nNextStageCount, pBlob);
	}
	break;
	case MC_MATCH_CLAN_MEMBER_CONNECTED:
	{
		char szMember[256];

		pCommand->GetParameter(szMember, 0, MPT_STR, sizeof(szMember));
		OnClanMemberConnected(szMember);
	}
	break;
	case MC_MATCH_NOTIFY_CALLVOTE:
	{
		char szDiscuss[128] = "";
		char szArg[256] = "";

		pCommand->GetParameter(szDiscuss, 0, MPT_STR, sizeof(szDiscuss));
		pCommand->GetParameter(szArg, 1, MPT_STR, sizeof(szArg));
		OnNotifyCallVote(szDiscuss, szArg);
	}
	break;
	case MC_MATCH_NOTIFY_VOTERESULT:
	{
		char szDiscuss[128];
		int nResult = 0;

		pCommand->GetParameter(szDiscuss, 0, MPT_STR, sizeof(szDiscuss));
		pCommand->GetParameter(&nResult, 1, MPT_INT);
		OnNotifyVoteResult(szDiscuss, nResult);
	}
	break;
	case MC_MATCH_VOTE_RESPONSE:
	{
		int nMsgCode = 0;
		pCommand->GetParameter(&nMsgCode, 0, MPT_INT);
		OnVoteAbort(nMsgCode);
	}
	break;
	case MC_MATCH_BROADCAST_CLAN_RENEW_VICTORIES:
	{
		char szWinnerClanName[256], szLoserClanName[256];
		int nVictories;

		pCommand->GetParameter(szWinnerClanName, 0, MPT_STR, sizeof(szWinnerClanName));
		pCommand->GetParameter(szLoserClanName, 1, MPT_STR, sizeof(szLoserClanName));
		pCommand->GetParameter(&nVictories, 2, MPT_INT);
		OnBroadcastClanRenewVictories(szWinnerClanName, szLoserClanName, nVictories);
	}
	break;
	case MC_MATCH_BROADCAST_CLAN_INTERRUPT_VICTORIES:
	{
		char szWinnerClanName[256], szLoserClanName[256];
		int nVictories;

		pCommand->GetParameter(szWinnerClanName, 0, MPT_STR, sizeof(szWinnerClanName));
		pCommand->GetParameter(szLoserClanName, 1, MPT_STR, sizeof(szLoserClanName));
		pCommand->GetParameter(&nVictories, 2, MPT_INT);
		OnBroadcastClanInterruptVictories(szWinnerClanName, szLoserClanName, nVictories);
	}
	break;
	case MC_MATCH_BROADCAST_DUEL_RENEW_VICTORIES:
	{
		char szChannelName[256], szChampionName[256];
		int nVictories, nRoomNo;

		pCommand->GetParameter(szChampionName, 0, MPT_STR, sizeof(szChampionName));
		pCommand->GetParameter(szChannelName, 1, MPT_STR, sizeof(szChannelName));
		pCommand->GetParameter(&nRoomNo, 2, MPT_INT);
		pCommand->GetParameter(&nVictories, 3, MPT_INT);
		OnBroadcastDuelRenewVictories(szChampionName, szChannelName, nRoomNo, nVictories);
	}
	break;
	case MC_MATCH_BROADCAST_DUEL_INTERRUPT_VICTORIES:
	{
		char szChampionName[256], szInterrupterName[256];
		int nVictories;

		pCommand->GetParameter(szChampionName, 0, MPT_STR, sizeof(szChampionName));
		pCommand->GetParameter(szInterrupterName, 1, MPT_STR, sizeof(szInterrupterName));
		pCommand->GetParameter(&nVictories, 2, MPT_INT);
		OnBroadcastDuelInterruptVictories(szChampionName, szInterrupterName, nVictories);
	}
	break;
	case MC_MATCH_RESPONSE_STAGE_FOLLOW:
	{
		int nMsgID;
		pCommand->GetParameter(&nMsgID, 0, MPT_INT);
		OnFollowResponse(nMsgID);
	}
	break;
	case MC_MATCH_SCHEDULE_ANNOUNCE_SEND:
	{
		char cAnnounce[512] = { 0 };
		pCommand->GetParameter(cAnnounce, 0, MPT_STR, sizeof(cAnnounce));
		ZChatOutput(cAnnounce);
	}
	break;
	case MC_MATCH_EXPIRED_RENT_ITEM:
	{
		MCommandParameter* pParam = pCommand->GetParameter(0);
		if (pParam->GetType() != MPT_BLOB) break;
		void* pBlob = pParam->GetPointer();

		OnExpiredRentItem(pBlob);
	}
	break;
	case MC_MATCH_FIND_HACKING:
	{
	}
	break;
	case MC_MATCH_ROUTE_UPDATE_STAGE_EQUIP_LOOK:
	{
		MUID uidPlayer;
		int nParts;
		int nItemID;

		pCommand->GetParameter(&uidPlayer, 0, MPT_UID);
		pCommand->GetParameter(&nParts, 1, MPT_INT);
		pCommand->GetParameter(&nItemID, 2, MPT_INT);

		OnResponseUpdateStageEquipLook(uidPlayer, nParts, nItemID);
	}
	break;
	default:
		if (!ret)
		{
		}
		break;
	}

	if (m_fnOnCommandCallback) ret = m_fnOnCommandCallback(pCommand);

	return ret;
}
/***********************************************************************
  DrawPage : protected
  
  desc : 페이지를 그린다
  arg  : none
  ret  : none
************************************************************************/
void ZMonsterBookInterface::DrawPage( void)
{
	// 페이지 정보를 가져온다
	ZMonsterBookPageItr itr = m_mapMonsterBookPage.find( m_nCurrentPageNum);
	ZMonsterBookPageInfo* pPageInfo;
	if ( itr != m_mapMonsterBookPage.end())
		pPageInfo = (*itr).second;
	else
		pPageInfo = new ZMonsterBookPageInfo;


	// Get resource pointer
	ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();


	// 배경 이미지 로딩
	if ( m_pBookBgImg != NULL)
	{
		delete m_pBookBgImg;
		m_pBookBgImg = NULL;
	}

	m_pBookBgImg = new CCBitmapR2;
	if ( m_nCurrentPageNum == 0)
		((CCBitmapR2*)m_pBookBgImg)->Create( "monsterIllust.png", RGetDevice(), "interface/MonsterIllust/book_firstbg.jpg");
	else
		((CCBitmapR2*)m_pBookBgImg)->Create( "monsterIllust.png", RGetDevice(), "interface/MonsterIllust/book_bg.jpg");

	if ( m_pBookBgImg)
	{
		// 읽어온 비트맵 이미지 포인터를 해당 위젯에 넘겨줘서 표시한다
		CCPicture* pPicture = (CCPicture*)pResource->FindWidget( "MonsterBook_BookBG");
		if ( pPicture)
			pPicture->SetBitmap( m_pBookBgImg->GetSourceBitmap());
	}


	// 해당 몬스터의 일러스트 이미지를 업데이트 한다
	if ( m_pIllustImg)
	{
		delete m_pIllustImg;
		m_pIllustImg = NULL;
	}
	CCPicture* pPicture = (CCPicture*)pResource->FindWidget( "MonsterBook_MonsterIllust");
	if ( pPicture)
		pPicture->SetBitmap( NULL);


	m_pIllustImg = new CCBitmapR2;
	char szFileName[ 256];
	sprintf( szFileName, "interface/MonsterIllust/monster_Illust%02d.jpg", pPageInfo->m_nID);
	((CCBitmapR2*)m_pIllustImg)->Create( "monsterIllust.png", RGetDevice(), szFileName);
	if ( m_pIllustImg)
	{
		CCPicture* pPicture = (CCPicture*)pResource->FindWidget( "MonsterBook_MonsterIllust");
		if ( pPicture)
			pPicture->SetBitmap( m_pIllustImg->GetSourceBitmap());
	}


	// 해당 몬스터의 이름을 업데이트 한다
	CCLabel* pLabel = (CCLabel*)pResource->FindWidget( "MonsterBook_MonsterName");
	if (pLabel)
	{
		pLabel->SetText( m_nCurrentPageNum ? pPageInfo->m_strName.data() : "");
		pLabel->Show( true);
	}


	// 해당 몬스터의 등급을 업데이트 한다
	pLabel = (CCLabel*)pResource->FindWidget( "MonsterBook_MonsterGrade");
	if ( pLabel)
	{
		char szGrade[ 64] = { 0, };

		if ( m_nCurrentPageNum)
		{
			sprintf( szGrade, "%s : ", ZMsg(MSG_WORD_GRADE));

			switch ( pPageInfo->m_nGrade)
			{
				case NPC_GRADE_REGULAR :
					strcat( szGrade, ZMsg(MSG_WORD_REGULAR));
					break;

				case NPC_GRADE_LEGENDARY :
					strcat( szGrade, ZMsg(MSG_WORD_LEGENDARY));
					break;

				case NPC_GRADE_BOSS :
					strcat( szGrade, ZMsg(MSG_WORD_BOSS));
					break;

				case NPC_GRADE_ELITE :
					strcat( szGrade, ZMsg(MSG_WORD_ELITE));
					break;

				case NPC_GRADE_VETERAN :
					strcat( szGrade, ZMsg(MSG_WORD_VETERAN));
					break;
			}
		}

		pLabel->SetText( szGrade);
		pLabel->Show( true);
	}


	// 해당 몬스터의 설명을 업데이트 한다
	CCTextArea* pTextArea = (CCTextArea*)pResource->FindWidget( "MonsterBook_MonsterDesc");
	if ( pTextArea)
	{
		pTextArea->Clear();
		pTextArea->AddText( m_nCurrentPageNum ? pPageInfo->m_strDesc.data() : "", sColor( 0xFF321E00));
		pTextArea->Show();
	}


	// 해당 몬스터의 HP를 업데이트 한다
	pLabel = (CCLabel*)pResource->FindWidget( "MonsterBook_MonsterHP");
	if ( pLabel)
	{
		char szHP[ 128] = { 0, };

		if ( m_nCurrentPageNum)
		{
			strcpy( szHP, "HP : ");

			if ( pPageInfo->m_nHP > 200)
				strcat( szHP, ZMsg(MSG_WORD_VERYHARD));
			else if ( pPageInfo->m_nHP > 120)
				strcat( szHP, ZMsg(MSG_WORD_HARD));
			else if ( pPageInfo->m_nHP > 80)
				strcat( szHP, ZMsg(MSG_WORD_NORAML));
			else if ( pPageInfo->m_nHP > 30)
				strcat( szHP, ZMsg(MSG_WORD_WEAK));
			else
				strcat( szHP, ZMsg(MSG_WORD_VERYWEAK));
		}

		pLabel->SetText( szHP);
		pLabel->Show( true);
	}


	// 해당 몬스터의 특수기를 업데이트 한다
	pTextArea = (CCTextArea*)pResource->FindWidget( "MonsterBook_Attacks");
	if ( pTextArea)
	{
		pTextArea->Clear();

		for ( list<string>::iterator itrSkill = pPageInfo->m_Skill.begin();  itrSkill != pPageInfo->m_Skill.end();  itrSkill++)
			pTextArea->AddText( (*itrSkill).data(), sColor( 0xFF321E00));
	}


	// 드롭 아이템 업데이트
	list<ZDropItemInfo*>::iterator  itrDropItem = pPageInfo->m_DropItem.begin();
	for ( int i = 0;  i < 10;  i++)
	{
		char szWidgetName[ 50];
		sprintf( szWidgetName, "MonsterBook_DropItem%d", i);
		CCPicture* pPicture = (CCPicture*)pResource->FindWidget( szWidgetName);
		if ( pPicture)
		{
			if ( itrDropItem != pPageInfo->m_DropItem.end())
			{
				pPicture->AttachToolTip( (*itrDropItem)->m_strName.data());
				pPicture->SetBitmap( (*itrDropItem)->m_pIcon);
				pPicture->Show( true);

				itrDropItem++;
			}
			else
			{
				pPicture->Show( false);
			}
		}
	}


	// 페이지 번호를 업데이트 한다
	pLabel = (CCLabel*)pResource->FindWidget( "MonsterBook_PageNumber");
	if ( pLabel)
	{
		char szPageNum[ 20] = { 0, };

		if ( m_nCurrentPageNum)
			sprintf( szPageNum, "- %d -", m_nCurrentPageNum);

		pLabel->SetText( szPageNum);
	}


	// 달성률을 표시한다
	pLabel = (CCLabel*)ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "MonsterBook_Complete");
	if ( pLabel)
	{
		char szComplete[ 128] = { 0, };

		if ( m_nCurrentPageNum == 0)
			sprintf( szComplete, "%s : %.1f%%", ZMsg(MSG_WORD_RATE), m_fCompleteRate);

		pLabel->SetText( szComplete);
	}


	// 이전 페이지
	CCWidget* pWidget = pResource->FindWidget( "MonsterBook_PrevPageButton");
	if ( pWidget)
		pWidget->Show( (m_nCurrentPageNum > 0) ? true : false);


	// 다음 페이지
	pWidget = pResource->FindWidget( "MonsterBook_NextPageButton");
	if ( pWidget)
		pWidget->Show( (m_nCurrentPageNum < m_nTotalPageNum) ? true : false);


	// 메모리 삭제
	if ( itr == m_mapMonsterBookPage.end())
		delete pPageInfo;
}
void ShowProposalWaitFrame_OnExpire()
{
	ZChatOutput( ZMsg(MSG_CANCELED) );
}
void OnAskReplierAgreement_OnExpire()
{
	ZChatOutput( ZMsg(MSG_CANCELED) );
	ZGetGameClient()->ReplyAgreement(false);
}
Beispiel #19
0
void OnClanAskJoinAgreement_OnExpire()
{
	ZChatOutput( ZMsg(MSG_CANCELED), ZChat::CMT_SYSTEM);
	ZGetGameClient()->AnswerJoinerAgreement(false);
}
bool ZGameClient::OnCommand(CCCommand* pCommand)
{
	bool ret;
	ret = CCMatchClient::OnCommand(pCommand);

#ifdef _LOG_ENABLE_CLIENT_COMMAND_
	char buf[256];
	sprintf(buf,"[ID:%d]: %s\n", pCommand->GetID(), pCommand->GetDescription());
	OutputDebugString(buf);
#endif

	switch(pCommand->GetID()){
		case MC_NET_ONDISCONNECT:
			{

			}
			break;
		case MC_NET_ONERROR:
			{

			}
			break;
		case ZC_CHANGESKIN:
			{
				char szSkinName[256];
				pCommand->GetParameter(szSkinName, 0, MPT_STR, sizeof(szSkinName) );
				if(ZApplication::GetGameInterface()->ChangeInterfaceSkin(szSkinName))
				{
					CCClient::OutputMessage(CCZMOM_LOCALREPLY, "Change Skin To %s", szSkinName);
				}
				else
				{
					CCClient::OutputMessage(CCZMOM_LOCALREPLY, "Change Skin Failed");
				}
			}
			break;
		case MC_ADMIN_TERMINAL:
			{
				#ifndef _PUBLISH
					char szText[65535]; szText[0] = 0;
					CCUID uidChar;

					pCommand->GetParameter(&uidChar, 0, MPT_UID);
					pCommand->GetParameter(szText, 1, MPT_STR, sizeof(szText) );
					OutputToConsole(szText);
				#endif
			}
			break;
		case MC_NET_CHECKPING:
			{
				CCUID uid;
				if (pCommand->GetParameter(&uid, 0, MPT_UID)==false) break;
				CCCommand* pNew = new CCCommand(m_CommandManager.GetCommandDescByID(MC_NET_PING), uid, m_This);
				pNew->AddParameter(new CCCommandParameterUInt(timeGetTime()));
				Post(pNew);
				return true;
			}
		case MC_NET_PING:
			{
				unsigned int nTimeStamp;
				if (pCommand->GetParameter(&nTimeStamp, 0, MPT_UINT)==false) break;
				CCCommand* pNew = new CCCommand(m_CommandManager.GetCommandDescByID(MC_NET_PONG), pCommand->m_Sender, m_This);
				pNew->AddParameter(new CCCommandParameterUInt(nTimeStamp));
				Post(pNew);
				return true;
			}
		case MC_NET_PONG:
			{
				int nTimeStamp;
				pCommand->GetParameter(&nTimeStamp, 0, MPT_UINT);

				CCClient::OutputMessage(CCZMOM_LOCALREPLY, "Ping from (%u:%u) = %d", pCommand->GetSenderUID().High, pCommand->GetSenderUID().Low, timeGetTime()-nTimeStamp);
			}
			break;
		case MC_UDP_PONG:
			{
				unsigned int nIp, nTimeStamp;
				pCommand->GetParameter(&nIp, 0, MPT_UINT);
				pCommand->GetParameter(&nTimeStamp, 1, MPT_UINT);

				ZApplication::GetGameInterface()->SetAgentPing(nIp, nTimeStamp);
			}
			break;
		case MC_HSHIELD_PING:
			{
			/*	unsigned int nTimeStamp;

				if(pCommand->GetParameter(&nTimeStamp, 0, MPT_UINT) == false) break;
				
				CCCommandParameter* pParam = pCommand->GetParameter(1);
				if(pParam->GetType() != MPT_BLOB) 	break;
				void* pBlob = pParam->GetPointer();
				int nCount = CCGetBlobArrayCount(pBlob);

				unsigned char* pReqMsg = (unsigned char*)CCGetBlobArrayElement(pBlob, 0);
				
				DWORD dwRet = _AhnHS_MakeAckMsg(pReqMsg, ZGetMyInfo()->GetSystemInfo()->pbyAckMsg);

				if(dwRet != ERROR_SUCCESS)
					cclog("Making Ack Msg Failed. (Error code = %x)\n", dwRet);

				CCCommand* pNew = new CCCommand(m_CommandManager.GetCommandDescByID(MC_HSHIELD_PONG), pCommand->m_Sender, m_This);
				pNew->AddParameter(new CCCommandParameterUInt(nTimeStamp));
				void* pBlob2 = CCMakeBlobArray(sizeof(unsigned char), SIZEOF_ACKMSG);
				unsigned char* pCmdBlock = (unsigned char*)CCGetBlobArrayElement(pBlob2, 0);
				CopyMemory(pCmdBlock, ZGetMyInfo()->GetSystemInfo()->pbyAckMsg, SIZEOF_ACKMSG);

				pNew->AddParameter(new CCCmdParamBlob(pBlob2, CCGetBlobArraySize(pBlob2)));
//				CCEraseBlobArray(pBlob);
				CCEraseBlobArray(pBlob2);
				Post(pNew);
			*/
				return true;
			}
			break;
		case ZC_CON_CONNECT:
			{
				char szBuf[256];
				sprintf(szBuf, "Net.Connect %s:%d", ZGetConfiguration()->GetServerIP(), 
													ZGetConfiguration()->GetServerPort());
				ConsoleInputEvent(szBuf);
				SetServerAddr(ZGetConfiguration()->GetServerIP(), ZGetConfiguration()->GetServerPort());
			}
			break;
		case ZC_CON_DISCONNECT:
			{
				ConsoleInputEvent("Net.Disconnect");
			}
			break;
		case ZC_CON_CLEAR:
			{
				if (ZGetConsole()) ZGetConsole()->ClearMessage();
			}
			break;
		case ZC_CON_HIDE:
			{
				if (ZGetConsole()) ZGetConsole()->Show(false);
			}
			break;
		case ZC_CON_SIZE:
			{
				if (ZGetConsole())
				{
					int iConWidth, iConHeight;
					pCommand->GetParameter(&iConWidth, 0, MPT_INT);
					pCommand->GetParameter(&iConHeight, 1, MPT_INT);
					if ((iConWidth > 30) && (iConHeight > 30))
					{
						sPoint point = ZGetConsole()->GetPosition();
						ZGetConsole()->SetBounds(point.x, point.y, iConWidth, iConHeight);
					}
				}
			}
			break;
		case MC_CLOCK_SYNCHRONIZE:
			{
				unsigned long int nGlobalClock;
				pCommand->GetParameter(&nGlobalClock, 0, MPT_UINT);


				unsigned long int nLocalClock = GetClockCount();

				if (nGlobalClock > nLocalClock) m_bIsBigGlobalClock = true;
				else m_bIsBigGlobalClock = false;
				m_nClockDistance = ZGetClockDistance(nGlobalClock, nLocalClock);
			}
			break;
#ifdef _DEBUG
		case ZC_TEST_SETCLIENT1:
			{
				char szBuf[256];
				sprintf(szBuf, "peer.setport 10000");
				ConsoleInputEvent(szBuf);
				sprintf(szBuf, "peer.addpeer 127.0.0.1 10001");
				ConsoleInputEvent(szBuf);

				CCClient::OutputMessage(CCZMOM_LOCALREPLY, "Done SetClient1");
			}
			break;
		case ZC_TEST_SETCLIENT2:
			{
				char szBuf[256];
				sprintf(szBuf, "peer.setport 10001");
				ConsoleInputEvent(szBuf);
				sprintf(szBuf, "peer.addpeer 127.0.0.1 10000");
				ConsoleInputEvent(szBuf);

				CCClient::OutputMessage(CCZMOM_LOCALREPLY, "Done SetClient2");
			}
			break;
		case ZC_TEST_SETCLIENTALL:
			{
				char szMyIP[256];
				pCommand->GetParameter(szMyIP, 0, MPT_STR, sizeof(szMyIP) );

				
				char szBuf[256];
				char szIPs[][256] = { "192.168.0.100", "192.168.0.111", "192.168.0.10", 
					                  "192.168.0.11", "192.168.0.16", "192.168.0.20",
				                      "192.168.0.25", "192.168.0.30", "192.168.0.32",
										"192.168.0.200", "192.168.0.15", "192.168.0.17"};
				sprintf(szBuf, "peer.setport 10000");
				ConsoleInputEvent(szBuf);

				for (int i = 0; i < 12; i++)
				{
					if (!strcmp(szMyIP, szIPs[i])) continue;
					sprintf(szBuf, "peer.addpeer %s 10000", szIPs[i]);
					ConsoleInputEvent(szBuf);
				}

				CCClient::OutputMessage(CCZMOM_LOCALREPLY, "Done SetClient All");
			}
			break;
#endif
#ifndef _PUBLISH
		case ZC_TEST_BIRD1:
			{
				OnBirdTest();
			}
			break;
#endif
		case MC_MATCH_NOTIFY:
			{
				unsigned int nMsgID = 0;
				if (pCommand->GetParameter(&nMsgID, 0, MPT_UINT) == false) break;

				OnMatchNotify(nMsgID);
			}
			break;
		case MC_MATCH_BRIDGEPEER_ACK:
			{
				CCUID uidChar;
				int nCode;
				pCommand->GetParameter(&uidChar, 0, MPT_UID);
				pCommand->GetParameter(&nCode, 1, MPT_INT);
				OnBridgePeerACK(uidChar, nCode);
			}
			break;
		case MC_MATCH_STAGE_RESPONSE_FORCED_ENTRY:			// 난입
			{
				int nResult;
				pCommand->GetParameter(&nResult, 0, MPT_INT);
				if (nResult == MOK)
				{
					OnForcedEntryToGame();
				}
				else
				{
					ZApplication::GetGameInterface()->ShowMessage("난입할 수 없습니다.");
				}
			}
			break;
		case MC_MATCH_STAGE_JOIN:
			{
				CCUID uidChar, uidStage;
				unsigned int nRoomNo=0;
				char szStageName[256]="";

				pCommand->GetParameter(&uidChar, 0, MPT_UID);
				pCommand->GetParameter(&uidStage, 1, MPT_UID);
				pCommand->GetParameter(&nRoomNo, 2, MPT_UINT);
				pCommand->GetParameter(szStageName, 3, MPT_STR, sizeof(szStageName) );

				OnStageJoin(uidChar, uidStage, nRoomNo, szStageName);
			}
			break;
		case MC_MATCH_STAGE_LEAVE:
			{
				CCUID uidChar, uidStage;

				pCommand->GetParameter(&uidChar, 0, MPT_UID);
				pCommand->GetParameter(&uidStage, 1, MPT_UID);

				OnStageLeave(uidChar, uidStage);
			}
			break;
		case MC_MATCH_STAGE_START:
			{
				CCUID uidChar, uidStage;
				int nCountdown;

				pCommand->GetParameter(&uidChar, 0, MPT_UID);
				pCommand->GetParameter(&uidStage, 1, MPT_UID);
				pCommand->GetParameter(&nCountdown, 2, MPT_INT);

				OnStageStart(uidChar, uidStage, nCountdown);
			}
			break;

		case MC_MATCH_STAGE_LAUNCH:
			{
				CCUID uidStage;
				char szMapName[_MAX_DIR];

				pCommand->GetParameter(&uidStage, 0, MPT_UID);
				pCommand->GetParameter(szMapName, 1, MPT_STR, sizeof(szMapName) );
				OnStageLaunch(uidStage, szMapName);
			}
			break;

		case MC_MATCH_STAGE_RELAY_LAUNCH :
			{
				CCUID uidStage;
				bool bIsIgnore;
				char szMapName[_MAX_DIR];

				pCommand->GetParameter(&uidStage,	0, MPT_UID);
				pCommand->GetParameter(szMapName,	1, MPT_STR, sizeof(szMapName) );
				pCommand->GetParameter(&bIsIgnore,	2, MPT_BOOL);

				if( !bIsIgnore ) OnStageLaunch(uidStage, szMapName);
				else {
					m_bForcedEntry = true;
					ZApplication::GetGameInterface()->SerializeStageInterface();
				}				
			}
			break;

		case MC_MATCH_STAGE_FINISH_GAME:
			{
				bool bIsRelayMapUnFinish;
				CCUID uidStage;
				pCommand->GetParameter(&uidStage, 0, MPT_UID);
				pCommand->GetParameter(&bIsRelayMapUnFinish, 1, MPT_BOOL);
				
				OnStageFinishGame(uidStage, bIsRelayMapUnFinish);
			}
			break;

		case MC_MATCH_STAGE_MAP:
			{
				CCUID uidStage;
				char szMapName[_MAX_DIR];

				pCommand->GetParameter(&uidStage, 0, MPT_UID);
				pCommand->GetParameter(szMapName, 1, MPT_STR, sizeof(szMapName) );

				OnStageMap(uidStage, szMapName);
			}
			break;

		case MC_MATCH_STAGE_RELAY_MAP_INFO_UPDATE:
			{
				CCUID uidStage;
				int nRelayMapType = 0;
				int nRelayMapRepeatCount = 0;
				pCommand->GetParameter(&uidStage, 0, MPT_UID);
				pCommand->GetParameter(&nRelayMapType, 1, MPT_INT );
				pCommand->GetParameter(&nRelayMapRepeatCount, 2, MPT_INT );
				CCCommandParameter* pParam = pCommand->GetParameter(3);
				if (pParam->GetType() != MPT_BLOB)	break;
				void* pRelayMapListBlob = pParam->GetPointer();
				if( NULL == pRelayMapListBlob )	break;

				OnStageRelayMapListUpdate(nRelayMapType, nRelayMapRepeatCount, pRelayMapListBlob);
			}
			break;

		case MC_MATCH_STAGE_RELAY_MAP_ELEMENT_UPDATE:
			{
				CCUID uidStage;
				int nRelayMapType = 0;
				int nRelayMapRepeatCount = 0;

				pCommand->GetParameter(&uidStage, 0, MPT_UID );
				pCommand->GetParameter(&nRelayMapType, 1, MPT_INT );
				pCommand->GetParameter(&nRelayMapRepeatCount, 2, MPT_INT );

				OnStageRelayMapElementUpdate(nRelayMapType, nRelayMapRepeatCount);
			}
			break;

		case MC_MATCH_STAGE_TEAM:
			{
				CCUID uidChar, uidStage;
				unsigned int nTeam;
				pCommand->GetParameter(&uidChar, 0, MPT_UID);
				pCommand->GetParameter(&uidStage, 1, MPT_UID);
				pCommand->GetParameter(&nTeam, 2, MPT_UINT);
				OnStageTeam(uidChar, uidStage, nTeam);
			}
			break;

		case MC_MATCH_STAGE_PLAYER_STATE:
			{
				CCUID uidChar, uidStage;
				int nObjectStageState;
				pCommand->GetParameter(&uidChar, 0, MPT_UID);
				pCommand->GetParameter(&uidStage, 1, MPT_UID);
				pCommand->GetParameter(&nObjectStageState, 2, MPT_INT);
				OnStagePlayerState(uidChar, uidStage, CCMatchObjectStageState(nObjectStageState));
			}
			break;
		case MC_MATCH_STAGE_MASTER:
			{
				CCUID uidChar, uidStage;
				pCommand->GetParameter(&uidStage, 0, MPT_UID);
				pCommand->GetParameter(&uidChar, 1, MPT_UID);

				OnStageMaster(uidStage, uidChar);
			}
			break;
		case MC_MATCH_STAGE_CHAT:
			{
				CCUID uidStage, uidChar;
				static char szChat[512];
				pCommand->GetParameter(&uidChar, 0, MPT_UID);
				pCommand->GetParameter(&uidStage, 1, MPT_UID);
				pCommand->GetParameter(szChat, 2, MPT_STR, sizeof(szChat) );
				//check Chatting Message..jintriple3 줄 바꿈 문자 필터링
				CheckMsgAboutChat(szChat);
				OnStageChat(uidChar, uidStage, szChat);
			}
			break;
		case MC_MATCH_STAGE_LIST:
			{
				char nPrevStageCount, nNextStageCount;
				pCommand->GetParameter(&nPrevStageCount, 0, MPT_CHAR);
				pCommand->GetParameter(&nNextStageCount, 1, MPT_CHAR);

				CCCommandParameter* pParam = pCommand->GetParameter(2);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pBlob = pParam->GetPointer();
				int nCount = CCGetBlobArrayCount(pBlob);

				OnStageList((int)nPrevStageCount, (int)nNextStageCount, pBlob, nCount);
			}
			break;
		case MC_MATCH_CHANNEL_RESPONSE_PLAYER_LIST:
			{
				unsigned char nTotalPlayerCount, nPage;

				pCommand->GetParameter(&nTotalPlayerCount,	0, MPT_UCHAR);
				pCommand->GetParameter(&nPage,				1, MPT_UCHAR);

				CCCommandParameter* pParam = pCommand->GetParameter(2);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pBlob = pParam->GetPointer();
				int nCount = CCGetBlobArrayCount(pBlob);

				OnChannelPlayerList((int)nTotalPlayerCount, (int)nPage, pBlob, nCount);

			}
			break;
		case MC_MATCH_CHANNEL_RESPONSE_ALL_PLAYER_LIST:
			{
				CCUID uidChannel;

				pCommand->GetParameter(&uidChannel, 0, MPT_UID);

				CCCommandParameter* pParam = pCommand->GetParameter(1);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pBlob = pParam->GetPointer();
				int nCount = CCGetBlobArrayCount(pBlob);

				OnChannelAllPlayerList(uidChannel, pBlob, nCount);
			}
			break;
		case MC_MATCH_RESPONSE_FRIENDLIST:
			{
				CCCommandParameter* pParam = pCommand->GetParameter(0);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pBlob = pParam->GetPointer();
				int nCount = CCGetBlobArrayCount(pBlob);

				OnResponseFriendList(pBlob, nCount);
			}
			break;
		case MC_MATCH_RESPONSE_STAGESETTING:
			{
				CCUID uidStage;
				pCommand->GetParameter(&uidStage, 0, MPT_UID);

				CCCommandParameter* pStageParam = pCommand->GetParameter(1);
				if(pStageParam->GetType()!=MPT_BLOB) break;
				void* pStageBlob = pStageParam->GetPointer();
				int nStageCount = CCGetBlobArrayCount(pStageBlob);

				CCCommandParameter* pCharParam = pCommand->GetParameter(2);
				if(pCharParam->GetType()!=MPT_BLOB) break;
				void* pCharBlob = pCharParam->GetPointer();
				int nCharCount = CCGetBlobArrayCount(pCharBlob);

				int nStageState;
				pCommand->GetParameter(&nStageState, 3, MPT_INT);

				CCUID uidMaster;
				pCommand->GetParameter(&uidMaster, 4, MPT_UID);

				OnResponseStageSetting(uidStage, pStageBlob, nStageCount, pCharBlob, nCharCount, STAGE_STATE(nStageState), uidMaster);

				ChangeQuestStage();
			}
			break;
		case MC_MATCH_RESPONSE_PEER_RELAY:
			{
				CCUID uidPeer;
				if (pCommand->GetParameter(&uidPeer, 0, MPT_UID) == false) break;

				OnResponsePeerRelay(uidPeer);			
			}
			break;
		case MC_MATCH_LOADING_COMPLETE:
			{
				CCUID uidChar;
				int nPercent;

				if (pCommand->GetParameter(&uidChar, 0, MPT_UID) == false) break;
				if (pCommand->GetParameter(&nPercent, 1, MPT_INT) == false) break;

				OnLoadingComplete(uidChar, nPercent);
			}
			break;
		case MC_MATCH_ANNOUNCE:
			{
				unsigned int nType;
				char szMsg[256];
				pCommand->GetParameter(&nType, 0, MPT_UINT);
				pCommand->GetParameter(szMsg, 1, MPT_STR, sizeof(szMsg) );
				OnAnnounce(nType, szMsg);
			}
			break;
		case MC_MATCH_CHANNEL_RESPONSE_JOIN:
			{
				CCUID uidChannel;
				int nChannelType;
				char szChannelName[256];
				bool bEnableInterface;

				pCommand->GetParameter(&uidChannel,			0, MPT_UID);
				pCommand->GetParameter(&nChannelType,		1, MPT_INT);
				pCommand->GetParameter(szChannelName,		2, MPT_STR, sizeof(szChannelName) );
				pCommand->GetParameter(&bEnableInterface,	3, MPT_BOOL);

				const char* szChannelNameTranslated = ZGetStringResManager()->GetStringFromXml(szChannelName);

				OnChannelResponseJoin(uidChannel, (CCCHANNEL_TYPE)nChannelType, szChannelNameTranslated, bEnableInterface);
			}
			break;
		case MC_MATCH_CHANNEL_CHAT:
			{
				CCUID uidChannel, uidChar;
				char szChat[512];
				char szName[256];
				int nGrade;

				pCommand->GetParameter(&uidChannel, 0, MPT_UID);
				pCommand->GetParameter(szName, 1, MPT_STR, sizeof(szName) );
				pCommand->GetParameter(szChat, 2, MPT_STR, sizeof(szChat) );
				pCommand->GetParameter(&nGrade,3, MPT_INT);

				//jintriple3 줄 바꿈 문자 필터링
				//check chatting Message
				CheckMsgAboutChat(szChat);

				OnChannelChat(uidChannel, szName, szChat, nGrade);
			}
			break;
		case MC_MATCH_CHANNEL_LIST:
			{
				CCCommandParameter* pParam = pCommand->GetParameter(0);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pBlob = pParam->GetPointer();
				int nCount = CCGetBlobArrayCount(pBlob);
				OnChannelList(pBlob, nCount);
			}
			break;
		case MC_MATCH_CHANNEL_RESPONSE_RULE:
			{
				CCUID uidChannel;
				pCommand->GetParameter(&uidChannel, 0, MPT_UID);
				char szRuleName[128];
				pCommand->GetParameter(szRuleName, 1, MPT_STR, sizeof(szRuleName) );

				OnChannelResponseRule(uidChannel, szRuleName);
			}
			break;
		case MC_MATCH_RESPONSE_RECOMMANDED_CHANNEL:
			{
				CCUID uidChannel;
				pCommand->GetParameter(&uidChannel, 0, MPT_UID);

				OnResponseRecommandedChannel(uidChannel);
			}
			break;
		case MC_ADMIN_ANNOUNCE:
			{
				char szChat[512];
				unsigned long int nMsgType = 0;

				pCommand->GetParameter(szChat, 1, MPT_STR, sizeof(szChat) );
				pCommand->GetParameter(&nMsgType, 2, MPT_UINT);

				OnAdminAnnounce(ZGetStringResManager()->GetStringFromXml(szChat), ZAdminAnnounceType(nMsgType));
			}
			break;
		case MC_MATCH_GAME_LEVEL_UP:
			{
				CCUID uidChar;
				pCommand->GetParameter(&uidChar, 0, MPT_UID);

				OnGameLevelUp(uidChar);
			}
			break;
		case MC_MATCH_GAME_LEVEL_DOWN:
			{
				CCUID uidChar;
				pCommand->GetParameter(&uidChar, 0, MPT_UID);

				OnGameLevelDown(uidChar);
			}
			break;
		case MC_MATCH_RESPONSE_GAME_INFO:
			{
				CCUID uidStage;
				pCommand->GetParameter(&uidStage, 0, MPT_UID);

				CCCommandParameter* pParam = pCommand->GetParameter(1);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pGameInfoBlob = pParam->GetPointer();

				pParam = pCommand->GetParameter(2);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pRuleInfoBlob = pParam->GetPointer();

				pParam = pCommand->GetParameter(3);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pPlayerInfoBlob = pParam->GetPointer();

				OnResponseGameInfo(uidStage, pGameInfoBlob, pRuleInfoBlob, pPlayerInfoBlob);
			}
			break;
		case MC_MATCH_OBTAIN_WORLDITEM:
			{
				CCUID uidPlayer;
				int nIteCCUID;

				pCommand->GetParameter(&uidPlayer, 0, MPT_UID);
				pCommand->GetParameter(&nIteCCUID, 1, MPT_INT);

				OnObtainWorldItem(uidPlayer, nIteCCUID);
			}
			break;
		case MC_MATCH_SPAWN_WORLDITEM:
			{
				CCCommandParameter* pParam = pCommand->GetParameter(0);
				if (pParam->GetType()!=MPT_BLOB) break;

				void* pSpawnInfoBlob = pParam->GetPointer();

				OnSpawnWorldItem(pSpawnInfoBlob);
			}
			break;
		case MC_MATCH_REMOVE_WORLDITEM:
			{
				int nIteCCUID;

				pCommand->GetParameter(&nIteCCUID, 0, MPT_INT);

				OnRemoveWorldItem(nIteCCUID);
			}
			break;

		case MC_MATCH_USER_WHISPER:
			{
				char szSenderName[128]="";
				char szTargetName[128]="";
				char szMessage[1024]="";
				
				pCommand->GetParameter(szSenderName, 0, MPT_STR, sizeof(szSenderName) );
				pCommand->GetParameter(szTargetName, 1, MPT_STR, sizeof(szTargetName) );
				pCommand->GetParameter(szMessage, 2, MPT_STR, sizeof(szMessage) );

				//jintriple3 줄 바꿈 문자 필터링
				//check chatting Message
				CheckMsgAboutChat(szMessage);

				OnUserWhisper(szSenderName, szTargetName, szMessage);
			}
			break;
		case MC_MATCH_CHATROOM_JOIN:
			{
				char szPlayerName[128]="";
				char szChatRoomName[128]="";

				pCommand->GetParameter(szPlayerName, 0, MPT_STR, sizeof(szPlayerName) );
				pCommand->GetParameter(szChatRoomName, 1, MPT_STR, sizeof(szChatRoomName) );

				OnChatRoomJoin(szPlayerName, szChatRoomName);
			}
			break;
		case MC_MATCH_CHATROOM_LEAVE:
			{
				char szPlayerName[128]="";
				char szChatRoomName[128]="";

				pCommand->GetParameter(szPlayerName, 0, MPT_STR, sizeof(szPlayerName) );
				pCommand->GetParameter(szChatRoomName, 1, MPT_STR, sizeof(szChatRoomName) );

				OnChatRoomLeave(szPlayerName, szChatRoomName);
			}
			break;
		case MC_MATCH_CHATROOM_SELECT_WRITE:
			{
				char szChatRoomName[128]="";
				pCommand->GetParameter(szChatRoomName, 0, MPT_STR, sizeof(szChatRoomName) );

				OnChatRoomSelectWrite(szChatRoomName);
			}
			break;
		case MC_MATCH_CHATROOM_INVITE:
			{
				char szSenderName[64]="";
				char szTargetName[64]="";
				char szRoomName[128]="";

				pCommand->GetParameter(szSenderName, 0, MPT_STR, sizeof(szSenderName) );
				pCommand->GetParameter(szTargetName, 1, MPT_STR, sizeof(szTargetName) );
				pCommand->GetParameter(szRoomName, 2, MPT_STR, sizeof(szRoomName) );

				OnChatRoomInvite(szSenderName, szRoomName);
			}
			break;
		case MC_MATCH_CHATROOM_CHAT:
			{
				char szChatRoomName[128]="";
				char szPlayerName[128]="";
				char szChat[128]="";

				pCommand->GetParameter(szChatRoomName, 0, MPT_STR, sizeof(szChatRoomName) );
				pCommand->GetParameter(szPlayerName, 1, MPT_STR, sizeof(szPlayerName) );
				pCommand->GetParameter(szChat, 2, MPT_STR, sizeof(szChat) );

				//jintriple3 줄 바꿈 문자 필터링
				//check chatting Message
				CheckMsgAboutChat(szChat);

				OnChatRoomChat(szChatRoomName, szPlayerName, szChat);
			}
			break;
		case ZC_REPORT_119:
			{
				OnLocalReport119();
			}
			break;
		case ZC_MESSAGE:
			{
				int iMessageID;
				pCommand->GetParameter(&iMessageID, 0, MPT_INT);
				ZGetGameInterface()->ShowMessage(iMessageID);
			}break;
		case MC_TEST_PEERTEST_PING:
			{
				CCUID uidSender = pCommand->GetSenderUID();
				char szLog[128];
				sprintf(szLog, "PEERTEST_PING: from (%d%d)", uidSender.High, uidSender.Low);
				ZChatOutput(szLog, ZChat::CMT_SYSTEM);
			}
			break;
		case MC_TEST_PEERTEST_PONG:
			{
			}
			break;

		// 클랜관련
		case MC_MATCH_CLAN_RESPONSE_CREATE_CLAN:
			{
				int nResult, nRequestID;
				pCommand->GetParameter(&nResult, 0, MPT_INT);
				pCommand->GetParameter(&nRequestID, 1, MPT_INT);

				OnResponseCreateClan(nResult, nRequestID);

			}
			break;
		case MC_MATCH_CLAN_RESPONSE_AGREED_CREATE_CLAN:
			{
				int nResult;
				pCommand->GetParameter(&nResult, 0, MPT_INT);

				OnResponseAgreedCreateClan(nResult);
			}
			break;
		case MC_MATCH_CLAN_ASK_SPONSOR_AGREEMENT:
			{
				int nRequestID;
				char szClanName[256];
				CCUID uidMasterObject;
				char szMasterName[256];


				pCommand->GetParameter(&nRequestID,			 0, MPT_INT);
				pCommand->GetParameter(szClanName,			1, MPT_STR, sizeof(szClanName) );
				pCommand->GetParameter(&uidMasterObject,	2, MPT_UID);
				pCommand->GetParameter(szMasterName,		3, MPT_STR, sizeof(szMasterName) );

				OnClanAskSponsorAgreement(nRequestID, szClanName, uidMasterObject, szMasterName);
			}
			break;
		case MC_MATCH_CLAN_ANSWER_SPONSOR_AGREEMENT:
			{
				CCUID uidClanMaster;
				int nRequestID;
				bool bAnswer;
				char szCharName[256];

				pCommand->GetParameter(&nRequestID,		0, MPT_INT);
				pCommand->GetParameter(&uidClanMaster,	1, MPT_UID);
				pCommand->GetParameter(szCharName,		2, MPT_STR, sizeof(szCharName) );
				pCommand->GetParameter(&bAnswer,		3, MPT_BOOL);

				OnClanAnswerSponsorAgreement(nRequestID, uidClanMaster, szCharName, bAnswer);
			}
			break;
		case MC_MATCH_CLAN_RESPONSE_CLOSE_CLAN:
			{
				int nResult;
				pCommand->GetParameter(&nResult, 0, MPT_INT);

				OnClanResponseCloseClan(nResult);
			}
			break;
		case MC_MATCH_CLAN_RESPONSE_JOIN_CLAN:
			{
				int nResult;
				pCommand->GetParameter(&nResult, 0, MPT_INT);
				OnClanResponseJoinClan(nResult);
			}
			break;
		case MC_MATCH_CLAN_ASK_JOIN_AGREEMENT:
			{
				char szClanName[256], szClanAdmin[256];
				CCUID uidClanAdmin;

				pCommand->GetParameter(szClanName,		0, MPT_STR, sizeof(szClanName) );
				pCommand->GetParameter(&uidClanAdmin,	1, MPT_UID);
				pCommand->GetParameter(szClanAdmin,		2, MPT_STR, sizeof(szClanAdmin) );

				OnClanAskJoinAgreement(szClanName, uidClanAdmin, szClanAdmin);
			}
			break;
		case MC_MATCH_CLAN_ANSWER_JOIN_AGREEMENT:
			{
				CCUID uidClanAdmin;
				bool bAnswer;
				char szJoiner[256];

				pCommand->GetParameter(&uidClanAdmin,	0, MPT_UID);
				pCommand->GetParameter(szJoiner,		1, MPT_STR, sizeof(szJoiner) );
				pCommand->GetParameter(&bAnswer,		2, MPT_BOOL);

				OnClanAnswerJoinAgreement(uidClanAdmin, szJoiner, bAnswer);
			}
			break;
		case MC_MATCH_CLAN_RESPONSE_AGREED_JOIN_CLAN:
			{
				int nResult;
				pCommand->GetParameter(&nResult, 0, MPT_INT);
				OnClanResponseAgreedJoinClan(nResult);
			}
			break;
		case MC_MATCH_CLAN_UPDATE_CHAR_CLANINFO:
			{
				CCCommandParameter* pParam = pCommand->GetParameter(0);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pBlob = pParam->GetPointer();

				OnClanUpdateCharClanInfo(pBlob);
			}
			break;
		case MC_MATCH_CLAN_RESPONSE_LEAVE_CLAN:
			{
				int nResult;
				pCommand->GetParameter(&nResult, 0, MPT_INT);
				OnClanResponseLeaveClan(nResult);
			}
			break;
		case MC_MATCH_CLAN_MASTER_RESPONSE_CHANGE_GRADE:
			{
				int nResult;
				pCommand->GetParameter(&nResult, 0, MPT_INT);
				OnClanResponseChangeGrade(nResult);
			}
			break;
		case MC_MATCH_CLAN_ADMIN_RESPONSE_EXPEL_MEMBER:
			{
				int nResult;
				pCommand->GetParameter(&nResult, 0, MPT_INT);
				OnClanResponseExpelMember(nResult);
			}
			break;
		case MC_MATCH_CLAN_MSG:
			{
				char szSenderName[256];
				char szMsg[512];

				pCommand->GetParameter(szSenderName,	0, MPT_STR, sizeof(szSenderName) );
				pCommand->GetParameter(szMsg,			1, MPT_STR, sizeof( szMsg) );

				//jintriple3 줄 바꿈 문자 필터링
				//check chatting Message
				CheckMsgAboutChat(szMsg);

				OnClanMsg(szSenderName, szMsg);
			}
			break;
		case MC_MATCH_CLAN_RESPONSE_MEMBER_LIST:
			{
				CCCommandParameter* pParam = pCommand->GetParameter(0);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pBlob = pParam->GetPointer();

				OnClanMemberList(pBlob);

			}
			break;
		case MC_MATCH_CLAN_RESPONSE_CLAN_INFO:
			{
				CCCommandParameter* pParam = pCommand->GetParameter(0);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pBlob = pParam->GetPointer();

				OnClanResponseClanInfo(pBlob);
			}
			break;
		case MC_MATCH_CLAN_RESPONSE_EMBLEMURL:
			{
				int nCLID=0;
				int nEmblemChecksum=0;
				char szURL[4096]="";

				pCommand->GetParameter(&nCLID, 0, MPT_INT);
				pCommand->GetParameter(&nEmblemChecksum, 1, MPT_INT);
				pCommand->GetParameter(szURL, 2, MPT_STR, sizeof(szURL) );
				
				OnClanResponseEmblemURL(nCLID, nEmblemChecksum, szURL);
			}
			break;
		case MC_MATCH_CLAN_LOCAL_EMBLEMREADY:
			{
				int nCLID=0;
				char szURL[4096]="";

				pCommand->GetParameter(&nCLID, 0, MPT_INT);
				pCommand->GetParameter(szURL, 1, MPT_STR, sizeof(szURL) );
				
				OnClanEmblemReady(nCLID, szURL);
			}
			break;
		case MC_MATCH_RESPONSE_RESULT:
			{
				int nResult;
				pCommand->GetParameter(&nResult, 0, MPT_INT);
				if (nResult != MOK)
				{
					ZApplication::GetGameInterface()->ShowErrorMessage( nResult );
				}
			}
			break;
		case MC_MATCH_RESPONSE_CHARINFO_DETAIL:
			{
				CCCommandParameter* pParam = pCommand->GetParameter(0);
				if (pParam->GetType()!=MPT_BLOB) break;
				void* pBlob = pParam->GetPointer();

				OnResponseCharInfoDetail(pBlob);
			}
			break;
		case MC_MATCH_RESPONSE_PROPOSAL:
			{
				int nResult, nProposalMode, nRequestID;

				pCommand->GetParameter(&nResult,		0, MPT_INT);
				pCommand->GetParameter(&nProposalMode,	1, MPT_INT);
				pCommand->GetParameter(&nRequestID,		2, MPT_INT);

				OnResponseProposal(nResult, CCMatchProposalMode(nProposalMode), nRequestID);
			}
			break;
		case MC_MATCH_ASK_AGREEMENT:
			{
				CCUID uidProposer;
//				char szProposerCharName[256];
				int nProposalMode, nRequestID;
				
				

				pCommand->GetParameter(&uidProposer,		0, MPT_UID);
//				pCommand->GetParameter(szProposerCharName,	1, MPT_STR);

				CCCommandParameter* pParam = pCommand->GetParameter(1);
				void* pMemberNamesBlob = pParam->GetPointer();

				pCommand->GetParameter(&nProposalMode,		2, MPT_INT);
				pCommand->GetParameter(&nRequestID,			3, MPT_INT);

				OnAskAgreement(uidProposer, pMemberNamesBlob, CCMatchProposalMode(nProposalMode), nRequestID);
			}
			break;
		case MC_MATCH_REPLY_AGREEMENT:
			{
				CCUID uidProposer, uidChar;
				char szReplierName[256];
				int nProposalMode, nRequestID;
				bool bAgreement;

				pCommand->GetParameter(&uidProposer,		0, MPT_UID);
				pCommand->GetParameter(&uidChar,			1, MPT_UID);
				pCommand->GetParameter(szReplierName,		2, MPT_STR, sizeof(szReplierName) );
				pCommand->GetParameter(&nProposalMode,		3, MPT_INT);
				pCommand->GetParameter(&nRequestID,			4, MPT_INT);
				pCommand->GetParameter(&bAgreement,			5, MPT_BOOL);

				OnReplyAgreement(uidProposer, uidChar, szReplierName, CCMatchProposalMode(nProposalMode),
					             nRequestID, bAgreement);

			}

			break;

		// 레더 커맨드
		case MC_MATCH_LADDER_SEARCH_RIVAL:	// 검색 시작
			{
				ZGetGameInterface()->OnArrangedTeamGameUI(true);
			}break;
		case MC_MATCH_LADDER_CANCEL_CHALLENGE:
			{
				ZGetGameInterface()->OnArrangedTeamGameUI(false);
				
				char szCharName[MATCHOBJECT_NAME_LENGTH];
				pCommand->GetParameter(szCharName, 0, MPT_STR, sizeof(szCharName) );
				
				if(szCharName[0]!=0) {
					char szOutput[256];
					ZTransMsg(szOutput,MSG_LADDER_CANCEL,1,szCharName);
					ZChatOutput(sColor(ZCOLOR_CHAT_SYSTEM), szOutput);

				}else	 // 이름이 없으면 실패한경우다.
				{
					ZChatOutput(sColor(ZCOLOR_CHAT_SYSTEM), 
						ZMsg(MSG_LADDER_FAILED) );
				}
			}break;
		case MC_MATCH_LADDER_RESPONSE_CHALLENGE:
			{
				int nResult;
				pCommand->GetParameter(&nResult, 0, MPT_INT);
				OnLadderResponseChallenge(nResult);
			}
			break;
		case MC_MATCH_LADDER_PREPARE:
			{
				CCUID uidStage;
				pCommand->GetParameter(&uidStage, 0, MPT_UID);
				int nTeam;
				pCommand->GetParameter(&nTeam, 1, MPT_INT);

				OnLadderPrepare(uidStage, nTeam);
			}break;
		case MC_MATCH_LADDER_LAUNCH:		// 게임 시작
			{
				CCUID uidStage;
				pCommand->GetParameter(&uidStage, 0, MPT_UID);
				char szMapName[128];
				pCommand->GetParameter(szMapName, 1, MPT_STR, sizeof(szMapName) );

				OnLadderLaunch(uidStage, szMapName);
			}break;
		case MC_MATCH_CLAN_STANDBY_CLAN_LIST:
			{
				int nPrevStageCount, nNextStageCount;
				pCommand->GetParameter(&nPrevStageCount, 0, MPT_INT);
				pCommand->GetParameter(&nNextStageCount, 1, MPT_INT);

				CCCommandParameter* pParam = pCommand->GetParameter(2);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pBlob = pParam->GetPointer();

				OnClanStandbyClanList(nPrevStageCount, nNextStageCount, pBlob);
			}
			break;
		case MC_MATCH_CLAN_MEMBER_CONNECTED:
			{
				char szMember[256];

				pCommand->GetParameter(szMember, 0, MPT_STR, sizeof(szMember) );
				OnClanMemberConnected(szMember);
			}
			break;
		case MC_MATCH_NOTIFY_CALLVOTE:
			{
				char szDiscuss[128] = "";
				char szArg[256] = "";

				pCommand->GetParameter(szDiscuss, 0, MPT_STR, sizeof(szDiscuss) );
				pCommand->GetParameter(szArg, 1, MPT_STR, sizeof(szArg) );
				OnNotifyCallVote(szDiscuss, szArg);
			}
			break;
		case MC_MATCH_NOTIFY_VOTERESULT:
			{
				char szDiscuss[128];
				int nResult = 0;

				pCommand->GetParameter(szDiscuss, 0, MPT_STR, sizeof(szDiscuss) );
				pCommand->GetParameter(&nResult, 1, MPT_INT);
				OnNotifyVoteResult(szDiscuss, nResult);
			}
			break;
		case MC_MATCH_VOTE_RESPONSE:
			{
				int nMsgCode = 0;
				pCommand->GetParameter( &nMsgCode, 0, MPT_INT );
				OnVoteAbort( nMsgCode );
			}
			break;
		case MC_MATCH_BROADCAST_CLAN_RENEW_VICTORIES:
			{
				char szWinnerClanName[256], szLoserClanName[256];
				int nVictories;

				pCommand->GetParameter(szWinnerClanName,	0, MPT_STR, sizeof(szWinnerClanName) );
				pCommand->GetParameter(szLoserClanName,		1, MPT_STR, sizeof(szLoserClanName) );
				pCommand->GetParameter(&nVictories,			2, MPT_INT);
				OnBroadcastClanRenewVictories(szWinnerClanName, szLoserClanName, nVictories);
			}
			break;
		case MC_MATCH_BROADCAST_CLAN_INTERRUPT_VICTORIES:
			{
				char szWinnerClanName[256], szLoserClanName[256];
				int nVictories;

				pCommand->GetParameter(szWinnerClanName,	0, MPT_STR, sizeof(szWinnerClanName) );
				pCommand->GetParameter(szLoserClanName,		1, MPT_STR, sizeof(szLoserClanName) );
				pCommand->GetParameter(&nVictories,			2, MPT_INT);
				OnBroadcastClanInterruptVictories(szWinnerClanName, szLoserClanName, nVictories);
			}
			break;
		case MC_MATCH_BROADCAST_DUEL_RENEW_VICTORIES:
			{
				char szChannelName[256], szChampionName[256];
				int nVictories, nRoomNo;

				pCommand->GetParameter(szChampionName,		0, MPT_STR, sizeof(szChampionName) );
				pCommand->GetParameter(szChannelName,		1, MPT_STR, sizeof(szChannelName) );
				pCommand->GetParameter(&nRoomNo,			2, MPT_INT);
				pCommand->GetParameter(&nVictories,			3, MPT_INT);
				OnBroadcastDuelRenewVictories(szChampionName, szChannelName, nRoomNo, nVictories);
			}
			break;
		case MC_MATCH_BROADCAST_DUEL_INTERRUPT_VICTORIES:
			{
				char szChampionName[256], szInterrupterName[256];
				int nVictories;

				pCommand->GetParameter(szChampionName,		0, MPT_STR, sizeof(szChampionName) );
				pCommand->GetParameter(szInterrupterName,	1, MPT_STR, sizeof(szInterrupterName) );
				pCommand->GetParameter(&nVictories,			2, MPT_INT);
				OnBroadcastDuelInterruptVictories(szChampionName, szInterrupterName, nVictories);
			}
			break;
		case MC_MATCH_RESPONSE_STAGE_FOLLOW:
			{
				int nMsgID;
				pCommand->GetParameter( &nMsgID, 0, MPT_INT );
				OnFollowResponse( nMsgID );
			}
			break;
		case MC_MATCH_SCHEDULE_ANNOUNCE_SEND :
			{
				char cAnnounce[ 512 ] = {0};
				pCommand->GetParameter( cAnnounce, 0, MPT_STR , sizeof(cAnnounce) );
				ZChatOutput( cAnnounce );
			}
			break;
		case MC_MATCH_EXPIRED_RENT_ITEM:
			{
				CCCommandParameter* pParam = pCommand->GetParameter(0);
				if(pParam->GetType()!=MPT_BLOB) break;
				void* pBlob = pParam->GetPointer();

				OnExpiredRentItem(pBlob);
			}
			break;
		case MC_MATCH_FIND_HACKING:
			{
			}
			break;
		case MC_MATCH_REWARD_BATTLE_TIME:
			{
				CCUID uidOwner;
				char szRewardName[256], szRewardResetDesc[256];
				int nRemainReward;
				unsigned int nItemId, nItemCnt;
				unsigned int nRentHourPeriod;

				pCommand->GetParameter(&uidOwner,			0, MPT_UID);
				pCommand->GetParameter(szRewardName,		1, MPT_STR, sizeof(szRewardName) );
				pCommand->GetParameter(szRewardResetDesc,	2, MPT_STR, sizeof(szRewardResetDesc) );				
				pCommand->GetParameter(&nItemId,			3, MPT_UINT);
				pCommand->GetParameter(&nItemCnt,			4, MPT_UINT);
				pCommand->GetParameter(&nRentHourPeriod,	5, MPT_UINT);
				pCommand->GetParameter(&nRemainReward,		6, MPT_INT);

				const char* szCharName = "-";
				const char* szItemName = "-";

				if (ZGetCharacterManager())
				{
					ZCharacter* pChar = ZGetCharacterManager()->Find(uidOwner);
					if (pChar)
						szCharName = pChar->GetUserName();
				}

				CCMatchItemDesc* pItemDesc = CCGetMatchItemDescMgr()->GetItemDesc(nItemId);
				if (pItemDesc)
					szItemName = pItemDesc->m_pMItemName->Ref().m_szItemName;
				else
				{
					const ZGambleItemDefine* pGItemDef = ZGetGambleItemDefineMgr().GetGambleItemDefine(nItemId);
					if (pGItemDef)
						szItemName = pGItemDef->GetName().c_str();
				}

				// 이 커맨드는 
				// 1. 보상을 실제로 받은 경우
				// 2. 보상을 받을 수 있지만 기회가 남지 않아서 받을 수 없는 경우
				// 두 경우 모두 전송받는다. 따라서 상황에 맞게 적절한 처리가 필요하다

				bool bRewardReally = (nItemId != 0);
				bool bMyReward = (ZGetMyUID() == uidOwner);

				if (bRewardReally)
				{
					TimeReward_ShowCharEffect(uidOwner);	// 캐릭터 머리 위에 이펙트 출력
					TimeReward_ChatOutput_RewardGet(szRewardName, szCharName, szItemName);	// '누가 무엇을 받았다' 출력

					if (bMyReward)	// 나 자신을 위한 커맨드라면
					{
						if (nRemainReward >= 1)
							TimeReward_ChatOutput_RemainChance(nRemainReward);		// 남은 기회를 출력
						else if (nRemainReward == 0)
							TimeReward_ChatOutput_ResetChance(szRewardResetDesc);	// 이번에 받은 것이 마지막 기회였다면 재충전 시각 공지
						else if (nRemainReward == -1)
							int a=0;// 이 경우는 별도의 기회 제한이 없는 이벤트를 나타낸다, 특별히 기회에 대한 출력문을 보여주지 않는다
					}
				}
				else	// 조건은 충족했으나 남은 기회가 없어 받지 못한 경우
				{
					if (bMyReward)
					{
						TimeReward_ChatOutput_NoChance(szRewardName);				// 기회가 없어서 받지 못함을 알려주고
						TimeReward_ChatOutput_ResetChance(szRewardResetDesc);		// 재충전 시각을 공지
					}
				}
			}
			break;

		// 듀얼 토너먼트
#ifdef _DUELTOURNAMENT
		case MC_MATCH_DUELTOURNAMENT_RESPONSE_JOINGAME:
			{
				int nResult;
				pCommand->GetParameter(&nResult,	0, MPT_INT);

				switch (nResult)
				{
				case MERR_DT_WRONG_CHANNEL:
					ZApplication::GetGameInterface()->ShowErrorMessage( nResult );
					cclog("Error: Illegal request to join game, This isn't a duel tournament channel.\n");
					break;
				case MERR_DT_CANNOT_CHALLENGE:
					ZApplication::GetGameInterface()->ShowErrorMessage( nResult );
					cclog("Error: failed to challenge a duel tournament game.\n");
					break;
				case MERR_DT_ALREADY_JOIN:
					ZApplication::GetGameInterface()->ShowErrorMessage( nResult );
					cclog("Error: already trying to join a duel tournament game.\n");
					break;
				}
			}
			break;

		case MC_MATCH_DUELTOURNAMENT_PREPARE_MATCH:
			{
				CCUID uidStage = CCUID(0,0);
				int nType;
				pCommand->GetParameter(&uidStage, 0, MPT_UID);
				pCommand->GetParameter(&nType, 1, MPT_INT);
				CCCommandParameter* pParam = pCommand->GetParameter(2);
				void* pBlobPlayerInfo = pParam->GetPointer();

				OnDuelTournamentPrepare((CCDUELTOURNAMENTTYPE)nType, uidStage, pBlobPlayerInfo);
			}
			break;
		case MC_MATCH_DUELTOURNAMENT_LAUNCH_MATCH:
			{
				CCUID uidStage;
				pCommand->GetParameter(&uidStage, 0, MPT_UID);
				char szMapName[128];
				pCommand->GetParameter(szMapName, 1, MPT_STR, sizeof(szMapName) );


				ZIDLResource* pResource = ZApplication::GetGameInterface()->GetIDLResource();
				CCWidget* pWidget = pResource->FindWidget("DuelTournamentWaitMatchDialog");
				if(pWidget!=NULL)
					pWidget->Show(false);

				OnDuelTournamentLaunch(uidStage, szMapName);
			}
			break;
		case MC_MATCH_DUELTOURNAMENT_NOT_SERVICE_TIME:
			{
				int nOpenStartTime;
				int nOpenEndTime;
				pCommand->GetParameter(&nOpenStartTime,	0, MPT_INT);
				pCommand->GetParameter(&nOpenEndTime,	1, MPT_INT);

				// 듀얼토너먼트 신청이 서비스 시간에 따라 취소 되었음.
				ZApplication::GetGameInterface()->OnDuelTournamentGameUI(false); // 참가 신청 박스 닫아준다.
				const char *strFormat = ZErrStr( MERR_DT_NOT_SERVICE_TIME );
				if(strFormat)
				{
					char text[1024];
					sprintf(text, strFormat, nOpenStartTime, nOpenEndTime);
					ZApplication::GetGameInterface()->ShowErrorMessage(text, MERR_DT_NOT_SERVICE_TIME);
				}
			}
			break;
		case MC_MATCH_DUELTOURNAMENT_CHAR_INFO:
			{
				pCommand->GetParameter(&m_dtCharInfo.tournamentPoint,	0, MPT_INT);
				pCommand->GetParameter(&m_dtCharInfo.wins,				1, MPT_INT);
				pCommand->GetParameter(&m_dtCharInfo.losses,			2, MPT_INT);
				pCommand->GetParameter(&m_dtCharInfo.ranking,			3, MPT_INT);
				//pCommand->GetParameter(&rankingFructuation,	4, MPT_INT);
				pCommand->GetParameter(&m_dtCharInfo.winners,			5, MPT_INT);
				pCommand->GetParameter(&m_dtCharInfo.lastWeekGrade,		6, MPT_INT);

				ZGetGameInterface()->UpdateDuelTournamantMyCharInfoUI();
			}
			break;

		case MC_MATCH_DUELTOURNAMENT_CHAR_INFO_PREVIOUS:
			{
				pCommand->GetParameter(&m_dtCharInfoPrev.tournamentPoint,	0, MPT_INT);
				pCommand->GetParameter(&m_dtCharInfoPrev.wins,				1, MPT_INT);
				pCommand->GetParameter(&m_dtCharInfoPrev.losses,			2, MPT_INT);
				pCommand->GetParameter(&m_dtCharInfoPrev.ranking,			3, MPT_INT);
				pCommand->GetParameter(&m_dtCharInfoPrev.winners,			4, MPT_INT);

				ZGetGameInterface()->UpdateDuelTournamantMyCharInfoPreviousUI();
			}
			break;

#endif //_DUELTOURNAMENT

		// Gamble 아이템
		case MC_MATCH_RESPONSE_GAMBLE:
			{
				unsigned int nRecvItem;
				unsigned int nCnt;
				unsigned int nTime;

				pCommand->GetParameter(&nRecvItem,	0, MPT_UINT);
				pCommand->GetParameter(&nCnt,		1, MPT_UINT);
				pCommand->GetParameter(&nTime,		2, MPT_UINT);

				OnRecieveGambleItem( nRecvItem, nCnt, nTime);
			}
			break;

		case MC_QUEST_NPCLIST :
			{
				CCCommandParameter* pParam = pCommand->GetParameter( 0 );
				if( MPT_BLOB != pParam->GetType() ) 
				{
					break;
				}

				void* pBlobNPCList = pParam->GetPointer();
				if( NULL == pBlobNPCList )
				{
					return false;
				}

				int gameType;
				if (!pCommand->GetParameter(&gameType, 1, MPT_INT))
				{
					ASSERT(0);
					return false;
				}

				OnQuestNPCList( pBlobNPCList, (CCMATCH_GAMETYPE)gameType );
			}
			break;


		case MC_REQUEST_RESOURCE_CRC32 :
			{
				DWORD dwKey = 0;
				pCommand->GetParameter( &dwKey, 0, MPT_UINT );

				DWORD dwCrc32, dwXor;
				ZGetGame()->MakeResourceCRC32(dwKey, dwCrc32, dwXor);
				ZPostResponseResourceCRC32( dwCrc32, dwXor );
			}
			break;

		case MC_MATCH_ROUTE_UPDATE_STAGE_EQUIP_LOOK :
			{
				CCUID uidPlayer;
				int nParts;
				int nItemID;

				pCommand->GetParameter( &uidPlayer, 0, MPT_UID );
				pCommand->GetParameter( &nParts, 1, MPT_INT );
				pCommand->GetParameter( &nItemID, 2, MPT_INT );

				OnResponseUpdateStageEquipLook( uidPlayer, nParts, nItemID );
			}
			break;

		case MC_ADMIN_RESPONSE_KICK_PLAYER:
			{
				int nResult;
				pCommand->GetParameter( &nResult, 0, MPT_INT );
				OnAdminResponseKickPlayer(nResult);				
			}
			break;

		case MC_ADMIN_RESPONSE_BLOCK_PLAYER:
			{
				int nResult;
				pCommand->GetParameter( &nResult, 0, MPT_INT );
				OnAdminResponseBlockPlayer(nResult);
			}
			break;

		case MC_ADMIN_RESPONSE_MUTE_PLAYER:
			{
				int nResult;
				pCommand->GetParameter( &nResult, 0, MPT_INT );
				OnAdminResponseMutePlayer(nResult);
			}
			break;

		default:
			if (!ret)
			{
//				CCClient::OutputMessage(CCZMOM_LOCALREPLY, "Command(%s) handler not found", pCommand->m_pCommandDesc->GetName());
//				return false;
			}
			break;
	}

	if (m_fnOnCommandCallback) ret = m_fnOnCommandCallback(pCommand);


	return ret;
}
Beispiel #21
0
void ShowClanSponsorAgreeWaitFrame_OnExpire()
{
	ZChatOutput( ZMsg(MSG_CANCELED) );
}
void ZItemCountDlg::Open(ZITEMCOUNTDLG_MODE mode, const char* szItemName, CCBitmap* pIcon, int price, int nMin, int nMax, IItemCountDlgDoneHandler* pHandler )
{
	m_mode = mode;
	m_strItemName = szItemName;
	m_pItemIcon = pIcon;
	m_nPrice = price;
	m_nMin = nMin;
	m_nMax = nMax;
	m_pDoneHandler = pHandler;

	if (m_nMin > m_nMax || m_nMin < 0 || m_nMax < 0)
	{
		_ASSERT(0);
		m_nMin = m_nMax = 0;
	}

	m_nCurrCount = 1;

	CCFrame* pFrame = (CCFrame*)GetIDLResource()->FindWidget("TradeCountableItemFrame");
	CCLabel* pLabel1 = (CCLabel*)GetIDLResource()->FindWidget("TradeCountableItem_Message");
	CCLabel* pLabel2 = (CCLabel*)GetIDLResource()->FindWidget("TradeCountableItem_NullLabel");
	CCButton* pBtn = (CCButton*)GetIDLResource()->FindWidget("TradeCountableItem_Ok");

	switch (m_mode) {
		case ZICD_SELL:
			if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_SELL_ITEM));
			if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_SELL_COUNT_ASK));
			if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_SELL_COUNT));
			if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_SELL_BUTTON));
			break;
		case ZICD_BUY:
			if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_BUY_ITEM));
			if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_BUY_COUNT_ASK));
			if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_BUY_COUNT));
			if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_BUY_BUTTON));
			break;
		case ZICD_SENDACCOUNT:
			if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_SEND_ITEM));
			if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_SEND_COUNT_ASK));
			if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_SEND_COUNT));
			if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_SEND_BUTTON));
			break;
		case ZICD_BRINGACCOUNT:
			if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_BRING_ITEM));
			if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_BRING_COUNT_ASK));
			if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_BRING_COUNT));
			if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_BRING_BUTTON));
			break;
	}

	UpdateDlg();

	CCWidget* pWidget = GetIDLResource()->FindWidget( "TradeCountableItemFrame");
	if ( pWidget)
		pWidget->Show( true, true);

	pWidget = GetIDLResource()->FindWidget( "TradeCountableItem_CountNum");
	if ( pWidget)
		pWidget->SetFocus();
}