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

Method ConRecord

src/engine/server/server.cpp:3921–3956  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3919}
3920
3921void CServer::ConRecord(IConsole::IResult *pResult, void *pUser)
3922{
3923 CServer *pServer = (CServer *)pUser;
3924
3925 if(pServer->IsRecording(RECORDER_MANUAL))
3926 {
3927 pServer->Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "demo_recorder", "Demo recorder already recording");
3928 return;
3929 }
3930
3931 char aFilename[IO_MAX_PATH_LENGTH];
3932 if(pResult->NumArguments())
3933 {
3934 str_format(aFilename, sizeof(aFilename), "demos/%s.demo", pResult->GetString(0));
3935 }
3936 else
3937 {
3938 char aTimestamp[20];
3939 str_timestamp(aTimestamp, sizeof(aTimestamp));
3940 str_format(aFilename, sizeof(aFilename), "demos/demo_%s.demo", aTimestamp);
3941 }
3942 pServer->m_aDemoRecorder[RECORDER_MANUAL].Start(
3943 pServer->Storage(),
3944 pServer->Console(),
3945 aFilename,
3946 pServer->GameServer()->NetVersion(),
3947 pServer->GameServer()->Map()->BaseName(),
3948 pServer->m_aCurrentMapSha256[MAP_TYPE_SIX],
3949 pServer->m_aCurrentMapCrc[MAP_TYPE_SIX],
3950 "server",
3951 pServer->m_aCurrentMapSize[MAP_TYPE_SIX],
3952 pServer->m_apCurrentMapData[MAP_TYPE_SIX],
3953 nullptr,
3954 nullptr,
3955 nullptr);
3956}
3957
3958void CServer::ConStopRecord(IConsole::IResult *pResult, void *pUser)
3959{

Callers

nothing calls this directly

Calls 13

str_formatFunction · 0.85
str_timestampFunction · 0.85
NumArgumentsMethod · 0.80
IsRecordingMethod · 0.45
PrintMethod · 0.45
ConsoleMethod · 0.45
GetStringMethod · 0.45
StartMethod · 0.45
StorageMethod · 0.45
NetVersionMethod · 0.45
GameServerMethod · 0.45
BaseNameMethod · 0.45

Tested by

no test coverage detected