DDraceNetwork Docs
IServer Class Referenceabstract

#include <server.h>

Inheritance diagram for IServer:
[legend]
Collaboration diagram for IServer:
[legend]

Classes

struct  CClientInfo
 

Public Types

enum  { RCON_CID_SERV = -1 , RCON_CID_VOTE = -2 }
 

Public Member Functions

int Tick () const
 
int TickSpeed () const
 
virtual int Port () const =0
 
virtual int MaxClients () const =0
 
virtual int ClientCount () const =0
 
virtual int DistinctClientCount () const =0
 
virtual const char * ClientName (int ClientId) const =0
 
virtual const char * ClientClan (int ClientId) const =0
 
virtual int ClientCountry (int ClientId) const =0
 
virtual bool ClientSlotEmpty (int ClientId) const =0
 
virtual bool ClientIngame (int ClientId) const =0
 
virtual bool GetClientInfo (int ClientId, CClientInfo *pInfo) const =0
 
virtual void SetClientDDNetVersion (int ClientId, int DDNetVersion)=0
 
virtual void GetClientAddr (int ClientId, char *pAddrStr, int Size) const =0
 
virtual int GetClientVersion (int ClientId) const =0
 
virtual int SendMsg (CMsgPacker *pMsg, int Flags, int ClientId)=0
 
template<class T , typename std::enable_if<!protocol7::is_sixup< T >::value, int >::type = 0>
int SendPackMsg (const T *pMsg, int Flags, int ClientId)
 
template<class T , typename std::enable_if< protocol7::is_sixup< T >::value, int >::type = 1>
int SendPackMsg (const T *pMsg, int Flags, int ClientId)
 
template<class T >
int SendPackMsgTranslate (const T *pMsg, int Flags, int ClientId)
 
int SendPackMsgTranslate (const CNetMsg_Sv_Emoticon *pMsg, int Flags, int ClientId)
 
int SendPackMsgTranslate (const CNetMsg_Sv_Chat *pMsg, int Flags, int ClientId)
 
int SendPackMsgTranslate (const CNetMsg_Sv_KillMsg *pMsg, int Flags, int ClientId)
 
int SendPackMsgTranslate (const CNetMsg_Sv_RaceFinish *pMsg, int Flags, int ClientId)
 
template<class T >
int SendPackMsgOne (const T *pMsg, int Flags, int ClientId)
 
bool Translate (int &Target, int Client)
 
bool ReverseTranslate (int &Target, int Client)
 
virtual void GetMapInfo (char *pMapName, int MapNameSize, int *pMapSize, SHA256_DIGEST *pSha256, int *pMapCrc)=0
 
virtual bool WouldClientNameChange (int ClientId, const char *pNameRequest)=0
 
virtual bool WouldClientClanChange (int ClientId, const char *pClanRequest)=0
 
virtual void SetClientName (int ClientId, const char *pName)=0
 
virtual void SetClientClan (int ClientId, const char *pClan)=0
 
virtual void SetClientCountry (int ClientId, int Country)=0
 
virtual void SetClientScore (int ClientId, std::optional< int > Score)=0
 
virtual void SetClientFlags (int ClientId, int Flags)=0
 
virtual int SnapNewId ()=0
 
virtual void SnapFreeId (int Id)=0
 
virtual void * SnapNewItem (int Type, int Id, int Size)=0
 
template<typename T >
T * SnapNewItem (int Id)
 
virtual void SnapSetStaticsize (int ItemType, int Size)=0
 
virtual void SetRconCid (int ClientId)=0
 
virtual int GetAuthedState (int ClientId) const =0
 
virtual const char * GetAuthName (int ClientId) const =0
 
virtual void Kick (int ClientId, const char *pReason)=0
 
virtual void Ban (int ClientId, int Seconds, const char *pReason, bool VerbatimReason)=0
 
virtual void RedirectClient (int ClientId, int Port, bool Verbose=false)=0
 
virtual void ChangeMap (const char *pMap)=0
 
virtual void ReloadMap ()=0
 
virtual void DemoRecorder_HandleAutoStart ()=0
 
virtual void SaveDemo (int ClientId, float Time)=0
 
virtual void StartRecord (int ClientId)=0
 
virtual void StopRecord (int ClientId)=0
 
virtual bool IsRecording (int ClientId)=0
 
