diff options
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 84 |
1 files changed, 49 insertions, 35 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index 1458ff9..e6b57c2 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -996,44 +996,11 @@ namespace OpenSim | |||
996 | break; | 996 | break; |
997 | 997 | ||
998 | case "connections": | 998 | case "connections": |
999 | System.Text.StringBuilder connections = new System.Text.StringBuilder("Connections:\n"); | 999 | HandleShowConnections(); |
1000 | m_sceneManager.ForEachScene( | ||
1001 | delegate(Scene scene) { | ||
1002 | scene.ForEachClient( | ||
1003 | delegate(IClientAPI client) { | ||
1004 | connections.AppendFormat( | ||
1005 | "{0}: {1} ({2}) from {3} on circuit {4}\n", | ||
1006 | scene.RegionInfo.RegionName, | ||
1007 | client.Name, | ||
1008 | client.AgentId, | ||
1009 | client.RemoteEndPoint, | ||
1010 | client.CircuitCode | ||
1011 | ); | ||
1012 | } | ||
1013 | ); | ||
1014 | } | ||
1015 | ); | ||
1016 | |||
1017 | MainConsole.Instance.Output(connections.ToString()); | ||
1018 | break; | 1000 | break; |
1019 | 1001 | ||
1020 | case "circuits": | 1002 | case "circuits": |
1021 | System.Text.StringBuilder acd = new System.Text.StringBuilder("Agent Circuits:\n"); | 1003 | HandleShowCircuits(); |
1022 | m_sceneManager.ForEachScene( | ||
1023 | delegate(Scene scene) { | ||
1024 | //this.HttpServer. | ||
1025 | acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName); | ||
1026 | foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values) | ||
1027 | acd.AppendFormat( | ||
1028 | "\t{0} {1} ({2})\n", | ||
1029 | aCircuit.firstname, | ||
1030 | aCircuit.lastname, | ||
1031 | (aCircuit.child ? "Child" : "Root") | ||
1032 | ); | ||
1033 | } | ||
1034 | ); | ||
1035 | |||
1036 | MainConsole.Instance.Output(acd.ToString()); | ||
1037 | break; | 1004 | break; |
1038 | 1005 | ||
1039 | case "http-handlers": | 1006 | case "http-handlers": |
@@ -1138,6 +1105,53 @@ namespace OpenSim | |||
1138 | } | 1105 | } |
1139 | } | 1106 | } |
1140 | 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 | |||
1134 | private void HandleShowConnections() | ||
1135 | { | ||
1136 | ConsoleDisplayTable cdt = new ConsoleDisplayTable(); | ||
1137 | cdt.AddColumn("Region", 20); | ||
1138 | cdt.AddColumn("Avatar name", 24); | ||
1139 | cdt.AddColumn("Circuit code", 12); | ||
1140 | cdt.AddColumn("Endpoint", 23); | ||
1141 | cdt.AddColumn("Active?", 7); | ||
1142 | |||
1143 | m_sceneManager.ForEachScene( | ||
1144 | s => s.ForEachClient( | ||
1145 | c => cdt.AddRow( | ||
1146 | s.Name, | ||
1147 | c.Name, | ||
1148 | c.RemoteEndPoint.ToString(), | ||
1149 | c.CircuitCode.ToString(), | ||
1150 | c.IsActive.ToString()))); | ||
1151 | |||
1152 | MainConsole.Instance.Output(cdt.ToString()); | ||
1153 | } | ||
1154 | |||
1141 | /// <summary> | 1155 | /// <summary> |
1142 | /// Use XML2 format to serialize data to a file | 1156 | /// Use XML2 format to serialize data to a file |
1143 | /// </summary> | 1157 | /// </summary> |