mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-21 01:54:19 +00:00
demoplayer disconnect when render finished
This commit is contained in:
parent
628f1eb777
commit
1c150106f8
|
@ -778,6 +778,7 @@ void CClient::DisconnectWithReason(const char *pReason)
|
||||||
|
|
||||||
void CClient::Disconnect()
|
void CClient::Disconnect()
|
||||||
{
|
{
|
||||||
|
m_ButtonRender = false;
|
||||||
if(m_DummyConnected)
|
if(m_DummyConnected)
|
||||||
DummyDisconnect(0);
|
DummyDisconnect(0);
|
||||||
if(m_State != IClient::STATE_OFFLINE)
|
if(m_State != IClient::STATE_OFFLINE)
|
||||||
|
@ -2515,6 +2516,8 @@ void CClient::Update()
|
||||||
IVideo::Current()->nextVideoFrame();
|
IVideo::Current()->nextVideoFrame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if(m_ButtonRender)
|
||||||
|
Disconnect();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -3573,6 +3576,7 @@ const char *CClient::DemoPlayer_Render(const char *pFilename, int StorageType, c
|
||||||
|
|
||||||
// enter demo playback state
|
// enter demo playback state
|
||||||
SetState(IClient::STATE_DEMOPLAYBACK);
|
SetState(IClient::STATE_DEMOPLAYBACK);
|
||||||
|
m_ButtonRender = true;
|
||||||
|
|
||||||
this->CClient::StartVideo(NULL, this, pVideoName);
|
this->CClient::StartVideo(NULL, this, pVideoName);
|
||||||
m_DemoPlayer.Play();
|
m_DemoPlayer.Play();
|
||||||
|
|
|
@ -122,6 +122,7 @@ class CClient : public IClient, public CDemoPlayer::IListener
|
||||||
int m_UseTempRconCommands;
|
int m_UseTempRconCommands;
|
||||||
char m_Password[32];
|
char m_Password[32];
|
||||||
bool m_SendPassword;
|
bool m_SendPassword;
|
||||||
|
bool m_ButtonRender=false;
|
||||||
|
|
||||||
// version-checking
|
// version-checking
|
||||||
char m_aVersionStr[10];
|
char m_aVersionStr[10];
|
||||||
|
|
Loading…
Reference in a new issue