diff options
Diffstat (limited to 'OpenSim/Region/Application/OpenSimBase.cs')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 65 |
1 files changed, 23 insertions, 42 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index 618ce0a..b40aa4b 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -100,13 +100,7 @@ namespace OpenSim | |||
100 | /// <value> | 100 | /// <value> |
101 | /// The config information passed into the OpenSimulator region server. | 101 | /// The config information passed into the OpenSimulator region server. |
102 | /// </value> | 102 | /// </value> |
103 | public OpenSimConfigSource ConfigSource | 103 | public OpenSimConfigSource ConfigSource { get; private set; } |
104 | { | ||
105 | get { return m_config; } | ||
106 | set { m_config = value; } | ||
107 | } | ||
108 | |||
109 | protected OpenSimConfigSource m_config; | ||
110 | 104 | ||
111 | public List<IClientNetworkServer> ClientServers | 105 | public List<IClientNetworkServer> ClientServers |
112 | { | 106 | { |
@@ -146,13 +140,14 @@ namespace OpenSim | |||
146 | protected virtual void LoadConfigSettings(IConfigSource configSource) | 140 | protected virtual void LoadConfigSettings(IConfigSource configSource) |
147 | { | 141 | { |
148 | m_configLoader = new ConfigurationLoader(); | 142 | m_configLoader = new ConfigurationLoader(); |
149 | m_config = m_configLoader.LoadConfigSettings(configSource, envConfigSource, out m_configSettings, out m_networkServersInfo); | 143 | ConfigSource = m_configLoader.LoadConfigSettings(configSource, envConfigSource, out m_configSettings, out m_networkServersInfo); |
144 | Config = ConfigSource.Source; | ||
150 | ReadExtraConfigSettings(); | 145 | ReadExtraConfigSettings(); |
151 | } | 146 | } |
152 | 147 | ||
153 | protected virtual void ReadExtraConfigSettings() | 148 | protected virtual void ReadExtraConfigSettings() |
154 | { | 149 | { |
155 | IConfig networkConfig = m_config.Source.Configs["Network"]; | 150 | IConfig networkConfig = Config.Configs["Network"]; |
156 | if (networkConfig != null) | 151 | if (networkConfig != null) |
157 | { | 152 | { |
158 | proxyUrl = networkConfig.GetString("proxy_url", ""); | 153 | proxyUrl = networkConfig.GetString("proxy_url", ""); |
@@ -185,7 +180,7 @@ namespace OpenSim | |||
185 | /// </summary> | 180 | /// </summary> |
186 | protected override void StartupSpecific() | 181 | protected override void StartupSpecific() |
187 | { | 182 | { |
188 | IConfig startupConfig = m_config.Source.Configs["Startup"]; | 183 | IConfig startupConfig = Config.Configs["Startup"]; |
189 | if (startupConfig != null) | 184 | if (startupConfig != null) |
190 | { | 185 | { |
191 | string pidFile = startupConfig.GetString("PIDFile", String.Empty); | 186 | string pidFile = startupConfig.GetString("PIDFile", String.Empty); |
@@ -196,7 +191,7 @@ namespace OpenSim | |||
196 | } | 191 | } |
197 | 192 | ||
198 | // Load the simulation data service | 193 | // Load the simulation data service |
199 | IConfig simDataConfig = m_config.Source.Configs["SimulationDataStore"]; | 194 | IConfig simDataConfig = Config.Configs["SimulationDataStore"]; |
200 | if (simDataConfig == null) | 195 | if (simDataConfig == null) |
201 | throw new Exception("Configuration file is missing the [SimulationDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?"); | 196 | throw new Exception("Configuration file is missing the [SimulationDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?"); |
202 | 197 | ||
@@ -204,7 +199,7 @@ namespace OpenSim | |||
204 | if (String.IsNullOrEmpty(module)) | 199 | if (String.IsNullOrEmpty(module)) |
205 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section."); | 200 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [SimulationDataStore] section."); |
206 | 201 | ||
207 | m_simulationDataService = ServerUtils.LoadPlugin<ISimulationDataService>(module, new object[] { m_config.Source }); | 202 | m_simulationDataService = ServerUtils.LoadPlugin<ISimulationDataService>(module, new object[] { Config }); |
208 | if (m_simulationDataService == null) | 203 | if (m_simulationDataService == null) |
209 | throw new Exception( | 204 | throw new Exception( |
210 | string.Format( | 205 | string.Format( |
@@ -212,7 +207,7 @@ namespace OpenSim | |||
212 | module)); | 207 | module)); |
213 | 208 | ||
214 | // Load the estate data service | 209 | // Load the estate data service |
215 | IConfig estateDataConfig = m_config.Source.Configs["EstateDataStore"]; | 210 | IConfig estateDataConfig = Config.Configs["EstateDataStore"]; |
216 | if (estateDataConfig == null) | 211 | if (estateDataConfig == null) |
217 | throw new Exception("Configuration file is missing the [EstateDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?"); | 212 | throw new Exception("Configuration file is missing the [EstateDataStore] section. Have you copied OpenSim.ini.example to OpenSim.ini to reference config-include/ files?"); |
218 | 213 | ||
@@ -220,7 +215,7 @@ namespace OpenSim | |||
220 | if (String.IsNullOrEmpty(module)) | 215 | if (String.IsNullOrEmpty(module)) |
221 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); | 216 | throw new Exception("Configuration file is missing the LocalServiceModule parameter in the [EstateDataStore] section"); |
222 | 217 | ||
223 | m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { m_config.Source }); | 218 | m_estateDataService = ServerUtils.LoadPlugin<IEstateDataService>(module, new object[] { Config }); |
224 | if (m_estateDataService == null) | 219 | if (m_estateDataService == null) |
225 | throw new Exception( | 220 | throw new Exception( |
226 | string.Format( | 221 | string.Format( |
@@ -369,7 +364,7 @@ namespace OpenSim | |||
369 | } | 364 | } |
370 | 365 | ||
371 | IClientNetworkServer clientServer; | 366 | IClientNetworkServer clientServer; |
372 | Scene scene = SetupScene(regionInfo, proxyOffset, m_config.Source, out clientServer); | 367 | Scene scene = SetupScene(regionInfo, proxyOffset, Config, out clientServer); |
373 | 368 | ||
374 | m_log.Info("[MODULES]: Loading Region's modules (old style)"); | 369 | m_log.Info("[MODULES]: Loading Region's modules (old style)"); |
375 | 370 | ||
@@ -451,10 +446,10 @@ namespace OpenSim | |||
451 | string estateOwnerPassword = null; | 446 | string estateOwnerPassword = null; |
452 | string rawEstateOwnerUuid = null; | 447 | string rawEstateOwnerUuid = null; |
453 | 448 | ||
454 | if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null) | 449 | if (Config.Configs[ESTATE_SECTION_NAME] != null) |
455 | { | 450 | { |
456 | string defaultEstateOwnerName | 451 | string defaultEstateOwnerName |
457 | = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerName", "").Trim(); | 452 | = Config.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerName", "").Trim(); |
458 | string[] ownerNames = defaultEstateOwnerName.Split(' '); | 453 | string[] ownerNames = defaultEstateOwnerName.Split(' '); |
459 | 454 | ||
460 | if (ownerNames.Length >= 2) | 455 | if (ownerNames.Length >= 2) |
@@ -464,9 +459,9 @@ namespace OpenSim | |||
464 | } | 459 | } |
465 | 460 | ||
466 | // Info to be used only on Standalone Mode | 461 | // Info to be used only on Standalone Mode |
467 | rawEstateOwnerUuid = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerUUID", null); | 462 | rawEstateOwnerUuid = Config.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerUUID", null); |
468 | estateOwnerEMail = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerEMail", null); | 463 | estateOwnerEMail = Config.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerEMail", null); |
469 | estateOwnerPassword = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerPassword", null); | 464 | estateOwnerPassword = Config.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateOwnerPassword", null); |
470 | } | 465 | } |
471 | 466 | ||
472 | MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName); | 467 | MainConsole.Instance.OutputFormat("Estate {0} has no owner set.", regionInfo.EstateSettings.EstateName); |
@@ -713,7 +708,7 @@ namespace OpenSim | |||
713 | return new Scene( | 708 | return new Scene( |
714 | regionInfo, circuitManager, sceneGridService, | 709 | regionInfo, circuitManager, sceneGridService, |
715 | simDataService, estateDataService, false, | 710 | simDataService, estateDataService, false, |
716 | m_config.Source, m_version); | 711 | Config, m_version); |
717 | } | 712 | } |
718 | 713 | ||
719 | protected void ShutdownClientServer(RegionInfo whichRegion) | 714 | protected void ShutdownClientServer(RegionInfo whichRegion) |
@@ -754,7 +749,7 @@ namespace OpenSim | |||
754 | protected override PhysicsScene GetPhysicsScene(string osSceneIdentifier) | 749 | protected override PhysicsScene GetPhysicsScene(string osSceneIdentifier) |
755 | { | 750 | { |
756 | return GetPhysicsScene( | 751 | return GetPhysicsScene( |
757 | m_configSettings.PhysicsEngine, m_configSettings.MeshEngineName, m_config.Source, osSceneIdentifier); | 752 | m_configSettings.PhysicsEngine, m_configSettings.MeshEngineName, Config, osSceneIdentifier); |
758 | } | 753 | } |
759 | 754 | ||
760 | /// <summary> | 755 | /// <summary> |
@@ -991,9 +986,9 @@ namespace OpenSim | |||
991 | 986 | ||
992 | string defaultEstateName = null; | 987 | string defaultEstateName = null; |
993 | 988 | ||
994 | if (m_config.Source.Configs[ESTATE_SECTION_NAME] != null) | 989 | if (Config.Configs[ESTATE_SECTION_NAME] != null) |
995 | { | 990 | { |
996 | defaultEstateName = m_config.Source.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateName", null); | 991 | defaultEstateName = Config.Configs[ESTATE_SECTION_NAME].GetString("DefaultEstateName", null); |
997 | 992 | ||
998 | if (defaultEstateName != null) | 993 | if (defaultEstateName != null) |
999 | { | 994 | { |
@@ -1076,28 +1071,14 @@ namespace OpenSim | |||
1076 | MainConsole.Instance.Output("Joining the estate failed. Please try again."); | 1071 | MainConsole.Instance.Output("Joining the estate failed. Please try again."); |
1077 | } | 1072 | } |
1078 | } | 1073 | } |
1079 | } | 1074 | } |
1080 | 1075 | ||
1081 | return true; // need to update the database | 1076 | return true; // need to update the database |
1082 | } | 1077 | } |
1083 | } | 1078 | } |
1084 | 1079 | ||
1085 | public class OpenSimConfigSource | 1080 | public class OpenSimConfigSource |
1086 | { | 1081 | { |
1087 | public IConfigSource Source; | 1082 | public IConfigSource Source; |
1088 | |||
1089 | public void Save(string path) | ||
1090 | { | ||
1091 | if (Source is IniConfigSource) | ||
1092 | { | ||
1093 | IniConfigSource iniCon = (IniConfigSource) Source; | ||
1094 | iniCon.Save(path); | ||
1095 | } | ||
1096 | else if (Source is XmlConfigSource) | ||
1097 | { | ||
1098 | XmlConfigSource xmlCon = (XmlConfigSource) Source; | ||
1099 | xmlCon.Save(path); | ||
1100 | } | ||
1101 | } | ||
1102 | } | 1083 | } |
1103 | } | 1084 | } \ No newline at end of file |