Exemplo n.º 1
0
        protected override void CheckRouting(AATPayload payload, bool isDirectMessage)
        {
            // if (payload.IsDirectMessage && !isDirectMessage) return;

            try {
                if (payload.IsLexiconTerm(LexiconTermEnum.programmer_hello_world))
                {
                    this.OnProgrammerHelloReceived(payload);
                }

                else if (payload.IsLexiconTerm(LexiconTermEnum.programmer_goodbye_world))
                {
                    this.OnProgrammerGoodbyeReceived(payload);
                }

                // And can also hear everything which : Programmer hears.

                if (payload.IsLexiconTerm(LexiconTermEnum.world_wassup_programmer))
                {
                    this.OnWorldWassupReceived(payload);
                }
            } catch (Exception ex) {
                payload.Exception = ex;
            }
            this.Reply(payload);
        }
Exemplo n.º 2
0
        protected virtual void OnProgrammerGoodbyeReceived(AATPayload payload)
        {
            this.LogMessage(payload, "Goodbye - ");
            var plea = new PayloadEventArgs <AATPayload>(payload);

            this.Invoke(this.ProgrammerGoodbyeReceived, plea);
        }
Exemplo n.º 3
0
        protected virtual void OnWorldWassupReceived(AATPayload payload)
        {
            this.LogMessage(payload, "Wassup - ");
            var plea = new PayloadEventArgs <AATPayload>(payload);

            this.Invoke(this.WorldWassupReceived, plea);
        }
Exemplo n.º 4
0
 public void LogMessage(AATPayload payload, System.String msg)
 {
     if (IsDebugMode)
     {
         System.Diagnostics.Debug.WriteLine(msg);
         System.Diagnostics.Debug.WriteLine("payload: " + payload.SafeToString());
     }
 }
Exemplo n.º 5
0
 private void Reply(AATPayload payload)
 {
     if (!System.String.IsNullOrEmpty(payload.ReplyTo))
     {
         payload.DirectMessageQueue = this.QueueName;
         this.CheckPayload(payload);
         this.RMQChannel.BasicPublish("", payload.ReplyTo, body: Encoding.UTF8.GetBytes(payload.ToJSonString()));
     }
 }
Exemplo n.º 6
0
        protected override void CheckRouting(AATPayload payload, bool isDirectMessage)
        {
            // if (payload.IsDirectMessage && !isDirectMessage) return;

            try {
                if (payload.IsLexiconTerm(LexiconTermEnum.world_wassup_programmer))
                {
                    this.OnWorldWassupReceived(payload);
                }
            } catch (Exception ex) {
                payload.Exception = ex;
            }
            this.Reply(payload);
        }
Exemplo n.º 7
0
 partial void CheckPayload(AATPayload payload);
Exemplo n.º 8
0
 protected override void CheckRouting(AATPayload payload)
 {
     this.CheckRouting(payload, false);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Goodbye -
 /// </summary>
 public void ProgrammerGoodbye(AATPayload payload)
 {
     this.SendMessage(payload, "Goodbye - ",
                      "programmermic", "world.general.programmer.goodbye");
 }
Exemplo n.º 10
0
 /// <summary>
 /// Hello -
 /// </summary>
 public void ProgrammerHello(AATPayload payload)
 {
     this.SendMessage(payload, "Hello - ",
                      "programmermic", "world.general.programmer.hello");
 }
Exemplo n.º 11
0
 /// <summary>
 /// Wassup -
 /// </summary>
 public void WorldWassup(AATPayload payload)
 {
     this.SendMessage(payload, "Wassup - ",
                      "worldmic", "programmer.general.world.wassup");
 }