virtual void StopDemos ()=0
 
virtual void GetClientAddr (int ClientId, NETADDR *pAddr) const =0
 
virtual int * GetIdMap (int ClientId)=0
 
virtual bool DnsblWhite (int ClientId)=0
 
virtual bool DnsblPending (int ClientId)=0
 
virtual bool DnsblBlack (int ClientId)=0
 
virtual const char * GetAnnouncementLine ()=0
 
virtual void ReadAnnouncementsFile (const char *pFileName)=0
 
virtual bool ClientPrevIngame (int ClientId)=0
 
virtual const char * GetNetErrorString (int ClientId)=0
 
virtual void ResetNetErrorString (int ClientId)=0
 
virtual bool SetTimedOut (int ClientId, int OrigId)=0
 
virtual void SetTimeoutProtected (int ClientId)=0
 
virtual void SetErrorShutdown (const char *pReason)=0
 
virtual void ExpireServerInfo ()=0
 
virtual void FillAntibot (CAntibotRoundData *pData)=0
 
virtual void SendMsgRaw (int ClientId, const void *pData, int Size, int Flags)=0
 
virtual const char * GetMapName () const =0
 
virtual bool IsSixup (int ClientId) const =0
 
- Public Member Functions inherited from IInterface
 IInterface ()
 
virtual void Shutdown ()
 
virtual ~IInterface ()
 

Static Public Member Functions

static const char * InterfaceName ()
 

Protected Attributes

int m_CurrentGameTick
 

Additional Inherited Members

- Protected Member Functions inherited from IInterface
IKernelKernel ()
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
RCON_CID_SERV 
RCON_CID_VOTE 

Member Function Documentation

◆ Ban()

virtual void IServer::Ban ( int  ClientId,
int  Seconds,
const char *  pReason,
bool  VerbatimReason 
)
pure virtual

Implemented in CServer.

◆ ChangeMap()

virtual void IServer::ChangeMap ( const char *  pMap)
pure virtual

Implemented in CServer.

◆ ClientClan()

virtual const char * IServer::ClientClan ( int  ClientId) const
pure virtual

Implemented in CServer.

◆ ClientCount()

virtual int IServer::ClientCount ( ) const
pure virtual

Implemented in CServer.

◆ ClientCountry()

virtual int IServer::ClientCountry ( int  ClientId) const
pure virtual

Implemented in CServer.

◆ ClientIngame()

virtual bool IServer::ClientIngame ( int  ClientId) const
pure virtual

Implemented in CServer.

◆ ClientName()

virtual const char * IServer::ClientName ( int  ClientId) const
pure virtual

Implemented in CServer.

◆ ClientPrevIngame()

virtual bool IServer::ClientPrevIngame ( int  ClientId)
pure virtual

Implemented in CServer.

◆ ClientSlotEmpty()

virtual bool IServer::ClientSlotEmpty ( int  ClientId) const
pure virtual

Implemented in CServer.

◆ DemoRecorder_HandleAutoStart()

virtual void IServer::DemoRecorder_HandleAutoStart ( )
pure virtual

Implemented in CServer.

◆ DistinctClientCount()

virtual int IServer::DistinctClientCount ( ) const
pure virtual

Implemented in CServer.

◆ DnsblBlack()

virtual bool IServer::DnsblBlack ( int  ClientId)
pure virtual

Implemented in CServer.

◆ DnsblPending()

virtual bool IServer::DnsblPending ( int  ClientId)
pure virtual

Implemented in CServer.

◆ DnsblWhite()

virtual bool IServer::DnsblWhite ( int  ClientId)
pure virtual

Implemented in CServer.

◆ ExpireServerInfo()

virtual void IServer::ExpireServerInfo ( )
pure virtual

Implemented in CServer.

◆ FillAntibot()

virtual void IServer::FillAntibot ( CAntibotRoundData pData)
pure virtual

Implemented in CServer.

◆ GetAnnouncementLine()

virtual const char * IServer::GetAnnouncementLine ( )
pure virtual

Implemented in CServer.

◆ GetAuthedState()

virtual int IServer::GetAuthedState ( int  ClientId) const
pure virtual

Implemented in CServer.

◆ GetAuthName()

virtual const char * IServer::GetAuthName ( int  ClientId) const
pure virtual

Implemented in CServer.

