⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 msgannouncelist.cpp

📁 网络游戏魔域的服务端与客户端完整源代码 包括详细的说明文档与开发日志
💻 CPP
字号:
// MsgAnnounceList.cpp: implementation of the CMsgAnnounceList class.
//
//////////////////////////////////////////////////////////////////////

#include "MsgAnnounceList.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CMsgAnnounceList::CMsgAnnounceList()
{
	Init();
	m_pInfo	=(MSG_Info *)m_bufMsg;
}

CMsgAnnounceList::~CMsgAnnounceList()
{

}

BOOL CMsgAnnounceList::Create(char* pbufMsg, DWORD dwMsgSize)
{
	if (!CNetMsg::Create(pbufMsg, dwMsgSize))
		return false;
	
	if(_MSG_ANNOUNCE_LIST != this->GetType())
		return false;
	
	return true;
}

BOOL CMsgAnnounceList::Create(USHORT usType,int nIndex,OBJID idAnnounce)
{
	this->Init();
	
	m_pInfo->unMsgSize	=sizeof(MSG_Info);
	m_pInfo->unMsgType	=_MSG_ANNOUNCE_LIST;
	
	if (usType == CHECK_BY_ID)
		m_pInfo->usType = usType;
	else if (usType == CHECK_BY_INDEX)
		m_pInfo->idAnnounce = nIndex;
		
	return TRUE;
}

void CMsgAnnounceList::Process(void *pInfo)
{
	int nAmount = m_pInfo->usAmount;
	if ( 0 == nAmount)
		return;
	g_objHero.ClearAnnounceList();
	for(int i=0;i<nAmount;i++)
	{
		g_objHero.AddAnnounceList(m_pInfo->setAnnounce[i].idAnnounce,
			m_pInfo->setAnnounce[i].szTitle);
	}
	::PostCmd(CMD_FLASH_ANNOUNCELIST);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -