Skip to content

Commit 14d3de3

Browse files
committed
Updated for 2.46. Fixes issue #58
1 parent c0f2da2 commit 14d3de3

File tree

5 files changed

+72
-23
lines changed

5 files changed

+72
-23
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.45 (released 2024-10-22) 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.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.
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ public static ActorStateProperty Deserialize(IClassNetCache classMap, string[] o
270270
case "TAGame.Car_TA:ReplicatedDemolish":
271271
asp.Data = ReplicatedDemolish.Deserialize(br, netVersion);
272272
break;
273+
case "TAGame.Car_TA:ReplicatedDemolishExtended":
274+
asp.Data = ReplicatedDemolishExtended.Deserialize(br, netVersion);
275+
break;
273276
case "TAGame.Car_TA:ReplicatedDemolishGoalExplosion":
274277
asp.Data = ReplicatedDemolishGoalExplosion.Deserialize(br, netVersion);
275278
break;
@@ -630,6 +633,9 @@ protected static void SerializeData(uint engineVersion, uint licenseeVersion, UI
630633
case "TAGame.Car_TA:ReplicatedDemolish":
631634
((ReplicatedDemolish)data).Serialize(bw, netVersion);
632635
break;
636+
case "TAGame.Car_TA:ReplicatedDemolishExtended":
637+
((ReplicatedDemolishExtended)data).Serialize(bw, netVersion);
638+
break;
633639
case "TAGame.Car_TA:ReplicatedDemolishGoalExplosion":
634640
((ReplicatedDemolishGoalExplosion)data).Serialize(bw, netVersion);
635641
break;

RocketLeagueReplayParser/NetworkStream/ReplicatedDemolish.cs

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,32 @@ namespace RocketLeagueReplayParser.NetworkStream
88
{
99
public class ReplicatedDemolish
1010
{
11-
public bool Unknown1 { get; private set;}
12-
public Int32 AttackerActorId { get; private set;}
13-
public bool Unknown2 { get; private set;}
14-
public UInt32 VictimActorId { get; private set;} // Always equals this actor's id
15-
public Vector3D AttackerVelocity { get; private set;} // Not verified. Attacker/Victim velocity could be swapped
16-
public Vector3D VictimVelocity { get; private set;}
11+
public ObjectTarget Attacker { get; set; }
12+
public ObjectTarget Victim { get; set; }
13+
public Vector3D AttackerVelocity { get; private set; }
14+
public Vector3D VictimVelocity { get; private set; }
1715

1816
public static ReplicatedDemolish Deserialize(BitReader br, UInt32 netVersion)
1917
{
2018
var rd = new ReplicatedDemolish();
21-
22-
rd.Unknown1 = br.ReadBit();
23-
rd.AttackerActorId = br.ReadInt32();
24-
rd.Unknown2 = br.ReadBit();
25-
rd.VictimActorId = br.ReadUInt32();
26-
rd.AttackerVelocity = Vector3D.Deserialize(br, netVersion);
27-
rd.VictimVelocity = Vector3D.Deserialize(br, netVersion);
19+
20+
rd.DeserializeImpl(br, netVersion);
2821

2922
return rd;
3023
}
3124

32-
public void Serialize(BitWriter bw, UInt32 netVersion)
25+
protected virtual void DeserializeImpl(BitReader br, uint netVersion)
26+
{
27+
Attacker = ObjectTarget.Deserialize(br);
28+
Victim = ObjectTarget.Deserialize(br);
29+
AttackerVelocity = Vector3D.Deserialize(br, netVersion);
30+
VictimVelocity = Vector3D.Deserialize(br, netVersion);
31+
}
32+
33+
public virtual void Serialize(BitWriter bw, UInt32 netVersion)
3334
{
34-
bw.Write(Unknown1);
35-
bw.Write(AttackerActorId);
36-
bw.Write(Unknown2);
37-
bw.Write(VictimActorId);
35+
Attacker.Serialize(bw);
36+
Victim.Serialize(bw);
3837
AttackerVelocity.Serialize(bw, netVersion);
3938
VictimVelocity.Serialize(bw, netVersion);
4039
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace RocketLeagueReplayParser.NetworkStream
8+
{
9+
public class ReplicatedDemolishExtended : ReplicatedDemolish
10+
{
11+
public ObjectTarget AttackerPRI { get; private set;}
12+
public ObjectTarget SelfDemoFX { get; private set;}
13+
public bool bSelfDemolish { get; set; }
14+
public ObjectTarget GoalExplosionOwner { get; set; }
15+
16+
public new static ReplicatedDemolishExtended Deserialize(BitReader br, UInt32 netVersion)
17+
{
18+
var rde = new ReplicatedDemolishExtended();
19+
20+
rde.DeserializeImpl(br, netVersion);
21+
22+
return rde;
23+
}
24+
25+
protected override void DeserializeImpl(BitReader br, UInt32 netVersion)
26+
{
27+
AttackerPRI = ObjectTarget.Deserialize(br);
28+
SelfDemoFX = ObjectTarget.Deserialize(br);
29+
bSelfDemolish = br.ReadBit();
30+
GoalExplosionOwner = ObjectTarget.Deserialize(br);
31+
32+
base.DeserializeImpl(br, netVersion);
33+
}
34+
35+
public override void Serialize(BitWriter bw, UInt32 netVersion)
36+
{
37+
AttackerPRI.Serialize(bw);
38+
SelfDemoFX.Serialize(bw);
39+
bw.Write(bSelfDemolish);
40+
GoalExplosionOwner.Serialize(bw);
41+
base.Serialize(bw, netVersion);
42+
}
43+
}
44+
}

RocketLeagueReplayParser/RocketLeagueReplayParser.csproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
<Copyright>Copyright © 2015-2022</Copyright>
88

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

0 commit comments

Comments
 (0)