pub struct Replay { /* private fields */ }Expand description
A complete representation of all information able to be parsed from a Company of Heroes 3 replay. Note that parsing is not yet exhaustive, and iterative improvements will be made to pull more information from replay files over time.
Implementations§
source§impl Replay
impl Replay
sourcepub fn from_bytes(input: &[u8]) -> Result<Replay, ParseError<'_>>
pub fn from_bytes(input: &[u8]) -> Result<Replay, ParseError<'_>>
Takes a byte slice, parses it as a CoH3 replay, and returns a representation of the parsed information. Any failures during parsing or conversion will return an error.
fn main() {
let data = include_bytes!("/path/to/replay.rec");
let replay = vault::Replay::from_bytes(data);
assert!(replay.is_ok())
}sourcepub fn version(&self) -> u16
pub fn version(&self) -> u16
The Company of Heroes 3 game version this replay was recorded on. Note that this is probably more accurated described as the build version, and represents the final segment of digits you see in the game version on the game’s main menu. Every time the game is patched, this version will change, and replays are generally only viewable on the same game version they were recorded on.
sourcepub fn timestamp(&self) -> &str
pub fn timestamp(&self) -> &str
A UTF-16 representation of the recording user’s local time when the replay was recorded. Note that value may contain non-standard characters and is not guaranteed to be parsable into an accurate date/time format.
sourcepub fn game_type(&self) -> GameType
pub fn game_type(&self) -> GameType
The type of game this replay represents. Note that this information is parsed on a best-
effort basis and therefore may not always be correct. Also note that it’s currently not
known if there’s a way to differentiate between automatch and custom games for replays
recorded before the replay system release in patch 1.4.0. Games played before that patch
will be marked as either Skirmish (for local AI games) or Multiplayer (for networked
custom or automatch games). Games recorded on or after patch 1.4.0 will properly
differentiate between Custom and Automatch games.
sourcepub fn matchhistory_id(&self) -> Option<u64>
pub fn matchhistory_id(&self) -> Option<u64>
The ID used by Relic to track this match on their internal servers. This ID can be matched
with an ID of the same name returned by Relic’s CoH3 stats API, enabling linkage between
replay files and statistical information for a match. When the game type is Skirmish,
there is no ID assigned by Relic, so this will be None.
sourcepub fn mod_uuid(&self) -> Uuid
pub fn mod_uuid(&self) -> Uuid
The UUID of the base game mod this replay ran on. If no mod was used, this will be a nil UUID (all zeroes).
sourcepub fn map_filename(&self) -> &str
pub fn map_filename(&self) -> &str
Filename of the map this match was played on. See Map::filename for more information.
sourcepub fn map_localized_name_id(&self) -> &str
pub fn map_localized_name_id(&self) -> &str
Localization ID of the map’s name. See Map::localized_name_id for more information.
sourcepub fn map_localized_description_id(&self) -> &str
pub fn map_localized_description_id(&self) -> &str
Localization ID of the map’s description. See Map::localized_description_id for more
information.