示例#1
0
        public virtual bool ReadHeader(BitArchive reader)
        {
            uint header           = reader.ReadUInt32();
            uint historyWordCount = GetHistoryWordCount(header);

            for (int i = 0; i < historyWordCount; i++)
            {
                reader.ReadBit();
            }
            return(true);
        }
示例#2
0
        /// <summary>
        /// https://github.com/EpicGames/UnrealEngine/blob/70bc980c6361d9a7d23f6d23ffe322a2d6ef16fb/Engine/Source/Runtime/Engine/Private/NetConnection.cpp#L1525
        /// </summary>
        /// <param name="ar"></param>
        /// <returns></returns>
        public virtual bool ReceivedPacket(BitArchive ar)
        {
            ReadHeader(ar);
            ReadPacketInfo(ar);

            //TODO LOOP while( !Reader.AtEnd() && State!=USOCK_Closed )
            //while( ar.Offset < ar.Length )
            {
                if (DemoHeader !.EngineNetworkProtocolVersion < DemoHeader.EngineNetworkVersionHistory.HISTORY_ACKS_INCLUDED_IN_HEADER)
                {
                    ar.ReadBit();
                }

                InBunch bunch = ar.ReadInBunch();

                int bunchDataBits = (int)ar.ReadUInt32(2048 * 8);
            }
            return(true);
        }