-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathServerManager.h
executable file
·87 lines (65 loc) · 2.42 KB
/
ServerManager.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//
//---------------------------------------------------------------------------
#ifndef ServerManagerH
#define ServerManagerH
//---------------------------------------------------------------------------
class ServerThread;
//---------------------------------------------------------------------------
class clsServerManager {
public:
#ifdef _WIN32
static void OnSecTimer();
static void OnRegTimer();
#endif
static void Initialize();
static void FinalStop(const bool &bDeleteServiceLoop);
static void ResumeAccepts();
static void SuspendAccepts(const uint32_t &iTime);
static void UpdateAutoRegState();
static bool Start();
static void UpdateServers();
static void Stop();
static void FinalClose();
static void CreateServerThread(const int &iAddrFamily, const uint16_t &ui16PortNumber, const bool &bResume = false);
static string sPath, sScriptPath, sTitle;
#ifdef _WIN32
static string sLuaPath, sOS;
#endif
static size_t szGlobalBufferSize;
static char * sGlobalBuffer;
#ifdef _WIN32
static HANDLE hConsole, hLuaHeap, hLibHeap, hRecvHeap, hSendHeap;
#endif
static double daCpuUsage[60], dCpuUsage;
static uint64_t ui64ActualTick, ui64TotalShare;
static uint64_t ui64BytesRead, ui64BytesSent, ui64BytesSentSaved;
static uint64_t ui64LastBytesRead, ui64LastBytesSent;
static uint64_t ui64Mins, ui64Hours, ui64Days;
#ifndef _WIN32
static uint32_t ui32CpuCount;
#endif
static uint32_t ui32Joins, ui32Parts, ui32Logged, ui32Peak;
static uint32_t ui32aUploadSpeed[60], ui32aDownloadSpeed[60];
static uint32_t ui32ActualBytesRead, ui32ActualBytesSent;
static uint32_t ui32AverageBytesRead, ui32AverageBytesSent;
static ServerThread * ServersS;
static time_t tStartTime;
static bool bServerRunning, bServerTerminated, bIsRestart, bIsClose;
#ifdef _WIN32
static UINT_PTR sectimer;
static UINT_PTR regtimer;
#ifndef _BUILD_GUI
static bool bService;
#else
static HINSTANCE hInstance;
static HWND hWndActiveDialog;
#endif
#else
static bool bDaemon;
#endif
static bool bCmdAutoStart, bCmdNoAutoStart, bCmdNoTray, bUseIPv4, bUseIPv6, bIPv6DualStack;
static char sHubIP[16], sHubIP6[46];
static uint8_t ui8SrCntr, ui8MinTick;
};
//---------------------------------------------------------------------------
#endif