actually done, barring bugs

This commit is contained in:
Adam R. Grey 2021-07-23 05:37:31 -04:00
parent 5454333ac4
commit dd9c471a39
2 changed files with 2 additions and 7 deletions

View File

@ -4,11 +4,10 @@ public class Config
{ {
public string name { get; set; } = "guy who didn't configure"; public string name { get; set; } = "guy who didn't configure";
public string bootstrap_servers { get; set; } = "localhost:9092"; public string bootstrap_servers { get; set; } = "localhost:9092";
public List<Command> commands { get; set; }
public class Command public class Command
{ {
public string name { get; set; } public string name { get; set; }
public string shell { get; set; } public string shell { get; set; }
} }
public List<Command> commands { get; set; }
public List<Command> checks { get; set; }
} }

View File

@ -22,8 +22,7 @@ namespace directors_assistant
{ {
conf = JsonConvert.DeserializeObject<Config>(File.ReadAllText("appsettings.json")); conf = JsonConvert.DeserializeObject<Config>(File.ReadAllText("appsettings.json"));
telefranz = new Telefranz(conf.name, conf.bootstrap_servers, telefranz = new Telefranz(conf.name, conf.bootstrap_servers,
conf.commands.Select(c => c.name).ToList(), conf.commands.Select(c => c.name).ToList());
conf.checks.Select(c => c.name).ToList());
telefranz.addHandler((silver_messages.directorial.execute_command ec) => telefranz.addHandler((silver_messages.directorial.execute_command ec) =>
{ {
var matchedCommands = conf.commands.Where(c => c.name == ec.command)?.ToList(); var matchedCommands = conf.commands.Where(c => c.name == ec.command)?.ToList();
@ -53,9 +52,6 @@ namespace directors_assistant
} }
} }
}); });
telefranz.addHandler((silver_messages.directorial.execute_check ec) => {
//TODO
});
await Task.Delay(1000); await Task.Delay(1000);
telefranz.ProduceMessage(new silver_messages.global.sound_off()); telefranz.ProduceMessage(new silver_messages.global.sound_off());