Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
Contains functions for visually replaying past games. More...
Functions | |
OsPath | GetDirectoryPath () |
Returns the absolute path to the sim-log directory (that contains the directories with the replay files. More... | |
OsPath | GetCacheFilePath () |
Returns the absolute path to the replay cache file. More... | |
OsPath | GetTempCacheFilePath () |
Returns the absolute path to the temporary replay cache file used to always have a valid cache file in place even if bad things happen. More... | |
bool | StartVisualReplay (const OsPath &directory) |
Replays the commands.txt file in the given subdirectory visually. More... | |
bool | ReadCacheFile (const ScriptInterface &scriptInterface, JS::MutableHandleObject cachedReplaysObject) |
Reads the replay Cache file and parses it into a jsObject. More... | |
void | StoreCacheFile (const ScriptInterface &scriptInterface, JS::HandleObject replays) |
Stores the replay list in the replay cache file. More... | |
JS::HandleObject | ReloadReplayCache (const ScriptInterface &scriptInterface, bool compareFiles) |
Load the replay cache and check if there are new/deleted replays. More... | |
JS::Value | GetReplays (const ScriptInterface &scriptInterface, bool compareFiles) |
Get a list of replays to display in the GUI. More... | |
JS::Value | LoadReplayData (const ScriptInterface &scriptInterface, const OsPath &directory) |
Parses a commands.txt file and extracts metadata. More... | |
bool | DeleteReplay (const OsPath &replayFile) |
Permanently deletes the visual replay (including the parent directory) More... | |
JS::Value | GetReplayAttributes (const ScriptInterface &scriptInterface, const OsPath &directoryName) |
Returns the parsed header of the replay file (commands.txt). More... | |
bool | HasReplayMetadata (const OsPath &directoryName) |
Returns whether or not the metadata / summary screen data has been saved properly when the game ended. More... | |
JS::Value | GetReplayMetadata (const ScriptInterface &scriptInterface, const OsPath &directoryName) |
Returns the metadata of a replay. More... | |
void | AddReplayToCache (const ScriptInterface &scriptInterface, const CStrW &directoryName) |
Adds a replay to the replayCache. More... | |
Contains functions for visually replaying past games.
void VisualReplay::AddReplayToCache | ( | const ScriptInterface & | scriptInterface, |
const CStrW & | directoryName | ||
) |
Adds a replay to the replayCache.
bool VisualReplay::DeleteReplay | ( | const OsPath & | replayFile | ) |
Permanently deletes the visual replay (including the parent directory)
replayFile | - path to commands.txt, whose parent directory will be deleted. |
OsPath VisualReplay::GetCacheFilePath | ( | ) |
Returns the absolute path to the replay cache file.
OsPath VisualReplay::GetDirectoryPath | ( | ) |
Returns the absolute path to the sim-log directory (that contains the directories with the replay files.
JS::Value VisualReplay::GetReplayAttributes | ( | const ScriptInterface & | scriptInterface, |
const OsPath & | directoryName | ||
) |
Returns the parsed header of the replay file (commands.txt).
JS::Value VisualReplay::GetReplayMetadata | ( | const ScriptInterface & | scriptInterface, |
const OsPath & | directoryName | ||
) |
Returns the metadata of a replay.
JS::Value VisualReplay::GetReplays | ( | const ScriptInterface & | scriptInterface, |
bool | compareFiles | ||
) |
Get a list of replays to display in the GUI.
scriptInterface | - the ScriptInterface in which to create the return data. |
compareFiles | - reload the cache, which takes more time, but nearly ensures, that no changed replay is missed. |
OsPath VisualReplay::GetTempCacheFilePath | ( | ) |
Returns the absolute path to the temporary replay cache file used to always have a valid cache file in place even if bad things happen.
bool VisualReplay::HasReplayMetadata | ( | const OsPath & | directoryName | ) |
Returns whether or not the metadata / summary screen data has been saved properly when the game ended.
JS::Value VisualReplay::LoadReplayData | ( | const ScriptInterface & | scriptInterface, |
const OsPath & | directory | ||
) |
Parses a commands.txt file and extracts metadata.
Works similarly to CGame::LoadReplayData().
bool VisualReplay::ReadCacheFile | ( | const ScriptInterface & | scriptInterface, |
JS::MutableHandleObject | cachedReplaysObject | ||
) |
Reads the replay Cache file and parses it into a jsObject.
scriptInterface | - the ScriptInterface in which to create the return data. |
cachedReplaysObject | - the cached replays. |
JS::HandleObject VisualReplay::ReloadReplayCache | ( | const ScriptInterface & | scriptInterface, |
bool | compareFiles | ||
) |
Load the replay cache and check if there are new/deleted replays.
If so, update the cache.
scriptInterface | - the ScriptInterface in which to create the return data. |
compareFiles | - compare the directory name and the FileSize of the replays and the cache. |
bool VisualReplay::StartVisualReplay | ( | const OsPath & | directory | ) |
Replays the commands.txt file in the given subdirectory visually.
void VisualReplay::StoreCacheFile | ( | const ScriptInterface & | scriptInterface, |
JS::HandleObject | replays | ||
) |
Stores the replay list in the replay cache file.
scriptInterface | - the ScriptInterface in which to create the return data. |
replays | - the replay list to store. |