◆ GetClientAddr() [1/2]

virtual void IServer::GetClientAddr ( int  ClientId,
char *  pAddrStr,
int  Size 
) const
pure virtual

Implemented in CServer.

◆ GetClientAddr() [2/2]

virtual void IServer::GetClientAddr ( int  ClientId,
NETADDR pAddr 
) const
pure virtual

Implemented in CServer.

◆ GetClientInfo()

virtual bool IServer::GetClientInfo ( int  ClientId,
CClientInfo pInfo 
) const
pure virtual

Implemented in CServer.

◆ GetClientVersion()

virtual int IServer::GetClientVersion ( int  ClientId) const
pure virtual

Returns the version of the client with the given client ID.

Parameters
ClientIdthe client Id, which must be between 0 and MAX_CLIENTS - 1, or equal to SERVER_DEMO_CLIENT for server demos.
Returns
The version of the client with the given client ID. For server demos this is always the latest client version. On errors, VERSION_NONE is returned.

Implemented in CServer.

◆ GetIdMap()

virtual int * IServer::GetIdMap ( int  ClientId)
pure virtual

Implemented in CServer.

◆ GetMapInfo()

virtual void IServer::GetMapInfo ( char *  pMapName,
int  MapNameSize,
int *  pMapSize,
SHA256_DIGEST pSha256,
int *  pMapCrc 
)
pure virtual

Implemented in CServer.

◆ GetMapName()

virtual const char * IServer::GetMapName ( ) const
pure virtual

Implemented in CServer.

◆ GetNetErrorString()

virtual const char * IServer::GetNetErrorString ( int  ClientId)
pure virtual

Implemented in CServer.

◆ InterfaceName()

static const char * IServer::InterfaceName ( )
inlinestatic

◆ IsRecording()

virtual bool IServer::IsRecording ( int  ClientId)
pure virtual

Implemented in CServer.

◆ IsSixup()

virtual bool IServer::IsSixup ( int  ClientId) const
pure virtual

Implemented in CServer.

◆ Kick()

virtual void IServer::Kick ( int  ClientId,
const char *  pReason 
)
pure virtual

Implemented in CServer.

◆ MaxClients()

virtual int IServer::MaxClients ( ) const
pure virtual

Implemented in CServer.

◆ Port()

virtual int IServer::Port ( ) const
pure virtual

Implemented in CServer.

◆ ReadAnnouncementsFile()

virtual void IServer::ReadAnnouncementsFile ( const char *  pFileName)
pure virtual

Implemented in CServer.

◆ RedirectClient()

virtual void IServer::RedirectClient ( int  ClientId,
int  Port,
bool  Verbose = false 
)
pure virtual

Implemented in CServer.

◆ ReloadMap()

virtual void IServer::ReloadMap ( )
pure virtual

Implemented in CServer.

◆ ResetNetErrorString()

virtual void IServer::ResetNetErrorString ( int  ClientId)
pure virtual

Implemented in CServer.

◆ ReverseTranslate()

bool IServer::ReverseTranslate ( int &  Target,
int  Client 
)
inline

◆ SaveDemo()

virtual void IServer::SaveDemo ( int  ClientId,
float  Time 
)
pure virtual

Implemented in CServer.

◆ SendMsg()

virtual int IServer::SendMsg ( CMsgPacker pMsg,
int  Flags,
int  ClientId 
)
pure virtual

Implemented in CServer.

◆ SendMsgRaw()

virtual void IServer::SendMsgRaw ( int  ClientId,
const void *  pData,
int  Size,
int  Flags 
)
pure virtual

Implemented in CServer.

◆ SendPackMsg() [1/2]

template<class T , typename std::enable_if<!protocol7::is_sixup< T >::value, int >::type = 0>
int IServer::SendPackMsg ( const T *  pMsg,
int  Flags,
int  ClientId 
)
inline

◆ SendPackMsg() [2/2]

template<class T , typename std::enable_if< protocol7::is_sixup< T >::value, int >::type = 1>
int IServer::SendPackMsg ( const T *  pMsg,
int  Flags,
int  ClientId 
)
inline

◆ SendPackMsgOne()

template<class T >
int IServer::SendPackMsgOne ( const T *  pMsg,
int  Flags,
int  ClientId 
)
inline

◆ SendPackMsgTranslate() [1/5]

