From 0fd17c08ae642fac17b24dfad06c61cfe5739483 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 20 Aug 2019 23:28:59 +0100 Subject: Massive console refactor. Greatly simplify interface. --- OpenSim/Server/Base/CommandManager.cs | 15 ++++++++----- .../Server/Handlers/Asset/AssetServerConnector.cs | 26 +++++++++++----------- 2 files changed, 23 insertions(+), 18 deletions(-) mode change 100644 => 100755 OpenSim/Server/Base/CommandManager.cs mode change 100644 => 100755 OpenSim/Server/Handlers/Asset/AssetServerConnector.cs (limited to 'OpenSim/Server') diff --git a/OpenSim/Server/Base/CommandManager.cs b/OpenSim/Server/Base/CommandManager.cs old mode 100644 new mode 100755 index ffb20ce..9ada974 --- a/OpenSim/Server/Base/CommandManager.cs +++ b/OpenSim/Server/Base/CommandManager.cs @@ -178,7 +178,8 @@ namespace OpenSim.Server.Base { Dictionary plugin = (Dictionary)result[k]; bool enabled = (bool)plugin["enabled"]; - MainConsole.Instance.OutputFormat("{0}) {1} {2} rev. {3}", + MainConsole.Instance.Output("{0}) {1} {2} rev. {3}", + null, k, enabled == true ? "[ ]" : "[X]", plugin["name"], plugin["version"]); @@ -215,7 +216,8 @@ namespace OpenSim.Server.Base { Dictionary plugin = (Dictionary)result[k]; bool enabled = (bool)plugin["enabled"]; - MainConsole.Instance.OutputFormat("{0}) {1} {2} rev. {3}", + MainConsole.Instance.Output("{0}) {1} {2} rev. {3}", + null, k, enabled == true ? "[ ]" : "[X]", plugin["name"], plugin["version"]); @@ -235,7 +237,8 @@ namespace OpenSim.Server.Base { // name, version, repository Dictionary plugin = (Dictionary)result[k]; - MainConsole.Instance.OutputFormat("{0}) {1} rev. {2} {3}", + MainConsole.Instance.Output("{0}) {1} rev. {2} {3}", + null, k, plugin["name"], plugin["version"], @@ -309,7 +312,8 @@ namespace OpenSim.Server.Base { Dictionary repo = (Dictionary)result[k]; bool enabled = (bool)repo["enabled"]; - MainConsole.Instance.OutputFormat("{0}) {1} {2}", + MainConsole.Instance.Output("{0}) {1} {2}", + null, k, enabled == true ? "[ ]" : "[X]", repo["name"], repo["url"]); @@ -329,7 +333,8 @@ namespace OpenSim.Server.Base int ndx = Convert.ToInt16(cmd[2]); PluginManager.AddinInfo(ndx, out result); - MainConsole.Instance.OutputFormat("Name: {0}\nURL: {1}\nFile: {2}\nAuthor: {3}\nCategory: {4}\nDesc: {5}", + MainConsole.Instance.Output("Name: {0}\nURL: {1}\nFile: {2}\nAuthor: {3}\nCategory: {4}\nDesc: {5}", + null, result["name"], result["url"], result["file_name"], diff --git a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs old mode 100644 new mode 100755 index bad3ea2..b710ec1 --- a/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs +++ b/OpenSim/Server/Handlers/Asset/AssetServerConnector.cs @@ -125,14 +125,14 @@ namespace OpenSim.Server.Handlers.Asset if (asset == null || asset.Data.Length == 0) { - MainConsole.Instance.OutputFormat("Could not find asset with ID {0}", args[2]); + MainConsole.Instance.Output("Could not find asset with ID {0}", null, args[2]); return; } if (!m_AssetService.Delete(asset.ID)) - MainConsole.Instance.OutputFormat("ERROR: Could not delete asset {0} {1}", asset.ID, asset.Name); + MainConsole.Instance.Output("ERROR: Could not delete asset {0} {1}", null, asset.ID, asset.Name); else - MainConsole.Instance.OutputFormat("Deleted asset {0} {1}", asset.ID, asset.Name); + MainConsole.Instance.Output("Deleted asset {0} {1}", null, asset.ID, asset.Name); } void HandleDumpAsset(string module, string[] args) @@ -148,14 +148,14 @@ namespace OpenSim.Server.Handlers.Asset if (!UUID.TryParse(rawAssetId, out assetId)) { - MainConsole.Instance.OutputFormat("ERROR: {0} is not a valid ID format", rawAssetId); + MainConsole.Instance.Output("ERROR: {0} is not a valid ID format", null, rawAssetId); return; } AssetBase asset = m_AssetService.Get(assetId.ToString()); if (asset == null) { - MainConsole.Instance.OutputFormat("ERROR: No asset found with ID {0}", assetId); + MainConsole.Instance.Output("ERROR: No asset found with ID {0}", null, assetId); return; } @@ -172,7 +172,7 @@ namespace OpenSim.Server.Handlers.Asset } } - MainConsole.Instance.OutputFormat("Asset dumped to file {0}", fileName); + MainConsole.Instance.Output("Asset dumped to file {0}", null, fileName); } void HandleShowAsset(string module, string[] args) @@ -193,13 +193,13 @@ namespace OpenSim.Server.Handlers.Asset int i; - MainConsole.Instance.OutputFormat("Name: {0}", asset.Name); - MainConsole.Instance.OutputFormat("Description: {0}", asset.Description); - MainConsole.Instance.OutputFormat("Type: {0} (type number = {1})", (AssetType)asset.Type, asset.Type); - MainConsole.Instance.OutputFormat("Content-type: {0}", asset.Metadata.ContentType); - MainConsole.Instance.OutputFormat("Size: {0} bytes", asset.Data.Length); - MainConsole.Instance.OutputFormat("Temporary: {0}", asset.Temporary ? "yes" : "no"); - MainConsole.Instance.OutputFormat("Flags: {0}", asset.Metadata.Flags); + MainConsole.Instance.Output("Name: {0}", null, asset.Name); + MainConsole.Instance.Output("Description: {0}", null, asset.Description); + MainConsole.Instance.Output("Type: {0} (type number = {1})", null, (AssetType)asset.Type, asset.Type); + MainConsole.Instance.Output("Content-type: {0}", null, asset.Metadata.ContentType); + MainConsole.Instance.Output("Size: {0} bytes", null, asset.Data.Length); + MainConsole.Instance.Output("Temporary: {0}", null, asset.Temporary ? "yes" : "no"); + MainConsole.Instance.Output("Flags: {0}", null, asset.Metadata.Flags); for (i = 0 ; i < 5 ; i++) { -- cgit v1.1