DDraceNetwork Docs
client.cpp File Reference
#include <base/hash.h>
#include <base/hash_ctxt.h>
#include <base/log.h>
#include <base/logger.h>
#include <base/math.h>
#include <base/system.h>
#include <engine/external/json-parser/json.h>
#include <engine/config.h>
#include <engine/console.h>
#include <engine/discord.h>
#include <engine/editor.h>
#include <engine/engine.h>
#include <engine/favorites.h>
#include <engine/graphics.h>
#include <engine/input.h>
#include <engine/keys.h>
#include <engine/map.h>
#include <engine/serverbrowser.h>
#include <engine/sound.h>
#include <engine/steam.h>
#include <engine/storage.h>
#include <engine/textrender.h>
#include <engine/shared/assertion_logger.h>
#include <engine/shared/compression.h>
#include <engine/shared/config.h>
#include <engine/shared/demo.h>
#include <engine/shared/fifo.h>
#include <engine/shared/filecollection.h>
#include <engine/shared/http.h>
#include <engine/shared/masterserver.h>
#include <engine/shared/network.h>
#include <engine/shared/packer.h>
#include <engine/shared/protocol.h>
#include <engine/shared/protocol7.h>
#include <engine/shared/protocol_ex.h>
#include <engine/shared/rust_version.h>
#include <engine/shared/snapshot.h>
#include <engine/shared/uuid_manager.h>
#include <game/generated/protocol.h>
#include <game/generated/protocol7.h>
#include <game/generated/protocolglue.h>
#include <engine/shared/protocolglue.h>
#include <game/localization.h>
#include <game/version.h>
#include "client.h"
#include "demoedit.h"
#include "friends.h"
#include "notifications.h"
#include "serverbrowser.h"
#include "video.h"
#include "SDL.h"
#include <chrono>
#include <limits>
#include <new>
#include <stack>
#include <thread>
#include <tuple>
#include <engine/shared/config_variables.h>

Macros

#define GET_STRING(array)   str_copy(array, Up.GetString(CUnpacker::SANITIZE_CC | CUnpacker::SKIP_START_WHITESPACES), sizeof(array))
 
#define GET_INT(integer)   (integer) = str_toint(Up.GetString())
 
#define DDNET_CHECKSUM_SALT
 
#define CHECKSUM_RECORD(Flags)   (((Flags)&CFGFLAG_CLIENT) == 0 || ((Flags)&CFGFLAG_INSENSITIVE) != 0)
 
#define MACRO_CONFIG_INT(Name, ScriptName, Def, Min, Max, Flags, Desc)
 
#define MACRO_CONFIG_COL(Name, ScriptName, Def, Flags, Desc)
 
#define MACRO_CONFIG_STR(Name, ScriptName, Len, Def, Flags, Desc)
 

Typedefs

typedef std::tuple< int, int, int > TVersion
 

Functions

static bool RepackMsg (const CMsgPacker *pMsg, CPacker &Packer, bool Sixup)
 
void GenerateTimeoutCode (char *pBuffer, unsigned Size, char *pSeed, const NETADDR *pAddrs, int NumAddrs, bool Dummy)
 
static void FormatMapDownloadFilename (const char *pName, const SHA256_DIGEST *pSha256, int Crc, bool Temp, char *pBuffer, int BufferSize)
 
static int SavedServerInfoType (int Type)
 
static CServerCapabilities GetServerCapabilities (int Version, int Flags, bool Sixup)
 
TVersion ToVersion (char *pStr)
 
static CClientCreateClient ()
 
static bool UnknownArgumentCallback (const char *pCommand, void *pUser)
 
static bool SaveUnknownCommandCallback (const char *pCommand, void *pUser)
 
static Uint32 GetSdlMessageBoxFlags (IClient::EMessageBoxType Type)
 
static void ShowMessageBox (const char *pTitle, const char *pMessage, IClient::EMessageBoxType Type=IClient::MESSAGE_BOX_TYPE_ERROR)
 
int main (int argc, const char **argv)
 

Variables

static const ColorRGBA gs_ClientNetworkPrintColor {0.7f, 1, 0.7f, 1.0f}
 
static const ColorRGBA gs_ClientNetworkErrPrintColor {1.0f, 0.25f, 0.25f, 1.0f}
 
static const TVersion gs_InvalidVersion = std::make_tuple(-1, -1, -1)
 

Macro Definition Documentation

◆ CHECKSUM_RECORD

