DDraceNetwork Docs
CNetServer Class Reference

#include <network.h>

Collaboration diagram for CNetServer:
[legend]

Classes

struct  CSlot
 
struct  CSpamConn
 

Public Member Functions

int SetCallbacks (NETFUNC_NEWCLIENT pfnNewClient, NETFUNC_DELCLIENT pfnDelClient, void *pUser)
 
int SetCallbacks (NETFUNC_NEWCLIENT pfnNewClient, NETFUNC_NEWCLIENT_NOAUTH pfnNewClientNoAuth, NETFUNC_CLIENTREJOIN pfnClientRejoin, NETFUNC_DELCLIENT pfnDelClient, void *pUser)
 
bool Open (NETADDR BindAddr, CNetBan *pNetBan, int MaxClients, int MaxClientsPerIp)
 
int Close ()
 
int Recv (CNetChunk *pChunk, SECURITY_TOKEN *pResponseToken)
 
int Send (CNetChunk *pChunk)
 
int Update ()
 
int Drop (int ClientId, const char *pReason)
 
const NETADDRClientAddr (int ClientId) const
 
const char(* ClientAddrString (int ClientID) const)[NETADDR_MAXSTRSIZE]
 
bool HasSecurityToken (int ClientId) const
 
NETADDR Address () const
 
NETSOCKET Socket () const
 
CNetBanNetBan () const
 
int NetType () const
 
int MaxClients () const
 
void SendTokenSixup (NETADDR &Addr, SECURITY_TOKEN Token)
 
int SendConnlessSixup (CNetChunk *pChunk, SECURITY_TOKEN ResponseToken)
 
void SetMaxClientsPerIp (int Max)
 
bool SetTimedOut (int ClientId, int OrigId)
 
void SetTimeoutProtected (int ClientId)
 
int ResetErrorString (int ClientId)
 
const char * ErrorString (int ClientId)
 
SECURITY_TOKEN GetGlobalToken ()
 
SECURITY_TOKEN GetToken (const NETADDR &Addr)
 
SECURITY_TOKEN GetVanillaToken (const NETADDR &Addr)
 

Private Member Functions

void OnTokenCtrlMsg (NETADDR &Addr, int ControlMsg, const CNetPacketConstruct &Packet)
 
int OnSixupCtrlMsg (NETADDR &Addr, CNetChunk *pChunk, int ControlMsg, const CNetPacketConstruct &Packet, SECURITY_TOKEN &ResponseToken, SECURITY_TOKEN Token)
 
void OnPreConnMsg (NETADDR &Addr, CNetPacketConstruct &Packet)
 
void OnConnCtrlMsg (NETADDR &Addr, int ClientId, int ControlMsg, const CNetPacketConstruct &Packet)
 
bool ClientExists (const NETADDR &Addr)
 
int GetClientSlot (const NETADDR &Addr)
 
void SendControl (NETADDR &Addr, int ControlMsg, const void *pExtra, int ExtraSize, SECURITY_TOKEN SecurityToken)
 
int TryAcceptClient (NETADDR &Addr, SECURITY_TOKEN SecurityToken, bool VanillaAuth=false, bool Sixup=false, SECURITY_TOKEN Token=0)
 
int NumClientsWithAddr (NETADDR Addr)
 
bool Connlimit (NETADDR Addr)
 
void SendMsgs (NETADDR &Addr, const CPacker **ppMsgs, int Num)
 

Private Attributes

NETADDR m_Address
 
NETSOCKET m_Socket
 
CNetBanm_pNetBan
 
CSlot m_aSlots [NET_MAX_CLIENTS]
 
int m_MaxClients
 
int m_MaxClientsPerIp
 
NETFUNC_NEWCLIENT m_pfnNewClient
 
NETFUNC_NEWCLIENT_NOAUTH m_pfnNewClientNoAuth
 
NETFUNC_DELCLIENT m_pfnDelClient
 
NETFUNC_CLIENTREJOIN m_pfnClientRejoin
 
void * m_pUser
 
int m_NumConAttempts
 
int64_t m_TimeNumConAttempts
 
unsigned char m_aSecurityTokenSeed [16]
 
int64_t m_VConnFirst
 
int m_VConnNum
 
CSpamConn m_aSpamConns [NET_CONNLIMIT_IPS]
 
CNetRecvUnpacker m_RecvUnpacker
 

Member Function Documentation

◆ Address()

NETADDR CNetServer::Address ( ) const
inline

◆ ClientAddr()

const NETADDR * CNetServer::ClientAddr ( int  ClientId) const
inline

◆ ClientAddrString()

const char(* CNetServer::ClientAddrString ( int  ClientID) )[NETADDR_MAXSTRSIZE]
inline

◆ ClientExists()

bool CNetServer::ClientExists ( const NETADDR Addr)
inlineprivate

◆ Close()

int CNetServer::Close ( )

◆ Connlimit()

bool CNetServer::Connlimit ( NETADDR  Addr)
private

◆ Drop()

int CNetServer::Drop ( int  ClientId,
const char *  pReason 
)

◆ ErrorString()

const char * CNetServer::ErrorString ( int  ClientId)

◆ GetClientSlot()

int CNetServer::GetClientSlot ( const NETADDR Addr)
private

◆ GetGlobalToken()

SECURITY_TOKEN CNetServer::GetGlobalToken ( )

◆ GetToken()

SECURITY_TOKEN CNetServer::GetToken ( const NETADDR Addr)

◆ GetVanillaToken()

SECURITY_TOKEN CNetServer::GetVanillaToken ( const NETADDR Addr)
inline

◆ HasSecurityToken()

