Skip to content

Commit

Permalink
Implement basic support for "Battleborn", see #68.
Browse files Browse the repository at this point in the history
  • Loading branch information
EliotVU committed Nov 17, 2023
1 parent bce38c4 commit 13460cc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/Branch/DefaultEngineBranch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ protected override TokenMap BuildTokenMap(UnrealPackage linker)
switch (linker.Build.Name)
{
#if BORDERLANDS2
case UnrealPackage.GameBuild.BuildName.Battleborn:
case UnrealPackage.GameBuild.BuildName.Borderlands2:
tokenMap[0x4C] = typeof(LocalVariableToken<int>);
tokenMap[0x4D] = typeof(LocalVariableToken<float>);
Expand Down
3 changes: 2 additions & 1 deletion src/Core/Classes/UClass.cs
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ protected override void Deserialize()
ClassGroups = DeserializeGroup("ClassGroups");
#endif
#if BORDERLANDS2
if (Package.Build == UnrealPackage.GameBuild.BuildName.Borderlands2)
if (Package.Build == UnrealPackage.GameBuild.BuildName.Borderlands2 ||
Package.Build == UnrealPackage.GameBuild.BuildName.Battleborn)
{
byte unknownByte = _Buffer.ReadByte();
Record("Unknown:Borderlands2", unknownByte);
Expand Down
3 changes: 2 additions & 1 deletion src/Core/Classes/UFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public partial class UFunction : UStruct, IUnrealNetObject
protected override void Deserialize()
{
#if BORDERLANDS2
if (Package.Build == UnrealPackage.GameBuild.BuildName.Borderlands2)
if (Package.Build == UnrealPackage.GameBuild.BuildName.Borderlands2 ||
Package.Build == UnrealPackage.GameBuild.BuildName.Battleborn)
{
ushort size = _Buffer.ReadUShort();
_Buffer.Skip(size * 2);
Expand Down
1 change: 1 addition & 0 deletions src/Core/Classes/UState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ protected override void Deserialize()
#if BORDERLANDS2 || TRANSFORMERS || BATMAN
// FIXME:Temp fix
if (Package.Build == UnrealPackage.GameBuild.BuildName.Borderlands2 ||
Package.Build == UnrealPackage.GameBuild.BuildName.Battleborn ||
Package.Build == BuildGeneration.HMS ||
Package.Build == UnrealPackage.GameBuild.BuildName.Batman4)
{
Expand Down
18 changes: 17 additions & 1 deletion src/UnrealPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -577,6 +577,15 @@ public enum BuildName
/// </summary>
[Build(867, 868, 9u, 32u)] RocketLeague,

/// <summary>
/// Battleborn
///
/// 874/078
///
/// EngineVersion and CookerVersion are packed with the respective Licensee version.
/// </summary>
[Build(874, 78u)] Battleborn,

/// <summary>
/// Special Force 2
///
Expand Down Expand Up @@ -1247,7 +1256,14 @@ public void Deserialize(IUnrealStream stream)
}
#endif
}

#if BORDERLANDS
if (stream.Package.Build == GameBuild.BuildName.Battleborn)
{
// FIXME: Package format is being deserialzied incorrectly and fails here.
stream.ReadUInt32();
return;
}
#endif
if (stream.Version >= VTextureAllocations)
{
// TextureAllocations, TextureTypes
Expand Down

0 comments on commit 13460cc

Please sign in to comment.