#define CHECKSUM_RECORD (   Flags)    (((Flags)&CFGFLAG_CLIENT) == 0 || ((Flags)&CFGFLAG_INSENSITIVE) != 0)

◆ DDNET_CHECKSUM_SALT

#define DDNET_CHECKSUM_SALT
Value:
{ \
{ \
0xdb, 0x87, 0x7f, 0x2b, 0x2d, 0xdb, 0x3b, 0xa6, \
0x9f, 0x67, 0xa6, 0xd1, 0x69, 0xec, 0x67, 0x1d, \
} \
}

◆ GET_INT

#define GET_INT (   integer)    (integer) = str_toint(Up.GetString())

◆ GET_STRING

#define GET_STRING (   array)    str_copy(array, Up.GetString(CUnpacker::SANITIZE_CC | CUnpacker::SKIP_START_WHITESPACES), sizeof(array))

◆ MACRO_CONFIG_COL

#define MACRO_CONFIG_COL (   Name,
  ScriptName,
  Def,
  Flags,
  Desc 
)
Value:
if(CHECKSUM_RECORD(Flags)) \
{ \
m_Checksum.m_Data.m_Config.m_##Name = g_Config.m_##Name; \
}
#define CHECKSUM_RECORD(Flags)
CConfig g_Config
Definition: config.cpp:12

◆ MACRO_CONFIG_INT

#define MACRO_CONFIG_INT (   Name,
  ScriptName,
  Def,
  Min,
  Max,
  Flags,
  Desc 
)
Value:
if(CHECKSUM_RECORD(Flags)) \
{ \
m_Checksum.m_Data.m_Config.m_##Name = g_Config.m_##Name; \
}

◆ MACRO_CONFIG_STR

#define MACRO_CONFIG_STR (   Name,
  ScriptName,
  Len,
  Def,
  Flags,
  Desc 
)
Value:
if(CHECKSUM_RECORD(Flags)) \
{ \
str_copy(m_Checksum.m_Data.m_Config.m_##Name, g_Config.m_##Name, sizeof(m_Checksum.m_Data.m_Config.m_##Name)); \
}

Typedef Documentation

◆ TVersion

typedef std::tuple<int, int, int> TVersion

Function Documentation

◆ CreateClient()

static CClient * CreateClient ( )
static

◆ FormatMapDownloadFilename()

static void FormatMapDownloadFilename ( const char *  pName,
const SHA256_DIGEST pSha256,
int  Crc,
bool  Temp,
char *  pBuffer,
int  BufferSize 
)
static

◆ GenerateTimeoutCode()

void GenerateTimeoutCode ( char *  pBuffer,
unsigned  Size,
char *  pSeed,
const NETADDR pAddrs,
int  NumAddrs,
bool  Dummy 
)

◆ GetSdlMessageBoxFlags()

static Uint32 GetSdlMessageBoxFlags ( IClient::EMessageBoxType  Type)
static

◆ GetServerCapabilities()

static CServerCapabilities GetServerCapabilities ( int  Version,
int  Flags,
bool  Sixup 
)
static

◆ main()

int main ( int  argc,
const char **  argv 
)

◆ RepackMsg()

static bool RepackMsg ( const CMsgPacker pMsg,
CPacker Packer,
bool  Sixup 
)
inlinestatic

◆ SavedServerInfoType()

static int SavedServerInfoType ( int  Type)
static

◆ SaveUnknownCommandCallback()

static bool SaveUnknownCommandCallback ( const char *  pCommand,
void *  pUser 
)
static

◆ ShowMessageBox()

static void ShowMessageBox ( const char *  pTitle,
const char *  pMessage,
IClient::EMessageBoxType  Type = IClient::MESSAGE_BOX_TYPE_ERROR 
)
static

◆ ToVersion()

TVersion ToVersion ( char *  pStr)

◆ UnknownArgumentCallback()

static bool UnknownArgumentCallback ( const char *  pCommand,
void *  pUser 
)
static

Variable Documentation

◆ gs_ClientNetworkErrPrintColor

const ColorRGBA gs_ClientNetworkErrPrintColor {1.0f, 0.25f, 0.25f, 1.0f}
static

◆ gs_ClientNetworkPrintColor

const ColorRGBA gs_ClientNetworkPrintColor {0.7f, 1, 0.7f, 1.0f}
static

◆ gs_InvalidVersion

const TVersion gs_InvalidVersion = std::make_tuple(-1, -1, -1)
static