Class MessageReceiverExtensions
Inheritance
Inherited Members
Show
Syntax
public static class MessageReceiverExtensions
Methods
RegisterHandler<T>(IMessageReceiver, MessageDelegateWithPlayer<T>)
Registers a handler for a network message that has INetworkPlayer and T Message parameters
When network message are sent, the first 2 bytes are the Id for the type T. When message is received the handler with the matching Id is found and invoked
Declaration
public static void RegisterHandler<T>(this IMessageReceiver receiver, MessageDelegateWithPlayer<T> handler)
Parameters
Type | Name | Description |
---|---|---|
Mirage.IMessageReceiver | receiver | |
Mirage.MessageDelegateWithPlayer<T> | handler |
RegisterHandler<T>(IMessageReceiver, MessageDelegate<T>, Boolean)
Registers a handler for a network message that has just T Message parameter
When network message are sent, the first 2 bytes are the Id for the type T. When message is received the handler with the matching Id is found and invoked
Declaration
public static void RegisterHandler<T>(this IMessageReceiver receiver, MessageDelegate<T> handler, bool allowUnauthenticated = false)
Parameters
Type | Name | Description |
---|---|---|
Mirage.IMessageReceiver | receiver | |
Mirage.MessageDelegate<T> | handler | |
System.Boolean | allowUnauthenticated |
RegisterHandler<T>(IMessageReceiver, MessageDelegateWithPlayerAsync<T>, Boolean)
Registers a handler for a network message that has INetworkPlayer and T Message parameters and returns UniTaskVoid.
This allows for async handles without allocations
When network message are sent, the first 2 bytes are the Id for the type T. When message is received the handler with the matching Id is found and invoked
Declaration
public static void RegisterHandler<T>(this IMessageReceiver receiver, MessageDelegateWithPlayerAsync<T> handler, bool allowUnauthenticated = false)
Parameters
Type | Name | Description |
---|---|---|
Mirage.IMessageReceiver | receiver | |
Mirage.MessageDelegateWithPlayerAsync<T> | handler | |
System.Boolean | allowUnauthenticated |
RegisterHandler<T>(IMessageReceiver, MessageDelegateAsync<T>, Boolean)
Registers a handler for a network message that has just T Message parameter and returns UniTaskVoid.
This allows for async handles without allocations
When network message are sent, the first 2 bytes are the Id for the type T. When message is received the handler with the matching Id is found and invoked
Declaration
public static void RegisterHandler<T>(this IMessageReceiver receiver, MessageDelegateAsync<T> handler, bool allowUnauthenticated = false)
Parameters
Type | Name | Description |
---|---|---|
Mirage.IMessageReceiver | receiver | |
Mirage.MessageDelegateAsync<T> | handler | |
System.Boolean | allowUnauthenticated |