2015-08-22 13:09:19 +00:00
|
|
|
/* (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,
|
2017-09-10 21:54:29 +00:00
|
|
|
RACE_IDLE,
|
|
|
|
RACE_PREPARE,
|
2015-08-22 13:09:19 +00:00
|
|
|
RACE_STARTED,
|
|
|
|
RACE_FINISHED,
|
|
|
|
};
|
2017-02-21 16:10:08 +00:00
|
|
|
|
2017-09-28 17:13:20 +00:00
|
|
|
static const char *ms_pRaceDemoDir;
|
|
|
|
|
|
|
|
char m_aTmpFilename[128];
|
|
|
|
|
2017-09-09 21:10:42 +00:00
|
|
|
int m_RaceState;
|
2017-09-10 21:54:29 +00:00
|
|
|
int m_RaceStartTick;
|
2017-09-09 21:10:42 +00:00
|
|
|
int m_RecordStopTick;
|
|
|
|
int m_Time;
|
|
|
|
|
2021-08-23 10:49:15 +00:00
|
|
|
static int RaceDemolistFetchCallback(const CFsFileInfo *pInfo, int IsDir, int StorageType, void *pUser);
|
2017-09-28 17:13:20 +00:00
|
|
|
|
|
|
|
void GetPath(char *pBuf, int Size, int Time = -1) const;
|
|
|
|
|
2017-09-09 21:10:42 +00:00
|
|
|
void StopRecord(int Time = -1);
|
|
|
|
bool CheckDemo(int Time) const;
|
|
|
|
|
|
|
|
public:
|
2017-09-12 20:54:29 +00:00
|
|
|
bool m_AllowRestart;
|
2017-09-09 21:10:42 +00:00
|
|
|
|
2015-08-22 13:09:19 +00:00
|
|
|
CRaceDemo();
|
2017-02-21 16:10:08 +00:00
|
|
|
|
2015-08-22 13:09:19 +00:00
|
|
|
virtual void OnReset();
|
|
|
|
virtual void OnStateChange(int NewState, int OldState);
|
|
|
|
virtual void OnMessage(int MsgType, void *pRawMsg);
|
2017-09-09 19:38:41 +00:00
|
|
|
virtual void OnMapLoad();
|
2017-10-06 20:01:33 +00:00
|
|
|
|
|
|
|
void OnNewSnapshot();
|
2015-08-22 13:09:19 +00:00
|
|
|
};
|
|
|
|
#endif
|