rattletrap-4.0.9: Parse and generate Rocket League replays.

Safe HaskellNone
LanguageHaskell2010

Rattletrap

Synopsis

Documentation

decodeReplayFile :: ByteString -> Either String Replay #

Parses a raw replay.

encodeReplayJson :: Replay -> ByteString #

Encodes a replay as JSON.

decodeReplayJson :: ByteString -> Either String Replay #

Parses a JSON replay.

encodeReplayFile :: Replay -> ByteString #

Encodes a raw replay.

data Replay #

A Rocket League replay.

Constructors

Replay 

Fields

data Section a #

A section is a large piece of a Replay. It has a 32-bit size (in bytes), a 32-bit CRC (see Rattletrap.Utility.Crc), and then a bunch of data (the body). This interface is provided so that you don't have to think about the size and CRC.

Constructors

Section 

Fields

Instances

Eq a => Eq (Section a) # 

Methods

(==) :: Section a -> Section a -> Bool #

(/=) :: Section a -> Section a -> Bool #

Ord a => Ord (Section a) # 

Methods

compare :: Section a -> Section a -> Ordering #

(<) :: Section a -> Section a -> Bool #

(<=) :: Section a -> Section a -> Bool #

(>) :: Section a -> Section a -> Bool #

(>=) :: Section a -> Section a -> Bool #

max :: Section a -> Section a -> Section a #

min :: Section a -> Section a -> Section a #

Show a => Show (Section a) # 

Methods

showsPrec :: Int -> Section a -> ShowS #

show :: Section a -> String #

showList :: [Section a] -> ShowS #

ToJSON a => ToJSON (Section a) # 
FromJSON a => FromJSON (Section a) # 

data Header #

Contains high-level metadata about a Replay.

Constructors

Header 

Fields

  • headerEngineVersion :: Word32le

    The "major" ("engine") version number.

  • headerLicenseeVersion :: Word32le

    The "minor" ("licensee") version number.

  • headerPatchVersion :: Maybe Word32le

    The "patch" ("net") version number.

  • headerLabel :: Str

    Always TAGame.Replay_Soccar_TA.

  • headerProperties :: Dictionary Property

    These properties determine how a replay will look in the list of replays in-game. One element is required for the replay to show up:

    • MapName: This is a NameProperty with a case-insensitive map identifier, like Stadium_P.

    There are many other properties that affect how the replay looks in the list of replays.

    • Date: A StrProperty with the format YYYY-mm-dd:HH-MM. Dates are not validated, but the month must be between 1 and 12 to show up. The hour is shown modulo 12 with AM or PM.
    • MatchType: A NameProperty. If this is not one of the expected values, nothing will be shown next to the replay's map. The expected values are: Online, Offline, Private, and Season.
    • NumFrames: This IntProperty is used to calculate the length of the match. There are 30 frames per second, a typical 5-minute match has about 9,000 frames.
    • PrimaryPlayerTeam: This is an IntProperty. It is either 0 (blue) or 1 (orange). Any other value is ignored. If this would be 0, you don't have to set it at all.
    • ReplayName: An optional StrProperty with a user-supplied name for the replay.
    • Team0Score: The blue team's score as an IntProperty. Can be omitted if the score is 0.
    • Team1Score: The orange team's score as an IntProperty. Can also be omitted if the score is 0.
    • TeamSize: An IntProperty with the number of players per team. This value is not validated, so you can put absurd values like 99. To get an "unfair" team size like 1v4, you must set the bUnfairBots BoolProperty to True.

newtype Str #

Constructors

Str 

Fields

Instances

Eq Str # 

Methods

(==) :: Str -> Str -> Bool #

(/=) :: Str -> Str -> Bool #

Ord Str # 

Methods

compare :: Str -> Str -> Ordering #

(<) :: Str -> Str -> Bool #

(<=) :: Str -> Str -> Bool #

(>) :: Str -> Str -> Bool #

(>=) :: Str -> Str -> Bool #

max :: Str -> Str -> Str #

min :: Str -> Str -> Str #

Show Str # 

Methods

showsPrec :: Int -> Str -> ShowS #

show :: Str -> String #

showList :: [Str] -> ShowS #

ToJSON Str # 
FromJSON Str # 

data PropertyValue a #

Constructors

PropertyValueArray (List (Dictionary a))

Yes, a list of dictionaries. No, it doesn't make sense. These usually only have one element.

PropertyValueBool Word8le 
PropertyValueByte Str (Maybe Str)

This is a strange name for essentially a key-value pair.

PropertyValueFloat Float32le 
PropertyValueInt Int32le 
PropertyValueName Str

It's unclear how exactly this is different than a StrProperty.

PropertyValueQWord Word64le 
PropertyValueStr Str 

newtype List a #

Constructors

List 

Fields

Instances

Eq a => Eq (List a) # 

Methods

(==) :: List a -> List a -> Bool #

(/=) :: List a -> List a -> Bool #

Ord a => Ord (List a) # 

Methods

compare :: List a -> List a -> Ordering #

(<) :: List a -> List a -> Bool #

(<=) :: List a -> List a -> Bool #

(>) :: List a -> List a -> Bool #

(>=) :: List a -> List a -> Bool #

max :: List a -> List a -> List a #

min :: List a -> List a -> List a #

Show a => Show (List a) # 

Methods

showsPrec :: Int -> List a -> ShowS #

show :: List a -> String #

showList :: [List a] -> ShowS #

ToJSON a => ToJSON (List a) # 
FromJSON a => FromJSON (List a) # 

data Content #

Contains low-level game data about a Replay.

Constructors

Content 

Fields

data KeyFrame #

Constructors

KeyFrame 

Fields

data Frame #

Constructors

Frame 

Fields

data SpawnedReplication #

Constructors

SpawnedReplication 

Fields

data AttributeValue #

data AppliedDamageAttribute #

data CamSettingsAttribute #

data DamageStateAttribute #

data ExtendedExplosionAttribute #

data LoadoutAttribute #

data LoadoutsOnlineAttribute #

data PrivateMatchSettingsAttribute #

Instances

Eq PrivateMatchSettingsAttribute # 
Ord PrivateMatchSettingsAttribute # 
Show PrivateMatchSettingsAttribute # 
ToJSON PrivateMatchSettingsAttribute # 
FromJSON PrivateMatchSettingsAttribute # 

data ReservationAttribute #

data RigidBodyStateAttribute #

data Message #

Constructors

Message 

Fields

data Mark #

Constructors

Mark 

Fields

Instances

Eq Mark # 

Methods

(==) :: Mark -> Mark -> Bool #

(/=) :: Mark -> Mark -> Bool #

Ord Mark # 

Methods

compare :: Mark -> Mark -> Ordering #

(<) :: Mark -> Mark -> Bool #

(<=) :: Mark -> Mark -> Bool #

(>) :: Mark -> Mark -> Bool #

(>=) :: Mark -> Mark -> Bool #

max :: Mark -> Mark -> Mark #

min :: Mark -> Mark -> Mark #

Show Mark # 

Methods

showsPrec :: Int -> Mark -> ShowS #

show :: Mark -> String #

showList :: [Mark] -> ShowS #

ToJSON Mark # 
FromJSON Mark #