simplify output of show caps list a bit

This commit is contained in:
UbitUmarov
2024-04-17 20:31:21 +01:00
parent 863ff6bc9f
commit 604282c482
2 changed files with 34 additions and 27 deletions

View File

@@ -26,9 +26,7 @@
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using log4net;
@@ -36,7 +34,6 @@ using Nini.Config;
using Mono.Addins;
using OpenMetaverse;
using OpenSim.Framework;
using OpenSim.Framework.Console;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Region.Framework.Interfaces;
@@ -50,19 +47,16 @@ namespace OpenSim.Region.CoreModules.Framework
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
private string m_showCapsCommandFormat = " {0,-38} {1,-60}\n";
private static readonly string m_showCapsCommandFormat = " {0,-38} {1,-60}\n";
protected Scene m_scene;
/// <summary>
/// Each agent has its own capabilities handler.
/// </summary>
protected Dictionary<uint, Caps> m_capsObjects = new Dictionary<uint, Caps>();
protected Dictionary<UUID, string> m_capsPaths = new Dictionary<UUID, string>();
protected Dictionary<UUID, Dictionary<ulong, string>> m_childrenSeeds
= new Dictionary<UUID, Dictionary<ulong, string>>();
protected readonly Dictionary<uint, Caps> m_capsObjects = new();
protected readonly Dictionary<UUID, string> m_capsPaths = new();
protected readonly Dictionary<UUID, Dictionary<ulong, string>> m_childrenSeeds = new();
public void Initialise(IConfigSource source)
{
@@ -296,7 +290,7 @@ namespace OpenSim.Region.CoreModules.Framework
if (SceneManager.Instance.CurrentScene != null && SceneManager.Instance.CurrentScene != m_scene)
return;
StringBuilder capsReport = new StringBuilder();
StringBuilder capsReport = new();
capsReport.AppendFormat("Region {0}:\n", m_scene.RegionInfo.RegionName);
lock (m_capsObjects)
@@ -308,13 +302,12 @@ namespace OpenSim.Region.CoreModules.Framework
if(m_scene.TryGetScenePresence(caps.AgentID, out ScenePresence sp) && sp!=null)
name = sp.Name;
capsReport.AppendFormat("** Circuit {0}; {1} {2}:\n", kvp.Key, caps.AgentID,name);
capsReport.AppendFormat("** Base URL {0}\n", caps.CapsHandlers.BaseURL);
for (IDictionaryEnumerator kvp2 = caps.CapsHandlers.GetCapsDetails(false, null).GetEnumerator(); kvp2.MoveNext(); )
{
Uri uri = new Uri(kvp2.Value.ToString());
capsReport.AppendFormat(m_showCapsCommandFormat, kvp2.Key, uri.PathAndQuery);
}
Dictionary<string, string> capsPaths = caps.CapsHandlers.GetCapsLocalPaths();
foreach(KeyValuePair<string, string> kvp2 in capsPaths)
capsReport.AppendFormat(m_showCapsCommandFormat, kvp2.Key, kvp2.Value);
foreach (KeyValuePair<string, PollServiceEventArgs> kvp2 in caps.GetPollHandlers())
capsReport.AppendFormat(m_showCapsCommandFormat, kvp2.Key, kvp2.Value.Url);