aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-29 16:29:11 +0000
committerJustin Clark-Casey (justincc)2011-11-29 16:29:11 +0000
commitd3a46b03bf8761f5917b324392aa60b10cd9e078 (patch)
treec25e76ff0a95305668ce684d45347041dd011089 /OpenSim/Region/CoreModules/Framework
parentCorrect mistake in "debug eq" help (diff)
downloadopensim-SC_OLD-d3a46b03bf8761f5917b324392aa60b10cd9e078.zip
opensim-SC_OLD-d3a46b03bf8761f5917b324392aa60b10cd9e078.tar.gz
opensim-SC_OLD-d3a46b03bf8761f5917b324392aa60b10cd9e078.tar.bz2
opensim-SC_OLD-d3a46b03bf8761f5917b324392aa60b10cd9e078.tar.xz
tabulate "show caps" output for easier readability
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r--OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs15
1 files changed, 10 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
index afbd902..780411f 100644
--- a/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/Caps/CapabilitiesModule.cs
@@ -29,6 +29,7 @@ using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Reflection; 31using System.Reflection;
32using System.Text;
32using log4net; 33using log4net;
33using Nini.Config; 34using Nini.Config;
34using Mono.Addins; 35using Mono.Addins;
@@ -46,6 +47,8 @@ namespace OpenSim.Region.CoreModules.Framework
46 public class CapabilitiesModule : INonSharedRegionModule, ICapabilitiesModule 47 public class CapabilitiesModule : INonSharedRegionModule, ICapabilitiesModule
47 { 48 {
48 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 49 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
50
51 private string m_showCapsCommandFormat = " {0,-38} {1,-60}\n";
49 52
50 protected Scene m_scene; 53 protected Scene m_scene;
51 54
@@ -68,7 +71,7 @@ namespace OpenSim.Region.CoreModules.Framework
68 m_scene.RegisterModuleInterface<ICapabilitiesModule>(this); 71 m_scene.RegisterModuleInterface<ICapabilitiesModule>(this);
69 MainConsole.Instance.Commands.AddCommand("Capabilities", false, "show caps", 72 MainConsole.Instance.Commands.AddCommand("Capabilities", false, "show caps",
70 "show caps", 73 "show caps",
71 "Shows all registered capabilities", CapabilitiesCommand); 74 "Shows all registered capabilities", HandleShowCapsCommand);
72 } 75 }
73 76
74 public void RegionLoaded(Scene scene) 77 public void RegionLoaded(Scene scene)
@@ -227,21 +230,23 @@ namespace OpenSim.Region.CoreModules.Framework
227 } 230 }
228 } 231 }
229 232
230 private void CapabilitiesCommand(string module, string[] cmdparams) 233 private void HandleShowCapsCommand(string module, string[] cmdparams)
231 { 234 {
232 System.Text.StringBuilder caps = new System.Text.StringBuilder(); 235 StringBuilder caps = new StringBuilder();
233 caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName); 236 caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName);
234 237
235 foreach (KeyValuePair<UUID, Caps> kvp in m_capsObjects) 238 foreach (KeyValuePair<UUID, Caps> kvp in m_capsObjects)
236 { 239 {
237 caps.AppendFormat("** User {0}:\n", kvp.Key); 240 caps.AppendFormat("** User {0}:\n", kvp.Key);
241
238 for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.CapsDetails.GetEnumerator(); kvp2.MoveNext(); ) 242 for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.CapsDetails.GetEnumerator(); kvp2.MoveNext(); )
239 { 243 {
240 Uri uri = new Uri(kvp2.Value.ToString()); 244 Uri uri = new Uri(kvp2.Value.ToString());
241 caps.AppendFormat(" {0} = {1}\n", kvp2.Key, uri.PathAndQuery); 245 caps.AppendFormat(m_showCapsCommandFormat, kvp2.Key, uri.PathAndQuery);
242 } 246 }
247
243 foreach (KeyValuePair<string, string> kvp3 in kvp.Value.ExternalCapsHandlers) 248 foreach (KeyValuePair<string, string> kvp3 in kvp.Value.ExternalCapsHandlers)
244 caps.AppendFormat(" {0} = {1}\n", kvp3.Key, kvp3.Value); 249 caps.AppendFormat(m_showCapsCommandFormat, kvp3.Key, kvp3.Value);
245 } 250 }
246 251
247 MainConsole.Instance.Output(caps.ToString()); 252 MainConsole.Instance.Output(caps.ToString());