protected virtual void OnWorldWassupReceived(ADVPPayload payload)
        {
            this.LogMessage(payload, "Wassup - ");
            var plea = new PayloadEventArgs <ADVPPayload>(payload);

            this.Invoke(this.WorldWassupReceived, plea);
        }
Beispiel #2
0
        protected virtual void OnProgrammerGoodbyeReceived(ADVPPayload payload)
        {
            this.LogMessage(payload, "Goodbye - ");
            var plea = new PayloadEventArgs <ADVPPayload>(payload);

            this.Invoke(this.ProgrammerGoodbyeReceived, plea);
        }
Beispiel #3
0
        protected override void CheckRouting(ADVPPayload 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);
        }
 public void LogMessage(ADVPPayload payload, System.String msg)
 {
     if (IsDebugMode)
     {
         System.Diagnostics.Debug.WriteLine(msg);
         System.Diagnostics.Debug.WriteLine("payload: " + payload.SafeToString());
     }
 }
 private void Reply(ADVPPayload 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()));
     }
 }
        protected override void CheckRouting(ADVPPayload 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);
        }
 /// <summary>
 /// Hello -
 /// </summary>
 public void ProgrammerHello(ADVPPayload payload)
 {
     this.SendMessage(payload, "Hello - ",
                      "programmermic", "world.general.programmer.hello");
 }
 partial void CheckPayload(ADVPPayload payload);
 protected override void CheckRouting(ADVPPayload payload)
 {
     this.CheckRouting(payload, false);
 }
 /// <summary>
 /// Goodbye -
 /// </summary>
 public void ProgrammerGoodbye(ADVPPayload payload)
 {
     this.SendMessage(payload, "Goodbye - ",
                      "programmermic", "world.general.programmer.goodbye");
 }
Beispiel #11
0
 /// <summary>
 /// Wassup -
 /// </summary>
 public void WorldWassup(ADVPPayload payload)
 {
     this.SendMessage(payload, "Wassup - ",
                      "worldmic", "programmer.general.world.wassup");
 }