Exemplo n.º 1
0
 public virtual void HandleTelegram(Telegram t)
 {
 }
Exemplo n.º 2
0
        public void DispatchTelegram(double delayInSeconds, Guid from, Guid to, MessageType type, Dictionary<string, object> parms, bool persist)
        {
            Telegram t = new Telegram();
            t.Sender = from;
            t.Recipient = to;
            t.MessageType = type;
            t.SendTime = DateTime.Now.AddSeconds(delayInSeconds);
            t.Parameters = new Shared.PropertyBag();

            IGameObject go = m_ActorManager.GetGameObjectFromId(t.Recipient);
            if(go == null || (!(go is IMessagable)))
            {
                System.Diagnostics.Trace.WriteLine(from.ToString() + " is attempting to send a message to non-registered entity " + to.ToString());
                return;
            }

            if(delayInSeconds == 0)
            {
                ((IMessagable)go).HandleTelegram(t);
                return;
            }

            m_TelegramQ.Add(t.SendTime, t);
        }
Exemplo n.º 3
0
 public virtual void HandleTelegram(Telegram t)
 {
 }