Class: VaultCoh::Replay

Inherits:
Object
  • Object
show all
Defined in:
lib/vault_coh/replay.rb

Overview

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.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_bytes(bytes) ⇒ Replay

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.

Examples:

require 'vault_coh'

bytes = File.read('/path/to/replay.rec').unpack('C*')
replay = VaultCoh::Replay.from_bytes(bytes)
puts replay.version

Parameters:

  • bytes (Array<Byte>)

    Byte array representation of a CoH3 replay file (required).

Returns:



23
# File 'lib/vault_coh/replay.rb', line 23

def self.from_bytes(bytes); end

Instance Method Details

#lengthInteger

A simple count of the number of ticks that were executed in this match. Because CoH3’s engine runs at 8 ticks per second, you can divide this value by 8 to get the duration of the match in seconds.

Returns:

  • (Integer)


84
# File 'lib/vault_coh/replay.rb', line 84

def length; end

#mapMap

Map information for this match.

Returns:



54
# File 'lib/vault_coh/replay.rb', line 54

def map; end

#map_filenameString

Filename of the map this match was played on. See Map#filename for more information.

Returns:

  • (String)


60
# File 'lib/vault_coh/replay.rb', line 60

def map_filename; end

#map_localized_description_idString

Localization ID of the map’s description. See Map#localized_description_id for more information.

Returns:

  • (String)


72
# File 'lib/vault_coh/replay.rb', line 72

def map_localized_description_id; end

#map_localized_name_idString

Localization ID of the map’s name. See Map#localized_name_id for more information.

Returns:

  • (String)


66
# File 'lib/vault_coh/replay.rb', line 66

def map_localized_name_id; end

#matchhistory_idInteger

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.

Returns:

  • (Integer)

    unsigned, 64 bits



49
# File 'lib/vault_coh/replay.rb', line 49

def matchhistory_id; end

#playersArray<Player>

A list of all players who participated in this match.

Returns:



77
# File 'lib/vault_coh/replay.rb', line 77

def players; end

#timestampString

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.

Returns:

  • (String)


41
# File 'lib/vault_coh/replay.rb', line 41

def timestamp; end

#to_hHash

Returns a hash representation of the object.

Returns:

  • (Hash)


89
# File 'lib/vault_coh/replay.rb', line 89

def to_h; end

#versionInteger

The Company of Heroes 3 game version this replay was recorded on. Note that this is probably more accurately 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.

Returns:

  • (Integer)

    unsigned, 16 bits



33
# File 'lib/vault_coh/replay.rb', line 33

def version; end