msgfriendinfo.cpp

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

CPP
76
字号
// MsgFriendInfo.cpp: implementation of the CMsgFriendInfo class.
//
//////////////////////////////////////////////////////////////////////

#include "allmsg.h"
#include "Npc.h"
#include "NpcManager.h"
#include "GameMap.h"
#include "MapGroup.h"

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

CMsgFriendInfo::CMsgFriendInfo()
{
	Init();
	m_pInfo	=(MSG_Info *)m_bufMsg;

}

CMsgFriendInfo::~CMsgFriendInfo()
{

}

//////////////////////////////////////////////////////////////////////
BOOL CMsgFriendInfo::Create(int nAction, OBJID idFriend, int nLook, int nLevel, int nProfession, int nPk, OBJID idSyn, int nRank, LPCTSTR szMate, UCHAR ucNobilityRank)
{
	if(!szMate)
		return false;

	// init
	this->Init();

	// fill info now
	m_unMsgSize	=sizeof(MSG_Info);
	m_unMsgType	=_MSG_FRIENDINFO;

	m_pInfo->idFriend		= idFriend;
	m_pInfo->dwLook			= nLook;
	m_pInfo->ucLevel		= nLevel;
	m_pInfo->ucProfession	= nProfession;
	m_pInfo->sPk			= nPk;
	m_pInfo->dwSynID_Rank	= (idSyn&MASK_SYNID) | (nRank<<MASK_RANK_SHIFT);
	SafeCopy(m_pInfo->szMate, szMate, _MAX_NAMESIZE);
	m_pInfo->ucNobilityRank	= ucNobilityRank;
	m_pInfo->ucAction		= nAction;

	return true;
}

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

	memcpy(this->m_bufMsg, pbufMsg, dwMsgSize);
	return true;
}

//////////////////////////////////////////////////////////////////////
void CMsgFriendInfo::Process(CGameSocket* pSocket)
{
#ifdef _MYDEBUG
	::LogSave("Process CMsgFriendInfo: ID:0x:%x, Type:%d, LookType:%d, CellX:%d, CellY:%d, Name:%s",
				m_pInfo->id	, m_pInfo->ucType,
				m_pInfo->usLook, m_pInfo->usCellX, 
				m_pInfo->usCellY, m_pInfo->szName);

#endif
	ASSERT(!"CMsgFriendInfo::Process");
}

⌨️ 快捷键说明

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