diff --git a/src/Unreal.Core/Models/Enums/NetworkVersionHistory.cs b/src/Unreal.Core/Models/Enums/NetworkVersionHistory.cs index be626ba..88fd3cd 100644 --- a/src/Unreal.Core/Models/Enums/NetworkVersionHistory.cs +++ b/src/Unreal.Core/Models/Enums/NetworkVersionHistory.cs @@ -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, diff --git a/src/Unreal.Core/Models/Enums/ReplayVersionHistory.cs b/src/Unreal.Core/Models/Enums/ReplayVersionHistory.cs index e348ef3..eb3c2ba 100644 --- a/src/Unreal.Core/Models/Enums/ReplayVersionHistory.cs +++ b/src/Unreal.Core/Models/Enums/ReplayVersionHistory.cs @@ -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 diff --git a/src/Unreal.Core/ReplayReader.cs b/src/Unreal.Core/ReplayReader.cs index 4e257ae..8fbc363 100644 --- a/src/Unreal.Core/ReplayReader.cs +++ b/src/Unreal.Core/ReplayReader.cs @@ -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(); @@ -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,