franz/franz.tests/Program.cs
Adam R Grey 142873a298 execute command arguments = 1 string; more intuitive
given that I've been down this road of "why did it explode? oh because it's an array of strings. why is it an array? this should stop" before
2022-12-14 17:11:32 -05:00

37 lines
1.4 KiB
C#

using System;
using System.Collections.Generic;
using System.Net;
namespace franz.tests
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World, I'm " + Dns.GetHostName());
Telefranz.Configure("tester", "alloces:9092", new System.Collections.Generic.List<string>(){"a!"});
Console.WriteLine("telefranz configured");
Telefranz.Instance.addHandler<gray_messages.global.report>(r => {
Console.WriteLine("a report (response to soundoff) has come in");
Console.WriteLine(r);
});
Telefranz.Instance.addHandler<gray_messages.directorial.execute_command>((ec) => {
Console.WriteLine("message received: execute_command");
if(ec.command == "a!"){
Console.WriteLine($"a! command executing! {string.Join("; ", ec.args)}");
}
});
Telefranz.Instance.ProduceMessage(new gray_messages.global.sound_off());
System.Threading.Thread.Sleep(15000);
Telefranz.Instance.ProduceMessage(new gray_messages.directorial.execute_command(){
command= "a!",
args= "parameters to pass along"
});
System.Threading.Thread.Sleep(5000);
Console.WriteLine("k.");
}
}
}