S3PDBSocketParser.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:1k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //-----------------------------------------//
  2. //                                         //
  3. //  File : S3PDBSocketParser.h      //
  4. // Author : Yang Xiaodong            //
  5. // Modified : 8/24/2002                //
  6. //                                         //
  7. //-----------------------------------------//
  8. #if !defined(AFX_S3PDBSOCKETPARSER_H__8B70E8D1_C829_49AA_95E9_E8E092F44010__INCLUDED_)
  9. #define AFX_S3PDBSOCKETPARSER_H__8B70E8D1_C829_49AA_95E9_E8E092F44010__INCLUDED_
  10. #include "KStdAfx.h"
  11. #include "LoginDef.h"
  12. typedef struct tag_PARSEDDATAPACKET
  13. {
  14. DWORD m_dwParam;
  15. IBYTE* m_lpData;
  16. DWORD m_dwSize;
  17. }_PARSEDDATAPACKET, *_LPPARSEDDATAPACKET;
  18. typedef const tag_PARSEDDATAPACKET* _LPCPARSEDDATAPACKET;
  19. class S3PDBSocketParser : public _PARSEDDATAPACKET
  20. {
  21. public:
  22. S3PDBSocketParser();
  23. virtual ~S3PDBSocketParser();
  24. inline operator _LPCPARSEDDATAPACKET() const
  25. {
  26. return this;
  27. }
  28. inline operator _LPPARSEDDATAPACKET()
  29. {
  30. return this;
  31. }
  32. static BOOL Encode( const IBYTE* pRawData/* Input */, unsigned long ulRawSize/* Input */,
  33. IBYTE* pEncodedData/* Output */, unsigned long& ulEncodedSize/* Output */ );
  34. virtual BOOL Parse( IBYTE* lpData, DWORD dwSize, BOOL bEncrypt = TRUE );
  35. protected:
  36. virtual BOOL Decode( IBYTE* lpData/*Input*/, DWORD& dwSize/*Input/Output*/, IBYTE* lpRetData/*Output*/ );
  37. virtual void Init();
  38. virtual void Release();
  39. };
  40. #endif // !defined(AFX_S3PDBSOCKETPARSER_H__8B70E8D1_C829_49AA_95E9_E8E092F44010__INCLUDED_)