summaryrefslogtreecommitdiff
path: root/replay/errorsystem.h
diff options
context:
space:
mode:
Diffstat (limited to 'replay/errorsystem.h')
-rw-r--r--replay/errorsystem.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/replay/errorsystem.h b/replay/errorsystem.h
new file mode 100644
index 0000000..967133d
--- /dev/null
+++ b/replay/errorsystem.h
@@ -0,0 +1,67 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+//=======================================================================================//
+
+#ifndef ERRORSYSTEM_H
+#define ERRORSYSTEM_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+//----------------------------------------------------------------------------------------
+
+#include "replay/ireplayerrorsystem.h"
+#include "basethinker.h"
+#include "utllinkedlist.h"
+
+//----------------------------------------------------------------------------------------
+
+class KeyValues;
+class CClientRecordingSessionBlock;
+class CHttpDownloader;
+
+//----------------------------------------------------------------------------------------
+
+class IErrorReporter
+{
+public:
+ virtual void ReportErrorsToUser( wchar_t *pErrorText ) = 0;
+};
+
+//----------------------------------------------------------------------------------------
+
+class CErrorSystem : public CBaseThinker,
+ public IReplayErrorSystem
+{
+public:
+ CErrorSystem( IErrorReporter *pErrorReporter );
+ ~CErrorSystem();
+
+ virtual void AddErrorFromTokenName( const char *pToken );
+ virtual void AddFormattedErrorFromTokenName( const char *pFormatToken, KeyValues *pFormatArgs );
+
+#if !defined( DEDICATED )
+ void OGS_ReportSessionBlockDownloadError( const CHttpDownloader *pDownloader, const CClientRecordingSessionBlock *pBlock,
+ int nLocalFileSize, int nMaxBlock, const bool *pSizesDiffer,
+ const bool *pHashFail, uint8 *pLocalHash );
+ void OGS_ReportSessioInfoDownloadError( const CHttpDownloader *pDownloader, const char *pErrorToken );
+ void OGS_ReportGenericError( const char *pGenericErrorToken );
+#endif
+
+private:
+ void AddError( const wchar_t *pError );
+ void AddError( const char *pError );
+
+ float GetNextThinkTime() const;
+ void Think();
+
+ void Clear();
+
+ IErrorReporter *m_pErrorReporter;
+ CUtlLinkedList< wchar_t *, int > m_lstErrors;
+};
+
+
+//----------------------------------------------------------------------------------------
+
+#endif // ERRORSYSTEM_H