1
0
Fork 0
mirror of https://github.com/sbrl/Nibriboard.git synced 2018-01-10 21:33:49 +00:00

[server] Sete up infrastructure for sub-actions to the plane action in the command console

This commit is contained in:
Starbeamrainbowlabs 2017-12-15 23:40:38 +00:00
parent 8b602f1aed
commit 80da550b08
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -63,7 +63,7 @@ namespace Nibriboard
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");
await destination.WriteLineAsync(" plane list List all the currently loaded planes");
break;
case "save":
await destination.WriteAsync("Saving ripple space - ");
@ -71,13 +71,26 @@ namespace Nibriboard
await destination.WriteLineAsync("done.");
await destination.WriteLineAsync($"Save is now {BytesToString(server.PlaneManager.LastSaveFileSize)} in size.");
break;
case "planes":
case "plane":
if(commandParts.Length < 2) {
await destination.WriteLineAsync("Error: No sub-action specified.");
break;
}
string subAction = commandParts[1].Trim();
switch(subAction)
{
case "list":
await destination.WriteLineAsync("Planes:");
foreach(Plane plane in server.PlaneManager.Planes)
await destination.WriteLineAsync($" {plane.Name} @ {plane.ChunkSize} ({plane.LoadedChunks} / ~{plane.SoftLoadedChunkLimit} chunks loaded, {plane.UnloadableChunks} inactive)");
await destination.WriteLineAsync();
await destination.WriteLineAsync($"Total {server.PlaneManager.Planes.Count}");
break;
default:
await destination.WriteLineAsync($"Error: Unknown sub-action {subAction}.");
break;
}
break;
default:
await destination.WriteLineAsync($"Error: Unrecognised command {commandName}");