rattletrap 9.1.0 → 9.1.1
raw patch · 12 files changed
+38/−28 lines, 12 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- rattletrap.cabal +1/−1
- source/library/Rattletrap/Console/Main.hs +1/−3
- source/library/Rattletrap/Decode/AttributeValue.hs +2/−1
- source/library/Rattletrap/Decode/Content.hs +3/−5
- source/library/Rattletrap/Decode/FlaggedByteAttribute.hs +2/−1
- source/library/Rattletrap/Decode/PickupAttributeNew.hs +3/−1
- source/library/Rattletrap/Decode/ProductAttribute.hs +6/−7
- source/library/Rattletrap/Decode/Section.hs +5/−1
- source/library/Rattletrap/Decode/SpawnedReplication.hs +6/−3
- source/library/Rattletrap/Decode/Str.hs +7/−2
- source/library/Rattletrap/Encode/FlaggedByteAttribute.hs +0/−0
- source/library/Rattletrap/Type/Quaternion.hs +2/−3
rattletrap.cabal view
@@ -1,7 +1,7 @@ cabal-version: 2.2 name: rattletrap-version: 9.1.0+version: 9.1.1 category: Game description: Rattletrap parses and generates Rocket League replays.
source/library/Rattletrap/Console/Main.hs view
@@ -61,9 +61,7 @@ pure (LazyBytes.toStrict (Client.responseBody response)) putOutput :: Config -> Bytes.ByteString -> IO ()-putOutput config = case configOutput config of- Nothing -> Bytes.putStr- Just file -> Bytes.writeFile file+putOutput = maybe Bytes.putStr Bytes.writeFile . configOutput getConfig :: [String] -> IO Config getConfig arguments = do
source/library/Rattletrap/Decode/AttributeValue.hs view
@@ -101,7 +101,8 @@ AttributeTypePartyLeader -> AttributeValuePartyLeader <$> decodePartyLeaderAttributeBits version AttributeTypePickup -> AttributeValuePickup <$> decodePickupAttributeBits- AttributeTypePickupNew -> AttributeValuePickupNew <$> decodePickupAttributeNewBits+ AttributeTypePickupNew ->+ AttributeValuePickupNew <$> decodePickupAttributeNewBits AttributeTypePlayerHistoryKey -> AttributeValuePlayerHistoryKey <$> decodePlayerHistoryKeyAttributeBits AttributeTypePrivateMatchSettings ->
source/library/Rattletrap/Decode/Content.hs view
@@ -55,9 +55,7 @@ (decodeFramesBits version numFrames maxChannels classAttributeMap) mempty frames <- either fail pure (runDecodeBits bitGet (reverseBytes stream))- unknown <- Binary.getRemainingLazyByteString- pure- (Content+ Content levels keyFrames streamSize@@ -69,5 +67,5 @@ names classMappings caches- (LazyBytes.unpack unknown)- )+ . LazyBytes.unpack+ <$> Binary.getRemainingLazyByteString
source/library/Rattletrap/Decode/FlaggedByteAttribute.hs view
@@ -9,4 +9,5 @@ decodeFlaggedByteAttributeBits :: DecodeBits FlaggedByteAttribute-decodeFlaggedByteAttributeBits = FlaggedByteAttribute <$> getBool <*> decodeWord8leBits+decodeFlaggedByteAttributeBits =+ FlaggedByteAttribute <$> getBool <*> decodeWord8leBits
source/library/Rattletrap/Decode/PickupAttributeNew.hs view
@@ -11,4 +11,6 @@ decodePickupAttributeNewBits :: DecodeBits PickupAttributeNew decodePickupAttributeNewBits = do instigator <- getBool- PickupAttributeNew <$> decodeWhen instigator decodeWord32leBits <*> decodeWord8leBits+ PickupAttributeNew+ <$> decodeWhen instigator decodeWord32leBits+ <*> decodeWord8leBits
source/library/Rattletrap/Decode/ProductAttribute.hs view
@@ -37,13 +37,12 @@ Just "TAGame.ProductAttribute_TeamEdition_TA" -> decodeTeamEdition version Just "TAGame.ProductAttribute_TitleID_TA" -> decodeTitle Just "TAGame.ProductAttribute_UserColor_TA" -> decodeColor version- Just objectName ->- fail- ("[RT05] unknown object name "- <> show objectName- <> " for ID "- <> show objectId- )+ Just objectName -> fail+ ("[RT05] unknown object name "+ <> show objectName+ <> " for ID "+ <> show objectId+ ) Nothing -> fail ("[RT06] missing object name for ID " <> show objectId) pure (ProductAttribute flag objectId maybeObjectName value)
source/library/Rattletrap/Decode/Section.hs view
@@ -23,4 +23,8 @@ crcMessage :: Word32le -> Word32le -> String crcMessage actual expected = unwords- ["[RT10] actual CRC", show actual, "does not match expected CRC", show expected]+ [ "[RT10] actual CRC"+ , show actual+ , "does not match expected CRC"+ , show expected+ ]
source/library/Rattletrap/Decode/SpawnedReplication.hs view
@@ -54,16 +54,19 @@ Nothing -> Right Nothing Just nameIndex -> case getName (classAttributeMapNameMap classAttributeMap) nameIndex of- Nothing -> Left ("[RT11] could not get name for index " <> show nameIndex)+ Nothing ->+ Left ("[RT11] could not get name for index " <> show nameIndex) Just name -> Right (Just name) lookupObjectName :: ClassAttributeMap -> Word32le -> Either String Str lookupObjectName classAttributeMap objectId = case getObjectName (classAttributeMapObjectMap classAttributeMap) objectId of- Nothing -> Left ("[RT12] could not get object name for id " <> show objectId)+ Nothing ->+ Left ("[RT12] could not get object name for id " <> show objectId) Just objectName -> Right objectName lookupClassName :: Str -> Either String Str lookupClassName objectName = case getClassName objectName of- Nothing -> Left ("[RT13] could not get class name for object " <> show objectName)+ Nothing ->+ Left ("[RT13] could not get class name for object " <> show objectName) Just className -> Right className
source/library/Rattletrap/Decode/Str.hs view
@@ -13,6 +13,8 @@ import qualified Data.ByteString as Bytes import qualified Data.Text as Text import qualified Data.Text.Encoding as Text+import qualified Data.Text.Encoding.Error as Text+import qualified Debug.Trace as Debug decodeStr :: Decode Str decodeStr = do@@ -34,8 +36,11 @@ getTextDecoder :: Int32le -> Bytes.ByteString -> Text.Text getTextDecoder size bytes = let- decode =- if size < Int32le 0 then Text.decodeUtf16LE else Text.decodeLatin1+ decode = if size < Int32le 0+ then Text.decodeUtf16LEWith $ \message input -> do+ Debug.traceM $ "WARNING: " <> show (Text.DecodeError message input)+ Text.lenientDecode message input+ else Text.decodeLatin1 in decode bytes dropNull :: Text.Text -> Text.Text
source/library/Rattletrap/Encode/FlaggedByteAttribute.hs view
source/library/Rattletrap/Type/Quaternion.hs view
@@ -14,6 +14,7 @@ import Rattletrap.Type.Common import Rattletrap.Type.CompressedWord +import qualified Data.List as List import qualified Data.Maybe as Maybe data Quaternion = Quaternion@@ -76,9 +77,7 @@ roundTrip = decompressPart . compressPart computedPart = Maybe.fromMaybe biggestPart- (Maybe.listToMaybe- (filter (\(value, _) -> value /= roundTrip value) parts)- )+ (List.find (\(value, _) -> value /= roundTrip value) parts) in snd (if (biggestPart == computedPart) || (abs (fst biggestPart - fst computedPart) > 0.00001)