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

Method DemoRecorder_HandleAutoStart

src/engine/server/server.cpp:3830–3862  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3828}
3829
3830void CServer::DemoRecorder_HandleAutoStart()
3831{
3832 if(Config()->m_SvAutoDemoRecord)
3833 {
3834 m_aDemoRecorder[RECORDER_AUTO].Stop(IDemoRecorder::EStopMode::KEEP_FILE);
3835
3836 char aTimestamp[20];
3837 str_timestamp(aTimestamp, sizeof(aTimestamp));
3838 char aFilename[IO_MAX_PATH_LENGTH];
3839 str_format(aFilename, sizeof(aFilename), "demos/auto/server/%s_%s.demo", GameServer()->Map()->BaseName(), aTimestamp);
3840 m_aDemoRecorder[RECORDER_AUTO].Start(
3841 Storage(),
3842 m_pConsole,
3843 aFilename,
3844 GameServer()->NetVersion(),
3845 GameServer()->Map()->BaseName(),
3846 m_aCurrentMapSha256[MAP_TYPE_SIX],
3847 m_aCurrentMapCrc[MAP_TYPE_SIX],
3848 "server",
3849 m_aCurrentMapSize[MAP_TYPE_SIX],
3850 m_apCurrentMapData[MAP_TYPE_SIX],
3851 nullptr,
3852 nullptr,
3853 nullptr);
3854
3855 if(Config()->m_SvAutoDemoMax)
3856 {
3857 // clean up auto recorded demos
3858 CFileCollection AutoDemos;
3859 AutoDemos.Init(Storage(), "demos/auto/server", "", ".demo", Config()->m_SvAutoDemoMax);
3860 }
3861 }
3862}
3863
3864void CServer::SaveDemo(int ClientId, float Time)
3865{

Callers

nothing calls this directly

Calls 10

str_timestampFunction · 0.85
str_formatFunction · 0.85
StorageFunction · 0.85
ConfigFunction · 0.50
StopMethod · 0.45
BaseNameMethod · 0.45
MapMethod · 0.45
StartMethod · 0.45
NetVersionMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected