#include <Recorder.h>
Inherits SubsystemInterface.
Classes | |
| struct | ReplayHeader |
Public Member Functions | |
| RecorderClass () | |
| Constructor. | |
| virtual | ~RecorderClass () |
| Destructor. | |
| void | init () |
| Initialize TheRecorder. | |
| void | reset () |
| Reset the state of TheRecorder. | |
| void | update () |
| General purpose update function. | |
| void | updateRecord () |
| The update function for recording. | |
| void | updatePlayback () |
| The update function for playing back a file. | |
| Bool | playbackFile (AsciiString filename) |
| Starts playback of the specified file. | |
| Bool | testVersionPlayback (AsciiString filename) |
| Returns if the playback is a valid playback file for this version or not. | |
| AsciiString | getCurrentReplayFilename (void) |
| valid during playback only | |
| void | stopPlayback () |
| Stops playback. Its fine to call this even if not playing back a file. | |
| void | handleCRCMessage (UnsignedInt newCRC, Int playerIndex, Bool fromPlayback) |
| Bool | readReplayHeader (ReplayHeader &header) |
| RecorderModeType | getMode () |
| Returns the current operating mode. | |
| void | initControls () |
| Show or Hide the Replay controls. | |
| AsciiString | getReplayDir () |
| Returns the directory that holds the replay files. | |
| AsciiString | getReplayExtention () |
| Returns the file extention for replay files. | |
| AsciiString | getLastReplayFileName () |
| Returns the filename used for the default replay. | |
| GameInfo * | getGameInfo (void) |
| Returns the slot list for playback game start. | |
| Bool | isMultiplayer (void) |
| is this a multiplayer game (record OR playback)? | |
| Int | getGameMode (void) |
| void | logPlayerDisconnect (UnicodeString player, Int slot) |
| void | logCRCMismatch (void) |
| void | cleanUpReplayFile (void) |
| after a crash, send replay/debug info to a central repository | |
| void | stopRecording () |
| Stop recording and close m_file. | |
Public Member Functions inherited from SubsystemInterface | |
| SubsystemInterface () | |
| virtual | ~SubsystemInterface () |
| virtual void | postProcessLoad () |
| virtual void | draw (void) |
| void | UPDATE (void) |
| void | DRAW (void) |
| AsciiString | getName (void) |
| void | setName (AsciiString name) |
Protected Member Functions | |
| void | startRecording (GameDifficulty diff, Int originalGameMode, Int rankPoints, Int maxFPS) |
| Start recording to m_file. | |
| void | writeToFile (GameMessage *msg) |
| Write this GameMessage to m_file. | |
| void | logGameStart (AsciiString options) |
| void | logGameEnd (void) |
| AsciiString | readAsciiString () |
| Read the next string from m_file using ascii characters. | |
| UnicodeString | readUnicodeString () |
| Read the next string from m_file using unicode characters. | |
| void | readNextFrame () |
| Read the next frame number to execute a command on. | |
| void | appendNextCommand () |
| Read the next GameMessage and append it to TheCommandList. | |
| void | writeArgument (GameMessageArgumentDataType type, const GameMessageArgumentType arg) |
| void | readArgument (GameMessageArgumentDataType type, GameMessage *msg) |
| void | cullBadCommands () |
| prevent the user from giving mouse commands that he shouldn't be able to do during playback. | |
Protected Attributes | |
| CRCInfo * | m_crcInfo |
| FILE * | m_file |
| AsciiString | m_fileName |
| Int | m_currentFilePosition |
| RecorderModeType | m_mode |
| AsciiString | m_currentReplayFilename |
| valid during playback only | |
| ReplayGameInfo | m_gameInfo |
| Bool | m_wasDesync |
| Bool | m_doingAnalysis |
| Int | m_originalGameMode |
| UnsignedInt | m_nextFrame |
| The Frame that the next message is to be executed on. This can be -1. | |
Protected Attributes inherited from SubsystemInterface | |
| AsciiString | m_name |
Definition at line 56 of file Recorder.h.
| RecorderClass::RecorderClass | ( | ) |
|
virtual |
|
protected |
Read the next GameMessage and append it to TheCommandList.
This reads the next command from the replay file and appends it to TheCommandList.
Definition at line 1236 of file Recorder.cpp.
| void RecorderClass::cleanUpReplayFile | ( | void | ) |
after a crash, send replay/debug info to a central repository
Definition at line 289 of file Recorder.cpp.
|
protected |
prevent the user from giving mouse commands that he shouldn't be able to do during playback.
This needs to be called for every frame during playback. Basically it prevents the user from inserting.
Definition at line 1460 of file Recorder.cpp.
| AsciiString RecorderClass::getCurrentReplayFilename | ( | void | ) |
valid during playback only
Definition at line 918 of file Recorder.cpp.
|
inline |
Returns the slot list for playback game start.
Definition at line 115 of file Recorder.h.
|
inline |
Definition at line 119 of file Recorder.h.
| AsciiString RecorderClass::getLastReplayFileName | ( | ) |
Returns the filename used for the default replay.
returns the file name used for the replay file that is recorded to.
Definition at line 1502 of file Recorder.cpp.
| RecorderModeType RecorderClass::getMode | ( | ) |
Returns the current operating mode.
Show or Hide the Replay controls.
return the current operating mode of TheRecorder.
Definition at line 1571 of file Recorder.cpp.
| AsciiString RecorderClass::getReplayDir | ( | ) |
Returns the directory that holds the replay files.
returns the directory that holds the replay files.
Definition at line 1483 of file Recorder.cpp.
| AsciiString RecorderClass::getReplayExtention | ( | ) |
Returns the file extention for replay files.
returns the file extention for the replay files.
Definition at line 1495 of file Recorder.cpp.
| void RecorderClass::handleCRCMessage | ( | UnsignedInt | newCRC, |
| Int | playerIndex, | ||
| Bool | fromPlayback ) |
Definition at line 981 of file Recorder.cpp.
|
virtual |
Initialize TheRecorder.
Initialization The recorder will record by default since every game will be recorded. Obviously a game that is being played back will not be recorded. Since the playback is done through a special interface, that interface will set the recorder mode to RECORDERMODETYPE_PLAYBACK.
Implements SubsystemInterface.
Definition at line 394 of file Recorder.cpp.
| void RecorderClass::initControls | ( | ) |
Show or Hide the Replay controls.
is this a multiplayer game (record OR playback)?
Definition at line 1576 of file Recorder.cpp.
| Bool RecorderClass::isMultiplayer | ( | void | ) |
is this a multiplayer game (record OR playback)?
< slots default to closed for non-networked games
Definition at line 1589 of file Recorder.cpp.
| void RecorderClass::logCRCMismatch | ( | void | ) |
Definition at line 173 of file Recorder.cpp.
|
protected |
Definition at line 219 of file Recorder.cpp.
|
protected |
Definition at line 67 of file Recorder.cpp.
| void RecorderClass::logPlayerDisconnect | ( | UnicodeString | player, |
| Int | slot ) |
Definition at line 123 of file Recorder.cpp.
| Bool RecorderClass::playbackFile | ( | AsciiString | filename | ) |
Starts playback of the specified file.
Start playback of the file. Return true or false depending on if the file is a valid replay file or not.
Definition at line 1053 of file Recorder.cpp.
|
protected |
Definition at line 1342 of file Recorder.cpp.
|
protected |
Read the next string from m_file using ascii characters.
Read an ascii string from the current file position. The string is assumed to be 0-terminated.
Definition at line 1195 of file Recorder.cpp.
|
protected |
Read the next frame number to execute a command on.
Read the frame number for the next command in the playback file. If the end of the file is reached, the playback is stopped and the next frame is said to be -1.
Definition at line 1224 of file Recorder.cpp.
| Bool RecorderClass::readReplayHeader | ( | ReplayHeader & | header | ) |
Read in a replay header, for (1) populating a replay listbox or (2) starting playback. In case (2), set FILE *m_file.
Definition at line 816 of file Recorder.cpp.
|
protected |
Read the next string from m_file using unicode characters.
Read a unicode string from the current file position. The string is assumed to be 0-terminated.
Definition at line 1167 of file Recorder.cpp.
|
virtual |
Reset the state of TheRecorder.
Reset the recorder to the "initialized state."
Implements SubsystemInterface.
Definition at line 414 of file Recorder.cpp.
|
protected |
Start recording to m_file.
Start a new file for recording. This will always overwrite the "LastReplay.rep" file with the new one. So don't call this unless you really mean it.
Definition at line 533 of file Recorder.cpp.
| void RecorderClass::stopPlayback | ( | ) |
Stops playback. Its fine to call this even if not playing back a file.
Stop the currently running playback. This is probably due either to the user exiting out of the playback or reaching the end of the playback file.
Definition at line 462 of file Recorder.cpp.
| void RecorderClass::stopRecording | ( | ) |
Stop recording and close m_file.
This will stop the current recording session and close the file. This should always be called at the end of every game.
Definition at line 703 of file Recorder.cpp.
| Bool RecorderClass::testVersionPlayback | ( | AsciiString | filename | ) |
Returns if the playback is a valid playback file for this version or not.
Return true if this version of the file is the same as our version of the game
Definition at line 1023 of file Recorder.cpp.
|
virtual |
General purpose update function.
update Do the update for this frame.
Implements SubsystemInterface.
Definition at line 428 of file Recorder.cpp.
| void RecorderClass::updatePlayback | ( | ) |
The update function for playing back a file.
Do the update for the next frame of this playback.
Definition at line 439 of file Recorder.cpp.
| void RecorderClass::updateRecord | ( | ) |
The update function for recording.
Update function for recording a game. Basically all the pertinant logic commands for this frame are written out to a file.
Definition at line 479 of file Recorder.cpp.
|
protected |
Definition at line 786 of file Recorder.cpp.
|
protected |
Write this GameMessage to m_file.
Write this game message to the record file. This also writes the game message's execution frame.
<
Definition at line 724 of file Recorder.cpp.
|
protected |
Definition at line 82 of file Recorder.h.
|
protected |
Definition at line 144 of file Recorder.h.
|
protected |
valid during playback only
Definition at line 146 of file Recorder.h.
|
protected |
Definition at line 151 of file Recorder.h.
|
protected |
Definition at line 142 of file Recorder.h.
|
protected |
Definition at line 143 of file Recorder.h.
|
protected |
Definition at line 148 of file Recorder.h.
|
protected |
Definition at line 145 of file Recorder.h.
|
protected |
The Frame that the next message is to be executed on. This can be -1.
Definition at line 155 of file Recorder.h.
|
protected |
Definition at line 153 of file Recorder.h.
|
protected |
Definition at line 149 of file Recorder.h.