Ejemplo n.º 1
0
        public virtual bool ParseCheckpointContent(ChunkArchive ar, string id, string group, string metadata, uint time1, uint time2)
        {
            if ((DemoHeader !.HeaderFlags & DemoHeader.ReplayHeaderFlags.HasStreamingFixes) > 0)
            {
                long packetOffset = ar.ReadInt64();
            }
            if (DemoHeader !.NetworkVersion >= NetworkVersionHistory.multipleLevels)
            {
                int levelForCheckpoint = ar.ReadInt32();
            }

            if (DemoHeader !.NetworkVersion >= NetworkVersionHistory.deletedStartupActors)
            {
                string[] deletedNetStartupActors = ar.ReadArray(ar.ReadString);
            }

            int valuesCount = ar.ReadInt32();

            for (int i = 0; i < valuesCount; i++)
            {
                uint   guid      = ar.ReadIntPacked();
                uint   outerGuid = ar.ReadIntPacked();
                string path      = ar.ReadString();
                uint   checksum  = ar.ReadUInt32();
                byte   flags     = ar.ReadByte();
            }
            NetFieldExportGroupMap(ar);
            ParsePlaybackPacket(ar);
            // File.WriteAllBytes( "dump.dump", binaryReader.DumpRemainingBytes() );
            return(true);
        }
Ejemplo n.º 2
0
        public virtual bool ParseNetFieldExportGroup(ChunkArchive ar)
        {
            string a         = ar.ReadString();
            uint   packedInt = ar.ReadIntPacked();
            uint   count     = ar.ReadIntPacked();

            for (int i = 0; i < count; i++)
            {
                ar.ReadNetFieldExport();
            }
            return(true);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Was writed to support how Fortnite store replays.
        /// This may need to be upgrade to support other games, or some future version of Fortnite.
        /// </summary>
        /// <param name="binaryReader"></param>
        /// <param name="replayDataInfo"></param>
        /// <returns></returns>
        public virtual bool ParsePlaybackPacket(ChunkArchive reader)
        {
            bool  appendPacket           = true;
            bool  hasLevelStreamingFixes = true;               //TODO: this method
            int   currentLevelIndex      = reader.ReadInt32(); //TODO: use replayVersion. HasLevelStreamingFixes
            float timeSeconds            = reader.ReadSingle();

            if (float.IsNaN(timeSeconds))
            {
                throw new InvalidDataException();
            }
            ParseExportData(reader);  //TODO: use replayVersion. HasLevelStreamingFixes
            if (HaveLevelStreamingFixes())
            {
                uint streamingLevelscount = reader.ReadIntPacked();
                for (int i = 0; i < streamingLevelscount; i++)
                {
                    string levelName = reader.ReadString();
                }
            }
            else
            {
                throw new NotSupportedException("TODO");
            }
            long skipExternalOffset = 0;

            if (HaveLevelStreamingFixes())
            {
                skipExternalOffset = reader.ReadInt64();
            }
            else
            {
                throw new NotImplementedException();
            }

            ParseExternalData(reader);
            uint seenLevelIndex = 0;

            //while( true )
            //{
            //    if( hasLevelStreamingFixes )
            //    {
            //        seenLevelIndex = reader.ReadIntPacked();
            //    }
            //    int amount = ParsePacket( reader );
            //    if( amount == 0 ) break;
            //    if( appendPacket ) continue;
            //}//There is more data ?
            return(true);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Was writed to support how Fortnite store replays.
        /// This may need to be upgrade to support other games, or some future version of Fortnite.
        /// https://github.com/EpicGames/UnrealEngine/blob/7d9919ac7bfd80b7483012eab342cb427d60e8c9/Engine/Source/Runtime/Engine/Private/DemoNetDriver.cpp#L2848
        /// </summary>
        /// <param name="binaryReader"></param>
        /// <param name="replayDataInfo"></param>
        /// <returns></returns>
        public virtual bool ParsePlaybackPacket(ChunkArchive reader)
        {
            if (DemoHeader !.NetworkVersion >= DemoHeader.NetworkVersionHistory.multipleLevels)
            {
                int currentLevelIndex = reader.ReadInt32();
            }
            float timeSeconds = reader.ReadSingle();

            if (float.IsNaN(timeSeconds))
            {
                throw new InvalidDataException();
            }
            if (DemoHeader !.NetworkVersion >= DemoHeader.NetworkVersionHistory.levelStreamingFixes)
            {
                ParseExportData(reader);
            }
            if (HasLevelStreamingFixes())
            {
                uint streamingLevelscount = reader.ReadIntPacked();
                for (int i = 0; i < streamingLevelscount; i++)
                {
                    string levelName = reader.ReadString();
                }
            }
            else
            {
                throw new NotSupportedException("TODO");
            }
            long skipExternalOffset = 0;

            if (HasLevelStreamingFixes())
            {
                skipExternalOffset = reader.ReadInt64();
            }
            else
            {
                throw new NotImplementedException();
            }

            ParseExternalData(reader);
            return(ReadPackets(reader));
        }
Ejemplo n.º 5
0
        public virtual bool ParseNetFieldExports(ChunkArchive reader)
        {
            uint exportCount = reader.ReadIntPacked();

            for (int i = 0; i < exportCount; i++)
            {
                uint pathNameIndex = reader.ReadIntPacked();
                uint wasExported   = reader.ReadIntPacked();
                if (wasExported > 0)
                {
                    string pathName   = reader.ReadString();
                    uint   numExports = reader.ReadIntPacked();
                }
                else
                {
                    //We does nothing here but Unreal does something
                }
                var netExports = reader.ReadNetFieldExport();
            }
            return(true);
        }