Global.cpp
上传用户:tt_chan
上传日期:2009-12-03
资源大小:4523k
文件大小:4k
源码类别:

模拟服务器

开发平台:

Visual C++

  1. #include "stdafx.h"
  2. // **************************************************************************************
  3. //
  4. // Global Variables Definition
  5. //
  6. // **************************************************************************************
  7. HINSTANCE g_hInst = NULL; // Application instance
  8. HWND g_hMainWnd = NULL; // Main window handle
  9. HWND g_hLogMsgWnd = NULL;
  10. HWND g_hToolBar = NULL;
  11. HWND g_hStatusBar = NULL;
  12. int g_nStatusPartsWidths[_NUMOFMAX_STATUS_PARTS] = { 10, 10, 10, -1 };
  13. TBBUTTON tbButtons[] = 
  14. {
  15. { 0, IDM_STARTSERVICE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
  16. { 1, IDM_STOPSERVICE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
  17. { 0, 0, 0, BTNS_SEP, 0L, 0},
  18. { 2, IDM_SETFONTCOLOR, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0},
  19. { 3, IDM_SETBKGCOLOR, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0L, 0}
  20. };
  21. CDatabase g_MirDB;
  22. CConnection *g_pConnCommon;
  23. CConnection *g_pConnGame;
  24. CWHList<char *> g_xAdminCommandList;
  25. CWHList<char *> g_xUserCommandList;
  26. CWHList<CEvent*> g_xEventList;
  27. CWHList<CEvent*> g_xEventCloseList;
  28. CWHList<CHolySeizeInfo*> g_xHolySeizeList;
  29. CWHList<CUserInfo*> g_xLoginOutUserInfo;
  30. CWHList<CReadyUserInfo*> g_xReadyUserInfoList;
  31. CWHList<CReadyUserInfo2*> g_xReadyUserInfoList2;
  32. CWHList<CMerchantObject*> g_xMerchantObjList;
  33. BOOL g_fInitMerchant = FALSE;
  34. CWHList<CNPCObject*> g_xNPCObjList;
  35. CWHList<CUserInfo*> g_xReadyList;
  36. CWHList<CGateInfo*> g_xGateList;
  37. CStaticArray<CUserInfo> g_xUserInfoArr( 10000 );
  38. CStaticArray<CPlayerObject> g_xPlayerObjectArr( 10000 );
  39. CWHList<CUserInfo*> g_xUserInfoList;
  40. int g_nMirDayTime = 1;
  41. // General Standard Data
  42. CWHList<CMirMap*> g_xMirMapList; // Map List
  43. CMoveMapEventInfo* g_pMoveMapEventInfo = NULL; // Map Event List
  44. int g_nNumOfMoveMapEventInfo = 0;
  45. CMagicInfo* g_pMagicInfo = NULL; // Magic List
  46. int g_nNumOfMagicInfo = 0;
  47. CMonsterGenInfo* g_pMonGenInfo = NULL; // Monster Gen List
  48. int g_nNumOfMonGenInfo = 0;
  49. CMonRaceInfo* g_pMonRaceInfo = NULL; // Monster List
  50. int g_nNumOfMonRaceInfo = 0;
  51. CStdItemSpecial* g_pStdItemSpecial = NULL; // Standard Item List
  52. int g_nStdItemSpecial = 0;
  53. CStdItem* g_pStdItemEtc = NULL; // Standard General Item list
  54. int g_nStdItemEtc = 0;
  55. CMerchantInfo* g_pMerchantInfo = NULL; // Merchant List
  56. int g_nNumOfMurchantInfo = 0;
  57. int g_nNumOfMapInfo;
  58. BOOL g_fTerminated = FALSE;
  59. SOCKET g_ssock = INVALID_SOCKET;
  60. SOCKADDR_IN g_saddr;
  61. SOCKET g_csock = INVALID_SOCKET;
  62. SOCKADDR_IN g_caddr;
  63. SOCKET g_clsock = INVALID_SOCKET;
  64. SOCKADDR_IN g_claddr;
  65. _TSEARCHTABLE g_SearchTable[_MAX_SEARCHTABLE];
  66. char g_szGoldName[8];
  67. DWORD NEEDEXPS[MAXLEVEL] = {
  68. 100, //1
  69. 200, //2
  70. 300, //3
  71. 400, //4
  72. 600, //5
  73. 900, //6
  74. 1200, //7
  75. 1700, //8
  76. 2500, //9
  77. 6000, //10
  78. 8000, //11
  79. 10000, //12
  80. 15000, //13
  81. 30000, //14
  82. 40000, //15
  83. 50000, //16
  84. 70000, //17
  85. 100000, //18
  86. 120000, //19
  87. 140000, //20
  88. 250000, //21
  89. 300000, //22
  90. 350000, //23
  91. 400000, //24
  92. 500000, //25
  93. 700000, //26
  94. 1000000, //27
  95. 1400000, //28
  96. 1800000, //29
  97. 2000000, //30
  98. 2400000, //31
  99. 2800000, //32
  100. 3200000, //33
  101. 3600000, //34
  102. 4000000, //35
  103. 4800000, //36
  104. 5600000, //37
  105. 8200000, //38
  106. 9000000, //39
  107. 12000000, //40
  108. 16000000, //41
  109. 30000000, //42
  110. 50000000, //43
  111. 80000000, //44
  112. 120000000, //45
  113. 480000000, //46
  114. 1000000000, //47
  115. 3000000000, //48
  116. 3500000000, //49
  117. 4000000000, //50
  118. 4000000000 //51
  119. };
  120. HANDLE g_hThreadForComm = NULL;
  121. HANDLE g_hSvrMsgEvnt = NULL;
  122. CWHList<CScripterObject*> g_xScripterList;