int IServer::SendPackMsgTranslate ( const CNetMsg_Sv_Chat pMsg,
int  Flags,
int  ClientId 
)
inline

◆ SendPackMsgTranslate() [2/5]

int IServer::SendPackMsgTranslate ( const CNetMsg_Sv_Emoticon pMsg,
int  Flags,
int  ClientId 
)
inline

◆ SendPackMsgTranslate() [3/5]

int IServer::SendPackMsgTranslate ( const CNetMsg_Sv_KillMsg pMsg,
int  Flags,
int  ClientId 
)
inline

◆ SendPackMsgTranslate() [4/5]

int IServer::SendPackMsgTranslate ( const CNetMsg_Sv_RaceFinish *  pMsg,
int  Flags,
int  ClientId 
)
inline

◆ SendPackMsgTranslate() [5/5]

template<class T >
int IServer::SendPackMsgTranslate ( const T *  pMsg,
int  Flags,
int  ClientId 
)
inline

◆ SetClientClan()

virtual void IServer::SetClientClan ( int  ClientId,
const char *  pClan 
)
pure virtual

Implemented in CServer.

◆ SetClientCountry()

virtual void IServer::SetClientCountry ( int  ClientId,
int  Country 
)
pure virtual

Implemented in CServer.

◆ SetClientDDNetVersion()

virtual void IServer::SetClientDDNetVersion ( int  ClientId,
int  DDNetVersion 
)
pure virtual

Implemented in CServer.

◆ SetClientFlags()

virtual void IServer::SetClientFlags ( int  ClientId,
int  Flags 
)
pure virtual

Implemented in CServer.

◆ SetClientName()

virtual void IServer::SetClientName ( int  ClientId,
const char *  pName 
)
pure virtual

Implemented in CServer.

◆ SetClientScore()

virtual void IServer::SetClientScore ( int  ClientId,
std::optional< int >  Score 
)
pure virtual

Implemented in CServer.

◆ SetErrorShutdown()

virtual void IServer::SetErrorShutdown ( const char *  pReason)
pure virtual

Implemented in CServer.

◆ SetRconCid()

virtual void IServer::SetRconCid ( int  ClientId)
pure virtual

Implemented in CServer.

◆ SetTimedOut()

virtual bool IServer::SetTimedOut ( int  ClientId,
int  OrigId 
)
pure virtual

Implemented in CServer.

◆ SetTimeoutProtected()

virtual void IServer::SetTimeoutProtected ( int  ClientId)
pure virtual

Implemented in CServer.

◆ SnapFreeId()

virtual void IServer::SnapFreeId ( int  Id)
pure virtual

Implemented in CServer.

◆ SnapNewId()

virtual int IServer::SnapNewId ( )
pure virtual

Implemented in CServer.

◆ SnapNewItem() [1/2]

template<typename T >
T * IServer::SnapNewItem ( int  Id)
inline

◆ SnapNewItem() [2/2]

virtual void * IServer::SnapNewItem ( int  Type,
int  Id,
int  Size 
)
pure virtual

Implemented in CServer.

◆ SnapSetStaticsize()

virtual void IServer::SnapSetStaticsize ( int  ItemType,
int  Size 
)
pure virtual

Implemented in CServer.

◆ StartRecord()

virtual void IServer::StartRecord ( int  ClientId)
pure virtual

Implemented in CServer.

◆ StopDemos()

virtual void IServer::StopDemos ( )
pure virtual

Implemented in CServer.

◆ StopRecord()

virtual void IServer::StopRecord ( int  ClientId)
pure virtual

Implemented in CServer.

◆ Tick()

int IServer::Tick ( ) const
inline

◆ TickSpeed()

int IServer::TickSpeed ( ) const
inline

◆ Translate()

bool IServer::Translate ( int &  Target,
int  Client 
)
inline

◆ WouldClientClanChange()

virtual bool IServer::WouldClientClanChange ( int  ClientId,
const char *  pClanRequest 
)
pure virtual

Implemented in CServer.

◆ WouldClientNameChange()

virtual bool IServer::WouldClientNameChange ( int  ClientId,
const char *  pNameRequest 
)
pure virtual

Implemented in CServer.

Member Data Documentation

◆ m_CurrentGameTick

int IServer::m_CurrentGameTick
protected

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