Merge pull request #7104 from Robyt3/Client-Demo-Record-Verbose

Hide `client is not online` log message except when using `record`
This commit is contained in:
Dennis Felsing 2023-08-29 20:35:37 +00:00 committed by GitHub
commit 7ad18dec6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View file

@ -167,7 +167,7 @@ public:
#if defined(CONF_VIDEORECORDER) #if defined(CONF_VIDEORECORDER)
virtual const char *DemoPlayer_Render(const char *pFilename, int StorageType, const char *pVideoName, int SpeedIndex, bool StartPaused = false) = 0; virtual const char *DemoPlayer_Render(const char *pFilename, int StorageType, const char *pVideoName, int SpeedIndex, bool StartPaused = false) = 0;
#endif #endif
virtual void DemoRecorder_Start(const char *pFilename, bool WithTimestamp, int Recorder) = 0; virtual void DemoRecorder_Start(const char *pFilename, bool WithTimestamp, int Recorder, bool Verbose = false) = 0;
virtual void DemoRecorder_HandleAutoStart() = 0; virtual void DemoRecorder_HandleAutoStart() = 0;
virtual void DemoRecorder_Stop(int Recorder, bool RemoveFile = false) = 0; virtual void DemoRecorder_Stop(int Recorder, bool RemoveFile = false) = 0;
virtual class IDemoRecorder *DemoRecorder(int Recorder) = 0; virtual class IDemoRecorder *DemoRecorder(int Recorder) = 0;

View file

@ -3957,10 +3957,13 @@ void CClient::Con_DemoSpeed(IConsole::IResult *pResult, void *pUserData)
pSelf->m_DemoPlayer.SetSpeed(pResult->GetFloat(0)); pSelf->m_DemoPlayer.SetSpeed(pResult->GetFloat(0));
} }
void CClient::DemoRecorder_Start(const char *pFilename, bool WithTimestamp, int Recorder) void CClient::DemoRecorder_Start(const char *pFilename, bool WithTimestamp, int Recorder, bool Verbose)
{ {
if(State() != IClient::STATE_ONLINE) if(State() != IClient::STATE_ONLINE)
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "demorec/record", "client is not online"); {
if(Verbose)
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "demorec/record", "client is not online");
}
else else
{ {
char aFilename[IO_MAX_PATH_LENGTH]; char aFilename[IO_MAX_PATH_LENGTH];
@ -4038,9 +4041,9 @@ void CClient::Con_Record(IConsole::IResult *pResult, void *pUserData)
{ {
CClient *pSelf = (CClient *)pUserData; CClient *pSelf = (CClient *)pUserData;
if(pResult->NumArguments()) if(pResult->NumArguments())
pSelf->DemoRecorder_Start(pResult->GetString(0), false, RECORDER_MANUAL); pSelf->DemoRecorder_Start(pResult->GetString(0), false, RECORDER_MANUAL, true);
else else
pSelf->DemoRecorder_Start(pSelf->m_aCurrentMap, true, RECORDER_MANUAL); pSelf->DemoRecorder_Start(pSelf->m_aCurrentMap, true, RECORDER_MANUAL, true);
} }
void CClient::Con_StopRecord(IConsole::IResult *pResult, void *pUserData) void CClient::Con_StopRecord(IConsole::IResult *pResult, void *pUserData)

View file

@ -482,7 +482,7 @@ public:
void RegisterCommands(); void RegisterCommands();
const char *DemoPlayer_Play(const char *pFilename, int StorageType) override; const char *DemoPlayer_Play(const char *pFilename, int StorageType) override;
void DemoRecorder_Start(const char *pFilename, bool WithTimestamp, int Recorder) override; void DemoRecorder_Start(const char *pFilename, bool WithTimestamp, int Recorder, bool Verbose = false) override;
void DemoRecorder_HandleAutoStart() override; void DemoRecorder_HandleAutoStart() override;
void DemoRecorder_StartReplayRecorder(); void DemoRecorder_StartReplayRecorder();
void DemoRecorder_Stop(int Recorder, bool RemoveFile = false) override; void DemoRecorder_Stop(int Recorder, bool RemoveFile = false) override;