diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Agent')
-rw-r--r-- | OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs index c023a6f..1d8e70e 100644 --- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs | |||
@@ -26,12 +26,14 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Collections; | ||
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using System.Reflection; | 31 | using System.Reflection; |
31 | using log4net; | 32 | using log4net; |
32 | using Nini.Config; | 33 | using Nini.Config; |
33 | using OpenMetaverse; | 34 | using OpenMetaverse; |
34 | using OpenSim.Framework; | 35 | using OpenSim.Framework; |
36 | using OpenSim.Framework.Console; | ||
35 | using OpenSim.Region.Framework.Interfaces; | 37 | using OpenSim.Region.Framework.Interfaces; |
36 | using OpenSim.Region.Framework.Scenes; | 38 | using OpenSim.Region.Framework.Scenes; |
37 | using Caps=OpenSim.Framework.Capabilities.Caps; | 39 | using Caps=OpenSim.Framework.Capabilities.Caps; |
@@ -61,6 +63,9 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities | |||
61 | { | 63 | { |
62 | m_scene = scene; | 64 | m_scene = scene; |
63 | m_scene.RegisterModuleInterface<ICapabilitiesModule>(this); | 65 | m_scene.RegisterModuleInterface<ICapabilitiesModule>(this); |
66 | MainConsole.Instance.Commands.AddCommand("Capabilities", false, "show caps", | ||
67 | "show capabilities", | ||
68 | "Shows all registered capabilities", CapabilitiesCommand); | ||
64 | } | 69 | } |
65 | 70 | ||
66 | public void RegionLoaded(Scene scene) | 71 | public void RegionLoaded(Scene scene) |
@@ -72,7 +77,9 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities | |||
72 | m_scene.UnregisterModuleInterface<ICapabilitiesModule>(this); | 77 | m_scene.UnregisterModuleInterface<ICapabilitiesModule>(this); |
73 | } | 78 | } |
74 | 79 | ||
75 | public void PostInitialise() {} | 80 | public void PostInitialise() |
81 | { | ||
82 | } | ||
76 | 83 | ||
77 | public void Close() {} | 84 | public void Close() {} |
78 | 85 | ||
@@ -226,5 +233,23 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities | |||
226 | m_log.Info(" >> "+x+", "+y+": "+kvp.Value); | 233 | m_log.Info(" >> "+x+", "+y+": "+kvp.Value); |
227 | } | 234 | } |
228 | } | 235 | } |
236 | |||
237 | private void CapabilitiesCommand(string module, string[] cmdparams) | ||
238 | { | ||
239 | System.Text.StringBuilder caps = new System.Text.StringBuilder(); | ||
240 | caps.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName); | ||
241 | |||
242 | foreach (KeyValuePair<UUID, Caps> kvp in m_capsHandlers) | ||
243 | { | ||
244 | caps.AppendFormat("** User {0}:\n", kvp.Key); | ||
245 | for (IDictionaryEnumerator kvp2 = kvp.Value.CapsHandlers.CapsDetails.GetEnumerator(); kvp2.MoveNext(); ) | ||
246 | { | ||
247 | Uri uri = new Uri(kvp2.Value.ToString()); | ||
248 | caps.AppendFormat(" {0} = {1}\n", kvp2.Key, uri.PathAndQuery); | ||
249 | } | ||
250 | } | ||
251 | |||
252 | MainConsole.Instance.Output(caps.ToString()); | ||
253 | } | ||
229 | } | 254 | } |
230 | } | 255 | } |