msgmapinfo.cpp

来自「网络游戏魔域的服务端与客户端完整源代码 包括详细的说明文档与开发日志」· C++ 代码 · 共 60 行

CPP
60
字号
// MsgMapInfo.cpp: implementation of the CMsgMapInfo class.
//
//////////////////////////////////////////////////////////////////////

#include "AllMsg.h"
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

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

CMsgMapInfo::~CMsgMapInfo()
{

}

//////////////////////////////////////////////////////////////////////
BOOL CMsgMapInfo::Create(CGameMap* pMap)
{
	IF_NOT (pMap)
		return false;

	// init
	this->Init();

	// fill info now
	m_pInfo->idMap		= pMap->GetID();
	m_pInfo->idDoc		= pMap->GetDocID();
	m_pInfo->dwType		= pMap->GetType();

	m_unMsgType	= _MSG_MAPINFO;
	m_unMsgSize	= sizeof(MSG_Info);

	return true;

}

//////////////////////////////////////////////////////////////////////
BOOL CMsgMapInfo::Create(char* pbufMsg, DWORD dwMsgSize)
{
	if (!CNetMsg::Create(pbufMsg, dwMsgSize))
		return false;

	if(_MSG_MAPINFO != this->GetType())
		return false;

	return true;
}

//////////////////////////////////////////////////////////////////////
void CMsgMapInfo::Process(void* pInfo)
{
}

//////////////////////////////////////////////////////////////////////

⌨️ 快捷键说明

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