Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated for C5S5 #59

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/ConsoleReader/ConsoleReader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<ProjectReference Include="..\FortniteReplayReader\FortniteReplayReader.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="Replays\chapter5season5.replay">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Replays\collectPickup.replay">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
7 changes: 6 additions & 1 deletion src/ConsoleReader/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private static void Main(string[] args)
//var replayFilesFolder = Path.Combine(localAppDataFolder, @"FortniteGame\Saved\Demos");
//var replayFilesFolder = @"F:\Projects\FortniteReplayCollection\_upload\";
var replayFilesFolder = @"C:\Users\ferro\Downloads\";
var replayFiles = Directory.EnumerateFiles(replayFilesFolder, "*.replay");
var replayFiles = Directory.EnumerateFiles("Replays", "*.replay");

var sw = new Stopwatch();
#if DEBUG
Expand All @@ -35,6 +35,11 @@ private static void Main(string[] args)
long total = 0;
foreach (var replayFile in replayFiles)
{
if(!replayFile.Contains("chapter5"))
{
continue;
}

sw.Restart();
try
{
Expand Down
Binary file added src/ConsoleReader/Replays/chapter5season5.replay
Binary file not shown.
2 changes: 2 additions & 0 deletions src/Unreal.Core/Models/DataBunch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ public DataBunch(DataBunch InBunch)
/// </summary>
public bool bPartialInitial { get; set; }

public bool bHasPartialCustomExportsFinalBit { get; set; }

/// <summary>
/// The final bunch of a partial bunch
/// </summary>
Expand Down
4 changes: 4 additions & 0 deletions src/Unreal.Core/Models/Enums/EngineNetworkVersionHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public enum EngineNetworkVersionHistory
HISTORY_SUBOBJECT_DESTROY_FLAG = 30, // Bump version to support subobject destruction message flags
HISTORY_GAMESTATE_REPLCIATED_TIME_AS_DOUBLE = 31, // Bump version to support AGameStateBase::ReplicatedWorldTimeSeconds as double instead of float.
HISTORY_CUSTOMVERION = 32, // Bump version to switch to using custom versions
DynamicMontageSerialization = 33, // Bump version to support dynamic montage serialization in the Gameplay Ability System
PredictionKeyBaseNotReplicated = 34, // Bump version to stop FPredictionKey::Base from being replicated (it was unused).
RepMoveOptionalAcceleration = 35, // Bump version to support serialization changes to RepMove for optional Acceleration
CustomExports = 36, // Bump version to support CustomExports (such as NetTokens used for supporting "Dynamic Replication" of GameplayTags -- see FGameplayTag::NetSerialize_Packed) // -----<new versions can be added above this line>-------------------------------------------------

HISTORY_ENGINENETVERSION_PLUS_ONE,
LATEST = HISTORY_ENGINENETVERSION_PLUS_ONE - 1,
Expand Down
13 changes: 13 additions & 0 deletions src/Unreal.Core/ReplayReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
/// </summary>
private uint?[] IgnoringChannels = new uint?[DefaultMaxChannelSize]; // channel index, actorguid

public ReplayReader(ILogger logger, ParseMode mode)

Check warning on line 93 in src/Unreal.Core/ReplayReader.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Non-nullable property 'Replay' must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring the property as nullable.
{
_logger = logger;
_parseMode = mode;
Expand Down Expand Up @@ -758,6 +758,16 @@
};
_netGuidCache.AddToExportGroupMap(pathName, group);
}
else if (numExports > group.NetFieldExportsLength)
{
var oldExports = group.NetFieldExports;

group.NetFieldExports = new NetFieldExport[numExports];
group.NetFieldExportsLength = numExports;

Array.Copy(oldExports, group.NetFieldExports, oldExports.Length);
}

//GuidCache->NetFieldExportGroupPathToIndex.Add(PathName, PathNameIndex);
//GuidCache->NetFieldExportGroupIndexToGroup.Add(PathNameIndex, NetFieldExportGroup);
}
Expand Down Expand Up @@ -1750,9 +1760,9 @@
OnExportRead(channelIndex, exportGroup);
}

if (Channels[channelIndex].IsIgnoringGroup(group.PathName) && _parseMode != ParseMode.Debug)

Check warning on line 1763 in src/Unreal.Core/ReplayReader.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Dereference of a possibly null reference.
{
Channels[channelIndex].IgnoreGroup(group.PathName);

Check warning on line 1765 in src/Unreal.Core/ReplayReader.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

Dereference of a possibly null reference.
}

return true;
Expand Down Expand Up @@ -1940,6 +1950,8 @@
// https://github.com/EpicGames/UnrealEngine/blob/70bc980c6361d9a7d23f6d23ffe322a2d6ef16fb/Engine/Source/Runtime/Engine/Private/NetConnection.cpp#1549
InPacketId++;

bool bHasPartialCustomExportsFinalBit = !(bitReader.EngineNetworkVersion < EngineNetworkVersionHistory.CustomExports);

//var rejectedChannels = new Dictionary<uint, uint>();
while (!bitReader.AtEnd())
{
Expand Down Expand Up @@ -2003,6 +2015,7 @@
}

bunch.bPartialInitial = bunch.bPartial && bitReader.ReadBit();
bunch.bHasPartialCustomExportsFinalBit = bunch.bPartial && bHasPartialCustomExportsFinalBit ? bitReader.ReadBit() : false;
bunch.bPartialFinal = bunch.bPartial && bitReader.ReadBit();

var chType = ChannelType.None;
Expand Down Expand Up @@ -2036,7 +2049,7 @@
//};
}
}
bunch.ChType = chType;

Check warning on line 2052 in src/Unreal.Core/ReplayReader.cs

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

'DataBunch.ChType' is obsolete: 'UE_DEPRECATED(4.22, "ChType deprecated in favor of ChName.")'
bunch.ChName = chName;

// UChannel* Channel = Channels[Bunch.ChIndex];
Expand Down
Loading