OpenEnroth 73e68f7
|
#include <EngineTraceRecorder.h>
Public Member Functions | |
EngineTraceRecorder () | |
~EngineTraceRecorder () | |
void | startRecording (EngineController *game, const Blob &savedGame={}) |
EngineTraceRecording | finishRecording (EngineController *game) |
bool | isRecording () const |
Private Attributes | |
Blob | _savedGame |
std::unique_ptr< EventTrace > | _trace |
std::unique_ptr< ConfigPatch > | _configSnapshot |
std::unique_ptr< FileSystem > | _ramFs |
std::optional< ScopedRollback< FileSystem * > > | _fsRollback |
Friends | |
class | PlatformIntrospection |
Additional Inherited Members | |
Private Member Functions inherited from PlatformApplicationAware | |
~PlatformApplicationAware ()=default | |
PlatformApplication * | application () const |
template<class T > | |
T * | component () const |
virtual void | installNotify () |
virtual void | removeNotify () |
Component that exposes a trace recording interface. Doesn't have a Component
in its name because who likes class names half a screen long.
Depends on EngineDeterministicComponent
and EngineTraceSimpleRecorder
, install them into PlatformApplication
first.
Note that the difference from EngineTraceSimpleRecorder
is that this component isn't dumb and offers a complete solution to trace recording. Traces that were recorded with startRecording
/ finishRecording
can then be played back with EngineTracePlayer
.
Some notes on how this works. When starting trace recording:
Why do we need to start trace recording with loading the game? Loading the game updates the states of all actors on the map, and since trace recording and playback must start in the same state, the only option that we have is to start both trace playback and trace recording by loading the same save.
EngineTraceRecorder::EngineTraceRecorder | ( | ) |
EngineTraceRecorder::~EngineTraceRecorder | ( | ) |
EngineTraceRecording EngineTraceRecorder::finishRecording | ( | EngineController * | game | ) |
Finishes trace recording.
Note that this method needs to be called from the control thread, see EngineControlComponent
.
game | Engine controller. |
|
inline |
void EngineTraceRecorder::startRecording | ( | EngineController * | game, |
const Blob & | savedGame = {} |
||
) |
Starts trace recording.
Note that this method needs to be called from the control thread, see EngineControlComponent
.
game | Engine controller. |
savedGame | Saved game to load instead of starting recording from current game state. |
|
friend |
|
private |
|
private |
|
private |
|
private |
|
private |