rattletrap-4.0.9: Parse and generate Rocket League replays.

Safe HaskellNone
LanguageHaskell2010

Rattletrap

Synopsis

Documentation

encodeReplayJson :: Replay -> ByteString Source #

Encodes a replay as JSON.

encodeReplayFile :: Replay -> ByteString Source #

Encodes a raw replay.

data Replay Source #

A Rocket League replay.

Constructors

Replay 

Fields

data Section a Source #

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) Source # 

Methods

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

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

Ord a => Ord (Section a) Source # 

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) Source # 

Methods

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

show :: Section a -> String #

showList :: [Section a] -> ShowS #

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

data Header Source #

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 Source #

Constructors

Str 

Fields

Instances

Eq Str Source # 

Methods

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

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

Ord Str Source # 

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 Source # 

Methods

showsPrec :: Int -> Str -> ShowS #

show :: Str -> String #

showList :: [Str] -> ShowS #

ToJSON Str Source # 
FromJSON Str Source # 

data PropertyValue a Source #

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 Source #

Constructors

List 

Fields

Instances

Eq a => Eq (List a) Source # 

Methods

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

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

Ord a => Ord (List a) Source # 

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) Source # 

Methods

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

show :: List a -> String #

showList :: [List a] -> ShowS #

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

data Content Source #

Contains low-level game data about a Replay.

Constructors

Content 

Fields

data KeyFrame Source #

Constructors

KeyFrame 

Fields

data Frame Source #

Constructors

Frame 

Fields

data SpawnedReplication Source #

Constructors

SpawnedReplication 

Fields

data AttributeValue Source #

data AppliedDamageAttribute Source #

data CamSettingsAttribute Source #

data DamageStateAttribute Source #

data ExtendedExplosionAttribute Source #

data LoadoutAttribute Source #

data LoadoutsOnlineAttribute Source #

data PrivateMatchSettingsAttribute Source #

Instances

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

data ReservationAttribute Source #

data RigidBodyStateAttribute Source #

data Message Source #

Constructors

Message 

Fields

data Mark Source #

Constructors

Mark 

Fields

Instances