docs.unity.cn
    Show / Hide Table of Contents

    Struct NetworkId

    The connection identifier assigned by the server to the incoming client connection. The NetworkIdComponent is used as temporary client identifier for the current session. When a client disconnects, its network id can be reused by the server, and assigned to a new, incoming connection (on a a "first come, first serve" basis). Thus, there is no guarantee that a disconnecting client will receive the same network id once reconnected. As such, the network identifier should never be used to persist - and then retrieve - information for a given client/player.

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

    Fields

    Value

    The network identifier assigned by the server. A valid identifier it is always greater than 0.

    Declaration
    public int Value
    Field Value
    Type Description
    Int32
    Back to top Copyright © 2023 Unity Technologies — Terms of use
    Generated by DocFX
    on Wednesday, June 21, 2023