Ejemplo n.º 1
0
        /// <summary>
        ///     Sets the network statistics for a given direction for the current frame.
        /// </summary>
        /// <param name="frameData">The network statistics.</param>
        /// <param name="direction">The direction of those statistics.</param>
        public void SetFrameStats(NetFrameStats frameData, Direction direction)
        {
            // First we need to zero out the data before processing the _sparse_ data in the NetFrameStats.
            foreach (var pair in Data)
            {
                pair.Value.Clear(nextFrameIndex, direction);
            }

            foreach (var pair in frameData.Messages)
            {
                if (!Data.TryGetValue(pair.Key, out var data))
                {
                    data = new DataSequence(sequenceLength);
                }

                data.AddFrame(nextFrameIndex, pair.Value, direction);
                Data[pair.Key] = data;
            }
        }
Ejemplo n.º 2
0
 internal void AddOutgoingSample(NetFrameStats frameStats)
 {
     lastOutgoingData.CopyFrom(frameStats);
 }