bool CNetServer::HasSecurityToken ( int  ClientId) const
inline

◆ MaxClients()

int CNetServer::MaxClients ( ) const
inline

◆ NetBan()

CNetBan * CNetServer::NetBan ( ) const
inline

◆ NetType()

int CNetServer::NetType ( ) const
inline

◆ NumClientsWithAddr()

int CNetServer::NumClientsWithAddr ( NETADDR  Addr)
private

◆ OnConnCtrlMsg()

void CNetServer::OnConnCtrlMsg ( NETADDR Addr,
int  ClientId,
int  ControlMsg,
const CNetPacketConstruct Packet 
)
private

◆ OnPreConnMsg()

void CNetServer::OnPreConnMsg ( NETADDR Addr,
CNetPacketConstruct Packet 
)
private

◆ OnSixupCtrlMsg()

int CNetServer::OnSixupCtrlMsg ( NETADDR Addr,
CNetChunk pChunk,
int  ControlMsg,
const CNetPacketConstruct Packet,
SECURITY_TOKEN ResponseToken,
SECURITY_TOKEN  Token 
)
private

◆ OnTokenCtrlMsg()

void CNetServer::OnTokenCtrlMsg ( NETADDR Addr,
int  ControlMsg,
const CNetPacketConstruct Packet 
)
private

◆ Open()

bool CNetServer::Open ( NETADDR  BindAddr,
CNetBan pNetBan,
int  MaxClients,
int  MaxClientsPerIp 
)

◆ Recv()

int CNetServer::Recv ( CNetChunk pChunk,
SECURITY_TOKEN pResponseToken 
)

◆ ResetErrorString()

int CNetServer::ResetErrorString ( int  ClientId)

◆ Send()

int CNetServer::Send ( CNetChunk pChunk)

◆ SendConnlessSixup()

int CNetServer::SendConnlessSixup ( CNetChunk pChunk,
SECURITY_TOKEN  ResponseToken 
)

◆ SendControl()

void CNetServer::SendControl ( NETADDR Addr,
int  ControlMsg,
const void *  pExtra,
int  ExtraSize,
SECURITY_TOKEN  SecurityToken 
)
private

◆ SendMsgs()

void CNetServer::SendMsgs ( NETADDR Addr,
const CPacker **  ppMsgs,
int  Num 
)
private

◆ SendTokenSixup()

void CNetServer::SendTokenSixup ( NETADDR Addr,
SECURITY_TOKEN  Token 
)

◆ SetCallbacks() [1/2]

int CNetServer::SetCallbacks ( NETFUNC_NEWCLIENT  pfnNewClient,
NETFUNC_DELCLIENT  pfnDelClient,
void *  pUser 
)

◆ SetCallbacks() [2/2]

int CNetServer::SetCallbacks ( NETFUNC_NEWCLIENT  pfnNewClient,
NETFUNC_NEWCLIENT_NOAUTH  pfnNewClientNoAuth,
NETFUNC_CLIENTREJOIN  pfnClientRejoin,
NETFUNC_DELCLIENT  pfnDelClient,
void *  pUser 
)

◆ SetMaxClientsPerIp()

void CNetServer::SetMaxClientsPerIp ( int  Max)

◆ SetTimedOut()

bool CNetServer::SetTimedOut ( int  ClientId,
int  OrigId 
)

◆ SetTimeoutProtected()

void CNetServer::SetTimeoutProtected ( int  ClientId)

◆ Socket()

NETSOCKET CNetServer::Socket ( ) const
inline

◆ TryAcceptClient()

int CNetServer::TryAcceptClient ( NETADDR Addr,
SECURITY_TOKEN  SecurityToken,
bool  VanillaAuth = false,
bool  Sixup = false,
SECURITY_TOKEN  Token = 0 
)
private

◆ Update()

int CNetServer::Update ( )

Member Data Documentation

◆ m_Address

NETADDR CNetServer::m_Address
private

◆ m_aSecurityTokenSeed

unsigned char CNetServer::m_aSecurityTokenSeed[16]
private

◆ m_aSlots

CSlot CNetServer::m_aSlots[NET_MAX_CLIENTS]
private

◆ m_aSpamConns

CSpamConn CNetServer::m_aSpamConns[NET_CONNLIMIT_IPS]
private

◆ m_MaxClients

int CNetServer::m_MaxClients
private

◆ m_MaxClientsPerIp

int CNetServer::m_MaxClientsPerIp
private

◆ m_NumConAttempts

int CNetServer::m_NumConAttempts
private

◆ m_pfnClientRejoin

NETFUNC_CLIENTREJOIN CNetServer::m_pfnClientRejoin
private

◆ m_pfnDelClient

NETFUNC_DELCLIENT CNetServer::m_pfnDelClient
private

◆ m_pfnNewClient

NETFUNC_NEWCLIENT CNetServer::m_pfnNewClient
private

◆ m_pfnNewClientNoAuth

NETFUNC_NEWCLIENT_NOAUTH CNetServer::m_pfnNewClientNoAuth
private

◆ m_pNetBan

CNetBan* CNetServer::m_pNetBan
private

◆ m_pUser

void* CNetServer::m_pUser
private

◆ m_RecvUnpacker

CNetRecvUnpacker CNetServer::m_RecvUnpacker
private

◆ m_Socket

NETSOCKET CNetServer::m_Socket
private

◆ m_TimeNumConAttempts

int64_t CNetServer::m_TimeNumConAttempts
private

◆ m_VConnFirst

int64_t CNetServer::m_VConnFirst
private

◆ m_VConnNum

int CNetServer::m_VConnNum
private

The documentation for this class was generated from the following files: