Skip to content

Commit

Permalink
Merge pull request #45 from donCalculator/version2500
Browse files Browse the repository at this point in the history
adding support for v25.00
  • Loading branch information
Shiqan authored Jun 10, 2023
2 parents 027c096 + 9fdd3af commit 528141b
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 528141b

Please sign in to comment.