From 6b359739d2b25a9bb0edf98943e9401760a80604 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 23 Dec 2017 17:24:20 +0000 Subject: [PATCH] [server] Add version subcommand to console & rearrange plane help --- Nibriboard/CommandConsole.cs | 29 ++++++++++++++++++++++------- Nibriboard/NibriboardServer.cs | 2 +- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Nibriboard/CommandConsole.cs b/Nibriboard/CommandConsole.cs index 3135618..680a0df 100644 --- a/Nibriboard/CommandConsole.cs +++ b/Nibriboard/CommandConsole.cs @@ -62,12 +62,15 @@ namespace Nibriboard 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(" plane list List all the currently loaded planes"); - await destination.WriteLineAsync(" plane create {new-plane-name} [{chunkSize}] Create a new named plane, optionally with the specified chunk size"); - await destination.WriteLineAsync(" plane status {plane-name} Show the statistics of the specified plane"); - await destination.WriteLineAsync(" clients List the currently connected clients"); + await destination.WriteLineAsync(" help Show this message"); + await destination.WriteLineAsync(" version Show the version of nibriboard that is currently running"); + await destination.WriteLineAsync(" save Save the ripplespace to disk"); + await destination.WriteLineAsync(" plane {subcommand} Interact with planes"); + await destination.WriteLineAsync(" clients List the currently connected clients"); + break; + case "version": + await destination.WriteLineAsync($"Nibriboard Server {NibriboardServer.Version}, built on {NibriboardServer.BuildDate.ToString("R")}"); + await destination.WriteLineAsync("By Starbeamrainbowlabs, licensed under MPL-2.0"); break; case "save": await destination.WriteAsync("Saving ripple space - "); @@ -77,7 +80,19 @@ namespace Nibriboard break; case "plane": if(commandParts.Length < 2) { - await destination.WriteLineAsync("Error: No sub-action specified."); + await destination.WriteLineAsync("Nibriboard Server Command Console: plane"); + await destination.WriteLineAsync("----------------------------------------"); + await destination.WriteLineAsync("Interact with planes."); + await destination.WriteLineAsync("Usage:"); + await destination.WriteLineAsync(" plane {subcommand}"); + await destination.WriteLineAsync(); + await destination.WriteLineAsync("Subcommands:"); + await destination.WriteLineAsync(" list"); + await destination.WriteLineAsync(" List all the currently loaded planes"); + await destination.WriteLineAsync(" create {new-plane-name} [{chunkSize}]"); + await destination.WriteLineAsync(" Create a new named plane, optionally with the specified chunk size"); + await destination.WriteLineAsync(" status {plane-name}"); + await destination.WriteLineAsync(" Show the statistics of the specified plane"); break; } string subAction = commandParts[1].Trim(); diff --git a/Nibriboard/NibriboardServer.cs b/Nibriboard/NibriboardServer.cs index 4568371..d54723f 100644 --- a/Nibriboard/NibriboardServer.cs +++ b/Nibriboard/NibriboardServer.cs @@ -24,7 +24,7 @@ namespace Nibriboard get { Version asmVersion = Assembly.GetExecutingAssembly().GetName().Version; string commit = EmbeddedFiles.ReadAllText("Nibriboard.commit-hash.txt"); - return $"{asmVersion.Major}.{asmVersion.Minor}.{asmVersion.Build}-{commit.Substring(0, 7)}"; + return $"v{asmVersion.Major}.{asmVersion.Minor}.{asmVersion.Build}-{commit.Substring(0, 7)}"; } } ///