msgallot.cpp

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

CPP
64
字号
// MsgAllot.cpp: implementation of the CMsgAllot class.
//
//////////////////////////////////////////////////////////////////////

#include "AllMsg.h"

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

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

CMsgAllot::~CMsgAllot()
{

}

//-------------------------------------------------------------------

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

	if(_MSG_ALLOT != this->GetType())
		return false;
	
	return true;
}

//-------------------------------------------------------------------

BOOL CMsgAllot::Create(unsigned char ucForce, unsigned char ucSpeed, unsigned char ucHealth, unsigned char ucSoul)
{
	// init
	this->Init();
	
	if((ucForce+ucSpeed+ucHealth+ucSoul) == 0)
	{
		return false;
	}

	m_pInfo->ucForce = ucForce;
	m_pInfo->ucHealth = ucHealth;
	m_pInfo->ucSoul = ucSoul;
	m_pInfo->ucSpeed = ucSpeed;

	m_unMsgType	=_MSG_ALLOT;
	m_unMsgSize	=sizeof(MSG_Info);

	return true;
}

//-------------------------------------------------------------------
void CMsgAllot::Process(void* pInfo)
{
	return;
}
//-------------------------------------------------------------------

⌨️ 快捷键说明

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