Put output for "show connections" command into standard table format.
Also moves into own method.0.7.3-extended
parent
85985a8c3e
commit
523d03fb76
|
@ -990,21 +990,7 @@ namespace OpenSim
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "connections":
|
case "connections":
|
||||||
System.Text.StringBuilder connections = new System.Text.StringBuilder("Connections:\n");
|
HandleShowConnections();
|
||||||
m_sceneManager.ForEachScene(
|
|
||||||
delegate(Scene scene)
|
|
||||||
{
|
|
||||||
scene.ForEachClient(
|
|
||||||
delegate(IClientAPI client)
|
|
||||||
{
|
|
||||||
connections.AppendFormat("{0}: {1} ({2}) from {3} on circuit {4}\n",
|
|
||||||
scene.RegionInfo.RegionName, client.Name, client.AgentId, client.RemoteEndPoint, client.CircuitCode);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
MainConsole.Instance.Output(connections.ToString());
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "circuits":
|
case "circuits":
|
||||||
|
@ -1112,6 +1098,21 @@ namespace OpenSim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HandleShowConnections()
|
||||||
|
{
|
||||||
|
ConsoleDisplayTable cdt = new ConsoleDisplayTable();
|
||||||
|
cdt.AddColumn("Region", 20);
|
||||||
|
cdt.AddColumn("Avatar name", 25);
|
||||||
|
cdt.AddColumn("Remote endpoint", 23);
|
||||||
|
cdt.AddColumn("Circuit number", 14);
|
||||||
|
|
||||||
|
m_sceneManager.ForEachScene(
|
||||||
|
s => s.ForEachClient(
|
||||||
|
c => cdt.AddRow(s.RegionInfo.RegionName, c.Name, c.RemoteEndPoint.ToString(), c.CircuitCode.ToString())));
|
||||||
|
|
||||||
|
MainConsole.Instance.Output(cdt.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Use XML2 format to serialize data to a file
|
/// Use XML2 format to serialize data to a file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue