MirMsg.h
资源名称:盛大传奇外挂原代码.rar [点击查看]
上传用户:marco7834
上传日期:2010-02-24
资源大小:82k
文件大小:1k
源码类别:
游戏引擎
开发平台:
Visual C++
- // MirMsg.h: interface for the MirMsg class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_MIRMSG_H__69733770_48C7_4904_BD1C_474545C0BA38__INCLUDED_)
- #define AFX_MIRMSG_H__69733770_48C7_4904_BD1C_474545C0BA38__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #pragma comment( lib, "ws2_32.lib" )
- #include <winsock2.h>
- #define MSGBUFFERSIZE 2048
- #define MIRVERSION "<mir152>"
- #define MSGHEADERSIZE 12
- #define MSGLENGTH 1024
- typedef struct
- {
- union
- {
- DWORD dwFlag;
- struct
- {
- WORD wa;
- WORD wb;
- };
- };
- WORD wCmd;
- WORD w1;
- WORD w2;
- WORD w3;
- char data[1024];
- }MMSG;
- class CMirMsg
- {
- public:
- CMirMsg();
- virtual ~CMirMsg();
- public:
- char GetMsgFlag();
- int SendGateMsg( SOCKET s, MMSG * pmsg );
- int SendMsg( SOCKET s, MMSG * pmsg );
- int RecvGateMsg( SOCKET s, MMSG * pmsg );
- int RecvMsg( SOCKET s, MMSG * pmsg );
- int RecvString( SOCKET s, char * string, int maxlen );
- int SendString( SOCKET s, char * string );
- private:
- char * m_RecvBuffer;
- char * m_ConvBuffer;
- char * m_SendBuffer;
- char m_msgflag;
- };
- #endif // !defined(AFX_MIRMSG_H__69733770_48C7_4904_BD1C_474545C0BA38__INCLUDED_)