-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathEngineDemoRecorder.hpp
More file actions
62 lines (46 loc) · 1.5 KB
/
EngineDemoRecorder.hpp
File metadata and controls
62 lines (46 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
#include "Command.hpp"
#include "Interface.hpp"
#include "Module.hpp"
#include "Utils.hpp"
#include <string>
#include <utility>
#include <vector>
// Ticks before demo autostop
#define DEMO_AUTOSTOP_DELAY 15
class EngineDemoRecorder : public Module {
public:
Interface *s_ClientDemoRecorder = nullptr;
using _GetRecordingTick = int(__rescall *)(void *thisptr);
_GetRecordingTick GetRecordingTick = nullptr;
char *m_szDemoBaseName = nullptr;
int *m_nDemoNumber = nullptr;
bool *m_bRecording = nullptr;
std::string currentDemo = std::string();
bool isRecordingDemo = false;
bool requestedStop = false;
int lastDemoNumber = 1;
bool customDataReady = false;
int autorecordStartNum = 1;
std::vector<std::string> queuedCommands = {};
std::vector<std::pair<std::string, uint32_t>> queuedVScriptChecksums = {};
char coopRadialMenuLastPos[8];
public:
int GetTick();
std::string GetDemoFilename();
// CDemoRecorder::SetSignonState
DECL_DETOUR(SetSignonState, int state);
// CDemoRecorder::StartRecording
DECL_DETOUR(StartRecording, const char *filename, bool continuously);
// CDemoRecorder::StopRecording
DECL_DETOUR(StopRecording);
// CDemoRecorder::RecordCustomData
DECL_DETOUR(RecordCustomData, int id, const void *data, unsigned long length);
DECL_DETOUR_COMMAND(stop);
DECL_DETOUR_COMMAND(record);
bool Init() override;
void Shutdown() override;
const char *Name() override { return MODULE("engine"); }
void RecordData(const void *data, unsigned long length);
void Stop();
};