![]() |
Mercury Messaging
Documentation for the Mercury Messaging Framework
|
Base routing node of Mercury XM. Contains a list of MmResponders and sends MmMessages to responders in list, following the specifications of control blocks to MmInvoke method. More...
Public Member Functions | |
MmRelayNode () | |
Creates an empty MmResponder list on construction. More... | |
override void | Awake () |
Grab attached MmNetworkResponder, if present. Detect and refresh parents. Instantiate any cloneable MmResponders. More... | |
override void | Start () |
Calls MmOnStartComplete through MmResponder Start. More... | |
virtual MmRoutingTableItem | MmAddToRoutingTable (MmResponder mmResponder, MmLevelFilter level) |
Add an MmResponder to the MmRoutingTable, with level designation. More... | |
virtual MmRoutingTableItem | MmAddToRoutingTable (MmResponder mmResponder, string newName) |
Add an MmResponder to the MmRoutingTable, with level designation. More... | |
void | MmRefreshResponders () |
Grab all MmResponders attached to the same GameObject. Does not grab any other MmRelayNodes attached to the same GameObject. More... | |
void | RefreshParents () |
Iterates through RoutingTable list and assigns this MmRelayNode as a parent to child MmResponders. More... | |
virtual void | MmAddNodeToList (GameObject go) |
Given a GameObject, extract an MmRelayNode if present and add it to this MmRelayNode's Responder list. More... | |
virtual void | AddParent (MmRelayNode parent) |
Given an MmRelayNode, add it as parent to this instance's MmRoutingTable. More... | |
override void | MmInvoke (MmMessageType msgType, MmMessage message) |
Invoke an MmMethod. More... | |
virtual void | MmInvoke (MmMethod mmMethod, MmMetadataBlock metadataBlock=null) |
Invoke an MmMethod with no parameter. More... | |
virtual void | MmInvoke (MmMethod mmMethod, bool param, MmMetadataBlock metadataBlock=null) |
Invoke an MmMethod with parameter: bool. More... | |
virtual void | MmInvoke (MmMethod mmMethod, int param, MmMetadataBlock metadataBlock=null) |
Invoke an MmMethod with parameter: int. More... | |
virtual void | MmInvoke (MmMethod mmMethod, float param, MmMetadataBlock metadataBlock=null) |
Invoke an MmMethod with parameter: float. More... | |
virtual void | MmInvoke (MmMethod mmMethod, Vector3 param, MmMetadataBlock metadataBlock=null) |
Invoke an MmMethod with parameter: Vector3. More... | |
virtual void | MmInvoke (MmMethod mmMethod, Vector4 param, MmMetadataBlock metadataBlock=null) |
Invoke an MmMethod with parameter: Vector4. More... | |
virtual void | MmInvoke (MmMethod mmMethod, string param, MmMetadataBlock metadataBlock=null) |
Invoke an MmMethod with parameter: string. More... | |
virtual void | MmInvoke (MmMethod mmMethod, byte[] param, MmMetadataBlock metadataBlock=null) |
Invoke an MmMethod with parameter: byte array. More... | |
virtual void | MmInvoke (MmMethod mmMethod, MmTransform param, MmMetadataBlock metadataBlock=null) |
Invoke an MmMethod with parameter: MmTransform. More... | |
virtual void | MmInvoke (MmMethod mmMethod, List< MmTransform > param, MmMetadataBlock metadataBlock=null) |
Invoke an MmMethod with parameter: List<MmTransform>. More... | |
virtual void | MmInvoke (MmMethod mmMethod, IMmSerializable param, MmMetadataBlock metadataBlock=null) |
Invoke an MmMethod with parameter: IMmSerializable. More... | |
override MmRelayNode | GetRelayNode () |
Implementation of IMmResponder's GetRelayNode, which returns this. More... | |
![]() | |
virtual void | Update () |
Base Update of MmResponder Derived classes should always override. More... | |
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... | |
virtual 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... | |
virtual 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... | |
Static Public Member Functions | |
static MmRelayNode | GetRelayNode (IMmResponder iMmResponder) |
Given an MmResponder, extract an MmRelayNode from it's GameObject, if one is present. More... | |
static MmRelayNode | GetRelayNode (GameObject go) |
Given a GameObject, extract the first MmRelayNode, if any are present. More... | |
Public Attributes | |
bool | FlipNetworkFlagOnSend = false |
Does the node convert the message to a local message from networked on post send in order to guarantee that it does not send it over the network deeper in the hierarchy. More... | |
bool | AllowNetworkPropagationLocally = false |
Allows Node to pass a Network-only message into the hierarchy More... | |
bool | ReparentClonedRespondersToSelf = true |
Indicates whether cloned MmResponders should be added as children to the MmRelayNode's GameObject. More... | |
bool | Initialized |
Indicates whether the MmRelayNode is ready for use This gets set either in Awake or on the first MmInvoke. More... | |
bool | AutoGrabAttachedResponders = true |
There may be an issue where a message is received before self responders have been added to the list. In order to resolve that issue, we allow the node to automatically grab all responders. The consequence here is that you cannot have responders on a node that do not automatically get added to the list. More... | |
MmRoutingTable | RoutingTable |
List of associated Mercury Responders. Each Mercury Routing Table Item contains: MmResponder, Name, Level (Self, Child, Parent), Cloneable (Indicates whether the Responder should be cloned when MmRelayNode is awoken), MmTag (Multi-tag filter supported by Mercury XM). More... | |
Protected Member Functions | |
void | InitializeNode () |
virtual MmLevelFilter | LevelFilterAdjust (ref MmMessage message, MmLevelFilter direction) |
If the level filter is designated 'Child', then it is recorded locally, but converted to a 'Child+Self' for use by the RoutingTable (which need to pass the message on to all children, but still need to be able to execute the message on their own responders, otherwise, it just goes to the terminal points of the graph without ever executing). More... | |
virtual MmActiveFilter | ActiveFilterAdjust (ref MmMessage message) |
Allows modification of active filter in message as it gets passed between MmRelayNodes. More... | |
virtual MmSelectedFilter | SelectedFilterAdjust (ref MmMessage message) |
Allows modification of selected filter in message as it gets passed between MmRelayNodes. More... | |
virtual MmNetworkFilter | NetworkFilterAdjust (ref MmMessage message) |
Allows modification of network filter in message as it gets passed between MmRelayNodes. More... | |
virtual bool | ResponderCheck (MmLevelFilter levelFilter, MmActiveFilter activeFilter, MmSelectedFilter selectedFilter, MmNetworkFilter networkFilter, MmRoutingTableItem mmRoutingTableItem, MmMessage message) |
This method determines if a particular MmResponder should receive a message via MmInvoke. This performs 4 checks: Tag Check, Level Check, Active Check, & Selected Check. More... | |
virtual bool | TagCheck (MmRoutingTableItem mmRoutingTableItem, MmMessage message) |
Determine if MmResponder passes MmRelayNode tag filter check using value embedded in MmMessage. More... | |
virtual bool | LevelCheck (MmLevelFilter levelFilter, IMmResponder responder, MmLevelFilter responderLevel) |
Determine if MmResponder passes MmRelayNode level filter check using value embedded in MmMessage. More... | |
virtual bool | ActiveCheck (MmActiveFilter activeFilter, IMmResponder responder) |
Determine if MmResponder passes MmRelayNode active filter check using value embedded in MmMessage. More... | |
virtual bool | SelectedCheck (MmSelectedFilter selectedFilter, IMmResponder responder) |
Determine if MmResponder passes MmRelayNode selected filter check using value embedded in MmMessage. More... | |
virtual bool | NetworkCheck (MmRoutingTableItem mmRoutingTableItem, MmMessage message) |
Checks if a responder should recieve a message based on the network flag in a control block. Network messages can go to other nodes, but not to self responders. More... | |
Protected Attributes | |
Queue< MmRoutingTableItem > | MmRespondersToAdd |
Queue of MmResponders to add once list is no longer in use by an MmInvoke More... | |
Queue< KeyValuePair< MmMessageType, MmMessage > > | SerialExecutionQueue |
Queue of Memessages to route if serialExecution is enabled and messages are received while another message is being executed. More... | |
Properties | |
IMmNetworkResponder | MmNetworkResponder [get] |
Associated MmNetworkResponder. If an MmNetworkResponder is attached o the same GameObject, it will automatically attach to this MmRelayNode. This turns all MmMethod invocations into networked MmMethod invocations, with no additional effort. More... | |
string | Name [get] |
MmRelayNode name: returns GameObject name. More... | |
![]() | |
GameObject | MmGameObject [get] |
Handle to an instance's GameObject. More... | |
MmTag | Tag [get, set] |
MmTags allow you to specify filters for execution in Mercury XM graphs. More... | |
bool | TagCheckEnabled [get, set] |
Determines whether tag checking is enabled for this IMmResponder More... | |
![]() | |
MmTag | Tag [get, set] |
MmTags allow you to specify filters for execution in MercuryMessaging Hierarchies. MmTag More... | |
GameObject | MmGameObject [get] |
Handle to an instance's GameObject. More... | |
bool | TagCheckEnabled [get, set] |
Determines whether tag checking is enabled for this IMmResponder More... | |
Base routing node of Mercury XM. Contains a list of MmResponders and sends MmMessages to responders in list, following the specifications of control blocks to MmInvoke method.
MercuryMessaging.MmRelayNode.MmRelayNode | ( | ) |
Creates an empty MmResponder list on construction.
|
protectedvirtual |
Determine if MmResponder passes MmRelayNode active filter check using value embedded in MmMessage.
activeFilter | Active filter value extracted from MmMessage. |
responder | Observed MmResponder |
|
protectedvirtual |
Allows modification of active filter in message as it gets passed between MmRelayNodes.
message | MmMessage to be adjusted. |
|
virtual |
Given an MmRelayNode, add it as parent to this instance's MmRoutingTable.
parent | MmRelayNode to add as a parent. |
|
virtual |
Grab attached MmNetworkResponder, if present. Detect and refresh parents. Instantiate any cloneable MmResponders.
Reimplemented from MercuryMessaging.MmResponder.
Reimplemented in MercuryMessaging.MmRelaySwitchNode.
|
virtual |
Implementation of IMmResponder's GetRelayNode, which returns this.
Implements MercuryMessaging.MmResponder.
|
static |
Given an MmResponder, extract an MmRelayNode from it's GameObject, if one is present.
iMmResponder | Observed MmResponder |
|
static |
Given a GameObject, extract the first MmRelayNode, if any are present.
go | Observed GameObject. |
|
protectedvirtual |
Determine if MmResponder passes MmRelayNode level filter check using value embedded in MmMessage.
levelFilter | Level filter value extracted from MmMessage. |
responder | Observed MmResponder. |
responderLevel | Observed MmResponder Level. |
|
protectedvirtual |
If the level filter is designated 'Child', then it is recorded locally, but converted to a 'Child+Self' for use by the RoutingTable (which need to pass the message on to all children, but still need to be able to execute the message on their own responders, otherwise, it just goes to the terminal points of the graph without ever executing).
message | MmMessage to be adjusted. |
direction | Intended direction of message |
|
virtual |
Given a GameObject, extract an MmRelayNode if present and add it to this MmRelayNode's Responder list.
go | GameObject that should have an MmRelayNode attached. |
|
virtual |
Add an MmResponder to the MmRoutingTable, with level designation.
mmResponder | MmResponder to be added. |
level | Level designation of responder. |
|
virtual |
Add an MmResponder to the MmRoutingTable, with level designation.
mmResponder | MmResponder to be added. |
newName | Name of MmResponder as it will appear in list. |
override void MercuryMessaging.MmRelayNode.MmInvoke | ( | MmMessageType | msgType, |
MmMessage | message | ||
) |
Invoke an MmMethod.
msgType | Type 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. |
message | The message to send. This class builds on UNET's MessageBase so it is Auto [de]serialized by UNET. |
Implements MercuryMessaging.IMmNode.
|
virtual |
Invoke an MmMethod with no parameter.
mmMethod | MmMethod Identifier - MmMethod |
metadataBlock | Object defining the routing of Mmessages through MercuryMessaging Hierarchies. MmMetadataBlock |
Implements MercuryMessaging.IMmNode.
|
virtual |
Invoke an MmMethod with parameter: bool.
mmMethod | MmMethod Identifier - MmMethod |
param | MmMethod parameter: bool. |
metadataBlock | Object defining the routing of Mmessages through MercuryMessaging Hierarchies. MmMetadataBlock |
Implements MercuryMessaging.IMmNode.
|
virtual |
Invoke an MmMethod with parameter: int.
mmMethod | MmMethod Identifier - MmMethod |
param | MmMethod parameter: int. |
metadataBlock | Object defining the routing of Mmessages through MercuryMessaging Hierarchies. MmMetadataBlock |
Implements MercuryMessaging.IMmNode.
|
virtual |
Invoke an MmMethod with parameter: float.
mmMethod | MmMethod Identifier - MmMethod |
param | MmMethod parameter: float. |
metadataBlock | Object defining the routing of Mmessages through MercuryMessaging Hierarchies. MmMetadataBlock |
Implements MercuryMessaging.IMmNode.
|
virtual |
Invoke an MmMethod with parameter: Vector3.
mmMethod | MmMethod Identifier - MmMethod |
param | MmMethod parameter: Vector3. |
metadataBlock | Object defining the routing of Mmessages through MercuryMessaging Hierarchies. MmMetadataBlock |
Implements MercuryMessaging.IMmNode.
|
virtual |
Invoke an MmMethod with parameter: Vector4.
mmMethod | MmMethod Identifier - MmMethod |
param | MmMethod parameter: Vector4. |
metadataBlock | Object defining the routing of Mmessages through MercuryMessaging Hierarchies. MmMetadataBlock |
Implements MercuryMessaging.IMmNode.
|
virtual |
Invoke an MmMethod with parameter: string.
mmMethod | MmMethod Identifier - MmMethod |
param | MmMethod parameter: string. |
metadataBlock | Object defining the routing of Mmessages through MercuryMessaging Hierarchies. MmMetadataBlock |
Implements MercuryMessaging.IMmNode.
|
virtual |
Invoke an MmMethod with parameter: byte array.
mmMethod | MmMethod Identifier - MmMethod |
param | MmMethod parameter: byte array. |
metadataBlock | Object defining the routing of Mmessages through MercuryMessaging Hierarchies. MmMetadataBlock |
Implements MercuryMessaging.IMmNode.
|
virtual |
Invoke an MmMethod with parameter: MmTransform.
mmMethod | MmMethod Identifier - MmMethod |
param | MmMethod parameter: MmTransform. MmTransform |
metadataBlock | Object defining the routing of Mmessages through MercuryMessaging Hierarchies. MmMetadataBlock |
Implements MercuryMessaging.IMmNode.
|
virtual |
Invoke an MmMethod with parameter: List<MmTransform>.
mmMethod | MmMethod Identifier - MmMethod |
param | MmMethod parameter: List<MmTransform>. |
metadataBlock | Object defining the routing of Mmessages through MercuryMessaging Hierarchies. MmMetadataBlock |
Implements MercuryMessaging.IMmNode.
|
virtual |
Invoke an MmMethod with parameter: IMmSerializable.
mmMethod | MmMethod Identifier - MmMethod |
param | MmMethod parameter: IMmSerializable. IMmSerializable |
metadataBlock | Object defining the routing of Mmessages through MercuryMessaging Hierarchies. MmMetadataBlock |
Implements MercuryMessaging.IMmNode.
void MercuryMessaging.MmRelayNode.MmRefreshResponders | ( | ) |
Grab all MmResponders attached to the same GameObject. Does not grab any other MmRelayNodes attached to the same GameObject.
|
protectedvirtual |
Checks if a responder should recieve a message based on the network flag in a control block. Network messages can go to other nodes, but not to self responders.
mmRoutingTableItem | Observed MmResponder |
message | Input message. |
|
protectedvirtual |
Allows modification of network filter in message as it gets passed between MmRelayNodes.
message | MmMessage to be adjusted. |
void MercuryMessaging.MmRelayNode.RefreshParents | ( | ) |
Iterates through RoutingTable list and assigns this MmRelayNode as a parent to child MmResponders.
|
protectedvirtual |
This method determines if a particular MmResponder should receive a message via MmInvoke. This performs 4 checks: Tag Check, Level Check, Active Check, & Selected Check.
levelFilter | Extracted message level filter - before adjust. |
activeFilter | Extracted message active filter - before adjust. |
selectedFilter | Extracted message selected filter - before adjust. |
networkFilter | Extracted message network filter - before adjust. |
mmRoutingTableItem | RoutingTableItem of currently observed MmResponder |
message | MmMessage to be checked. |
|
protectedvirtual |
Determine if MmResponder passes MmRelayNode selected filter check using value embedded in MmMessage.
selectedFilter | Selected filter value extracted from MmMessage. |
responder | Observed MmResponder |
Reimplemented in MercuryMessaging.MmRelaySwitchNode.
|
protectedvirtual |
Allows modification of selected filter in message as it gets passed between MmRelayNodes.
message | MmMessage to be adjusted. |
|
virtual |
Calls MmOnStartComplete through MmResponder Start.
Reimplemented from MercuryMessaging.MmResponder.
Reimplemented in MercuryMessaging.MmRelaySwitchNode.
|
protectedvirtual |
Determine if MmResponder passes MmRelayNode tag filter check using value embedded in MmMessage.
mmRoutingTableItem | RoutingTableItem of currently observed MmResponder |
message | MmMessage to be checked. |
bool MercuryMessaging.MmRelayNode.AllowNetworkPropagationLocally = false |
Allows Node to pass a Network-only message into the hierarchy
bool MercuryMessaging.MmRelayNode.AutoGrabAttachedResponders = true |
There may be an issue where a message is received before self responders have been added to the list. In order to resolve that issue, we allow the node to automatically grab all responders. The consequence here is that you cannot have responders on a node that do not automatically get added to the list.
bool MercuryMessaging.MmRelayNode.FlipNetworkFlagOnSend = false |
Does the node convert the message to a local message from networked on post send in order to guarantee that it does not send it over the network deeper in the hierarchy.
bool MercuryMessaging.MmRelayNode.Initialized |
Indicates whether the MmRelayNode is ready for use This gets set either in Awake or on the first MmInvoke.
|
protected |
Queue of MmResponders to add once list is no longer in use by an MmInvoke
bool MercuryMessaging.MmRelayNode.ReparentClonedRespondersToSelf = true |
Indicates whether cloned MmResponders should be added as children to the MmRelayNode's GameObject.
MmRoutingTable MercuryMessaging.MmRelayNode.RoutingTable |
List of associated Mercury Responders. Each Mercury Routing Table Item contains: MmResponder, Name, Level (Self, Child, Parent), Cloneable (Indicates whether the Responder should be cloned when MmRelayNode is awoken), MmTag (Multi-tag filter supported by Mercury XM).
|
protected |
Queue of Memessages to route if serialExecution is enabled and messages are received while another message is being executed.
|
get |
Associated MmNetworkResponder. If an MmNetworkResponder is attached o the same GameObject, it will automatically attach to this MmRelayNode. This turns all MmMethod invocations into networked MmMethod invocations, with no additional effort.
|
get |
MmRelayNode name: returns GameObject name.