Skip to content

Commit bf9aaa8

Browse files
committed
[GEN][ZH] Refactor the recorder class to use a ramfile for replay playback.
1 parent 3bda27a commit bf9aaa8

File tree

4 files changed

+148
-112
lines changed

4 files changed

+148
-112
lines changed

Generals/Code/GameEngine/Include/Common/Recorder.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
#include "Common/MessageStream.h"
2929
#include "GameNetwork/GameInfo.h"
3030

31+
class File;
32+
3133
/**
3234
* The ReplayGameInfo class holds information about the replay game and
3335
* the contents of its slot list for reconstructing multiplayer games.
@@ -89,7 +91,7 @@ class RecorderClass : public SubsystemInterface {
8991
CRCInfo *m_crcInfo;
9092
public:
9193

92-
// read in info relating to a replay, conditionally setting up m_file for playback
94+
// read in info relating to a replay, conditionally setting up m_replayFile for playback
9395
struct ReplayHeader
9496
{
9597
AsciiString filename;
@@ -139,8 +141,8 @@ class RecorderClass : public SubsystemInterface {
139141
void logGameStart(AsciiString options);
140142
void logGameEnd( void );
141143

142-
AsciiString readAsciiString(); ///< Read the next string from m_file using ascii characters.
143-
UnicodeString readUnicodeString(); ///< Read the next string from m_file using unicode characters.
144+
AsciiString readAsciiString(); ///< Read the next string from m_replayFile using ascii characters.
145+
UnicodeString readUnicodeString(); ///< Read the next string from m_replayFile using unicode characters.
144146
void readNextFrame(); ///< Read the next frame number to execute a command on.
145147
void appendNextCommand(); ///< Read the next GameMessage and append it to TheCommandList.
146148
void writeArgument(GameMessageArgumentDataType type, const GameMessageArgumentType arg);
@@ -154,6 +156,7 @@ class RecorderClass : public SubsystemInterface {
154156

155157
CullBadCommandsResult cullBadCommands(); ///< prevent the user from giving mouse commands that he shouldn't be able to do during playback.
156158

159+
File* m_replayFile;
157160
FILE *m_file;
158161
AsciiString m_fileName;
159162
Int m_currentFilePosition;

0 commit comments

Comments
 (0)