public void Serialize(NetBitReader reader)
        {
            var isHardcoded = reader.ReadBoolean();

            if (isHardcoded)
            {
                uint nameIndex;
                if (reader.EngineNetworkVersion < EngineNetworkVersionHistory.HISTORY_CHANNEL_NAMES)
                {
                    nameIndex = reader.ReadUInt32();
                }
                else
                {
                    nameIndex = reader.ReadIntPacked();
                }

                Value = ((UnrealNames)nameIndex).ToString();

                return;
            }

            var inString = reader.ReadFString();
            var inNumber = reader.ReadInt32();

            Value = inString;
        }
        public void Serialize(NetBitReader reader)
        {
            bool repPosition = reader.ReadBoolean();

            if (repPosition)
            {
                bRepPosition           = true;
                SectionIdToPlay        = 0;
                SkipPositionCorrection = false;

                uint packedPosition = reader.ReadIntPacked();

                Position = packedPosition / 100;
            }
            else
            {
                bRepPosition = false;

                SkipPositionCorrection = true;
                Position        = 0;
                SectionIdToPlay = reader.ReadBitsToInt(7);
            }

            IsStopped              = reader.ReadBit();
            ForcePlayBit           = reader.ReadBit();
            SkipPositionCorrection = reader.ReadBit();
            bSkipPlayRate          = reader.ReadBit();

            AnimMontage = new UObjectGUID {
                Value = reader.ReadIntPacked()
            };
            PlayRate      = reader.SerializePropertyFloat();
            BlendTime     = reader.SerializePropertyFloat();
            NextSectionID = reader.ReadByte();

            PredictionKey = new FPredictionKey();
            PredictionKey.Serialize(reader);
        }
예제 #3
0
        /*
         * private FRepMovement AsRepMovement()
         * {
         *  _reader.Reset();
         *
         *  FRepMovement repMovement = _reader.SerializeRepMovement();
         *
         *  if(_reader.IsError || !_reader.AtEnd())
         *  {
         *      return null;
         *  }
         *
         *  return repMovement;
         * }
         */

        private string AsStaticName()
        {
            _reader.Reset();

            var isHardcoded = _reader.ReadBoolean();

            if (isHardcoded)
            {
                uint nameIndex;
                if (_reader.EngineNetworkVersion < EngineNetworkVersionHistory.HISTORY_CHANNEL_NAMES)
                {
                    nameIndex = _reader.ReadUInt32();
                }
                else
                {
                    nameIndex = _reader.ReadIntPacked();
                }

                if (_reader.IsError || !_reader.AtEnd())
                {
                    return(null);
                }

                return(((UnrealNames)nameIndex).ToString());
            }

            var inString = _reader.ReadFString();
            var inNumber = _reader.ReadInt32();

            if (_reader.IsError || !_reader.AtEnd())
            {
                return(null);
            }

            return(inString);
        }