Skip to content

Commit

Permalink
Adding support for new unknown ID type
Browse files Browse the repository at this point in the history
  • Loading branch information
jjbott committed Sep 26, 2020
1 parent 9c2ca08 commit 39de56c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
13 changes: 12 additions & 1 deletion RocketLeagueReplayParser/NetworkStream/UniqueId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace RocketLeagueReplayParser.NetworkStream
{
public class UniqueId
{
public enum UniqueIdType { Unknown = 0, Steam = 1, PS4 = 2, PS3 = 3, Xbox = 4, Switch = 6, Psynet = 7 }
public enum UniqueIdType { Unknown = 0, Steam = 1, PS4 = 2, PS3 = 3, Xbox = 4, Switch = 6, Psynet = 7, Unknown2 = 11 }

public UniqueIdType Type { get; protected set; }
public byte[] Id { get; private set; }
Expand Down Expand Up @@ -86,6 +86,17 @@ protected static void DeserializeId(BitReader br, UniqueId uid, UInt32 licenseeV
uid.Id = br.ReadBytes(32);
}
}
else if (uid.Type == UniqueIdType.Unknown2)
{
// This is really a "GetString", but keeping everything as bytes.
var id = br.ReadBytes(4);
var len = (id[3] << 24) + (id[2] << 16) + (id[1] << 8) + id[0];
#if DEBUG
// Not yet sure if this is always true
if (len != 33) { throw new Exception("Unknown2 ID length != 33"); }
#endif
uid.Id = id.Concat(br.ReadBytes(len)).ToArray();
}
else
{
throw new ArgumentException(string.Format("Invalid type: {0}. Next bits are {1}", ((int)uid.Type).ToString(), br.GetBits(br.Position, Math.Min(4096, br.Length - br.Position)).ToBinaryString()));
Expand Down
8 changes: 4 additions & 4 deletions RocketLeagueReplayParser/RocketLeagueReplayParser.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<Copyright>Copyright © 2015-2020</Copyright>

<!--Incrementing minor for every major patch -->
<Version>2.7.1</Version>
<FileVersion>2.7.1</FileVersion>
<PackageVersion>2.7.1</PackageVersion>
<AssemblyVersion>2.7.1.0</AssemblyVersion>
<Version>2.7.2</Version>
<FileVersion>2.7.2</FileVersion>
<PackageVersion>2.7.2</PackageVersion>
<AssemblyVersion>2.7.2.0</AssemblyVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CompareNETObjects" Version="4.52.0" />
Expand Down

0 comments on commit 39de56c

Please sign in to comment.