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

模拟服务器

开发平台:

C/C++

  1. /********************************************************************
  2. created: 2003/05/30
  3. file base: Application
  4. file ext: h
  5. author: liupeng
  6. purpose:
  7. *********************************************************************/
  8. #ifndef __INCLUDE_APPLICATION_H__
  9. #define __INCLUDE_APPLICATION_H__
  10. #include "mutex.h"
  11. #include "Network.h"
  12. #include "Intercessor.h"
  13. class CBishopApp
  14. {
  15. public:
  16. CBishopApp();
  17. CBishopApp( HINSTANCE hInstance );
  18. virtual ~CBishopApp();
  19. int Run();
  20. protected:
  21. /*
  22.  * Login dialog
  23.  */
  24. bool LoginSystem();
  25. static BOOL CALLBACK LoginDlgProc( HWND hwndDlg,
  26. UINT message, 
  27. WPARAM wParam, 
  28. LPARAM lParam );
  29. static void EnterToAffirm( HWND hwndDlg );
  30. static void LeaveToAffirm( HWND hwndDlg );
  31. static bool CheckUserInfo( HWND hwndDlg );
  32. static DWORD WINAPI ServerLoginRoutine( HWND hwndDlg );
  33. static void SendAnnounceText( HWND hwndDlg, const char *pText, UINT uLength, UINT uOption, BOOL bAllGS );
  34. static void EnableGameSvrCtrl( HWND hwndDlg, BOOL nEnable );
  35. static void EnableCtrl( HWND hwndDlg, UINT nCtrlID, BOOL nEnable );
  36. /*
  37.  * Main dialog
  38.  */
  39. BOOL RegisterMainWndClass();
  40. UINT MainDialog();
  41. static BOOL CALLBACK MainWndProc( HWND hwnd, 
  42.                            UINT msg,
  43.                            WPARAM wParam,
  44.                            LPARAM lParam );
  45. static void InitMainDlg( HWND hDlg );
  46. static void CloseMainDlg( HWND hDlg );
  47. static void UpdateVariable( HWND hDlg );
  48. private:
  49. static void AddGameServerInfo( HWND hDlg, UINT nID, const char *pInfo );
  50. static void DelGameServerInfo( HWND hDlg, UINT nID );
  51. enum enumServerLoginErrorCode
  52. {
  53. enumConnectFailed = 0xA1,
  54. enumUsrNamePswdErr,
  55. enumIPPortErr,
  56. enumException
  57. };
  58. OnlineGameLib::Win32::CMutex m_theOnlyOneInstance;
  59. static HINSTANCE  m_hInst;
  60. static CNetwork  m_theNetwork;
  61. static CIntercessor  *m_pIntercessor;
  62. };
  63. #endif // __INCLUDE_APPLICATION_H__