mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
record a new demo when a game ends. Closes #358
This commit is contained in:
parent
eedaf62d97
commit
41b8022aa1
|
@ -77,6 +77,7 @@ public:
|
|||
virtual void Quit() = 0;
|
||||
virtual const char *DemoPlayer_Play(const char *pFilename, int StorageType) = 0;
|
||||
virtual void DemoRecorder_Start(const char *pFilename, bool WithTimestamp) = 0;
|
||||
virtual void DemoRecorder_HandleAutoStart() = 0;
|
||||
virtual void DemoRecorder_Stop() = 0;
|
||||
virtual void AutoScreenshot_Start() = 0;
|
||||
|
||||
|
|
|
@ -2154,6 +2154,7 @@ void CClient::DemoRecorder_HandleAutoStart()
|
|||
{
|
||||
if(g_Config.m_ClAutoDemoRecord)
|
||||
{
|
||||
DemoRecorder_Stop();
|
||||
DemoRecorder_Start("auto/autorecord", true);
|
||||
if(g_Config.m_ClAutoDemoMax)
|
||||
{
|
||||
|
|
|
@ -591,6 +591,12 @@ void CGameClient::OnGameOver()
|
|||
Client()->AutoScreenshot_Start();
|
||||
}
|
||||
|
||||
void CGameClient::OnStartGame()
|
||||
{
|
||||
if(Client()->State() != IClient::STATE_DEMOPLAYBACK)
|
||||
Client()->DemoRecorder_HandleAutoStart();
|
||||
}
|
||||
|
||||
void CGameClient::OnRconLine(const char *pLine)
|
||||
{
|
||||
m_pGameConsole->PrintLine(CGameConsole::CONSOLETYPE_REMOTE, pLine);
|
||||
|
@ -781,6 +787,8 @@ void CGameClient::OnNewSnapshot()
|
|||
m_Snap.m_pGameobj = (CNetObj_Game *)pData;
|
||||
if(s_GameOver == 0 && m_Snap.m_pGameobj->m_GameOver != 0)
|
||||
OnGameOver();
|
||||
else if(s_GameOver != 0 && m_Snap.m_pGameobj->m_GameOver == 0)
|
||||
OnStartGame();
|
||||
s_GameOver = m_Snap.m_pGameobj->m_GameOver;
|
||||
}
|
||||
else if(Item.m_Type == NETOBJTYPE_FLAG)
|
||||
|
|
|
@ -181,6 +181,7 @@ public:
|
|||
virtual void OnEnterGame();
|
||||
virtual void OnRconLine(const char *pLine);
|
||||
virtual void OnGameOver();
|
||||
virtual void OnStartGame();
|
||||
|
||||
virtual const char *GetItemName(int Type);
|
||||
virtual const char *Version();
|
||||
|
|
Loading…
Reference in a new issue