1#ifndef ENGINE_CLIENT_GHOST_H
2#define ENGINE_CLIENT_GHOST_H
14static_assert(
MAX_CHUNK_SIZE %
sizeof(uint32_t) == 0,
"Chunk size must be aligned with uint32_t");
67 int Start(
const char *pFilename,
const char *pMap,
const SHA256_DIGEST &MapSha256,
const char *pName)
override;
68 void Stop(
int Ticks,
int Time)
override;
70 void WriteData(
int Type,
const void *pData,
size_t Size)
override;
103 bool Load(
const char *pFilename,
const char *pMap,
const SHA256_DIGEST &MapSha256,
unsigned MapCrc)
override;
104 void Close()
override;
108 bool ReadData(
int Type,
void *pData,
size_t Size)
override;
CGhostItem()
Definition: ghost.h:39
void Reset()
Definition: ghost.h:43
CGhostItem(int Type)
Definition: ghost.h:41
int m_Type
Definition: ghost.h:37
unsigned char m_aData[MAX_ITEM_SIZE]
Definition: ghost.h:36
bool ReadData(int Type, void *pData, size_t Size) override
Definition: ghost.cpp:441
const char * m_pBufferEnd
Definition: ghost.h:86
CGhostLoader()
Definition: ghost.cpp:207
CGhostItem m_LastItem
Definition: ghost.h:90
const CGhostInfo * GetInfo() const override
Definition: ghost.h:105
CGhostInfo m_Info
Definition: ghost.h:81
class IStorage * m_pStorage
Definition: ghost.h:78
bool CheckHeaderMap(const CGhostHeader &Header, const char *pFilename, const char *pMap, const SHA256_DIGEST &MapSha256, unsigned MapCrc, bool LogMapMismatch) const
Definition: ghost.cpp:297
int m_BufferCurItem
Definition: ghost.h:88
bool GetGhostInfo(const char *pFilename, CGhostInfo *pGhostInfo, const char *pMap, const SHA256_DIGEST &MapSha256, unsigned MapCrc) override
Definition: ghost.cpp:483
void Close() override
Definition: ghost.cpp:471
char * m_pBufferPos
Definition: ghost.h:85
void ResetBuffer()
Definition: ghost.cpp:219
int m_BufferPrevItem
Definition: ghost.h:89
bool ReadNextType(int *pType) override
Definition: ghost.cpp:412
bool ValidateHeader(const CGhostHeader &Header, const char *pFilename) const
Definition: ghost.cpp:254
void Init()
Definition: ghost.cpp:214
bool ReadChunk(int *pType)
Definition: ghost.cpp:364
IOHANDLE m_File
Definition: ghost.h:76
char m_aFilename[IO_MAX_PATH_LENGTH]
Definition: ghost.h:77
int m_BufferNumItems
Definition: ghost.h:87
IOHANDLE ReadHeader(CGhostHeader &Header, const char *pFilename, const char *pMap, const SHA256_DIGEST &MapSha256, unsigned MapCrc, bool LogMapMismatch) const
Definition: ghost.cpp:228
CGhostHeader m_Header
Definition: ghost.h:80
char m_aBuffer[MAX_CHUNK_SIZE]
Definition: ghost.h:83
bool Load(const char *pFilename, const char *pMap, const SHA256_DIGEST &MapSha256, unsigned MapCrc) override
Definition: ghost.cpp:339
char m_aBufferTemp[MAX_CHUNK_SIZE]
Definition: ghost.h:84
void WriteData(int Type, const void *pData, size_t Size) override
Definition: ghost.cpp:96
IOHANDLE m_File
Definition: ghost.h:48
void FlushChunk()
Definition: ghost.cpp:128
int m_BufferNumItems
Definition: ghost.h:56
void Init()
Definition: ghost.cpp:43
CGhostRecorder()
Definition: ghost.cpp:36
void ResetBuffer()
Definition: ghost.cpp:77
class IStorage * m_pStorage
Definition: ghost.h:50
bool IsRecording() const override
Definition: ghost.h:71
const char * m_pBufferEnd
Definition: ghost.h:55
char * m_pBufferPos
Definition: ghost.h:54
char m_aFilename[IO_MAX_PATH_LENGTH]
Definition: ghost.h:49
void Stop(int Ticks, int Time) override
Definition: ghost.cpp:170
char m_aBuffer[MAX_CHUNK_SIZE]
Definition: ghost.h:52
CGhostItem m_LastItem
Definition: ghost.h:57
char m_aBufferTemp[MAX_CHUNK_SIZE]
Definition: ghost.h:53
int Start(const char *pFilename, const char *pMap, const SHA256_DIGEST &MapSha256, const char *pName) override
Definition: ghost.cpp:48
@ NUM_ITEMS_PER_CHUNK
Definition: ghost.h:11
@ MAX_ITEM_SIZE
Definition: ghost.h:10
@ MAX_CHUNK_SIZE
Definition: ghost.h:12
@ MAX_NAME_LENGTH
Definition: protocol.h:97
void * IOHANDLE
Definition: logger.h:11
@ IO_MAX_PATH_LENGTH
Definition: types.h:43