Skip to content

Commit e116e69

Browse files
committed
Added support for 2.49. Fixed string serialization issue
1 parent 14d3de3 commit e116e69

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Rocket League Replay Parser
22
Parses replay files generated by the game Rocket League. Parses to C# objects, which can be serialized to JSON.
33

4-
Supports all replay files created by Rocket League version 2.46 (released 2024-12-03) and earlier. Newer versions may work as well - updates don't always change the replay format. Changes to the replay format are usually supported within a few days. Please create an issue for any replays that fail to parse, or for replays that parse incorrectly.
4+
Supports all replay files created by Rocket League version 2.49 (released 2025-03-14) and earlier. Newer versions may work as well - updates don't always change the replay format. Changes to the replay format are usually supported within a few days. Please create an issue for any replays that fail to parse, or for replays that parse incorrectly.
55

66
Includes a library that can be used in your project (```Install-Package RocketLeagueReplayParser```) as well as a basic console based front end that can be used to convert a replay file to JSON.
77

RocketLeagueReplayParser/NetworkStream/ActorStateProperty.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ public static ActorStateProperty Deserialize(IClassNetCache classMap, string[] o
126126
case "TAGame.RumblePickups_TA:ConcurrentItemCount":
127127
case "TAGame.PRI_TA:BotBannerProductID":
128128
case "TAGame.Car_KnockOut_TA:ReplicatedStateName":
129+
case "TAGame.PRI_TA:SelfDemolitions":
130+
case "TAGame.PRI_TA:CarDemolitions":
129131
asp.Data = br.ReadUInt32();
130132
break;
131133
case "ProjectX.GRI_X:ReplicatedGameMutatorIndex":
@@ -490,6 +492,8 @@ protected static void SerializeData(uint engineVersion, uint licenseeVersion, UI
490492
case "TAGame.RumblePickups_TA:ConcurrentItemCount":
491493
case "TAGame.PRI_TA:BotBannerProductID":
492494
case "TAGame.Car_KnockOut_TA:ReplicatedStateName":
495+
case "TAGame.PRI_TA:SelfDemolitions":
496+
case "TAGame.PRI_TA:CarDemolitions":
493497
bw.Write((UInt32)data);
494498
break;
495499
case "ProjectX.GRI_X:ReplicatedGameMutatorIndex":

RocketLeagueReplayParser/RocketLeagueReplayParser.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<Title>RocketLeagueReplayParser</Title>
55
<Company>Joe Bott</Company>
66
<Product>RocketLeagueReplayParser</Product>
7-
<Copyright>Copyright © 2015-2022</Copyright>
7+
<Copyright>Copyright © 2015-2025</Copyright>
88

99
<!--Incrementing minor for every major patch -->
10-
<Version>3.10.0</Version>
11-
<FileVersion>3.10.0</FileVersion>
12-
<PackageVersion>3.10.0</PackageVersion>
13-
<AssemblyVersion>3.10.0</AssemblyVersion>
10+
<Version>3.11.0</Version>
11+
<FileVersion>3.11.0</FileVersion>
12+
<PackageVersion>3.11.0</PackageVersion>
13+
<AssemblyVersion>3.11.0</AssemblyVersion>
1414
</PropertyGroup>
1515
<ItemGroup>
1616
<PackageReference Include="CompareNETObjects" Version="4.76.0" />

RocketLeagueReplayParser/StringExtension.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,26 @@ public static IEnumerable<byte> Serialize(this string s)
1313
{
1414
var result = new List<byte>();
1515

16-
int length = s.Length + 1; // +1 for trailing 0
16+
int length = s.Length;
1717
bool isUnicode = s.Any(c => c > 255);
1818
if (isUnicode)
1919
{
2020
length *= -1;
2121
}
2222

23+
if (s.Length > 0)
24+
{
25+
// add space for the trailing 0 to length
26+
if ( isUnicode )
27+
{
28+
length -= 1;
29+
}
30+
else
31+
{
32+
length += 1;
33+
}
34+
}
35+
2336
result.AddRange(BitConverter.GetBytes(length));
2437

2538
if ( s.Length > 0 )

0 commit comments

Comments
 (0)