37 lines
1.4 KiB
C#
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.");
|
|
}
|
|
}
|
|
}
|