ddnet/src/game/client/components/race_demo.h
heinrich5991 1820a0e168 Add some checksum functions to the client
Let's see if it works out, if not, we can revert it.
2022-01-31 21:31:26 +01:00

50 lines
1 KiB
C++

/* (c) Redix and Sushi */
#ifndef GAME_CLIENT_COMPONENTS_RACE_DEMO_H
#define GAME_CLIENT_COMPONENTS_RACE_DEMO_H
#include <game/client/component.h>
class CRaceDemo : public CComponent
{
enum
{
RACE_NONE = 0,
RACE_IDLE,
RACE_PREPARE,
RACE_STARTED,
RACE_FINISHED,
};
static const char *ms_pRaceDemoDir;
char m_aTmpFilename[128];
int m_RaceState;
int m_RaceStartTick;
int m_RecordStopTick;
int m_Time;
static int RaceDemolistFetchCallback(const CFsFileInfo *pInfo, int IsDir, int StorageType, void *pUser);
void GetPath(char *pBuf, int Size, int Time = -1) const;
void StopRecord(int Time = -1);
bool CheckDemo(int Time) const;
public:
bool m_AllowRestart;
CRaceDemo();
virtual int Sizeof() const override { return sizeof(*this); }
virtual void OnReset() override;
virtual void OnStateChange(int NewState, int OldState) override;
virtual void OnMessage(int MsgType, void *pRawMsg) override;
virtual void OnMapLoad() override;
virtual void OnShutdown() override;
void OnNewSnapshot();
};
#endif