franz/franz.tests/Program.cs

33 lines
1.2 KiB
C#
Raw Normal View History

using System;
2021-12-17 06:30:26 -05:00
using System.Collections.Generic;
using System.Net;
namespace franz.tests
{
class Program
{
static void Main(string[] args)
{
2021-12-17 06:30:26 -05:00
Console.WriteLine("Hello World, Im' " + Dns.GetHostName());
Telefranz.Configure("tester", "alloces:9092", new System.Collections.Generic.List<string>(){"a!"});
Telefranz.Instance.addHandler<gray_messages.global.report>(r => {
Console.WriteLine(r);
});
Telefranz.Instance.addHandler<gray_messages.directorial.execute_command>((ec) => {
2021-12-17 06:30:26 -05:00
if(ec.command == "a!"){
Console.WriteLine($"a! command executing! {string.Join("; ", ec.args)}");
}
});
Telefranz.Instance.ProduceMessage(new gray_messages.global.sound_off());
2021-12-17 06:30:26 -05:00
System.Threading.Thread.Sleep(15000);
Telefranz.Instance.ProduceMessage(new gray_messages.directorial.execute_command(){
2021-12-17 06:30:26 -05:00
command= "a!",
args= new List<string>(){"param 1", "param 2"}
});
System.Threading.Thread.Sleep(5000);
Console.WriteLine("k.");
}
}
}