aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Application')
-rw-r--r--OpenSim/Region/Application/OpenSim.cs104
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs23
2 files changed, 82 insertions, 45 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 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Diagnostics;
31using System.IO; 32using System.IO;
32using System.Reflection; 33using System.Reflection;
33using System.Text; 34using 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;
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index ddc7f10..0adb693 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -437,7 +437,7 @@ namespace OpenSim
437 scene.LoadPrimsFromStorage(regionInfo.originRegionID); 437 scene.LoadPrimsFromStorage(regionInfo.originRegionID);
438 438
439 // TODO : Try setting resource for region xstats here on scene 439 // TODO : Try setting resource for region xstats here on scene
440 MainServer.Instance.AddStreamHandler(new Region.Framework.Scenes.RegionStatsHandler(regionInfo)); 440 MainServer.Instance.AddStreamHandler(new RegionStatsHandler(regionInfo));
441 441
442 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 442 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
443 scene.EventManager.TriggerParcelPrimCountUpdate(); 443 scene.EventManager.TriggerParcelPrimCountUpdate();
@@ -856,6 +856,9 @@ namespace OpenSim
856 return Util.UTF8.GetBytes("OK"); 856 return Util.UTF8.GetBytes("OK");
857 } 857 }
858 858
859 public string Name { get { return "SimStatus"; } }
860 public string Description { get { return "Simulator Status"; } }
861
859 public string ContentType 862 public string ContentType
860 { 863 {
861 get { return "text/plain"; } 864 get { return "text/plain"; }
@@ -880,6 +883,9 @@ namespace OpenSim
880 { 883 {
881 OpenSimBase m_opensim; 884 OpenSimBase m_opensim;
882 string osXStatsURI = String.Empty; 885 string osXStatsURI = String.Empty;
886
887 public string Name { get { return "XSimStatus"; } }
888 public string Description { get { return "Simulator XStatus"; } }
883 889
884 public XSimStatusHandler(OpenSimBase sim) 890 public XSimStatusHandler(OpenSimBase sim)
885 { 891 {
@@ -920,6 +926,9 @@ namespace OpenSim
920 { 926 {
921 OpenSimBase m_opensim; 927 OpenSimBase m_opensim;
922 string osUXStatsURI = String.Empty; 928 string osUXStatsURI = String.Empty;
929
930 public string Name { get { return "UXSimStatus"; } }
931 public string Description { get { return "Simulator UXStatus"; } }
923 932
924 public UXSimStatusHandler(OpenSimBase sim) 933 public UXSimStatusHandler(OpenSimBase sim)
925 { 934 {
@@ -1051,13 +1060,13 @@ namespace OpenSim
1051 /// Load the estate information for the provided RegionInfo object. 1060 /// Load the estate information for the provided RegionInfo object.
1052 /// </summary> 1061 /// </summary>
1053 /// <param name="regInfo"></param> 1062 /// <param name="regInfo"></param>
1054 public void PopulateRegionEstateInfo(RegionInfo regInfo) 1063 public bool PopulateRegionEstateInfo(RegionInfo regInfo)
1055 { 1064 {
1056 if (EstateDataService != null) 1065 if (EstateDataService != null)
1057 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false); 1066 regInfo.EstateSettings = EstateDataService.LoadEstateSettings(regInfo.RegionID, false);
1058 1067
1059 if (regInfo.EstateSettings.EstateID != 0) 1068 if (regInfo.EstateSettings.EstateID != 0)
1060 return; 1069 return false; // estate info in the database did not change
1061 1070
1062 m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName); 1071 m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName);
1063 1072
@@ -1092,7 +1101,7 @@ namespace OpenSim
1092 } 1101 }
1093 1102
1094 if (defaultEstateJoined) 1103 if (defaultEstateJoined)
1095 return; 1104 return true; // need to update the database
1096 else 1105 else
1097 m_log.ErrorFormat( 1106 m_log.ErrorFormat(
1098 "[OPENSIM BASE]: Joining default estate {0} failed", defaultEstateName); 1107 "[OPENSIM BASE]: Joining default estate {0} failed", defaultEstateName);
@@ -1154,8 +1163,10 @@ namespace OpenSim
1154 MainConsole.Instance.Output("Joining the estate failed. Please try again."); 1163 MainConsole.Instance.Output("Joining the estate failed. Please try again.");
1155 } 1164 }
1156 } 1165 }
1157 } 1166 }
1158 } 1167
1168 return true; // need to update the database
1169 }
1159 } 1170 }
1160 1171
1161 public class OpenSimConfigSource 1172 public class OpenSimConfigSource