Skip to main content

MLAPI.Messaging.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 static class CustomMessagingManager

Methods#

RegisterNamedMessageHandler(String, CustomMessagingManager.HandleNamedMessageDelegate)#

Registers a named message handler delegate.

Declaration#

public static 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, List<UInt64>, Stream, NetworkChannel)#

Sends the named message

Declaration#

public static void SendNamedMessage(string name, List<ulong> clientIds, Stream stream, NetworkChannel networkChannel = NetworkChannel.Internal)

Parameters#

TypeNameDescription
System.StringnameThe message name to send
System.Collections.Generic.List<System.UInt64>clientIdsThe clients to send to, sends to everyone if null
System.IO.StreamstreamThe message stream containing the data
NetworkChannelnetworkChannelThe channel to send the data on

SendNamedMessage(String, UInt64, Stream, NetworkChannel)#

Sends a named message

Declaration#

public static void SendNamedMessage(string name, ulong clientId, Stream stream, NetworkChannel networkChannel = NetworkChannel.Internal)

Parameters#

TypeNameDescription
System.StringnameThe message name to send
System.UInt64clientIdThe client to send the message to
System.IO.StreamstreamThe message stream containing the data
NetworkChannelnetworkChannelThe channel to send the data on

SendUnnamedMessage(List<UInt64>, NetworkBuffer, NetworkChannel)#

Sends unnamed message to a list of clients

Declaration#

public static void SendUnnamedMessage(List<ulong> clientIds, NetworkBuffer buffer, NetworkChannel networkChannel = NetworkChannel.Internal)

Parameters#

TypeNameDescription
System.Collections.Generic.List<System.UInt64>clientIdsThe clients to send to, sends to everyone if null
NetworkBufferbufferThe message stream containing the data
NetworkChannelnetworkChannelThe channel to send the data on

SendUnnamedMessage(UInt64, NetworkBuffer, NetworkChannel)#

Sends a unnamed message to a specific client

Declaration#

public static void SendUnnamedMessage(ulong clientId, NetworkBuffer buffer, NetworkChannel networkChannel = NetworkChannel.Internal)

Parameters#

TypeNameDescription
System.UInt64clientIdThe client to send the message to
NetworkBufferbufferThe message stream containing the data
NetworkChannelnetworkChannelThe channel tos end the data on

UnregisterNamedMessageHandler(String)#

Unregisters a named message handler.

Declaration#

public static void UnregisterNamedMessageHandler(string name)

Parameters#

TypeNameDescription
System.StringnameThe name of the message.

Events#

OnUnnamedMessage#

Event invoked when unnamed messages arrive

Declaration#

public static event CustomMessagingManager.UnnamedMessageDelegate OnUnnamedMessage

Event Type#

TypeDescription
CustomMessagingManager.UnnamedMessageDelegate