2017-09-09 00:41:11 +00:00
|
|
|
#ifndef ENGINE_GHOST_H
|
|
|
|
#define ENGINE_GHOST_H
|
|
|
|
|
2020-10-10 20:58:33 +00:00
|
|
|
#include <base/hash.h>
|
2017-09-09 00:41:11 +00:00
|
|
|
#include <engine/shared/protocol.h>
|
|
|
|
|
|
|
|
#include "kernel.h"
|
|
|
|
|
2020-10-10 20:58:33 +00:00
|
|
|
class CGhostInfo
|
2017-09-09 00:41:11 +00:00
|
|
|
{
|
2017-10-28 12:23:24 +00:00
|
|
|
public:
|
2017-09-09 00:41:11 +00:00
|
|
|
char m_aOwner[MAX_NAME_LENGTH];
|
2020-06-26 13:17:38 +00:00
|
|
|
char m_aMap[64];
|
2020-10-10 20:58:33 +00:00
|
|
|
int m_NumTicks;
|
|
|
|
int m_Time;
|
2017-09-09 00:41:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class IGhostRecorder : public IInterface
|
|
|
|
{
|
|
|
|
MACRO_INTERFACE("ghostrecorder", 0)
|
|
|
|
public:
|
|
|
|
virtual ~IGhostRecorder() {}
|
2017-10-28 12:23:24 +00:00
|
|
|
|
2020-10-10 20:58:33 +00:00
|
|
|
virtual int Start(const char *pFilename, const char *pMap, SHA256_DIGEST MapSha256, const char *pName) = 0;
|
2017-09-09 00:41:11 +00:00
|
|
|
virtual int Stop(int Ticks, int Time) = 0;
|
|
|
|
|
2017-10-28 12:23:24 +00:00
|
|
|
virtual void WriteData(int Type, const void *pData, int Size) = 0;
|
2017-09-09 00:41:11 +00:00
|
|
|
virtual bool IsRecording() const = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
class IGhostLoader : public IInterface
|
|
|
|
{
|
|
|
|
MACRO_INTERFACE("ghostloader", 0)
|
|
|
|
public:
|
|
|
|
virtual ~IGhostLoader() {}
|
2017-10-28 12:23:24 +00:00
|
|
|
|
2020-10-10 20:58:33 +00:00
|
|
|
virtual int Load(const char *pFilename, const char *pMap, SHA256_DIGEST MapSha256, unsigned MapCrc) = 0;
|
2017-09-09 00:41:11 +00:00
|
|
|
virtual void Close() = 0;
|
|
|
|
|
2020-10-10 20:58:33 +00:00
|
|
|
virtual const CGhostInfo *GetInfo() const = 0;
|
2017-09-09 00:41:11 +00:00
|
|
|
|
|
|
|
virtual bool ReadNextType(int *pType) = 0;
|
2017-10-28 12:23:24 +00:00
|
|
|
virtual bool ReadData(int Type, void *pData, int Size) = 0;
|
2017-09-09 00:41:11 +00:00
|
|
|
|
2020-10-10 20:58:33 +00:00
|
|
|
virtual bool GetGhostInfo(const char *pFilename, CGhostInfo *pInfo, const char *pMap, SHA256_DIGEST MapSha256, unsigned MapCrc) = 0;
|
2017-09-09 00:41:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|