Skip to main content

Unity.Netcode.CustomMessagingManager

The manager class to manage custom messages, note that this is different from the NetworkManager custom messages. These are named and are much easier to use.

Inheritance#

System.Dynamic.ExpandoObject

System.Dynamic.ExpandoObject

Inherited Members#

Object.Equals(Object)

Object.Equals(Object, Object)

Object.GetHashCode()

Object.GetType()

Object.MemberwiseClone()

Object.ReferenceEquals(Object, Object)

Object.ToString()

Namespace: System.Dynamic.ExpandoObject#
Assembly: MLAPI.dll#
Syntax#
public class CustomMessagingManager

RegisterNamedMessageHandler(String, CustomMessagingManager.HandleNamedMessageDelegate)#

Registers a named message handler delegate.

Declaration#

public void RegisterNamedMessageHandler(string name, CustomMessagingManager.HandleNamedMessageDelegate callback)

Parameters#

TypeNameDescription
System.StringnameName of the message.
CustomMessagingManager.HandleNamedMessageDelegatecallbackThe callback to run when a named message is received.

SendNamedMessage(String, IReadOnlyList\<UInt64>, FastBufferWriter, NetworkDelivery)#

Sends the named message

Declaration#

public void SendNamedMessage(string messageName, IReadOnlyList<ulong> clientIds, FastBufferWriter messageStream, NetworkDelivery networkDelivery = NetworkDelivery.ReliableSequenced)

Parameters#

TypeNameDescription
System.StringmessageNameThe message name to send
IReadOnlyList\<System.UInt64>clientIdsThe clients to send to, sends to everyone if null
FastBufferWritermessageStreamThe message stream containing the data
NetworkDeliverynetworkDeliveryThe delivery type (QoS) to send data with

SendNamedMessage(String, UInt64, FastBufferWriter, NetworkDelivery)#

Sends a named message

Declaration#

public void SendNamedMessage(string messageName, ulong clientId, FastBufferWriter messageStream, NetworkDelivery networkDelivery = NetworkDelivery.ReliableSequenced)

Parameters#

TypeNameDescription
System.StringmessageNameThe message name to send
System.UInt64clientIdThe client to send the message to
FastBufferWritermessageStreamThe message stream containing the data
NetworkDeliverynetworkDeliveryThe delivery type (QoS) to send data with

SendNamedMessageToAll(String, FastBufferWriter, NetworkDelivery)#

Sends a named message to all clients

Declaration#

public void SendNamedMessageToAll(string messageName, FastBufferWriter messageStream, NetworkDelivery networkDelivery = NetworkDelivery.ReliableSequenced)

Parameters#

TypeNameDescription
System.StringmessageName
FastBufferWritermessageStreamThe message stream containing the data
NetworkDeliverynetworkDeliveryThe delivery type (QoS) to send data with

SendUnnamedMessage(IReadOnlyList\<UInt64>, FastBufferWriter, NetworkDelivery)#

Sends unnamed message to a list of clients

Declaration#

public void SendUnnamedMessage(IReadOnlyList<ulong> clientIds, FastBufferWriter messageBuffer, NetworkDelivery networkDelivery = NetworkDelivery.ReliableSequenced)

Parameters#

TypeNameDescription
IReadOnlyList\<System.UInt64>clientIdsThe clients to send to, sends to everyone if null
FastBufferWritermessageBufferThe message stream containing the data
NetworkDeliverynetworkDeliveryThe delivery type (QoS) to send data with

SendUnnamedMessage(UInt64, FastBufferWriter, NetworkDelivery)#

Sends a unnamed message to a specific client

Declaration#

public void SendUnnamedMessage(ulong clientId, FastBufferWriter messageBuffer, NetworkDelivery networkDelivery = NetworkDelivery.ReliableSequenced)

Parameters#

TypeNameDescription
System.UInt64clientIdThe client to send the message to
FastBufferWritermessageBufferThe message stream containing the data
NetworkDeliverynetworkDeliveryThe delivery type (QoS) to send data with

SendUnnamedMessageToAll(FastBufferWriter, NetworkDelivery)#

Sends unnamed message to all clients

Declaration#

public void SendUnnamedMessageToAll(FastBufferWriter messageBuffer, NetworkDelivery networkDelivery = NetworkDelivery.ReliableSequenced)

Parameters#

TypeNameDescription
FastBufferWritermessageBufferThe message stream containing the data
NetworkDeliverynetworkDeliveryThe delivery type (QoS) to send data with

UnregisterNamedMessageHandler(String)#

Unregisters a named message handler.

Declaration#

public void UnregisterNamedMessageHandler(string name)

Parameters#

TypeNameDescription
System.StringnameThe name of the message.

#

OnUnnamedMessage#

Event invoked when unnamed messages arrive

Declaration#

public event CustomMessagingManager.UnnamedMessageDelegate OnUnnamedMessage

Event Type#

TypeDescription
CustomMessagingManager.UnnamedMessageDelegate