aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Application/OpenSimBase.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Application/OpenSimBase.cs78
1 files changed, 39 insertions, 39 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs
index b8363ab..75dc741 100644
--- a/OpenSim/Region/Application/OpenSimBase.cs
+++ b/OpenSim/Region/Application/OpenSimBase.cs
@@ -85,7 +85,7 @@ namespace OpenSim
85 85
86 protected string proxyUrl; 86 protected string proxyUrl;
87 protected int proxyOffset = 0; 87 protected int proxyOffset = 0;
88 88
89 public string userStatsURI = String.Empty; 89 public string userStatsURI = String.Empty;
90 public string managedStatsURI = String.Empty; 90 public string managedStatsURI = String.Empty;
91 91
@@ -125,7 +125,7 @@ namespace OpenSim
125 { 125 {
126 get { return m_EnvConfigSource; } 126 get { return m_EnvConfigSource; }
127 } 127 }
128 128
129 public uint HttpServerPort 129 public uint HttpServerPort
130 { 130 {
131 get { return m_httpServerPort; } 131 get { return m_httpServerPort; }
@@ -210,7 +210,7 @@ namespace OpenSim
210 } 210 }
211 211
212 /// <summary> 212 /// <summary>
213 /// Performs startup specific to the region server, including initialization of the scene 213 /// Performs startup specific to the region server, including initialization of the scene
214 /// such as loading configuration from disk. 214 /// such as loading configuration from disk.
215 /// </summary> 215 /// </summary>
216 protected override void StartupSpecific() 216 protected override void StartupSpecific()
@@ -228,7 +228,7 @@ namespace OpenSim
228 string pidFile = startupConfig.GetString("PIDFile", String.Empty); 228 string pidFile = startupConfig.GetString("PIDFile", String.Empty);
229 if (pidFile != String.Empty) 229 if (pidFile != String.Empty)
230 CreatePIDFile(pidFile); 230 CreatePIDFile(pidFile);
231 231
232 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty); 232 userStatsURI = startupConfig.GetString("Stats_URI", String.Empty);
233 233
234 m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true); 234 m_securePermissionsLoading = startupConfig.GetBoolean("SecurePermissionsLoading", true);
@@ -254,11 +254,11 @@ namespace OpenSim
254 if (m_simulationDataService == null) 254 if (m_simulationDataService == null)
255 throw new Exception( 255 throw new Exception(
256 string.Format( 256 string.Format(
257 "Could not load an ISimulationDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [SimulationDataStore] config section.", 257 "Could not load an ISimulationDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [SimulationDataStore] config section.",
258 module)); 258 module));
259 259
260 // Load the estate data service 260 // Load the estate data service
261 module = Util.GetConfigVarFromSections<string>(Config, "LocalServiceModule", new string[]{"EstateDataStore", "EstateService"}, String.Empty); 261 module = Util.GetConfigVarFromSections<string>(Config, "LocalServiceModule", new string[]{"EstateDataStore", "EstateService"}, String.Empty);
262 if (String.IsNullOrEmpty(module)) 262 if (String.IsNullOrEmpty(module))
263 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] or [EstateService] section"); 263 throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] or [EstateService] section");
264 264
@@ -268,7 +268,7 @@ namespace OpenSim
268 if (m_estateDataService == null) 268 if (m_estateDataService == null)
269 throw new Exception( 269 throw new Exception(
270 string.Format( 270 string.Format(
271 "Could not load an IEstateDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [EstateDataStore] config section.", 271 "Could not load an IEstateDataService implementation from {0}, as configured in the LocalServiceModule parameter of the [EstateDataStore] config section.",
272 module)); 272 module));
273 } 273 }
274 274
@@ -427,9 +427,9 @@ namespace OpenSim
427 regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName + 427 regionInfo.ServerURI = "http://" + regionInfo.ExternalHostName +
428 ":" + regionInfo.HttpPort.ToString() + "/"; 428 ":" + regionInfo.HttpPort.ToString() + "/";
429 429
430 430
431 regionInfo.osSecret = m_osSecret; 431 regionInfo.osSecret = m_osSecret;
432 432
433 if ((proxyUrl.Length > 0) && (portadd_flag)) 433 if ((proxyUrl.Length > 0) && (portadd_flag))
434 { 434 {
435 // set proxy url to RegionInfo 435 // set proxy url to RegionInfo
@@ -483,17 +483,17 @@ namespace OpenSim
483 483
484 // Prims have to be loaded after module configuration since some modules may be invoked during the load 484 // Prims have to be loaded after module configuration since some modules may be invoked during the load
485 scene.LoadPrimsFromStorage(regionInfo.originRegionID); 485 scene.LoadPrimsFromStorage(regionInfo.originRegionID);
486 486
487 // TODO : Try setting resource for region xstats here on scene 487 // TODO : Try setting resource for region xstats here on scene
488 MainServer.Instance.AddStreamHandler(new RegionStatsHandler(regionInfo)); 488 MainServer.Instance.AddStreamHandler(new RegionStatsHandler(regionInfo));
489 489
490 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID); 490 scene.loadAllLandObjectsFromStorage(regionInfo.originRegionID);
491 scene.EventManager.TriggerParcelPrimCountUpdate(); 491 scene.EventManager.TriggerParcelPrimCountUpdate();
492 492
493 if (scene.SnmpService != null) 493 if (scene.SnmpService != null)
494 { 494 {
495 scene.SnmpService.BootInfo("Grid Registration in progress", scene); 495 scene.SnmpService.BootInfo("Grid Registration in progress", scene);
496 } 496 }
497 497
498 try 498 try
499 { 499 {
@@ -502,7 +502,7 @@ namespace OpenSim
502 catch (Exception e) 502 catch (Exception e)
503 { 503 {
504 m_log.ErrorFormat( 504 m_log.ErrorFormat(
505 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}", 505 "[STARTUP]: Registration of region with grid failed, aborting startup due to {0} {1}",
506 e.Message, e.StackTrace); 506 e.Message, e.StackTrace);
507 507
508 if (scene.SnmpService != null) 508 if (scene.SnmpService != null)
@@ -630,7 +630,7 @@ namespace OpenSim
630 630
631 if (rawEstateOwnerUuid == null) 631 if (rawEstateOwnerUuid == null)
632 rawEstateOwnerUuid = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString()); 632 rawEstateOwnerUuid = MainConsole.Instance.CmdPrompt("User ID", UUID.Random().ToString());
633 633
634 UUID estateOwnerUuid = UUID.Zero; 634 UUID estateOwnerUuid = UUID.Zero;
635 if (!UUID.TryParse(rawEstateOwnerUuid, out estateOwnerUuid)) 635 if (!UUID.TryParse(rawEstateOwnerUuid, out estateOwnerUuid))
636 { 636 {
@@ -693,7 +693,7 @@ namespace OpenSim
693 scene.DeleteAllSceneObjects(); 693 scene.DeleteAllSceneObjects();
694 SceneManager.CloseScene(scene); 694 SceneManager.CloseScene(scene);
695 //ShutdownClientServer(scene.RegionInfo); 695 //ShutdownClientServer(scene.RegionInfo);
696 696
697 if (!cleanup) 697 if (!cleanup)
698 return; 698 return;
699 699
@@ -755,7 +755,7 @@ namespace OpenSim
755 SceneManager.CloseScene(scene); 755 SceneManager.CloseScene(scene);
756 //ShutdownClientServer(scene.RegionInfo); 756 //ShutdownClientServer(scene.RegionInfo);
757 } 757 }
758 758
759 /// <summary> 759 /// <summary>
760 /// Remove a region from the simulator without deleting it permanently. 760 /// Remove a region from the simulator without deleting it permanently.
761 /// </summary> 761 /// </summary>
@@ -767,7 +767,7 @@ namespace OpenSim
767 if (SceneManager.TryGetScene(name, out target)) 767 if (SceneManager.TryGetScene(name, out target))
768 CloseRegion(target); 768 CloseRegion(target);
769 } 769 }
770 770
771 /// <summary> 771 /// <summary>
772 /// Create a scene and its initial base structures. 772 /// Create a scene and its initial base structures.
773 /// </summary> 773 /// </summary>
@@ -803,15 +803,15 @@ namespace OpenSim
803 IEstateDataService estateDataService, AgentCircuitManager circuitManager) 803 IEstateDataService estateDataService, AgentCircuitManager circuitManager)
804 { 804 {
805 return new Scene( 805 return new Scene(
806 regionInfo, circuitManager, 806 regionInfo, circuitManager,
807 simDataService, estateDataService, 807 simDataService, estateDataService,
808 Config, m_version); 808 Config, m_version);
809 } 809 }
810 810
811 protected virtual void HandleRestartRegion(RegionInfo whichRegion) 811 protected virtual void HandleRestartRegion(RegionInfo whichRegion)
812 { 812 {
813 m_log.InfoFormat( 813 m_log.InfoFormat(
814 "[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})", 814 "[OPENSIM]: Got restart signal from SceneManager for region {0} ({1},{2})",
815 whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY); 815 whichRegion.RegionName, whichRegion.RegionLocX, whichRegion.RegionLocY);
816 816
817 //ShutdownClientServer(whichRegion); 817 //ShutdownClientServer(whichRegion);
@@ -846,18 +846,18 @@ namespace OpenSim
846 846
847 /// <summary> 847 /// <summary>
848 /// Handler to supply the current extended status of this sim 848 /// Handler to supply the current extended status of this sim
849 /// Sends the statistical data in a json serialization 849 /// Sends the statistical data in a json serialization
850 /// </summary> 850 /// </summary>
851 public class XSimStatusHandler : BaseStreamHandler 851 public class XSimStatusHandler : BaseStreamHandler
852 { 852 {
853 OpenSimBase m_opensim; 853 OpenSimBase m_opensim;
854 854
855 public XSimStatusHandler(OpenSimBase sim) 855 public XSimStatusHandler(OpenSimBase sim)
856 : base("GET", "/" + Util.SHA1Hash(sim.osSecret), "XSimStatus", "Simulator XStatus") 856 : base("GET", "/" + Util.SHA1Hash(sim.osSecret), "XSimStatus", "Simulator XStatus")
857 { 857 {
858 m_opensim = sim; 858 m_opensim = sim;
859 } 859 }
860 860
861 protected override byte[] ProcessRequest(string path, Stream request, 861 protected override byte[] ProcessRequest(string path, Stream request,
862 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 862 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
863 { 863 {
@@ -872,20 +872,20 @@ namespace OpenSim
872 872
873 /// <summary> 873 /// <summary>
874 /// Handler to supply the current extended status of this sim to a user configured URI 874 /// Handler to supply the current extended status of this sim to a user configured URI
875 /// Sends the statistical data in a json serialization 875 /// Sends the statistical data in a json serialization
876 /// If the request contains a key, "callback" the response will be wrappend in the 876 /// If the request contains a key, "callback" the response will be wrappend in the
877 /// associated value for jsonp used with ajax/javascript 877 /// associated value for jsonp used with ajax/javascript
878 /// </summary> 878 /// </summary>
879 protected class UXSimStatusHandler : BaseStreamHandler 879 protected class UXSimStatusHandler : BaseStreamHandler
880 { 880 {
881 OpenSimBase m_opensim; 881 OpenSimBase m_opensim;
882 882
883 public UXSimStatusHandler(OpenSimBase sim) 883 public UXSimStatusHandler(OpenSimBase sim)
884 : base("GET", "/" + sim.userStatsURI, "UXSimStatus", "Simulator UXStatus") 884 : base("GET", "/" + sim.userStatsURI, "UXSimStatus", "Simulator UXStatus")
885 { 885 {
886 m_opensim = sim; 886 m_opensim = sim;
887 } 887 }
888 888
889 protected override byte[] ProcessRequest(string path, Stream request, 889 protected override byte[] ProcessRequest(string path, Stream request,
890 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) 890 IOSHttpRequest httpRequest, IOSHttpResponse httpResponse)
891 { 891 {
@@ -978,7 +978,7 @@ namespace OpenSim
978 { 978 {
979 regionnum = SceneManager.Scenes.Count; 979 regionnum = SceneManager.Scenes.Count;
980 } 980 }
981 981
982 /// <summary> 982 /// <summary>
983 /// Create an estate with an initial region. 983 /// Create an estate with an initial region.
984 /// </summary> 984 /// </summary>
@@ -1005,19 +1005,19 @@ namespace OpenSim
1005 MainConsole.Instance.OutputFormat("An estate named {0} already exists. Please try again.", newName); 1005 MainConsole.Instance.OutputFormat("An estate named {0} already exists. Please try again.", newName);
1006 return false; 1006 return false;
1007 } 1007 }
1008 1008
1009 regInfo.EstateSettings.EstateName = newName; 1009 regInfo.EstateSettings.EstateName = newName;
1010 1010
1011 // FIXME: Later on, the scene constructor will reload the estate settings no matter what. 1011 // FIXME: Later on, the scene constructor will reload the estate settings no matter what.
1012 // Therefore, we need to do an initial save here otherwise the new estate name will be reset 1012 // Therefore, we need to do an initial save here otherwise the new estate name will be reset
1013 // back to the default. The reloading of estate settings by scene could be eliminated if it 1013 // back to the default. The reloading of estate settings by scene could be eliminated if it
1014 // knows that the passed in settings in RegionInfo are already valid. Also, it might be 1014 // knows that the passed in settings in RegionInfo are already valid. Also, it might be
1015 // possible to eliminate some additional later saves made by callers of this method. 1015 // possible to eliminate some additional later saves made by callers of this method.
1016 EstateDataService.StoreEstateSettings(regInfo.EstateSettings); 1016 EstateDataService.StoreEstateSettings(regInfo.EstateSettings);
1017 1017
1018 return true; 1018 return true;
1019 } 1019 }
1020 1020
1021 /// <summary> 1021 /// <summary>
1022 /// Load the estate information for the provided RegionInfo object. 1022 /// Load the estate information for the provided RegionInfo object.
1023 /// </summary> 1023 /// </summary>
@@ -1031,8 +1031,8 @@ namespace OpenSim
1031 return false; // estate info in the database did not change 1031 return false; // estate info in the database did not change
1032 1032
1033 m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName); 1033 m_log.WarnFormat("[ESTATE] Region {0} is not part of an estate.", regInfo.RegionName);
1034 1034
1035 List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll(); 1035 List<EstateSettings> estates = EstateDataService.LoadEstateSettingsAll();
1036 Dictionary<string, EstateSettings> estatesByName = new Dictionary<string, EstateSettings>(); 1036 Dictionary<string, EstateSettings> estatesByName = new Dictionary<string, EstateSettings>();
1037 1037
1038 foreach (EstateSettings estate in estates) 1038 foreach (EstateSettings estate in estates)
@@ -1130,7 +1130,7 @@ namespace OpenSim
1130 return true; // need to update the database 1130 return true; // need to update the database
1131 } 1131 }
1132 } 1132 }
1133 1133
1134 public class OpenSimConfigSource 1134 public class OpenSimConfigSource
1135 { 1135 {
1136 public IConfigSource Source; 1136 public IConfigSource Source;