mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Merge #2071
2071: Add an option to only start a new demo when connect while automatically record demos r=def- a=sirius1242 Origin auto demo recording of ddnet will generate lots of demo files especially when playing in mods which have shorter rounds, such as infclass. I added a new option to open a new demo file only when connect to server (include map changing), this is disabled by default, and can use `cl_auto_demo_on_connect 1` to open. It works only when `cl_auto_demo_record` open. Co-authored-by: sirius <sirius.ustc@gmail.com>
This commit is contained in:
commit
bf821fe391
|
@ -23,6 +23,7 @@ MACRO_CONFIG_INT(ClLoadCountryFlags, cl_load_country_flags, 1, 0, 1, CFGFLAG_SAV
|
|||
MACRO_CONFIG_STR(ClSkinFilterString, cl_skin_filter_string, 25, "", CFGFLAG_SAVE|CFGFLAG_CLIENT, "Skin filtering string")
|
||||
|
||||
MACRO_CONFIG_INT(ClAutoDemoRecord, cl_auto_demo_record, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Automatically record demos")
|
||||
MACRO_CONFIG_INT(ClAutoDemoOnConnect, cl_auto_demo_on_connect, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Only start a new demo when connect while automatically record demos")
|
||||
MACRO_CONFIG_INT(ClAutoDemoMax, cl_auto_demo_max, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Maximum number of automatically recorded demos (0 = no limit)")
|
||||
MACRO_CONFIG_INT(ClAutoScreenshot, cl_auto_screenshot, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Automatically take game over screenshot")
|
||||
MACRO_CONFIG_INT(ClAutoScreenshotMax, cl_auto_screenshot_max, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Maximum number of automatically created screenshots (0 = no limit)")
|
||||
|
|
|
@ -493,6 +493,9 @@ void CGameClient::OnConnected()
|
|||
for(int i = 0; i < MAX_CLIENTS; i++)
|
||||
m_aLastWorldCharacters[i].m_Alive = false;
|
||||
LoadMapSettings();
|
||||
|
||||
if(Client()->State() != IClient::STATE_DEMOPLAYBACK && g_Config.m_ClAutoDemoOnConnect)
|
||||
Client()->DemoRecorder_HandleAutoStart();
|
||||
}
|
||||
|
||||
void CGameClient::OnReset()
|
||||
|
@ -874,7 +877,7 @@ void CGameClient::OnGameOver()
|
|||
|
||||
void CGameClient::OnStartGame()
|
||||
{
|
||||
if(Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
if(Client()->State() != IClient::STATE_DEMOPLAYBACK && !g_Config.m_ClAutoDemoOnConnect)
|
||||
Client()->DemoRecorder_HandleAutoStart();
|
||||
m_pStatboard->OnReset();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue