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

📄 msgregister.cpp

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

#include "AllMsg.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CMsgRegister::CMsgRegister()
{
	Init();
	m_pInfo	=(MSG_Info *)m_bufMsg;
}

CMsgRegister::~CMsgRegister()
{

}


//////////////////////////////////////////////////////////////////////
BOOL CMsgRegister::Create(const char* pszAccount,
						  const char* pszName,
						  const char* pszPassword, 
						  DWORD unLook, 
						  USHORT unData, 
						  OBJID idAccount,
						  char	cLength,
						  char  cFat)
{
	// check param
	if(!pszAccount || _MAX_NAMESIZE <= strlen(pszAccount))
		return false;

	if(!pszName || _MAX_NAMESIZE <= strlen(pszName))
		return false;

	if(!pszPassword || _MAX_NAMESIZE <= strlen(pszPassword))
		return false;

	// init
	this->Init();

	// fill info now
	m_pInfo->unMsgSize	=sizeof(MSG_Info);
	m_pInfo->unMsgType	=_MSG_REGISTER;

	strcpy(m_pInfo->szAccount, pszAccount);
	strcpy(m_pInfo->szName, pszName);
	strcpy(m_pInfo->szPassword, pszPassword);
	
	m_pInfo->unLook			=unLook;
    m_pInfo->unData			=unData;
	m_pInfo->idAccount		=idAccount;
	
	m_pInfo->cLength		= cLength;
	m_pInfo->cFat			= cFat;
	return true;
}

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

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

	return true;
}

//////////////////////////////////////////////////////////////////////
void CMsgRegister::Process(void* pInfo)
{
	::LogMsg("Invalid msg CMsgRegister in client.");
}

⌨️ 快捷键说明

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