more tests and version 0.0.9

This commit is contained in:
Adam R. Grey 2021-12-17 06:30:26 -05:00
parent 73d729ff66
commit be6ddf26fd
4 changed files with 20 additions and 5 deletions

View File

@ -1,4 +1,6 @@
using System; using System;
using System.Collections.Generic;
using System.Net;
namespace franz.tests namespace franz.tests
{ {
@ -6,14 +8,24 @@ namespace franz.tests
{ {
static void Main(string[] args) static void Main(string[] args)
{ {
Console.WriteLine("Hello World!"); Console.WriteLine("Hello World, Im' " + Dns.GetHostName());
Telefranz.Configure("tester", "focalor:9092"); Telefranz.Configure("tester", "focalor:9092", new System.Collections.Generic.List<string>(){"a!"});
Telefranz.Instance.addHandler<silver_messages.global.report>(r => { Telefranz.Instance.addHandler<silver_messages.global.report>(r => {
Console.WriteLine(r); Console.WriteLine(r);
}); });
Telefranz.Instance.addHandler<silver_messages.directorial.execute_command>((ec) => {
if(ec.command == "a!"){
Console.WriteLine($"a! command executing! {string.Join("; ", ec.args)}");
}
});
Telefranz.Instance.ProduceMessage(new silver_messages.global.sound_off()); Telefranz.Instance.ProduceMessage(new silver_messages.global.sound_off());
System.Threading.Thread.Sleep(10000); System.Threading.Thread.Sleep(15000);
Telefranz.Instance.ProduceMessage(new silver_messages.directorial.execute_command(){
command= "a!",
args= new List<string>(){"param 1", "param 2"}
});
System.Threading.Thread.Sleep(5000);
Console.WriteLine("k."); Console.WriteLine("k.");
} }
} }

View File

@ -4,6 +4,7 @@ using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Net;
using System.Reflection; using System.Reflection;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -49,6 +50,7 @@ namespace franz
this.howToReport = new silver_messages.global.report() this.howToReport = new silver_messages.global.report()
{ {
name = name, name = name,
host = Dns.GetHostName(),
errors = errors ?? new List<string>(), errors = errors ?? new List<string>(),
warnings = warnings ?? new List<string>() warnings = warnings ?? new List<string>()
}; };
@ -154,7 +156,6 @@ namespace franz
{ {
clusterClient.Produce(typeof(T).ToString(), message.ToString()); clusterClient.Produce(typeof(T).ToString(), message.ToString());
} }
public void HiImAFunction() { }
} }
public class NotInitializedException : Exception public class NotInitializedException : Exception
{ {

View File

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<PackageId>silvermeddlists.franz</PackageId> <PackageId>silvermeddlists.franz</PackageId>
<Version>0.0.8</Version> <Version>0.0.9</Version>
<Authors>adam</Authors> <Authors>adam</Authors>
<Company>Silver Meddlists</Company> <Company>Silver Meddlists</Company>
</PropertyGroup> </PropertyGroup>

View File

@ -6,6 +6,8 @@ namespace silver_messages.global
{ {
//your name //your name
public string name { get; set; } public string name { get; set; }
//the hardware you live on
public string host { get; set; }
//capabilities by name which aren't implied by your name //capabilities by name which aren't implied by your name
public Capabilites capabilites { get; set; } = new Capabilites(); public Capabilites capabilites { get; set; } = new Capabilites();