{!See https://docs.google.com/document/d/1takg_GmIBBKKTj-GHZCwzxohpQz7Bhekivkk72kYMtE/edit for reference implementation of OneTrust, dataLayer and GTM} {!OneTrust Cookies Consent} {!OneTrust Cookies Consent end} {!dataLayer initialization push} {!dataLayer initialization push end} {!Google Tag Manager} {!Google Tag Manager end} Struct RpcQueue<TActionSerializer, TActionRequest> | Netcode for Entities | 1.1.0-pre.3
docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct RpcQueue<TActionSerializer, TActionRequest>

    A helper struct that should be used schedule outgoing RPCs. The RpcQueue is used internally by the code-generated systems that consume the SendRpcCommandRequest requests, and allow you to serialize the rpc (that will be sent into the OutgoingRpcDataStreamBuffer for the outgoing connection).

    You can use the RpcQueue in your custom system by retrieving an instance for the given TActionRequest, TActionSerializer pair from the RpcCollection by calling the GetRpcQueue<TActionSerializer, TActionRequest>() method.

    The typename of the struct implementing the IRpcCommandSerializer<T> interface for the TActionRequest The typename of a struct implementing the IComponentData interface

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Unity.NetCode
    Assembly: solution.dll
    Syntax
    public struct RpcQueue<TActionSerializer, TActionRequest> where TActionSerializer : struct, IRpcCommandSerializer<TActionRequest> where TActionRequest : struct, IComponentData
    Type Parameters
    Name Description
    TActionSerializer

    the struct type that implements the IRpcCommandSerializer interface.

    TActionRequest

    the rpc type

    Remarks

    If you intend to cache the retrieved queue (e.g. inside an OnCreate function in your system), you must ensure that your system is created after the RpcSystem by using the CreateAfterAttribute.

    Methods

    Name Description
    Schedule(DynamicBuffer<OutgoingRpcDataStreamBuffer>, ComponentLookup<GhostInstance>, TActionRequest)

    Schedules an rpc to be sent through the network, by serializing and appending a new rpc packet into the OutgoingRpcDataStreamBuffer, for the given connection.

    The binary rpc data has the following format:

    - PacketType: short or long based on the DynamicAssemblyList.

    - MsgLen: short, the length of the serialized data.

    - RpcData: the binary data generated by invoking the TActionSerializer serialize method.

    In This Article
    Back to top
    Copyright © 2023 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)