Mercury Messaging
Documentation for the Mercury Messaging Framework
MercuryMessaging.MmNetworkResponder Class Reference
Inheritance diagram for MercuryMessaging.MmNetworkResponder:
MercuryMessaging.IMmNetworkResponder

Public Member Functions

virtual void MmOnAwakeComplete ()
 Post Awake callback used between objects implementing this interface. This allows for initialization steps that must occur before one instance's Awake and its Start. More...
 
virtual void MmOnStartComplete ()
 Post Start callback used between objects implementing this interface This allows for initialization steps that must occur before one instance's Start and its first Update. More...
 
void MmRegisterAwakeCompleteCallback (IMmCallback callback)
 It is possible that certain handles are not going to be in-place when registration of the OnAwakeComplete callback is invoked. The is especially true in scenarios where MmRelayNodes are networked. This allows for a deferred registration, eliminating most instances where the Awake callback invocations fail. More...
 
void MmRegisterStartCompleteCallback (IMmCallback callback)
 It is possible that certain handles are not going to be in-place when registration of the OnStartComplete callback is invoked. The is especially true in scenarios where MmRelayNodes are networked. This allows for a deferred registration, eliminating most instances where the Start callback invocations fail. More...
 
virtual void MmInvoke (MmMessageType msgType, MmMessage message, int connectionId=-1)
 This is the network equivalent of IMmResponder's MmInvoke. The difference is this class allows specification of connectionIDs which can be used to ensure messages are routed to the correct objects on network clients. More...
 
virtual void Awake ()
 Awake gets the MmRelayNode, if one is present. Also calls the post-awake callback. More...
 
virtual void Start ()
 Attempts to register the this responder with the MmNetworkManager. Also calls the post-start callback. More...
 
virtual void MmSendMessageToServer (short msgType, MessageBase msg)
 Method serializes message and sends it to server. More...
 
virtual void MmSendMessageToClient (int channelId, short msgType, MmMessage msg)
 Send a message to a specific client over chosen UNET. More...
 
virtual void MmSendMessageToClient (short msgType, MmMessage msg)
 Send a message to all clients using UNET More...
 
virtual void RegisterToMmNetworkManager ()
 
virtual void RemoveSelfFromMmNetworkManager ()
 

Properties

MmRelayNode MmRelayNode [get]
 Get a handle to an MmRelayNode that shares the same GameObject. More...
 
bool AllowClientToSend [get]
 Allows us to stop messages on client from sending. More...
 
bool IsActiveAndEnabled [get]
 Set when Network Obj is active & enabled. This is important since Objects in UNET scenarios UNET may not be awake/active at the same times. More...
 
bool OnServer [get]
 Indicates whether the network responder is executing on a server More...
 
bool OnClient [get]
 Indicates whether the network responder is executing on a client More...
 
- Properties inherited from MercuryMessaging.IMmNetworkResponder
bool AllowClientToSend [get]
 Allows us to stop messages on client from sending. More...
 
bool IsActiveAndEnabled [get]
 Set when Network Obj is active & enabled. This is important since Objects in UNET scenarios UNET may not be awake/active at the same times. More...
 
bool OnServer [get]
 Indicates whether the network responder is executing on a server More...
 
bool OnClient [get]
 Indicates whether the network responder is executing on a client More...
 

Events

IMmCallback MmAwake
 Event triggered in the MmNetworkResponder when this object is awoken. Todo: Needs to be swapped for MmAwakeCompleteCallback More...
 
IMmCallback MmStart
 Event triggered in the MmNetworkResponder when this object is started. Todo: Needs to be swapped for MmStartCompleteCallback More...
 

Member Function Documentation

◆ Awake()

virtual void MercuryMessaging.MmNetworkResponder.Awake ( )
virtual

Awake gets the MmRelayNode, if one is present. Also calls the post-awake callback.

◆ MmInvoke()

virtual void MercuryMessaging.MmNetworkResponder.MmInvoke ( MmMessageType  msgType,
MmMessage  message,
int  connectionId = -1 
)
virtual

This is the network equivalent of IMmResponder's MmInvoke. The difference is this class allows specification of connectionIDs which can be used to ensure messages are routed to the correct objects on network clients.

Parameters
msgTypeType of message. This specifies the type of the payload. This is important in networked scenarios, when proper deseriaization into the correct type requires knowing what was used to serialize the object originally.
msgThe message to send. This class builds on UNET's MessageBase so it is Auto [de]serialized by UNET.
connectionIdConnection ID - use to identify clients.

Implements MercuryMessaging.IMmNetworkResponder.

◆ MmOnAwakeComplete()

virtual void MercuryMessaging.MmNetworkResponder.MmOnAwakeComplete ( )
virtual

