From 1cab9bd0de6a78431bdba37b8a610ef90054071f Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Fri, 15 Dec 2017 21:07:09 +0000 Subject: [PATCH] [server] Add planes command to list current planes --- Nibriboard/NibriboardServer.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Nibriboard/NibriboardServer.cs b/Nibriboard/NibriboardServer.cs index f57cd09..fbf7b9a 100644 --- a/Nibriboard/NibriboardServer.cs +++ b/Nibriboard/NibriboardServer.cs @@ -90,17 +90,29 @@ namespace Nibriboard switch(commandParts[0].Trim()) { case "help": - await destination.WriteLineAsync("NibriboardServer Command Console"); - await destination.WriteLineAsync("================================"); + await destination.WriteLineAsync("Nibriboard Server Command Console"); + await destination.WriteLineAsync("================================="); await destination.WriteLineAsync("Available commands:"); await destination.WriteLineAsync(" help Show this message"); await destination.WriteLineAsync(" save Save the ripplespace to disk"); + await destination.WriteLineAsync(" planes List all the currently loaded planes"); break; case "save": await destination.WriteAsync("Saving ripple space - "); await planeManager.Save(); await destination.WriteLineAsync("done."); break; + case "planes": + await destination.WriteLineAsync("Planes:"); + foreach(Plane plane in planeManager.Planes) + await destination.WriteLineAsync($"\t{plane.Name}"); + await destination.WriteLineAsync(); + await destination.WriteLineAsync($"Total {planeManager.Planes.Count}"); + break; + + default: + await destination.WriteLineAsync($"Error: Unrecognised command {commandParts[0].Trim()}"); + break; } } catch(Exception error)