示例#1
0
        /// <summary>
        /// Create and send a message object
        /// </summary>
        /// <param name="rType">Type of message to send</param>
        /// <param name="rFilter">Filter to send only to those listening to the filter</param>
        public static void SendMessage(string rType, string rFilter)
        {
            // Create the message
            Message lMessage = Message.Allocate();

            lMessage.Sender    = null;
            lMessage.Recipient = rFilter;
            lMessage.Type      = rType;
            lMessage.Data      = null;
            lMessage.Delay     = EnumMessageDelay.IMMEDIATE;

            // Send it or store it
            SendMessage(lMessage);

            // Free up the message since we created it
            Message.Release(lMessage);
        }
示例#2
0
        /// <summary>
        /// Create and send a message object
        /// </summary>
        /// <param name="rSender">Sender</param>
        /// <param name="rRecipient">Recipient name to send to</param>
        /// <param name="rType">Type of message to send</param>
        /// <param name="rData">Data to send</param>
        /// <param name="rDelay">Seconds to delay</param>
        public static void SendMessage(object rSender, string rRecipient, string rType, object rData, float rDelay)
        {
            // Create the message
            Message lMessage = Message.Allocate();

            lMessage.Sender    = rSender;
            lMessage.Recipient = rRecipient;
            lMessage.Type      = rType;
            lMessage.Data      = rData;
            lMessage.Delay     = rDelay;

            // Send it or store it
            SendMessage(lMessage);

            // Free up the message since we created it
            if (rDelay == EnumMessageDelay.IMMEDIATE)
            {
                lMessage.Release();
            }
        }
示例#3
0
        /// <summary>
        /// Create and send a message object
        /// </summary>
        /// <param name="rType">Type of message to send</param>
        public static void SendMessage(string rType, float rDelay = 0f)
        {
            // Create the message
            Message lMessage = Message.Allocate();

            lMessage.Sender    = null;
            lMessage.Recipient = "";
            lMessage.Type      = rType;
            lMessage.Data      = null;
            lMessage.Delay     = rDelay;

            // Send it or store it
            SendMessage(lMessage);

            // Free up the message since we created it
            if (rDelay == EnumMessageDelay.IMMEDIATE)
            {
                lMessage.Release();
            }
        }