| 1 | #ifndef ENGINE_GHOST_H |
| 2 | #define ENGINE_GHOST_H |
| 3 | |
| 4 | #include "kernel.h" |
| 5 | |
| 6 | #include <base/hash.h> |
| 7 | |
| 8 | #include <engine/shared/protocol.h> |
| 9 | |
| 10 | class CGhostInfo |
| 11 | { |
| 12 | public: |
| 13 | char m_aOwner[MAX_NAME_LENGTH]; |
| 14 | char m_aMap[64]; |
| 15 | int m_NumTicks; |
| 16 | int m_Time; |
| 17 | }; |
| 18 | |
| 19 | class IGhostRecorder : public IInterface |
| 20 | { |
| 21 | MACRO_INTERFACE("ghostrecorder" ) |
| 22 | public: |
| 23 | virtual int Start(const char *pFilename, const char *pMap, const SHA256_DIGEST &MapSha256, const char *pName) = 0; |
| 24 | virtual void Stop(int Ticks, int Time) = 0; |
| 25 | |
| 26 | virtual void WriteData(int Type, const void *pData, size_t Size) = 0; |
| 27 | virtual bool IsRecording() const = 0; |
| 28 | }; |
| 29 | |
| 30 | class IGhostLoader : public IInterface |
| 31 | { |
| 32 | MACRO_INTERFACE("ghostloader" ) |
| 33 | public: |
| 34 | virtual bool Load(const char *pFilename, const char *pMap, const SHA256_DIGEST &MapSha256, unsigned MapCrc) = 0; |
| 35 | virtual void Close() = 0; |
| 36 | |
| 37 | virtual const CGhostInfo *GetInfo() const = 0; |
| 38 | |
| 39 | virtual bool ReadNextType(int *pType) = 0; |
| 40 | virtual bool ReadData(int Type, void *pData, size_t Size) = 0; |
| 41 | |
| 42 | virtual bool GetGhostInfo(const char *pFilename, CGhostInfo *pInfo, const char *pMap, const SHA256_DIGEST &MapSha256, unsigned MapCrc) = 0; |
| 43 | }; |
| 44 | |
| 45 | #endif |
| 46 | |