diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSim.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSim.cs | 104 |
1 files changed, 65 insertions, 39 deletions
diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index fb1e831..ac0e3e1 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs | |||
@@ -28,6 +28,7 @@ | |||
28 | using System; | 28 | using System; |
29 | using System.Collections; | 29 | using System.Collections; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.Diagnostics; | ||
31 | using System.IO; | 32 | using System.IO; |
32 | using System.Reflection; | 33 | using System.Reflection; |
33 | using System.Text; | 34 | using System.Text; |
@@ -138,7 +139,7 @@ namespace OpenSim | |||
138 | m_log.Info("===================================================================="); | 139 | m_log.Info("===================================================================="); |
139 | m_log.Info("========================= STARTING OPENSIM ========================="); | 140 | m_log.Info("========================= STARTING OPENSIM ========================="); |
140 | m_log.Info("===================================================================="); | 141 | m_log.Info("===================================================================="); |
141 | 142 | ||
142 | //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); | 143 | //m_log.InfoFormat("[OPENSIM MAIN]: GC Is Server GC: {0}", GCSettings.IsServerGC.ToString()); |
143 | // http://msdn.microsoft.com/en-us/library/bb384202.aspx | 144 | // http://msdn.microsoft.com/en-us/library/bb384202.aspx |
144 | //GCSettings.LatencyMode = GCLatencyMode.Batch; | 145 | //GCSettings.LatencyMode = GCLatencyMode.Batch; |
@@ -225,7 +226,7 @@ namespace OpenSim | |||
225 | /// </summary> | 226 | /// </summary> |
226 | private void RegisterConsoleCommands() | 227 | private void RegisterConsoleCommands() |
227 | { | 228 | { |
228 | m_console.Commands.AddCommand("Regions", false, "force update", | 229 | m_console.Commands.AddCommand("Objects", false, "force update", |
229 | "force update", | 230 | "force update", |
230 | "Force the update of all objects on clients", | 231 | "Force the update of all objects on clients", |
231 | HandleForceUpdate); | 232 | HandleForceUpdate); |
@@ -306,7 +307,7 @@ namespace OpenSim | |||
306 | + " If this is not given then the oar is saved to region.oar in the current directory.", | 307 | + " If this is not given then the oar is saved to region.oar in the current directory.", |
307 | SaveOar); | 308 | SaveOar); |
308 | 309 | ||
309 | m_console.Commands.AddCommand("Regions", false, "edit scale", | 310 | m_console.Commands.AddCommand("Objects", false, "edit scale", |
310 | "edit scale <name> <x> <y> <z>", | 311 | "edit scale <name> <x> <y> <z>", |
311 | "Change the scale of a named prim", HandleEditScale); | 312 | "Change the scale of a named prim", HandleEditScale); |
312 | 313 | ||
@@ -349,7 +350,7 @@ namespace OpenSim | |||
349 | "show ratings", | 350 | "show ratings", |
350 | "Show rating data", HandleShow); | 351 | "Show rating data", HandleShow); |
351 | 352 | ||
352 | m_console.Commands.AddCommand("Regions", false, "backup", | 353 | m_console.Commands.AddCommand("Objects", false, "backup", |
353 | "backup", | 354 | "backup", |
354 | "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", RunCommand); | 355 | "Persist currently unsaved object changes immediately instead of waiting for the normal persistence call.", RunCommand); |
355 | 356 | ||
@@ -410,7 +411,7 @@ namespace OpenSim | |||
410 | "modules unload <name>", | 411 | "modules unload <name>", |
411 | "Unload a module", HandleModules); | 412 | "Unload a module", HandleModules); |
412 | 413 | ||
413 | m_console.Commands.AddCommand("Regions", false, "kill uuid", | 414 | m_console.Commands.AddCommand("Objects", false, "kill uuid", |
414 | "kill uuid <UUID>", | 415 | "kill uuid <UUID>", |
415 | "Kill an object by UUID", KillUUID); | 416 | "Kill an object by UUID", KillUUID); |
416 | } | 417 | } |
@@ -437,12 +438,16 @@ namespace OpenSim | |||
437 | } | 438 | } |
438 | } | 439 | } |
439 | 440 | ||
440 | private void WatchdogTimeoutHandler(System.Threading.Thread thread, int lastTick) | 441 | private void WatchdogTimeoutHandler(Watchdog.ThreadWatchdogInfo twi) |
441 | { | 442 | { |
442 | int now = Environment.TickCount & Int32.MaxValue; | 443 | int now = Environment.TickCount & Int32.MaxValue; |
443 | 444 | ||
444 | m_log.ErrorFormat("[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago", | 445 | m_log.ErrorFormat( |
445 | thread.Name, thread.ThreadState, now - lastTick); | 446 | "[WATCHDOG]: Timeout detected for thread \"{0}\". ThreadState={1}. Last tick was {2}ms ago. {3}", |
447 | twi.Thread.Name, | ||
448 | twi.Thread.ThreadState, | ||
449 | now - twi.LastTick, | ||
450 | twi.AlarmMethod != null ? string.Format("Data: {0}", twi.AlarmMethod()) : ""); | ||
446 | } | 451 | } |
447 | 452 | ||
448 | #region Console Commands | 453 | #region Console Commands |
@@ -618,10 +623,11 @@ namespace OpenSim | |||
618 | return; | 623 | return; |
619 | } | 624 | } |
620 | 625 | ||
621 | PopulateRegionEstateInfo(regInfo); | 626 | bool changed = PopulateRegionEstateInfo(regInfo); |
622 | IScene scene; | 627 | IScene scene; |
623 | CreateRegion(regInfo, true, out scene); | 628 | CreateRegion(regInfo, true, out scene); |
624 | regInfo.EstateSettings.Save(); | 629 | if (changed) |
630 | regInfo.EstateSettings.Save(); | ||
625 | } | 631 | } |
626 | 632 | ||
627 | /// <summary> | 633 | /// <summary> |
@@ -969,8 +975,7 @@ namespace OpenSim | |||
969 | if (showParams.Length > 1 && showParams[1] == "full") | 975 | if (showParams.Length > 1 && showParams[1] == "full") |
970 | { | 976 | { |
971 | agents = m_sceneManager.GetCurrentScenePresences(); | 977 | agents = m_sceneManager.GetCurrentScenePresences(); |
972 | } | 978 | } else |
973 | else | ||
974 | { | 979 | { |
975 | agents = m_sceneManager.GetCurrentSceneAvatars(); | 980 | agents = m_sceneManager.GetCurrentSceneAvatars(); |
976 | } | 981 | } |
@@ -979,7 +984,8 @@ namespace OpenSim | |||
979 | 984 | ||
980 | MainConsole.Instance.Output( | 985 | MainConsole.Instance.Output( |
981 | String.Format("{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", "Firstname", "Lastname", | 986 | String.Format("{0,-16} {1,-16} {2,-37} {3,-11} {4,-16} {5,-30}", "Firstname", "Lastname", |
982 | "Agent ID", "Root/Child", "Region", "Position")); | 987 | "Agent ID", "Root/Child", "Region", "Position") |
988 | ); | ||
983 | 989 | ||
984 | foreach (ScenePresence presence in agents) | 990 | foreach (ScenePresence presence in agents) |
985 | { | 991 | { |
@@ -989,8 +995,7 @@ namespace OpenSim | |||
989 | if (regionInfo == null) | 995 | if (regionInfo == null) |
990 | { | 996 | { |
991 | regionName = "Unresolvable"; | 997 | regionName = "Unresolvable"; |
992 | } | 998 | } else |
993 | else | ||
994 | { | 999 | { |
995 | regionName = regionInfo.RegionName; | 1000 | regionName = regionInfo.RegionName; |
996 | } | 1001 | } |
@@ -1003,7 +1008,8 @@ namespace OpenSim | |||
1003 | presence.UUID, | 1008 | presence.UUID, |
1004 | presence.IsChildAgent ? "Child" : "Root", | 1009 | presence.IsChildAgent ? "Child" : "Root", |
1005 | regionName, | 1010 | regionName, |
1006 | presence.AbsolutePosition.ToString())); | 1011 | presence.AbsolutePosition.ToString()) |
1012 | ); | ||
1007 | } | 1013 | } |
1008 | 1014 | ||
1009 | MainConsole.Instance.Output(String.Empty); | 1015 | MainConsole.Instance.Output(String.Empty); |
@@ -1012,16 +1018,20 @@ namespace OpenSim | |||
1012 | case "connections": | 1018 | case "connections": |
1013 | System.Text.StringBuilder connections = new System.Text.StringBuilder("Connections:\n"); | 1019 | System.Text.StringBuilder connections = new System.Text.StringBuilder("Connections:\n"); |
1014 | m_sceneManager.ForEachScene( | 1020 | m_sceneManager.ForEachScene( |
1015 | delegate(Scene scene) | 1021 | delegate(Scene scene) { |
1016 | { | 1022 | scene.ForEachClient( |
1017 | scene.ForEachClient( | 1023 | delegate(IClientAPI client) { |
1018 | delegate(IClientAPI client) | 1024 | connections.AppendFormat( |
1019 | { | 1025 | "{0}: {1} ({2}) from {3} on circuit {4}\n", |
1020 | connections.AppendFormat("{0}: {1} ({2}) from {3} on circuit {4}\n", | 1026 | scene.RegionInfo.RegionName, |
1021 | scene.RegionInfo.RegionName, client.Name, client.AgentId, client.RemoteEndPoint, client.CircuitCode); | 1027 | client.Name, |
1022 | } | 1028 | client.AgentId, |
1029 | client.RemoteEndPoint, | ||
1030 | client.CircuitCode | ||
1023 | ); | 1031 | ); |
1024 | } | 1032 | } |
1033 | ); | ||
1034 | } | ||
1025 | ); | 1035 | ); |
1026 | 1036 | ||
1027 | MainConsole.Instance.Output(connections.ToString()); | 1037 | MainConsole.Instance.Output(connections.ToString()); |
@@ -1030,13 +1040,17 @@ namespace OpenSim | |||
1030 | case "circuits": | 1040 | case "circuits": |
1031 | System.Text.StringBuilder acd = new System.Text.StringBuilder("Agent Circuits:\n"); | 1041 | System.Text.StringBuilder acd = new System.Text.StringBuilder("Agent Circuits:\n"); |
1032 | m_sceneManager.ForEachScene( | 1042 | m_sceneManager.ForEachScene( |
1033 | delegate(Scene scene) | 1043 | delegate(Scene scene) { |
1034 | { | 1044 | //this.HttpServer. |
1035 | //this.HttpServer. | 1045 | acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName); |
1036 | acd.AppendFormat("{0}:\n", scene.RegionInfo.RegionName); | 1046 | foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values) |
1037 | foreach (AgentCircuitData aCircuit in scene.AuthenticateHandler.GetAgentCircuits().Values) | 1047 | acd.AppendFormat( |
1038 | acd.AppendFormat("\t{0} {1} ({2})\n", aCircuit.firstname, aCircuit.lastname, (aCircuit.child ? "Child" : "Root")); | 1048 | "\t{0} {1} ({2})\n", |
1039 | } | 1049 | aCircuit.firstname, |
1050 | aCircuit.lastname, | ||
1051 | (aCircuit.child ? "Child" : "Root") | ||
1052 | ); | ||
1053 | } | ||
1040 | ); | 1054 | ); |
1041 | 1055 | ||
1042 | MainConsole.Instance.Output(acd.ToString()); | 1056 | MainConsole.Instance.Output(acd.ToString()); |
@@ -1077,17 +1091,29 @@ namespace OpenSim | |||
1077 | } | 1091 | } |
1078 | 1092 | ||
1079 | m_sceneManager.ForEachScene( | 1093 | m_sceneManager.ForEachScene( |
1080 | delegate(Scene scene) | 1094 | delegate(Scene scene) { |
1095 | m_log.Error("The currently loaded modules in " + scene.RegionInfo.RegionName + " are:"); | ||
1096 | foreach (IRegionModule module in scene.Modules.Values) | ||
1081 | { | 1097 | { |
1082 | m_log.Error("The currently loaded modules in " + scene.RegionInfo.RegionName + " are:"); | 1098 | if (!module.IsSharedModule) |
1083 | foreach (IRegionModule module in scene.Modules.Values) | ||
1084 | { | 1099 | { |
1085 | if (!module.IsSharedModule) | 1100 | m_log.Error("Region Module: " + module.Name); |
1086 | { | ||
1087 | m_log.Error("Region Module: " + module.Name); | ||
1088 | } | ||
1089 | } | 1101 | } |
1090 | }); | 1102 | } |
1103 | } | ||
1104 | ); | ||
1105 | |||
1106 | m_sceneManager.ForEachScene( | ||
1107 | delegate(Scene scene) { | ||
1108 | MainConsole.Instance.Output("Loaded new region modules in" + scene.RegionInfo.RegionName + " are:"); | ||
1109 | foreach (IRegionModuleBase module in scene.RegionModules.Values) | ||
1110 | { | ||
1111 | Type type = module.GetType().GetInterface("ISharedRegionModule"); | ||
1112 | string module_type = type != null ? "Shared" : "Non-Shared"; | ||
1113 | MainConsole.Instance.OutputFormat("New Region Module ({0}): {1}", module_type, module.Name); | ||
1114 | } | ||
1115 | } | ||
1116 | ); | ||
1091 | 1117 | ||
1092 | MainConsole.Instance.Output(""); | 1118 | MainConsole.Instance.Output(""); |
1093 | break; | 1119 | break; |