protected virtual void OnWorldWassupReceived(AUSPayload payload) { this.LogMessage(payload, "Wassup - "); var plea = new PayloadEventArgs <AUSPayload>(payload); this.Invoke(this.WorldWassupReceived, plea); }
protected virtual void OnProgrammerGoodbyeReceived(AUSPayload payload) { this.LogMessage(payload, "Goodbye - "); var plea = new PayloadEventArgs <AUSPayload>(payload); this.Invoke(this.ProgrammerGoodbyeReceived, plea); }
protected override void CheckRouting(AUSPayload 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(AUSPayload payload, System.String msg) { if (IsDebugMode) { System.Diagnostics.Debug.WriteLine(msg); System.Diagnostics.Debug.WriteLine("payload: " + payload.SafeToString()); } }
private void Reply(AUSPayload 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(AUSPayload 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(AUSPayload payload) { this.SendMessage(payload, "Hello - ", "programmermic", "world.general.programmer.hello"); }
partial void CheckPayload(AUSPayload payload);
protected override void CheckRouting(AUSPayload payload) { this.CheckRouting(payload, false); }
/// <summary> /// Goodbye - /// </summary> public void ProgrammerGoodbye(AUSPayload payload) { this.SendMessage(payload, "Goodbye - ", "programmermic", "world.general.programmer.goodbye"); }
/// <summary> /// Wassup - /// </summary> public void WorldWassup(AUSPayload payload) { this.SendMessage(payload, "Wassup - ", "worldmic", "programmer.general.world.wassup"); }