MMP, Cancel fork, because i do not know how to merge to the original foreign author

This commit is contained in:
ubuntu
2018-06-26 11:28:43 +08:00
parent 1c0e49a137
commit 97635546ab
32 changed files with 8231 additions and 0 deletions

46
server/src/server.h Normal file
View File

@@ -0,0 +1,46 @@
#ifndef SERVER_H
#define SERVER_H
#include "netban.h"
#include "network.h"
class CServer
{
class CClient
{
public:
enum
{
STATE_EMPTY=0,
STATE_CONNECTED,
STATE_AUTHED,
};
int m_State;
int64 m_TimeConnected;
int64 m_LastReceived;
};
CClient m_aClients[NET_MAX_CLIENTS];
CNetwork m_Network;
CNetBan m_NetBan;
class CMain *m_pMain;
bool m_Ready;
static int NewClientCallback(int ClientID, void *pUser);
static int DelClientCallback(int ClientID, const char *pReason, void *pUser);
public:
int Init(CMain *pMain, const char *Bind, int Port);
void Update();
void Send(int ClientID, const char *pLine);
void Shutdown();
CNetwork *Network() { return &m_Network; }
CNetBan *NetBan() { return &m_NetBan; }
CMain *Main() { return m_pMain; }
};
#endif