MCPcopy Create free account
hub / github.com/cppla/ServerStatus / CServer

Class CServer

server/src/server.h:7–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include "network.h"
6
7class CServer
8{
9 class CClient
10 {
11 public:
12 enum
13 {
14 STATE_EMPTY=0,
15 STATE_CONNECTED,
16 STATE_AUTHED,
17 };
18
19 int m_State;
20 int64 m_TimeConnected;
21 int64 m_LastReceived;
22 };
23 CClient m_aClients[NET_MAX_CLIENTS];
24
25 CNetwork m_Network;
26 CNetBan m_NetBan;
27
28 class CMain *m_pMain;
29
30 bool m_Ready;
31
32 static int NewClientCallback(int ClientID, void *pUser);
33 static int DelClientCallback(int ClientID, const char *pReason, void *pUser);
34
35public:
36 int Init(CMain *pMain, const char *Bind, int Port);
37 void Update();
38 void Send(int ClientID, const char *pLine);
39 void Shutdown();
40
41 CNetwork *Network() { return &m_Network; }
42 CNetBan *NetBan() { return &m_NetBan; }
43 CMain *Main() { return m_pMain; }
44};
45
46#endif

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected