doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
idAsyncServer Class Reference

#include <AsyncServer.h>

Public Member Functions

 idAsyncServer ()
 
bool InitPort (void)
 
void ClosePort (void)
 
void Spawn (void)
 
void Kill (void)
 
void ExecuteMapChange (void)
 
int GetPort (void) const
 
netadr_t GetBoundAdr (void) const
 
bool IsActive (void) const
 
int GetDelay (void) const
 
int GetOutgoingRate (void) const
 
int GetIncomingRate (void) const
 
bool IsClientInGame (int clientNum) const
 
int GetClientPing (int clientNum) const
 
int GetClientPrediction (int clientNum) const
 
int GetClientTimeSinceLastPacket (int clientNum) const
 
int GetClientTimeSinceLastInput (int clientNum) const
 
int GetClientOutgoingRate (int clientNum) const
 
int GetClientIncomingRate (int clientNum) const
 
float GetClientOutgoingCompression (int clientNum) const
 
float GetClientIncomingCompression (int clientNum) const
 
float GetClientIncomingPacketLoss (int clientNum) const
 
int GetNumClients (void) const
 
int GetNumIdleClients (void) const
 
int GetLocalClientNum (void) const
 
void RunFrame (void)
 
void ProcessConnectionLessMessages (void)
 
void RemoteConsoleOutput (const char *string)
 
void SendReliableGameMessage (int clientNum, const idBitMsg &msg)
 
void SendReliableGameMessageExcluding (int clientNum, const idBitMsg &msg)
 
void LocalClientSendReliableMessage (const idBitMsg &msg)
 
void MasterHeartbeat (bool force=false)
 
void DropClient (int clientNum, const char *reason)
 
void PacifierUpdate (void)
 
void UpdateUI (int clientNum)
 
void UpdateAsyncStatsAvg (void)
 
void GetAsyncStatsAvgMsg (idStr &msg)
 
void PrintLocalServerInfo (void)
 

Private Member Functions

void PrintOOB (const netadr_t to, int opcode, const char *string)
 
void DuplicateUsercmds (int frame, int time)
 
void ClearClient (int clientNum)
 
void InitClient (int clientNum, int clientId, int clientRate)
 
void InitLocalClient (int clientNum)
 
void BeginLocalClient (void)
 
void LocalClientInput (void)
 
void CheckClientTimeouts (void)
 
void SendPrintBroadcast (const char *string)
 
void SendPrintToClient (int clientNum, const char *string)
 
void SendUserInfoBroadcast (int userInfoNum, const idDict &info, bool sendToAll=false)
 
void SendUserInfoToClient (int clientNum, int userInfoNum, const idDict &info)
 
void SendSyncedCvarsBroadcast (const idDict &cvars)
 
void SendSyncedCvarsToClient (int clientNum, const idDict &cvars)
 
void SendApplySnapshotToClient (int clientNum, int sequence)
 
bool SendEmptyToClient (int clientNum, bool force=false)
 
bool SendPingToClient (int clientNum)
 
void SendGameInitToClient (int clientNum)
 
bool SendSnapshotToClient (int clientNum)
 
void ProcessUnreliableClientMessage (int clientNum, const idBitMsg &msg)
 
void ProcessReliableClientMessages (int clientNum)
 
void ProcessChallengeMessage (const netadr_t from, const idBitMsg &msg)
 
void ProcessConnectMessage (const netadr_t from, const idBitMsg &msg)
 
void ProcessRemoteConsoleMessage (const netadr_t from, const idBitMsg &msg)
 
void ProcessGetInfoMessage (const netadr_t from, const idBitMsg &msg)
 
bool ConnectionlessMessage (const netadr_t from, const idBitMsg &msg)
 
bool ProcessMessage (const netadr_t from, idBitMsg &msg)
 
void ProcessAuthMessage (const idBitMsg &msg)
 
bool SendPureServerMessage (const netadr_t to, int OS)
 
void ProcessPureMessage (const netadr_t from, const idBitMsg &msg)
 
int ValidateChallenge (const netadr_t from, int challenge, int clientId)
 
bool SendReliablePureToClient (int clientNum)
 
void ProcessReliablePure (int clientNum, const idBitMsg &msg)
 
bool VerifyChecksumMessage (int clientNum, const netadr_t *from, const idBitMsg &msg, idStr &reply, int OS)
 
void SendReliableMessage (int clientNum, const idBitMsg &msg)
 
int UpdateTime (int clamp)
 
void SendEnterGameToClient (int clientNum)
 
void ProcessDownloadRequestMessage (const netadr_t from, const idBitMsg &msg)
 

Private Attributes

bool active
 
int realTime
 
int serverTime
 
idPort serverPort
 
int serverId
 
int serverDataChecksum
 
int localClientNum
 
challenge_t challenges [MAX_CHALLENGES]
 
serverClient_t clients [MAX_ASYNC_CLIENTS]
 
usercmd_t userCmds [MAX_USERCMD_BACKUP][MAX_ASYNC_CLIENTS]
 
int gameInitId
 
int gameFrame
 
int gameTime
 
int gameTimeResidual
 
netadr_t rconAddress
 
int nextHeartbeatTime
 
int nextAsyncStatsTime
 
bool serverReloadingEngine
 
bool noRconOutput
 
int lastAuthTime
 
int stats_outrate [stats_numsamples]
 
int stats_current
 
int stats_average_sum
 
int stats_max
 
int stats_max_index
 

Static Private Attributes

static const int stats_numsamples = 60
 

Detailed Description

Definition at line 131 of file AsyncServer.h.

Constructor & Destructor Documentation

idAsyncServer::idAsyncServer ( void  )

Definition at line 69 of file AsyncServer.cpp.

Member Function Documentation

void idAsyncServer::BeginLocalClient ( void  )
private

Definition at line 723 of file AsyncServer.cpp.

void idAsyncServer::CheckClientTimeouts ( void  )
private

Definition at line 812 of file AsyncServer.cpp.

void idAsyncServer::ClearClient ( int  clientNum)
private

Definition at line 636 of file AsyncServer.cpp.

void idAsyncServer::ClosePort ( void  )

Definition at line 137 of file AsyncServer.cpp.

bool idAsyncServer::ConnectionlessMessage ( const netadr_t  from,
const idBitMsg msg 
)
private

Definition at line 2132 of file AsyncServer.cpp.

void idAsyncServer::DropClient ( int  clientNum,
const char *  reason 
)

Definition at line 758 of file AsyncServer.cpp.

void idAsyncServer::DuplicateUsercmds ( int  frame,
int  time 
)
private

Definition at line 613 of file AsyncServer.cpp.

void idAsyncServer::ExecuteMapChange ( void  )

Definition at line 243 of file AsyncServer.cpp.

void idAsyncServer::GetAsyncStatsAvgMsg ( idStr msg)

Definition at line 2665 of file AsyncServer.cpp.

netadr_t idAsyncServer::GetBoundAdr ( void  ) const

Definition at line 390 of file AsyncServer.cpp.

float idAsyncServer::GetClientIncomingCompression ( int  clientNum) const

Definition at line 551 of file AsyncServer.cpp.

float idAsyncServer::GetClientIncomingPacketLoss ( int  clientNum) const

Definition at line 566 of file AsyncServer.cpp.

int idAsyncServer::GetClientIncomingRate ( int  clientNum) const

Definition at line 521 of file AsyncServer.cpp.

float idAsyncServer::GetClientOutgoingCompression ( int  clientNum) const

Definition at line 536 of file AsyncServer.cpp.

int idAsyncServer::GetClientOutgoingRate ( int  clientNum) const

Definition at line 506 of file AsyncServer.cpp.

int idAsyncServer::GetClientPing ( int  clientNum) const

Definition at line 446 of file AsyncServer.cpp.

int idAsyncServer::GetClientPrediction ( int  clientNum) const

Definition at line 461 of file AsyncServer.cpp.

int idAsyncServer::GetClientTimeSinceLastInput ( int  clientNum) const

Definition at line 491 of file AsyncServer.cpp.

int idAsyncServer::GetClientTimeSinceLastPacket ( int  clientNum) const

Definition at line 476 of file AsyncServer.cpp.

int idAsyncServer::GetDelay ( void  ) const
inline

Definition at line 144 of file AsyncServer.h.

int idAsyncServer::GetIncomingRate ( void  ) const

Definition at line 418 of file AsyncServer.cpp.

int idAsyncServer::GetLocalClientNum ( void  ) const
inline

Definition at line 159 of file AsyncServer.h.

int idAsyncServer::GetNumClients ( void  ) const

Definition at line 581 of file AsyncServer.cpp.

int idAsyncServer::GetNumIdleClients ( void  ) const

Definition at line 596 of file AsyncServer.cpp.

int idAsyncServer::GetOutgoingRate ( void  ) const

Definition at line 399 of file AsyncServer.cpp.

int idAsyncServer::GetPort ( void  ) const

Definition at line 381 of file AsyncServer.cpp.

void idAsyncServer::InitClient ( int  clientNum,
int  clientId,
int  clientRate 
)
private

Definition at line 664 of file AsyncServer.cpp.

void idAsyncServer::InitLocalClient ( int  clientNum)
private

Definition at line 706 of file AsyncServer.cpp.

bool idAsyncServer::InitPort ( void  )

Definition at line 105 of file AsyncServer.cpp.

bool idAsyncServer::IsActive ( void  ) const
inline

Definition at line 143 of file AsyncServer.h.

bool idAsyncServer::IsClientInGame ( int  clientNum) const

Definition at line 437 of file AsyncServer.cpp.

void idAsyncServer::Kill ( void  )

Definition at line 203 of file AsyncServer.cpp.

void idAsyncServer::LocalClientInput ( void  )
private

Definition at line 734 of file AsyncServer.cpp.

void idAsyncServer::LocalClientSendReliableMessage ( const idBitMsg msg)

Definition at line 2319 of file AsyncServer.cpp.

void idAsyncServer::MasterHeartbeat ( bool  force = false)

Definition at line 2591 of file AsyncServer.cpp.

void idAsyncServer::PacifierUpdate ( void  )

Definition at line 2550 of file AsyncServer.cpp.

void idAsyncServer::PrintLocalServerInfo ( void  )

Definition at line 2106 of file AsyncServer.cpp.

void idAsyncServer::PrintOOB ( const netadr_t  to,
int  opcode,
const char *  string 
)
private

Definition at line 2574 of file AsyncServer.cpp.

void idAsyncServer::ProcessAuthMessage ( const idBitMsg msg)
private

Definition at line 1398 of file AsyncServer.cpp.

void idAsyncServer::ProcessChallengeMessage ( const netadr_t  from,
const idBitMsg msg 
)
private

Definition at line 1484 of file AsyncServer.cpp.

void idAsyncServer::ProcessConnectionLessMessages ( void  )

Definition at line 2332 of file AsyncServer.cpp.

void idAsyncServer::ProcessConnectMessage ( const netadr_t  from,
const idBitMsg msg 
)
private

Definition at line 1673 of file AsyncServer.cpp.

void idAsyncServer::ProcessDownloadRequestMessage ( const netadr_t  from,
const idBitMsg msg 
)
private

Definition at line 2674 of file AsyncServer.cpp.

void idAsyncServer::ProcessGetInfoMessage ( const netadr_t  from,
const idBitMsg msg 
)
private

Definition at line 2062 of file AsyncServer.cpp.

bool idAsyncServer::ProcessMessage ( const netadr_t  from,
idBitMsg msg 
)
private

Definition at line 2198 of file AsyncServer.cpp.

void idAsyncServer::ProcessPureMessage ( const netadr_t  from,
const idBitMsg msg 
)
private

Definition at line 1938 of file AsyncServer.cpp.

void idAsyncServer::ProcessReliableClientMessages ( int  clientNum)
private

Definition at line 1351 of file AsyncServer.cpp.

void idAsyncServer::ProcessReliablePure ( int  clientNum,
const idBitMsg msg 
)
private

Definition at line 1968 of file AsyncServer.cpp.

void idAsyncServer::ProcessRemoteConsoleMessage ( const netadr_t  from,
const idBitMsg msg 
)
private

Definition at line 2023 of file AsyncServer.cpp.

void idAsyncServer::ProcessUnreliableClientMessage ( int  clientNum,
const idBitMsg msg 
)
private

Definition at line 1224 of file AsyncServer.cpp.

void idAsyncServer::RemoteConsoleOutput ( const char *  string)

Definition at line 2004 of file AsyncServer.cpp.

void idAsyncServer::RunFrame ( void  )

Definition at line 2373 of file AsyncServer.cpp.

void idAsyncServer::SendApplySnapshotToClient ( int  clientNum,
int  sequence 
)
private

Definition at line 1036 of file AsyncServer.cpp.

bool idAsyncServer::SendEmptyToClient ( int  clientNum,
bool  force = false 
)
private

Definition at line 1052 of file AsyncServer.cpp.

void idAsyncServer::SendEnterGameToClient ( int  clientNum)
private

Definition at line 2625 of file AsyncServer.cpp.

void idAsyncServer::SendGameInitToClient ( int  clientNum)
private

Definition at line 1121 of file AsyncServer.cpp.

bool idAsyncServer::SendPingToClient ( int  clientNum)
private

Definition at line 1086 of file AsyncServer.cpp.

void idAsyncServer::SendPrintBroadcast ( const char *  string)
private

Definition at line 848 of file AsyncServer.cpp.

void idAsyncServer::SendPrintToClient ( int  clientNum,
const char *  string 
)
private

Definition at line 869 of file AsyncServer.cpp.

bool idAsyncServer::SendPureServerMessage ( const netadr_t  to,
int  OS 
)
private

Definition at line 1560 of file AsyncServer.cpp.

void idAsyncServer::SendReliableGameMessage ( int  clientNum,
const idBitMsg msg 
)

Definition at line 2263 of file AsyncServer.cpp.

void idAsyncServer::SendReliableGameMessageExcluding ( int  clientNum,
const idBitMsg msg 
)

Definition at line 2292 of file AsyncServer.cpp.

void idAsyncServer::SendReliableMessage ( int  clientNum,
const idBitMsg msg 
)
private

Definition at line 797 of file AsyncServer.cpp.

bool idAsyncServer::SendReliablePureToClient ( int  clientNum)
private

Definition at line 1598 of file AsyncServer.cpp.

bool idAsyncServer::SendSnapshotToClient ( int  clientNum)
private

Definition at line 1150 of file AsyncServer.cpp.

void idAsyncServer::SendSyncedCvarsBroadcast ( const idDict cvars)
private

Definition at line 993 of file AsyncServer.cpp.

void idAsyncServer::SendSyncedCvarsToClient ( int  clientNum,
const idDict cvars 
)
private

Definition at line 1016 of file AsyncServer.cpp.

void idAsyncServer::SendUserInfoBroadcast ( int  userInfoNum,
const idDict info,
bool  sendToAll = false 
)
private

Definition at line 891 of file AsyncServer.cpp.

void idAsyncServer::SendUserInfoToClient ( int  clientNum,
int  userInfoNum,
const idDict info 
)
private

Definition at line 965 of file AsyncServer.cpp.

void idAsyncServer::Spawn ( void  )

Definition at line 151 of file AsyncServer.cpp.

void idAsyncServer::UpdateAsyncStatsAvg ( void  )

Definition at line 2639 of file AsyncServer.cpp.

int idAsyncServer::UpdateTime ( int  clamp)
private

Definition at line 2358 of file AsyncServer.cpp.

void idAsyncServer::UpdateUI ( int  clientNum)

Definition at line 949 of file AsyncServer.cpp.

int idAsyncServer::ValidateChallenge ( const netadr_t  from,
int  challenge,
int  clientId 
)
private

Definition at line 1636 of file AsyncServer.cpp.

bool idAsyncServer::VerifyChecksumMessage ( int  clientNum,
const netadr_t from,
const idBitMsg msg,
idStr reply,
int  OS 
)
private

Definition at line 1885 of file AsyncServer.cpp.

Member Data Documentation

bool idAsyncServer::active
private

Definition at line 181 of file AsyncServer.h.

challenge_t idAsyncServer::challenges[MAX_CHALLENGES]
private

Definition at line 190 of file AsyncServer.h.

serverClient_t idAsyncServer::clients[MAX_ASYNC_CLIENTS]
private

Definition at line 191 of file AsyncServer.h.

int idAsyncServer::gameFrame
private

Definition at line 195 of file AsyncServer.h.

int idAsyncServer::gameInitId
private

Definition at line 194 of file AsyncServer.h.

int idAsyncServer::gameTime
private

Definition at line 196 of file AsyncServer.h.

int idAsyncServer::gameTimeResidual
private

Definition at line 197 of file AsyncServer.h.

int idAsyncServer::lastAuthTime
private

Definition at line 208 of file AsyncServer.h.

int idAsyncServer::localClientNum
private

Definition at line 188 of file AsyncServer.h.

int idAsyncServer::nextAsyncStatsTime
private

Definition at line 202 of file AsyncServer.h.

int idAsyncServer::nextHeartbeatTime
private

Definition at line 201 of file AsyncServer.h.

bool idAsyncServer::noRconOutput
private

Definition at line 206 of file AsyncServer.h.

netadr_t idAsyncServer::rconAddress
private

Definition at line 199 of file AsyncServer.h.

int idAsyncServer::realTime
private

Definition at line 182 of file AsyncServer.h.

int idAsyncServer::serverDataChecksum
private

Definition at line 187 of file AsyncServer.h.

int idAsyncServer::serverId
private

Definition at line 186 of file AsyncServer.h.

idPort idAsyncServer::serverPort
private

Definition at line 185 of file AsyncServer.h.

bool idAsyncServer::serverReloadingEngine
private

Definition at line 204 of file AsyncServer.h.

int idAsyncServer::serverTime
private

Definition at line 184 of file AsyncServer.h.

int idAsyncServer::stats_average_sum
private

Definition at line 215 of file AsyncServer.h.

int idAsyncServer::stats_current
private

Definition at line 214 of file AsyncServer.h.

int idAsyncServer::stats_max
private

Definition at line 216 of file AsyncServer.h.

int idAsyncServer::stats_max_index
private

Definition at line 217 of file AsyncServer.h.

const int idAsyncServer::stats_numsamples = 60
staticprivate

Definition at line 212 of file AsyncServer.h.

int idAsyncServer::stats_outrate[stats_numsamples]
private

Definition at line 213 of file AsyncServer.h.

usercmd_t idAsyncServer::userCmds[MAX_USERCMD_BACKUP][MAX_ASYNC_CLIENTS]
private

Definition at line 192 of file AsyncServer.h.


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