DDraceNetwork Documentation
Loading...
Searching...
No Matches
client.cpp File Reference
#include "client.h"
#include "demoedit.h"
#include "friends.h"
#include "serverbrowser.h"
#include <base/hash.h>
#include <base/hash_ctxt.h>
#include <base/log.h>
#include <base/logger.h>
#include <base/math.h>
#include <base/str.h>
#include <base/system.h>
#include <base/windows.h>
#include <engine/config.h>
#include <engine/console.h>
#include <engine/discord.h>
#include <engine/editor.h>
#include <engine/engine.h>
#include <engine/external/json-parser/json.h>
#include <engine/favorites.h>
#include <engine/graphics.h>
#include <engine/input.h>
#include <engine/keys.h>
#include <engine/map.h>
#include <engine/notifications.h>
#include <engine/serverbrowser.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/protocolglue.h>
#include <engine/shared/rust_version.h>
#include <engine/shared/snapshot.h>
#include <engine/shared/uuid_manager.h>
#include <engine/sound.h>
#include <engine/steam.h>
#include <engine/storage.h>
#include <engine/textrender.h>
#include <generated/protocol.h>
#include <generated/protocol7.h>
#include <generated/protocolglue.h>
#include <game/localization.h>
#include <game/version.h>
#include "video.h"
#include "SDL.h"
#include <chrono>
#include <limits>
#include <stack>
#include <thread>
#include <tuple>
#include <engine/shared/config_variables.h>
Include dependency graph for client.cpp:

Macros

#define GET_STRING(array)
#define GET_INT(integer)
#define DDNET_CHECKSUM_SALT
#define CHECKSUM_RECORD(Flags)
#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)
static void GenerateTimeoutCode (char *pBuffer, unsigned Size, char *pSeed, const NETADDR *pAddrs, int NumAddrs, bool Dummy)
static void FormatMapDownloadFilename (const char *pName, const std::optional< SHA256_DIGEST > &Sha256, int Crc, bool Temp, char *pBuffer, int BufferSize)
static int SavedServerInfoType (int Type)
static CServerCapabilities GetServerCapabilities (int Version, int Flags, bool Sixup)
static TVersion ToVersion (char *pStr)
static CClientCreateClient ()
static bool UnknownArgumentCallback (const char *pCommand, void *pUser)
static bool SaveUnknownCommandCallback (const char *pCommand, void *pUser)
int main (int argc, const char **argv)
static bool ViewLinkImpl (const char *pLink)

Variables

static constexpr ColorRGBA gs_ClientNetworkPrintColor {0.7f, 1, 0.7f, 1.0f}
static constexpr 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)
Value:
(((Flags) & CFGFLAG_CLIENT) == 0 || ((Flags) & CFGFLAG_INSENSITIVE) != 0)
@ CFGFLAG_CLIENT
Definition config.h:84
@ CFGFLAG_INSENSITIVE
Definition config.h:98

◆ 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)
Value:
(integer) = str_toint(Up.GetString())
int str_toint(const char *str)
Definition str.cpp:803

◆ GET_STRING

#define GET_STRING ( array)
Value:
@ SANITIZE_CC
Definition packer.h:64
@ SKIP_START_WHITESPACES
Definition packer.h:65
int str_copy(char *dst, const char *src, int dst_size)
Definition str.cpp:6

◆ 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:14

◆ 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()

CClient * CreateClient ( )
static

◆ FormatMapDownloadFilename()

void FormatMapDownloadFilename ( const char * pName,
const std::optional< SHA256_DIGEST > & Sha256,
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 )
static

◆ GetServerCapabilities()

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

◆ main()

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

◆ RepackMsg()

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

◆ SavedServerInfoType()

int SavedServerInfoType ( int Type)
static

◆ SaveUnknownCommandCallback()

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

◆ ToVersion()

TVersion ToVersion ( char * pStr)
static

◆ UnknownArgumentCallback()

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

◆ ViewLinkImpl()

bool ViewLinkImpl ( const char * pLink)
static

Variable Documentation

◆ gs_ClientNetworkErrPrintColor

ColorRGBA gs_ClientNetworkErrPrintColor {1.0f, 0.25f, 0.25f, 1.0f}
staticconstexpr

◆ gs_ClientNetworkPrintColor

ColorRGBA gs_ClientNetworkPrintColor {0.7f, 1, 0.7f, 1.0f}
staticconstexpr

◆ gs_InvalidVersion

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