diff options
-rw-r--r-- | OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 39 | ||||
-rw-r--r-- | OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | 6 |
2 files changed, 30 insertions, 15 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index ec28350..5d2d23e 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | |||
@@ -49,6 +49,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
49 | private OpenSimBase m_app; | 49 | private OpenSimBase m_app; |
50 | private BaseHttpServer m_httpd; | 50 | private BaseHttpServer m_httpd; |
51 | private IConfig m_config; | 51 | private IConfig m_config; |
52 | private IConfigSource m_configSource; | ||
52 | private string requiredPassword = String.Empty; | 53 | private string requiredPassword = String.Empty; |
53 | 54 | ||
54 | // TODO: required by IPlugin, but likely not at all right | 55 | // TODO: required by IPlugin, but likely not at all right |
@@ -66,12 +67,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
66 | 67 | ||
67 | public void Initialise(OpenSimBase openSim) | 68 | public void Initialise(OpenSimBase openSim) |
68 | { | 69 | { |
70 | m_configSource = openSim.ConfigSource.Source; | ||
69 | try | 71 | try |
70 | { | 72 | { |
71 | if (openSim.ConfigSource.Source.Configs["RemoteAdmin"] != null && | 73 | if (m_configSource.Configs["RemoteAdmin"] != null && |
72 | openSim.ConfigSource.Source.Configs["RemoteAdmin"].GetBoolean("enabled", false)) | 74 | m_configSource.Configs["RemoteAdmin"].GetBoolean("enabled", false)) |
73 | { | 75 | { |
74 | m_config = openSim.ConfigSource.Source.Configs["RemoteAdmin"]; | 76 | m_config = m_configSource.Configs["RemoteAdmin"]; |
75 | m_log.Info("[RADMIN]: Remote Admin Plugin Enabled"); | 77 | m_log.Info("[RADMIN]: Remote Admin Plugin Enabled"); |
76 | requiredPassword = m_config.GetString("access_password", String.Empty); | 78 | requiredPassword = m_config.GetString("access_password", String.Empty); |
77 | 79 | ||
@@ -438,16 +440,29 @@ namespace OpenSim.ApplicationPlugins.RemoteController | |||
438 | bool persist = Convert.ToBoolean((string)requestData["persist"]); | 440 | bool persist = Convert.ToBoolean((string)requestData["persist"]); |
439 | if (persist) | 441 | if (persist) |
440 | { | 442 | { |
441 | string regionConfigPath = Path.Combine(Path.Combine(Util.configDir(), "Regions"), | 443 | // default place for region XML files is in the |
442 | String.Format(m_config.GetString("region_file_template", "{0}x{1}-{2}.xml"), | 444 | // Regions directory of th config dir (aka /bin) |
443 | region.RegionLocX.ToString(), | 445 | string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); |
444 | region.RegionLocY.ToString(), | 446 | try |
445 | regionID.ToString(), | 447 | { |
446 | region.InternalEndPoint.Port.ToString(), | 448 | // OpenSim.ini can specify a different regions dir |
447 | region.RegionName.Replace(" ", "_").Replace(":", "_").Replace("/", "_"))); | 449 | IConfig startupConfig = (IConfig)m_configSource.Configs["Startup"]; |
450 | regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim(); | ||
451 | } | ||
452 | catch (Exception) | ||
453 | { | ||
454 | // No INI setting recorded. | ||
455 | } | ||
456 | string regionXmlPath = Path.Combine(regionConfigPath, | ||
457 | String.Format(m_config.GetString("region_file_template", "{0}x{1}-{2}.xml"), | ||
458 | region.RegionLocX.ToString(), | ||
459 | region.RegionLocY.ToString(), | ||
460 | regionID.ToString(), | ||
461 | region.InternalEndPoint.Port.ToString(), | ||
462 | region.RegionName.Replace(" ", "_").Replace(":", "_").Replace("/", "_"))); | ||
448 | m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}", | 463 | m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}", |
449 | region.RegionID, regionConfigPath); | 464 | region.RegionID, regionXmlPath); |
450 | region.SaveRegionToFile("dynamic region", regionConfigPath); | 465 | region.SaveRegionToFile("dynamic region", regionXmlPath); |
451 | } | 466 | } |
452 | 467 | ||
453 | m_app.CreateRegion(region); | 468 | m_app.CreateRegion(region); |
diff --git a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs index c345fce..4667070 100644 --- a/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs +++ b/OpenSim/Framework/RegionLoader/Filesystem/RegionLoaderFileSystem.cs | |||
@@ -33,11 +33,11 @@ namespace OpenSim.Framework.RegionLoader.Filesystem | |||
33 | { | 33 | { |
34 | public class RegionLoaderFileSystem : IRegionLoader | 34 | public class RegionLoaderFileSystem : IRegionLoader |
35 | { | 35 | { |
36 | private IConfigSource m_configSouce; | 36 | private IConfigSource m_configSource; |
37 | 37 | ||
38 | public void SetIniConfigSource(IConfigSource configSource) | 38 | public void SetIniConfigSource(IConfigSource configSource) |
39 | { | 39 | { |
40 | m_configSouce = configSource; | 40 | m_configSource = configSource; |
41 | } | 41 | } |
42 | 42 | ||
43 | public RegionInfo[] LoadRegions() | 43 | public RegionInfo[] LoadRegions() |
@@ -46,7 +46,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem | |||
46 | 46 | ||
47 | try | 47 | try |
48 | { | 48 | { |
49 | IConfig startupConfig = (IConfig)m_configSouce.Configs["Startup"]; | 49 | IConfig startupConfig = (IConfig)m_configSource.Configs["Startup"]; |
50 | regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim(); | 50 | regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim(); |
51 | } | 51 | } |
52 | catch (Exception) | 52 | catch (Exception) |