franz/franz.tests/Program.cs
Adam R Grey e1ff1db122
All checks were successful
gitea/franz/pipeline/head This commit looks good
.net7, and topic lister will also create them
2023-03-08 16:25:23 -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.lan: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.");
}
}
}