aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
diff options
context:
space:
mode:
authorDr Scofield2008-08-22 09:00:32 +0000
committerDr Scofield2008-08-22 09:00:32 +0000
commitcf5ee5eaa1505d3af811a5f317c82f151c5c3a4f (patch)
tree6c14e9464874fc02f8babf23564db64ff51d1266 /OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
parentCleaned up some warnings (diff)
downloadopensim-SC-cf5ee5eaa1505d3af811a5f317c82f151c5c3a4f.zip
opensim-SC-cf5ee5eaa1505d3af811a5f317c82f151c5c3a4f.tar.gz
opensim-SC-cf5ee5eaa1505d3af811a5f317c82f151c5c3a4f.tar.bz2
opensim-SC-cf5ee5eaa1505d3af811a5f317c82f151c5c3a4f.tar.xz
- fixes a bug in RemoteAdminPlugin where CreateRegion would not pay
attention to regionload_regionsdir from OpenSim.ini - fixes a type on RegionLoaderFileSystem
Diffstat (limited to 'OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs39
1 files changed, 27 insertions, 12 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);