diff options
author | Melanie Thielker | 2009-01-02 17:41:12 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-01-02 17:41:12 +0000 |
commit | 0138fdc5fddbe30924484686716465984e8f59c2 (patch) | |
tree | 3d734b2f626db149b14d945b424ece36e654673a /OpenSim/Framework | |
parent | Use only one (static) (de-)serializer for (de-)serializing SOPs. (diff) | |
download | opensim-SC_OLD-0138fdc5fddbe30924484686716465984e8f59c2.zip opensim-SC_OLD-0138fdc5fddbe30924484686716465984e8f59c2.tar.gz opensim-SC_OLD-0138fdc5fddbe30924484686716465984e8f59c2.tar.bz2 opensim-SC_OLD-0138fdc5fddbe30924484686716465984e8f59c2.tar.xz |
Allow some values that are set in OpenSim.ini to be set from region config
XML as well.
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 67 | ||||
-rw-r--r-- | OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 4 | ||||
-rw-r--r-- | OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs | 10 |
3 files changed, 72 insertions, 9 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index dc00059..057f021 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -199,6 +199,7 @@ namespace OpenSim.Framework | |||
199 | public bool isSandbox = false; | 199 | public bool isSandbox = false; |
200 | private EstateSettings m_estateSettings; | 200 | private EstateSettings m_estateSettings; |
201 | private RegionSettings m_regionSettings; | 201 | private RegionSettings m_regionSettings; |
202 | private IConfigSource m_configSource = null; | ||
202 | 203 | ||
203 | public UUID MasterAvatarAssignedUUID = UUID.Zero; | 204 | public UUID MasterAvatarAssignedUUID = UUID.Zero; |
204 | public string MasterAvatarFirstName = String.Empty; | 205 | public string MasterAvatarFirstName = String.Empty; |
@@ -212,6 +213,11 @@ namespace OpenSim.Framework | |||
212 | public UUID lastMapUUID = UUID.Zero; | 213 | public UUID lastMapUUID = UUID.Zero; |
213 | public string lastMapRefresh = "0"; | 214 | public string lastMapRefresh = "0"; |
214 | 215 | ||
216 | private int m_nonphysPrimMax = 0; | ||
217 | private int m_physPrimMax = 0; | ||
218 | private bool m_clampPrimSize = false; | ||
219 | private int m_objectCapacity = 0; | ||
220 | |||
215 | // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. | 221 | // Apparently, we're applying the same estatesettings regardless of whether it's local or remote. |
216 | 222 | ||
217 | // MT: Yes. Estates can't span trust boundaries. Therefore, it can be | 223 | // MT: Yes. Estates can't span trust boundaries. Therefore, it can be |
@@ -219,16 +225,18 @@ namespace OpenSim.Framework | |||
219 | // access the same database server. Since estate settings are lodaed | 225 | // access the same database server. Since estate settings are lodaed |
220 | // from there, that should be sufficient for full remote administration | 226 | // from there, that should be sufficient for full remote administration |
221 | 227 | ||
222 | public RegionInfo(string description, string filename, bool skipConsoleConfig) | 228 | public RegionInfo(string description, string filename, bool skipConsoleConfig, IConfigSource configSource) |
223 | { | 229 | { |
230 | m_configSource = configSource; | ||
224 | configMember = | 231 | configMember = |
225 | new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig); | 232 | new ConfigurationMember(filename, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig); |
226 | configMember.performConfigurationRetrieve(); | 233 | configMember.performConfigurationRetrieve(); |
227 | RegionFile = filename; | 234 | RegionFile = filename; |
228 | } | 235 | } |
229 | 236 | ||
230 | public RegionInfo(string description, XmlNode xmlNode, bool skipConsoleConfig) | 237 | public RegionInfo(string description, XmlNode xmlNode, bool skipConsoleConfig, IConfigSource configSource) |
231 | { | 238 | { |
239 | m_configSource = configSource; | ||
232 | configMember = | 240 | configMember = |
233 | new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig); | 241 | new ConfigurationMember(xmlNode, description, loadConfigurationOptions, handleIncomingConfiguration, !skipConsoleConfig); |
234 | configMember.performConfigurationRetrieve(); | 242 | configMember.performConfigurationRetrieve(); |
@@ -302,6 +310,26 @@ namespace OpenSim.Framework | |||
302 | set { m_regionSettings = value; } | 310 | set { m_regionSettings = value; } |
303 | } | 311 | } |
304 | 312 | ||
313 | public int NonphysPrimMax | ||
314 | { | ||
315 | get { return m_nonphysPrimMax; } | ||
316 | } | ||
317 | |||
318 | public int PhysPrimMax | ||
319 | { | ||
320 | get { return m_physPrimMax; } | ||
321 | } | ||
322 | |||
323 | public bool ClampPrimSize | ||
324 | { | ||
325 | get { return m_clampPrimSize; } | ||
326 | } | ||
327 | |||
328 | public int ObjectCapacity | ||
329 | { | ||
330 | get { return m_objectCapacity; } | ||
331 | } | ||
332 | |||
305 | public void SetEndPoint(string ipaddr, int port) | 333 | public void SetEndPoint(string ipaddr, int port) |
306 | { | 334 | { |
307 | IPAddress tmpIP = IPAddress.Parse(ipaddr); | 335 | IPAddress tmpIP = IPAddress.Parse(ipaddr); |
@@ -414,6 +442,17 @@ namespace OpenSim.Framework | |||
414 | configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | 442 | configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, |
415 | "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); | 443 | "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); |
416 | 444 | ||
445 | configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, | ||
446 | "Maximum size for nonphysical prims", m_nonphysPrimMax.ToString(), true); | ||
447 | |||
448 | configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, | ||
449 | "Maximum size for physical prims", m_physPrimMax.ToString(), true); | ||
450 | |||
451 | configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, | ||
452 | "Clamp prims to max size", m_clampPrimSize.ToString(), true); | ||
453 | |||
454 | configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, | ||
455 | "Max objects this sim will hold", m_objectCapacity.ToString(), true); | ||
417 | } | 456 | } |
418 | 457 | ||
419 | public void loadConfigurationOptions() | 458 | public void loadConfigurationOptions() |
@@ -462,6 +501,18 @@ namespace OpenSim.Framework | |||
462 | 501 | ||
463 | configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | 502 | configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, |
464 | "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); | 503 | "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); |
504 | |||
505 | configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, | ||
506 | "Maximum size for nonphysical prims", "0", true); | ||
507 | |||
508 | configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, | ||
509 | "Maximum size for physical prims", "0", true); | ||
510 | |||
511 | configMember.addConfigurationOption("clamp_prim_size", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, | ||
512 | "Clamp prims to max size", "false", true); | ||
513 | |||
514 | configMember.addConfigurationOption("object_capacity", ConfigurationOption.ConfigurationTypes.TYPE_INT32, | ||
515 | "Max objects this sim will hold", "0", true); | ||
465 | } | 516 | } |
466 | 517 | ||
467 | public bool shouldMasterAvatarDetailsBeAsked(string configuration_key) | 518 | public bool shouldMasterAvatarDetailsBeAsked(string configuration_key) |
@@ -527,6 +578,18 @@ namespace OpenSim.Framework | |||
527 | case "lastmap_refresh": | 578 | case "lastmap_refresh": |
528 | lastMapRefresh = (string)configuration_result; | 579 | lastMapRefresh = (string)configuration_result; |
529 | break; | 580 | break; |
581 | case "nonphysical_prim_max": | ||
582 | m_nonphysPrimMax = (int)configuration_result; | ||
583 | break; | ||
584 | case "physical_prim_max": | ||
585 | m_physPrimMax = (int)configuration_result; | ||
586 | break; | ||
587 | case "clamp_prim_size": | ||
588 | m_clampPrimSize = (bool)configuration_result; | ||
589 | break; | ||
590 | case "object_capacity": | ||
591 | m_objectCapacity = (int)configuration_result; | ||
592 | break; | ||
530 | } | 593 | } |
531 | 594 | ||
532 | return true; | 595 | return true; |
diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index a371851..05ccc4d 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | |||
@@ -63,14 +63,14 @@ namespace OpenSim.Framework.RegionLoader.Filesystem | |||
63 | 63 | ||
64 | if (configFiles.Length == 0) | 64 | if (configFiles.Length == 0) |
65 | { | 65 | { |
66 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"), false); | 66 | new RegionInfo("DEFAULT REGION CONFIG", Path.Combine(regionConfigPath, "default.xml"), false, m_configSource); |
67 | configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); | 67 | configFiles = Directory.GetFiles(regionConfigPath, "*.xml"); |
68 | } | 68 | } |
69 | 69 | ||
70 | RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; | 70 | RegionInfo[] regionInfos = new RegionInfo[configFiles.Length]; |
71 | for (int i = 0; i < configFiles.Length; i++) | 71 | for (int i = 0; i < configFiles.Length; i++) |
72 | { | 72 | { |
73 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i], false); | 73 | RegionInfo regionInfo = new RegionInfo("REGION CONFIG #" + (i + 1), configFiles[i], false, m_configSource); |
74 | regionInfos[i] = regionInfo; | 74 | regionInfos[i] = regionInfo; |
75 | } | 75 | } |
76 | 76 | ||
diff --git a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs index 029d396..60242e6 100644 --- a/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs +++ b/OpenSim/Framework/RegionLoader/Web/RegionLoaderWebServer.cs | |||
@@ -39,23 +39,23 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
39 | { | 39 | { |
40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 40 | private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
41 | 41 | ||
42 | private IConfigSource m_configSouce; | 42 | private IConfigSource m_configSource; |
43 | 43 | ||
44 | public void SetIniConfigSource(IConfigSource configSource) | 44 | public void SetIniConfigSource(IConfigSource configSource) |
45 | { | 45 | { |
46 | m_configSouce = configSource; | 46 | m_configSource = configSource; |
47 | } | 47 | } |
48 | 48 | ||
49 | public RegionInfo[] LoadRegions() | 49 | public RegionInfo[] LoadRegions() |
50 | { | 50 | { |
51 | if (m_configSouce == null) | 51 | if (m_configSource == null) |
52 | { | 52 | { |
53 | m_log.Error("[WEBLOADER]: Unable to load configuration source!"); | 53 | m_log.Error("[WEBLOADER]: Unable to load configuration source!"); |
54 | return null; | 54 | return null; |
55 | } | 55 | } |
56 | else | 56 | else |
57 | { | 57 | { |
58 | IConfig startupConfig = (IConfig) m_configSouce.Configs["Startup"]; | 58 | IConfig startupConfig = (IConfig) m_configSource.Configs["Startup"]; |
59 | string url = startupConfig.GetString("regionload_webserver_url", String.Empty).Trim(); | 59 | string url = startupConfig.GetString("regionload_webserver_url", String.Empty).Trim(); |
60 | if (url == String.Empty) | 60 | if (url == String.Empty) |
61 | { | 61 | { |
@@ -89,7 +89,7 @@ namespace OpenSim.Framework.RegionLoader.Web | |||
89 | { | 89 | { |
90 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); | 90 | m_log.Debug(xmlDoc.FirstChild.ChildNodes[i].OuterXml); |
91 | regionInfos[i] = | 91 | regionInfos[i] = |
92 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false); | 92 | new RegionInfo("REGION CONFIG #" + (i + 1), xmlDoc.FirstChild.ChildNodes[i],false,m_configSource); |
93 | } | 93 | } |
94 | 94 | ||
95 | return regionInfos; | 95 | return regionInfos; |