Skip to content

Commit

Permalink
adding support for v25.00
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisai-dev committed Jun 9, 2023
1 parent 027c096 commit 7923527
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Unreal.Core/Models/Enums/NetworkVersionHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public enum NetworkVersionHistory
HISTORY_GUIDCACHE_CHECKSUMS = 16, // Removing guid export checksums from saved data, they are ignored during playback
HISTORY_SAVE_PACKAGE_VERSION_UE = 17, // Save engine and licensee package version as well, in case serialization functions need them for compatibility
HISTORY_RECORDING_METADATA = 18, // Adding additional record-time information to the header
HISTORY_USE_CUSTOM_VERSION = 19, // Serializing replay and network versions as custom verions going forward

HISTORY_NETWORKVERSION_PLUS_ONE,
LATEST = HISTORY_NETWORKVERSION_PLUS_ONE - 1,
Expand Down
1 change: 1 addition & 0 deletions src/Unreal.Core/Models/Enums/ReplayVersionHistory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public enum ReplayVersionHistory : uint
HISTORY_STREAM_CHUNK_TIMES = 4,
HISTORY_FRIENDLY_NAME_ENCODING = 5,
HISTORY_ENCRYPTION = 6,
HISTORY_2500 = 7, // TODO, FIND THE NAME OF THIS

HISTORY_PLUS_ONE,
LATEST = HISTORY_PLUS_ONE - 1
Expand Down
14 changes: 14 additions & 0 deletions src/Unreal.Core/ReplayReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,14 @@ public virtual void ReadReplayHeader(FArchive archive)
_logger?.LogError("Header.Version < MIN_NETWORK_DEMO_VERSION. Header.Version: {}, MIN_NETWORK_DEMO_VERSION: {}", header.NetworkVersion, NetworkVersionHistory.HISTORY_EXTRA_VERSION);
throw new InvalidReplayException($"Header.Version < MIN_NETWORK_DEMO_VERSION. Header.Version: {header.NetworkVersion}, MIN_NETWORK_DEMO_VERSION: {NetworkVersionHistory.HISTORY_EXTRA_VERSION}");
}
if (header.NetworkVersion >= NetworkVersionHistory.HISTORY_USE_CUSTOM_VERSION)
{
var customVersionCount = archive.ReadInt32();

// version guid -> 16 bytes
// version -> 4 bytes
archive.SkipBytes(customVersionCount * 20);
}
header.NetworkChecksum = archive.ReadUInt32();
header.EngineNetworkVersion = archive.ReadUInt32AsEnum<EngineNetworkVersionHistory>();

Expand Down Expand Up @@ -524,7 +531,14 @@ public virtual void ReadReplayInfo(FArchive archive)
{
_logger?.LogWarning("Found unexpected ReplayVersionHistory: {}", fileVersion);
}
if (archive.ReplayVersion == ReplayVersionHistory.HISTORY_2500)
{
var customVersionCount = archive.ReadInt32();

// version guid -> 16 bytes
// version -> 4 bytes
archive.SkipBytes(customVersionCount * 20);
}
var info = new ReplayInfo()
{
FileVersion = fileVersion,
Expand Down

0 comments on commit 7923527

Please sign in to comment.