GameProc.h
上传用户:cydong117
上传日期:2009-11-10
资源大小:638k
文件大小:5k
源码类别:

模拟服务器

开发平台:

Visual C++

  1. /******************************************************************************************************************
  2.                                                                                                                    
  3. 葛碘疙:
  4. 累己磊:
  5. 累己老:
  6. [老磊][荐沥磊] : 荐沥 郴侩
  7.                                                                                                                    
  8. *******************************************************************************************************************/
  9. #ifndef _GAMEPROC_H
  10. #define _GAMEPROC_H
  11. typedef struct tagMEMMAPPEDID
  12. {
  13. CActor* pxActor[_MAX_CELL_OBJ];
  14. CMagic* pxMagic[_MAX_CELL_OBJ];
  15. LPGROUNDITEM pstItem[_MAX_CELL_OBJ];
  16. }MEMMAPPEDID, *LPMEMMAPPEDID;
  17. class CGameProcess : public CWHDefProcess
  18. {
  19. protected:
  20. VOID OnSvrMsgNewMap(_TDEFAULTMESSAGE *ptdm, char *pszMapName);
  21. VOID OnSvrMsgLogon(_TDEFAULTMESSAGE *ptdm, char *pszMsg);
  22. VOID OnSvrMsgHear(_TDEFAULTMESSAGE *ptdm, char *pszMsg);
  23. public:
  24.  CGameProcess();
  25. ~CGameProcess();
  26. public:
  27. BOOL m_bStatusView;
  28. BOOL m_bTileView;
  29. BOOL m_bCellView;
  30. BOOL m_bObj1View;
  31. BOOL m_bObj2View;
  32. BOOL m_bStopPtView;
  33. BOOL m_bShowSnow;
  34. BOOL m_bShowMist;
  35. BOOL m_bShowRain;
  36. BOOL m_bShadowABlend;
  37. BOOL m_bShowFPS;
  38. CHAR m_szMapName[MAX_PATH];
  39. MEMMAPPEDID m_stMemMappedID[_VIEW_CELL_Y_COUNT][_VIEW_CELL_X_COUNT];
  40. CPDLList<CActor> m_xActorList;
  41. CPDLList<CMagic> m_xMagicList;
  42. CPDLList<CMagic> m_xGroundMagicList;
  43. CPDLList<GROUNDITEM> m_stMapItemList;
  44. CBMMp3 m_xBGM;
  45. CParticle m_xParticles;
  46. CImageHandler m_xImage;
  47. CMapHandler m_xMap;
  48. CInterface m_xInterface;
  49. CMyHero m_xMyHero;
  50. HBRUSH m_hBrush;
  51. POINT m_ptMousePos;
  52. POINT m_ptCurrTile;
  53. BOOL m_bRender;
  54. BYTE m_bDayState;
  55. BYTE m_bFogState;
  56. CLightFog m_xLightFog;
  57. CMist m_xMist;
  58. CSnow m_xSnow;
  59. CRain m_xRain;
  60. CFlyingTail m_xFlyingTail;
  61. CSmoke m_xSmoke;
  62. CElec m_xElec;
  63. CNoticeBox m_xNotice;
  64. CActor* m_pxMouseTargetActor;
  65. CActor* m_pxMouseOldTargetActor;
  66. CActor* m_pxSavedTargetActor;
  67. CWHQueue m_xWaitPacketQueue;
  68. CWHQueue m_xWaitDefaultPacketQueue;
  69. WORD m_wInputDelayTime;
  70. WORD m_wCurrInputDelayTime;
  71. FLOAT m_fDarkRate;
  72. FLOAT m_fTileLightRed;
  73. FLOAT m_fTileLightGreen;
  74. FLOAT m_fTileLightBlue;
  75. WORD m_wShadowClr[800];
  76. D3DMATRIX m_matWorld;
  77. BOOL m_bShowShine;
  78. DWORD m_dwLastShineTick;
  79. WORD m_wShineCurrDelay;
  80. BYTE m_bCurrShineFrame;
  81. LPDIRECTDRAWSURFACE7 m_lpddsShineTextr[10]; // 酒捞袍 馆娄芭覆.
  82. D3DVERTEX m_avBillboard[4];
  83. BOOL RenderShine(INT nLoopTime);
  84. WORD m_wNPCWndPosX, m_wNPCWndPosY;
  85. virtual LRESULT DefMainWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  86. void OnProcPacketNotEncode(char *pszMsg);
  87. void OnSocketMessageRecieve(char *pszMsg);
  88. virtual VOID OnConnectToServer();
  89. virtual char* OnMessageReceive(CHAR* pszMessage);
  90. LRESULT OnKeyDown(WPARAM wParam, LPARAM lParam);
  91. LRESULT OnKeyUp(WPARAM wParam, LPARAM lParam);
  92. LRESULT OnMouseMove(WPARAM wParam, LPARAM lParam);
  93. LRESULT OnRButtonDown(WPARAM wParam, LPARAM lParam);
  94. LRESULT OnLButtonDown(WPARAM wParam, LPARAM lParam);
  95. LRESULT OnLButtonUp(WPARAM wParam, LPARAM lParam);
  96. LRESULT OnRButtonUp(WPARAM wParam, LPARAM lParam);
  97. LRESULT OnMove(WPARAM wParam, LPARAM lParam);
  98. LRESULT OnSysKeyDown(WPARAM wParam, LPARAM lParam);
  99. LRESULT OnSysKeyUp(WPARAM wParam, LPARAM lParam);
  100. LRESULT OnMsgInputted(WPARAM wParam, LPARAM lParam);
  101. LRESULT OnWheel(WPARAM wParam, LPARAM lParam);
  102. LRESULT OnLButtonDoubleClick(WPARAM wParam, LPARAM lParam);
  103. LRESULT OnTimer(WPARAM wParam, LPARAM lParam);
  104. LRESULT OnDestroy(WPARAM wParam, LPARAM lParam);
  105. public:
  106. VOID Init();
  107. VOID Load();
  108. VOID DeleteProc();
  109. VOID SetNextProc();
  110. VOID DropItemShow();
  111. VOID LoadMapChanged(CHAR* szMap);
  112. VOID AutoTargeting();
  113. BOOL ReceivePacket(CHAR* szMsg, INT nPacketLen);
  114. VOID RenderObject(INT nLoopTime);
  115. VOID RenderScene(INT nLoopTime);
  116. BOOL CheckMove(INT nX, INT nY, INT nSpeed, POINT* ptDestTile = NULL, INT* nDestDir = NULL);
  117. VOID CheckMappedData(INT nLoopTime, BOOL bIsMoveTime);
  118. VOID RenderMapTileGrid();
  119. VOID CommandAnalyze();
  120. BOOL TargetInLongAttack(BYTE bDir);
  121. VOID ProcessPacket();
  122. VOID ProcessDefaultPacket();
  123. VOID CloseNPCWindow();
  124. virtual VOID ShowStatus(INT nStartX, INT nStartY);
  125. CActor* FindActor(int nID); // gadget
  126. };
  127. #endif //_GAMEPROC_H