DDraceNetwork Docs
teehistorian.cpp File Reference
#include "teehistorian.h"
#include <base/system.h>
#include <engine/external/json-parser/json.h>
#include <engine/shared/config.h>
#include <engine/shared/json.h>
#include <engine/shared/snapshot.h>
#include <game/gamecore.h>
#include <engine/shared/teehistorian_ex_chunks.h>
#include <engine/shared/config_variables.h>
#include <game/tuning.h>
Include dependency graph for teehistorian.cpp:

Macros

#define UUID(id, name)   static const CUuid UUID_##id = CalculateUuid(name);
 
#define E(buf, str)   EscapeJson(buf, sizeof(buf), str)
 
#define MACRO_CONFIG_INT(Name, ScriptName, Def, Min, Max, Flags, Desc)
 
#define MACRO_CONFIG_COL(Name, ScriptName, Def, Flags, Desc)   MACRO_CONFIG_INT(Name, ScriptName, Def, 0, 0, Flags, Desc)
 
#define MACRO_CONFIG_STR(Name, ScriptName, Len, Def, Flags, Desc)
 
#define MACRO_TUNING_PARAM(Name, ScriptName, Value, Description)
 

Enumerations

enum  {
  TEEHISTORIAN_NONE , TEEHISTORIAN_FINISH , TEEHISTORIAN_TICK_SKIP , TEEHISTORIAN_PLAYER_NEW ,
  TEEHISTORIAN_PLAYER_OLD , TEEHISTORIAN_INPUT_DIFF , TEEHISTORIAN_INPUT_NEW , TEEHISTORIAN_MESSAGE ,
  TEEHISTORIAN_JOIN , TEEHISTORIAN_DROP , TEEHISTORIAN_CONSOLE_COMMAND , TEEHISTORIAN_EX
}
 

Variables

static const char TEEHISTORIAN_NAME [] = "teehistorian@ddnet.tw"
 
static const CUuid TEEHISTORIAN_UUID = CalculateUuid(TEEHISTORIAN_NAME)
 
static const char TEEHISTORIAN_VERSION [] = "2"
 
static const char TEEHISTORIAN_VERSION_MINOR [] = "9"
 

Macro Definition Documentation

◆ E

#define E (   buf,
  str 
)    EscapeJson(buf, sizeof(buf), str)

◆ MACRO_CONFIG_COL

#define MACRO_CONFIG_COL (   Name,
  ScriptName,
  Def,
  Flags,
  Desc 
)    MACRO_CONFIG_INT(Name, ScriptName, Def, 0, 0, Flags, Desc)

◆ MACRO_CONFIG_INT

#define MACRO_CONFIG_INT (   Name,
  ScriptName,
  Def,
  Min,
  Max,
  Flags,
  Desc 
)
Value:
if((Flags)&CFGFLAG_SERVER && !((Flags)&CFGFLAG_NONTEEHISTORIC) && pGameInfo->m_pConfig->m_##Name != (Def)) \
{ \
str_format(aJson, sizeof(aJson), "%s\"%s\":\"%d\"", \
First ? "" : ",", \
E(aBuffer1, #ScriptName), \
pGameInfo->m_pConfig->m_##Name); \
Write(aJson, str_length(aJson)); \
First = false; \
}
#define E(buf, str)
int str_length(const char *str)
Definition: system.cpp:2754
@ CFGFLAG_SERVER
Definition: config.h:46
@ CFGFLAG_NONTEEHISTORIC
Definition: config.h:55

◆ MACRO_CONFIG_STR

#define MACRO_CONFIG_STR (   Name,
  ScriptName,
  Len,
  Def,
  Flags,
  Desc 
)
Value:
if((Flags)&CFGFLAG_SERVER && !((Flags)&CFGFLAG_NONTEEHISTORIC) && str_comp(pGameInfo->m_pConfig->m_##Name, (Def)) != 0) \
{ \
str_format(aJson, sizeof(aJson), "%s\"%s\":\"%s\"", \
First ? "" : ",", \
E(aBuffer1, #ScriptName), \
E(aBuffer2, pGameInfo->m_pConfig->m_##Name)); \
Write(aJson, str_length(aJson)); \
First = false; \
}
int str_comp(const char *a, const char *b)
Definition: system.cpp:2933

◆ MACRO_TUNING_PARAM

#define MACRO_TUNING_PARAM (   Name,
  ScriptName,
  Value,
  Description 
)
Value:
if(pGameInfo->m_pTuning->m_##Name.Get() != (int)((Value)*100)) \
{ \
str_format(aJson, sizeof(aJson), "%s\"%s\":\"%d\"", \
First ? "" : ",", \
E(aBuffer1, #ScriptName), \
pGameInfo->m_pTuning->m_##Name.Get()); \
Write(aJson, str_length(aJson)); \
First = false; \
}

◆ UUID

#define UUID (   id,
  name 
)    static const CUuid UUID_##id = CalculateUuid(name);

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
TEEHISTORIAN_NONE 
TEEHISTORIAN_FINISH 
TEEHISTORIAN_TICK_SKIP 
TEEHISTORIAN_PLAYER_NEW 
TEEHISTORIAN_PLAYER_OLD 
TEEHISTORIAN_INPUT_DIFF 
TEEHISTORIAN_INPUT_NEW 
TEEHISTORIAN_MESSAGE 
TEEHISTORIAN_JOIN 
TEEHISTORIAN_DROP 
TEEHISTORIAN_CONSOLE_COMMAND 
TEEHISTORIAN_EX 

Variable Documentation

◆ TEEHISTORIAN_NAME

const char TEEHISTORIAN_NAME[] = "teehistorian@ddnet.tw"
static

◆ TEEHISTORIAN_UUID

const CUuid TEEHISTORIAN_UUID = CalculateUuid(TEEHISTORIAN_NAME)
static

◆ TEEHISTORIAN_VERSION

const char TEEHISTORIAN_VERSION[] = "2"
static

◆ TEEHISTORIAN_VERSION_MINOR

const char TEEHISTORIAN_VERSION_MINOR[] = "9"
static