MCPcopy Create free account
hub / github.com/ddnet/ddnet / DemoRecorder_Start

Method DemoRecorder_Start

src/engine/client/client.cpp:4047–4077  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4045}
4046
4047void CClient::DemoRecorder_Start(const char *pFilename, bool WithTimestamp, int Recorder)
4048{
4049 dbg_assert(State() == IClient::STATE_ONLINE, "Client must be online to record demo");
4050
4051 char aFilename[IO_MAX_PATH_LENGTH];
4052 if(WithTimestamp)
4053 {
4054 char aTimestamp[20];
4055 str_timestamp(aTimestamp, sizeof(aTimestamp));
4056 str_format(aFilename, sizeof(aFilename), "demos/%s_%s.demo", pFilename, aTimestamp);
4057 }
4058 else
4059 {
4060 str_format(aFilename, sizeof(aFilename), "demos/%s.demo", pFilename);
4061 }
4062
4063 m_aDemoRecorder[Recorder].Start(
4064 Storage(),
4065 m_pConsole,
4066 aFilename,
4067 IsSixup() ? GameClient()->NetVersion7() : GameClient()->NetVersion(),
4068 GameClient()->Map()->BaseName(),
4069 GameClient()->Map()->Sha256(),
4070 GameClient()->Map()->Crc(),
4071 "client",
4072 GameClient()->Map()->Size(),
4073 nullptr,
4074 GameClient()->Map()->File(),
4075 nullptr,
4076 nullptr);
4077}
4078
4079void CClient::DemoRecorder_HandleAutoStart()
4080{

Callers 2

RenderGameMethod · 0.80
Con_RecordMethod · 0.80

Calls 12

str_timestampFunction · 0.85
str_formatFunction · 0.85
StorageFunction · 0.85
NetVersion7Method · 0.80
StartMethod · 0.45
NetVersionMethod · 0.45
BaseNameMethod · 0.45
MapMethod · 0.45
Sha256Method · 0.45
CrcMethod · 0.45
SizeMethod · 0.45
FileMethod · 0.45

Tested by

no test coverage detected