/// <summary> /// Overrides the base MmInvoke /// Here we just stop the stopwatch. But we could throw in a switch (to represent normal usage) too. /// </summary> public override void MmInvoke(MmMessage message) { //base.MmInvoke (msgType, message); //Executable code //Debug.Log ("Function Called."); //int i = 3 + 4; stopWatch.Stop(); simpleLock = false; }
/// <summary> /// Override the basic functionality of MmRelayNode to allow for faster processing by skipping checks. /// </summary> /// <param name="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.</param> /// <param name="message">The message to send. /// This class builds on UNET's MessageBase so it is /// Auto [de]serialized by UNET.</param> public override void MmInvoke(MmMessage message) { if (AllowStandardMmInvoke) { base.MmInvoke(message); } else { //If the MmRelayNode has not been initialized, initialize it here, // and refresh the parents - to ensure proper routing can occur. InitializeNode(); MmNetworkFilter networkFilter = message.MetadataBlock.NetworkFilter; if (MmNetworkResponder != null && message.MetadataBlock.NetworkFilter != MmNetworkFilter.Local && !message.IsDeserialized) { MmNetworkFilter originalNetworkFilter = NetworkFilterAdjust(ref message); MmNetworkResponder.MmInvoke(message); message.MetadataBlock.NetworkFilter = originalNetworkFilter; } if (!AllowNetworkPropagationLocally && !message.IsDeserialized && message.MetadataBlock.NetworkFilter == MmNetworkFilter.Network) { return; } foreach (var routingTableItem in RoutingTable) { var responder = routingTableItem.Responder; //bool isLocalResponder = responder.MmGameObject == this.gameObject; MmLevelFilter responderLevel = routingTableItem.Level; responder.MmInvoke(message); } } }