docs.unity3d.com
    Show / Hide Table of Contents

    Struct NetworkSnapshotAck

    Client and Server Component. One per NetworkId entity, stores SnapshotAck and Ping info for a client.

    Inherited Members
    ValueType.Equals(Object)
    ValueType.GetHashCode()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetType()
    Namespace: Unity.NetCode
    Syntax
    public struct NetworkSnapshotAck : IComponentData, IQueryTypeParameter

    Fields

    DeviationRTT

    The round trip time average deviation from the EstimatedRTT. It is not a real standard deviation but an approximation using a simpler exponential smoothing average.

    Declaration
    public float DeviationRTT
    Field Value
    Type Description
    Single

    EstimatedRTT

    The calculated exponential smoothing average connection round trip time.

    Declaration
    public float EstimatedRTT
    Field Value
    Type Description
    Single

    LastReceivedRemoteTime

    The last remote time stamp received by the connection. The remote time is sent back (via command for the client or in the snapshot for the server) and used to calculate the round trip time for the connection.

    Declaration
    public uint LastReceivedRemoteTime
    Field Value
    Type Description
    UInt32

    LastReceivedSnapshotByLocal

    The field has a different meaning on the client vs on the server:

    Client: it is the last received ghost snapshot from the server.

    Server: record the last command tick that has been received. Used to discard either out of order or late commands.

    Declaration
    public NetworkTick LastReceivedSnapshotByLocal
    Field Value
    Type Description
    NetworkTick

    LastReceivedSnapshotByRemote

    The last snapshot (tick) received from the remote peer.

    For the client, it respresent the last received snapshot received from the server.

    For the server, it is the last acknowledge packet that has been received by client.

    Declaration
    public NetworkTick LastReceivedSnapshotByRemote
    Field Value
    Type Description
    NetworkTick

    LastReceiveTimestamp

    The local time stamp at which the connection has received the last message. Used to calculate the elapsed "processing" time and reported to the remote peer to correctly update the round trip time.

    Declaration
    public uint LastReceiveTimestamp
    Field Value
    Type Description
    UInt32

    NumLoadedPrefabs

    Server-only, the number of ghost prefabs loaded by remote client. On the client is not used and it is always 0.

    Declaration
    public uint NumLoadedPrefabs
    Field Value
    Type Description
    UInt32

    ReceivedSnapshotByLocalMask

    Client-only, a bitmask that indicates which of the last 32 snapshots has been received from the server. On the server it is always 0.

    Declaration
    public uint ReceivedSnapshotByLocalMask
    Field Value
    Type Description
    UInt32

    RemoteInterpolationDelay

    The reported interpolation delay reported by the client (in number of ticks).

    Declaration
    public uint RemoteInterpolationDelay
    Field Value
    Type Description
    UInt32

    ServerCommandAge

    How late the commands are received by server. Is a negative fixedPoint Q24:8 number that measure how many ticks behind the server was when he received the command, and it used as feedback by the NetworkTimeSystem to synchronize the ServerTick such that the client always runs ahead of the server. A positive number indicates that the client is running behind the server. A negative number indicates that the client is running ahead of the server.

    Declaration
    public int ServerCommandAge
    Field Value
    Type Description
    Int32

    Methods

    IsReceivedByRemote(NetworkTick)

    Return true if the snapshot for tick tick has been received (from a client perspective) or acknowledged (from the servers POV)

    Declaration
    public bool IsReceivedByRemote(NetworkTick tick)
    Parameters
    Type Name Description
    NetworkTick tick
    Returns
    Type Description
    Boolean

    Did you find this page useful? Please give it a rating:

    Thanks for rating this page!

    Report a problem on this page

    What kind of problem would you like to report?

    • This page needs code samples
    • Code samples do not work
    • Information is missing
    • Information is incorrect
    • Information is unclear or confusing
    • There is a spelling/grammar error on this page
    • Something else

    Thanks for letting us know! This page has been marked for review based on your feedback.

    If you have time, you can provide more information to help us fix the problem faster.

    Provide more information

    You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:

    You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:

    You've told us there is information missing from this page. Please tell us more about what's missing:

    You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:

    You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:

    You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:

    You've told us this page has a problem. Please tell us more about what's wrong:

    Thank you for helping to make the Unity documentation better!

    Your feedback has been submitted as a ticket for our documentation team to review.

    We are not able to reply to every ticket submitted.

    In This Article
    • Fields
      • DeviationRTT
      • EstimatedRTT
      • LastReceivedRemoteTime
      • LastReceivedSnapshotByLocal
      • LastReceivedSnapshotByRemote
      • LastReceiveTimestamp
      • NumLoadedPrefabs
      • ReceivedSnapshotByLocalMask
      • RemoteInterpolationDelay
      • ServerCommandAge
    • Methods
      • IsReceivedByRemote(NetworkTick)
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023