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

模拟服务器

开发平台:

C/C++

  1. // S3RobotDlg.h : header file
  2. //
  3. #if !defined(AFX_S3ROBOTDLG_H__7EFE14C3_D869_4410_ABD6_81B355BC4DFB__INCLUDED_)
  4. #define AFX_S3ROBOTDLG_H__7EFE14C3_D869_4410_ABD6_81B355BC4DFB__INCLUDED_
  5. #if _MSC_VER > 1000
  6. #pragma once
  7. #endif // _MSC_VER > 1000
  8. #include "HyperLink.h"
  9. #include <mmsystem.h>
  10. #include "kprotocol.h"
  11. /*
  12.  * disable warning C4786: symbol greater than 255 character,
  13.  * okay to ignore
  14.  */
  15. #pragma warning(disable: 4786)
  16. #include <vector>
  17. #include <map>
  18. #include <string>
  19. using namespace std;
  20. typedef map< int, string > SERVER_MAP;
  21. /////////////////////////////////////////////////////////////////////////////
  22. // CS3RobotDlg dialog
  23. class CS3RobotDlg : public CDialog
  24. {
  25. // Construction
  26. public:
  27. CS3RobotDlg(CWnd* pParent = NULL); // standard constructor
  28. void PreProcess();
  29. void Process();
  30. void InitFuntionEntry();
  31. // Dialog Data
  32. //{{AFX_DATA(CS3RobotDlg)
  33. enum { IDD = IDD_S3ROBOT_DIALOG };
  34. CHyperLink m_ctrlCopyRight;
  35. CListCtrl m_ctlPlayerInfoList;
  36. CListCtrl m_ctlCurrentMsgList;
  37. CComboBox m_ctrlLoginServerComBox;
  38. BOOL m_bCheckPostionRandom;
  39. BOOL m_bCheckRepeatLastCmd;
  40. CString m_csAccountName;
  41. CString m_csPassword;
  42. int m_nPositionSkillID;
  43. int m_nPosition_x;
  44. int m_nPosition_y;
  45. CString m_csSpeakMessage;
  46. int m_nPlayerAction;
  47. int m_nPlayerLoginSelect;
  48. //}}AFX_DATA
  49. // ClassWizard generated virtual function overrides
  50. //{{AFX_VIRTUAL(CS3RobotDlg)
  51. protected:
  52. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  53. //}}AFX_VIRTUAL
  54. private:
  55. bool ( CS3RobotDlg::*ProcessArray[s2c_end])( const char *pMsg );
  56. void OnLogonSuccess();
  57. void OnWaitForLogon();
  58. inline void EnableCtrl( UINT nID, BOOL bEnable );
  59. void EnableInfoCtrl( BOOL bEnable = TRUE );
  60. void ChangeServer( int nPos );
  61. struct tagLoginInfo
  62. {
  63. char szAccountName[MAX_PATH];
  64. char szPassword[MAX_PATH];
  65. int nPlayerIndex;
  66. }m_theLoginInfo;
  67. CImageList *m_pImgLst_InfoNormalIcon;
  68. CImageList *m_pImgLst_InfoSmallIcon;
  69. UINT m_unAppTimer;
  70. bool m_bActiveLife;
  71. MMRESULT m_wGameTimerID;
  72. SERVER_MAP m_ServerAddrMap;
  73. string m_strServerAddr;
  74. /*
  75.  * some funtion of processed protocol
  76.  */
  77. bool ProcessPing( const char *pMsg );
  78. bool Syncrolelist( const char *pMsg );
  79. // Implementation
  80. protected:
  81. HICON m_hIcon;
  82. // Generated message map functions
  83. //{{AFX_MSG(CS3RobotDlg)
  84. virtual BOOL OnInitDialog();
  85. afx_msg void OnPaint();
  86. afx_msg HCURSOR OnQueryDragIcon();
  87. afx_msg void OnBtnSendCommand();
  88. afx_msg void OnBtnUseDefaultSctfile();
  89. virtual void OnOK();
  90. virtual void OnCancel();
  91. afx_msg void OnBtnSctiptfileLogin();
  92. afx_msg void OnRadioPlayerFirst();
  93. afx_msg void OnRadioPlayerSecond();
  94. afx_msg void OnRadioActionMove();
  95. afx_msg void OnRadioActionSkill();
  96. afx_msg void OnRadioActionSpeak();
  97. afx_msg void OnCheckPositionRandom();
  98. afx_msg void OnCheckRepeatLastcommand();
  99. afx_msg void OnDestroy();
  100. afx_msg void OnTimer(UINT nIDEvent);
  101. afx_msg void OnSelchangeCtrlLoginserver();
  102. //}}AFX_MSG
  103. afx_msg HRESULT OnConnectCreate( WPARAM wParam, LPARAM lParam );
  104. afx_msg HRESULT OnConnectClose( WPARAM wParam, LPARAM lParam );
  105. DECLARE_MESSAGE_MAP()
  106. };
  107. inline void CS3RobotDlg::EnableCtrl( UINT nID, BOOL bEnable )
  108. {
  109. CWnd *pWnd = NULL;
  110. pWnd = GetDlgItem( nID );
  111. if ( pWnd && ::IsWindow( pWnd->GetSafeHwnd() ) )
  112. {
  113. pWnd->EnableWindow( bEnable );
  114. }
  115. }
  116. //{{AFX_INSERT_LOCATION}}
  117. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  118. #endif // !defined(AFX_S3ROBOTDLG_H__7EFE14C3_D869_4410_ABD6_81B355BC4DFB__INCLUDED_)