Post Awake callback used between objects implementing this interface. This allows for initialization steps that must occur before one instance's Awake and its Start.

Implements MercuryMessaging.IMmNetworkResponder.

◆ MmOnStartComplete()

virtual void MercuryMessaging.MmNetworkResponder.MmOnStartComplete ( )
virtual

Post Start callback used between objects implementing this interface This allows for initialization steps that must occur before one instance's Start and its first Update.

Implements MercuryMessaging.IMmNetworkResponder.

◆ MmRegisterAwakeCompleteCallback()

void MercuryMessaging.MmNetworkResponder.MmRegisterAwakeCompleteCallback ( IMmCallback  callback)

It is possible that certain handles are not going to be in-place when registration of the OnAwakeComplete callback is invoked. The is especially true in scenarios where MmRelayNodes are networked. This allows for a deferred registration, eliminating most instances where the Awake callback invocations fail.

Parameters
callbackCallback to be registered.

Implements MercuryMessaging.IMmNetworkResponder.

◆ MmRegisterStartCompleteCallback()

void MercuryMessaging.MmNetworkResponder.MmRegisterStartCompleteCallback ( IMmCallback  callback)

It is possible that certain handles are not going to be in-place when registration of the OnStartComplete callback is invoked. The is especially true in scenarios where MmRelayNodes are networked. This allows for a deferred registration, eliminating most instances where the Start callback invocations fail.

Parameters
callbackCallback to be registered.

Implements MercuryMessaging.IMmNetworkResponder.

◆ MmSendMessageToClient() [1/2]

virtual void MercuryMessaging.MmNetworkResponder.MmSendMessageToClient ( int  channelId,
short  msgType,
MmMessage  msg 
)
virtual

Send a message to a specific client over chosen UNET.

Parameters
channelIdClient connection ID
msgTypeType of message. This specifies the type of the payload. This is important in networked scenarios, when proper deseriaization into the correct type requires knowing what was used to serialize the object originally.
msgThe message to send. This utilises UNET's MessageBase so it is Auto [de]serialized by UNET. This also allows us to send messages that are not part of Mercury XM

◆ MmSendMessageToClient() [2/2]

virtual void MercuryMessaging.MmNetworkResponder.MmSendMessageToClient ( short  msgType,
MmMessage  msg 
)
virtual

Send a message to all clients using UNET

Parameters
msgTypeType of message. This specifies the type of the payload. This is important in networked scenarios, when proper deseriaization into the correct type requires knowing what was used to serialize the object originally.
msgThe message to send. This utilises UNET's MessageBase so it is Auto [de]serialized by UNET. This also allows us to send messages that are not part of Mercury XM

◆ MmSendMessageToServer()

virtual void MercuryMessaging.MmNetworkResponder.MmSendMessageToServer ( short  msgType,
MessageBase  msg 
)
virtual

Method serializes message and sends it to server.

Parameters
msgTypeType of message. This specifies the type of the payload. This is important in networked scenarios, when proper deseriaization into the correct type requires knowing what was used to serialize the object originally.
msgThe message to send. This utilises UNET's MessageBase so it is Auto [de]serialized by UNET. This also allows us to send messages that are not part of Mercury XM

◆ Start()

virtual void MercuryMessaging.MmNetworkResponder.Start ( )
virtual

Attempts to register the this responder with the MmNetworkManager. Also calls the post-start callback.

Property Documentation

◆ AllowClientToSend

bool MercuryMessaging.MmNetworkResponder.AllowClientToSend
get

Allows us to stop messages on client from sending.

◆ IsActiveAndEnabled

bool MercuryMessaging.MmNetworkResponder.IsActiveAndEnabled
get

Set when Network Obj is active & enabled. This is important since Objects in UNET scenarios UNET may not be awake/active at the same times.

◆ MmRelayNode

MmRelayNode MercuryMessaging.MmNetworkResponder.MmRelayNode
get

Get a handle to an MmRelayNode that shares the same GameObject.

◆ OnClient

bool MercuryMessaging.MmNetworkResponder.OnClient
get

Indicates whether the network responder is executing on a client

◆ OnServer

bool MercuryMessaging.MmNetworkResponder.OnServer
get

Indicates whether the network responder is executing on a server

Event Documentation

◆ MmAwake

IMmCallback MercuryMessaging.MmNetworkResponder.MmAwake

Event triggered in the MmNetworkResponder when this object is awoken. Todo: Needs to be swapped for MmAwakeCompleteCallback

◆ MmStart

IMmCallback MercuryMessaging.MmNetworkResponder.MmStart

Event triggered in the MmNetworkResponder when this object is started. Todo: Needs to be swapped for MmStartCompleteCallback


The documentation for this class was generated from the following file: