docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct ConnectionApproved

    Add this component to a ServerWorld network connection entity, to denote that it has been approved by your logic. It will be added automatically on the client, once the connection is approved.

    Implements
    IComponentData
    IQueryTypeParameter
    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: Unity.NetCode
    Assembly: Unity.NetCode.dll
    Syntax
    public struct ConnectionApproved : IComponentData, IQueryTypeParameter
    Remarks

    Typically: The flow is that you'll send a game-specific IApprovalRpcCommand to the server, containing a authentication secret fetched from your game backend. The server RPC handling logic then needs to authenticate this secret, and - if valid - add this component to denote (to netcode) that this connection is approved.
    If the client fails authentication, either allow them to timeout, or manually disconnect them with ApprovalFailure.

    Implements

    Unity.Entities.IComponentData
    Unity.Entities.IQueryTypeParameter

    See Also

    HandshakeApprovalTimeoutMS
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)