📄 varmsg.h
字号:
#pragma once
//=======================================================================================================================
/// VarMsg class
/**
@author
Kim Min Wook < taiyo@webzen.com >
@since
2006. 1. 11
@remarks
- 啊函 菩哦阑 焊尘锭 荤侩窍绰 努贰胶
@note
-
@history
- 2006/1/12 : StartTypePtr(Type) 窃荐 眠啊 : 积己磊甫 龋免且 乐霸
@todo
-
@usage
- ex)
*1锅掳 规过 : 积己磊甫 龋免窍瘤 臼酒辑 馆靛矫 檬扁拳甫 秦具 窃!
MSG_CG_PACKET * pMsgEx = (MSG_CG_PACKET *)m_VarMsg.StartPtr();
pMsgEx->m_byCategory = 0;
pMsgEx->m_byProtocol = 1;
m_VarMsg.SetSize( pMsgEx->GetSize() );
BASEINFO *pResultMsg = (BASEINFO*)m_VarMsg.NextPtr();
m_VarMsg.SetSize(pResultMsg->GetSize());
pPlayer->SendExPacket( m_VarMsg.GetMsgCount(), m_VarMsg.GetMsgPPtr(), m_VarMsg.GetMsgSizePtr() );
*2锅掳 规过 : 积己磊甫 龋免秦淋
MSG_CG_PACKET * pMsgEx = m_VarMsg.StartTypePtr(Param2Class<MSG_CG_PACKET>());
m_VarMsg.SetSize( pMsgEx->GetSize() );
BASEINFO *pResultMsg = (BASEINFO*)m_VarMsg.NextPtr();
m_VarMsg.SetSize(pResultMsg->GetSize());
pPlayer->SendExPacket( m_VarMsg.GetMsgCount(), m_VarMsg.GetMsgPPtr(), m_VarMsg.GetMsgSizePtr() );
*/
//=======================================================================================================================
#define _MAX_MSG_NUM (500)
#define _MAX_MSG_BUFFER_SIZE (1024)
class VarMsg
{
public:
VarMsg(void);
~VarMsg(void);
inline BYTE * StartPtr() { m_wCout = 0; return m_ppMsg[m_wCout++]; }
template< class PacketType >
inline PacketType * StartTypePtr( Param2Class<PacketType> ) { m_wCout = 0; return new (m_ppMsg[m_wCout++])(PacketType); }
inline BYTE * NextPtr() { ASSERT(m_wCout<_MAX_MSG_NUM); return m_ppMsg[m_wCout++]; }
inline VOID SetSize( WORD wSize ) { ASSERT(m_wCout>0); m_pwSize[m_wCout-1] = wSize; }
inline BYTE ** GetMsgPPtr() { return m_ppMsgOut; }
inline WORD * GetMsgSizePtr() { return m_pwSize; }
inline WORD GetMsgCount() { return m_wCout; }
private:
BYTE m_ppMsg[_MAX_MSG_NUM][_MAX_MSG_BUFFER_SIZE];
BYTE * m_ppMsgOut[_MAX_MSG_NUM];
WORD m_pwSize[_MAX_MSG_NUM];
WORD m_wCout;
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -