aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-12 23:09:36 +0100
committerJustin Clark-Casey (justincc)2012-07-12 23:09:36 +0100
commit15283d35f1c567d6b33d0ba2884c1a73c83c6ce6 (patch)
treeb6924d8313ce52fce049b84d6ad9cc8e9d525302 /OpenSim/Region
parentAdd active status to "show connections" (diff)
downloadopensim-SC-15283d35f1c567d6b33d0ba2884c1a73c83c6ce6.zip
opensim-SC-15283d35f1c567d6b33d0ba2884c1a73c83c6ce6.tar.gz
opensim-SC-15283d35f1c567d6b33d0ba2884c1a73c83c6ce6.tar.bz2
opensim-SC-15283d35f1c567d6b33d0ba2884c1a73c83c6ce6.tar.xz
Extend "show circuits" to show circuit code, ip and viewer name.
Also change to use standard table formatting "show circuits" and "show connections" console commands are very similar but access different data structures.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs51
1 files changed, 31 insertions, 20 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs
index e980716..230af8e 100644
--- a/OpenSim/Region/Application/OpenSim.cs
+++ b/OpenSim/Region/Application/OpenSim.cs
@@ -1000,22 +1000,7 @@ namespace OpenSim
1000 break; 1000 break;
1001 1001
1002 case "circuits": 1002 case "circuits":
1003 System.Text.StringBuilder acd = new System.Text.StringBuilder("Agent Circuits:\n"); 1003 HandleShowCircuits();
1004 m_sceneManager.ForEachScene(
1005 delegate(Scene scene) {
1006 //this.HttpServer.
1007 acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName);
1008 foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values)
1009 acd.AppendFormat(
1010 "\t{0} {1} ({2})\n",
1011 aCircuit.firstname,
1012 aCircuit.lastname,
1013 (aCircuit.child ? "Child" : "Root")
1014 );
1015 }
1016 );
1017
1018 MainConsole.Instance.Output(acd.ToString());
1019 break; 1004 break;
1020 1005
1021 case "http-handlers": 1006 case "http-handlers":
@@ -1120,19 +1105,45 @@ namespace OpenSim
1120 } 1105 }
1121 } 1106 }
1122 1107
1108 private void HandleShowCircuits()
1109 {
1110 ConsoleDisplayTable cdt = new ConsoleDisplayTable();
1111 cdt.AddColumn("Region", 20);
1112 cdt.AddColumn("Avatar name", 24);
1113 cdt.AddColumn("Type", 5);
1114 cdt.AddColumn("Code", 10);
1115 cdt.AddColumn("IP", 16);
1116 cdt.AddColumn("Viewer Name", 24);
1117
1118 m_sceneManager.ForEachScene(
1119 s =>
1120 {
1121 foreach (AgentCircuitData aCircuit in s.AuthenticateHandler.GetAgentCircuits().Values)
1122 cdt.AddRow(
1123 s.Name,
1124 aCircuit.Name,
1125 aCircuit.child ? "child" : "root",
1126 aCircuit.circuitcode.ToString(),
1127 aCircuit.IPAddress.ToString(),
1128 aCircuit.Viewer);
1129 });
1130
1131 MainConsole.Instance.Output(cdt.ToString());
1132 }
1133
1123 private void HandleShowConnections() 1134 private void HandleShowConnections()
1124 { 1135 {
1125 ConsoleDisplayTable cdt = new ConsoleDisplayTable(); 1136 ConsoleDisplayTable cdt = new ConsoleDisplayTable();
1126 cdt.AddColumn("Region", 20); 1137 cdt.AddColumn("Region", 20);
1127 cdt.AddColumn("Avatar name", 25); 1138 cdt.AddColumn("Avatar name", 24);
1128 cdt.AddColumn("Remote endpoint", 23); 1139 cdt.AddColumn("Circuit code", 12);
1129 cdt.AddColumn("Circuit number", 14); 1140 cdt.AddColumn("Endpoint", 23);
1130 cdt.AddColumn("Active?", 7); 1141 cdt.AddColumn("Active?", 7);
1131 1142
1132 m_sceneManager.ForEachScene( 1143 m_sceneManager.ForEachScene(
1133 s => s.ForEachClient( 1144 s => s.ForEachClient(
1134 c => cdt.AddRow( 1145 c => cdt.AddRow(
1135 s.RegionInfo.RegionName, 1146 s.Name,
1136 c.Name, 1147 c.Name,
1137 c.RemoteEndPoint.ToString(), 1148 c.RemoteEndPoint.ToString(),
1138 c.CircuitCode.ToString(), 1149 c.CircuitCode.ToString(),