Interface IMessageReceiver
An object that can receive messages
Syntax
public interface IMessageReceiver
Methods
RegisterHandler<T>(MessageDelegateWithPlayer<T>, Boolean)
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
void RegisterHandler<T>(MessageDelegateWithPlayer<T> handler, bool allowUnauthenticated)
Parameters
Type | Name | Description |
---|---|---|
Mirage.MessageDelegateWithPlayer<T> | handler | |
System.Boolean | allowUnauthenticated |
UnregisterHandler<T>()
Declaration
void UnregisterHandler<T>()
ClearHandlers()
Declaration
void ClearHandlers()
HandleMessage(INetworkPlayer, ArraySegment<Byte>)
Declaration
void HandleMessage(INetworkPlayer player, ArraySegment<byte> packet)
Parameters
Type | Name | Description |
---|---|---|
Mirage.INetworkPlayer | player | |
System.ArraySegment<System.Byte> | packet |