- fixes a bug in RemoteAdminPlugin where CreateRegion would not pay
attention to regionload_regionsdir from OpenSim.ini - fixes a type on RegionLoaderFileSystem0.6.0-stable
parent
0f6b899ec7
commit
cf5ee5eaa1
|
@ -49,6 +49,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
private OpenSimBase m_app;
|
private OpenSimBase m_app;
|
||||||
private BaseHttpServer m_httpd;
|
private BaseHttpServer m_httpd;
|
||||||
private IConfig m_config;
|
private IConfig m_config;
|
||||||
|
private IConfigSource m_configSource;
|
||||||
private string requiredPassword = String.Empty;
|
private string requiredPassword = String.Empty;
|
||||||
|
|
||||||
// TODO: required by IPlugin, but likely not at all right
|
// TODO: required by IPlugin, but likely not at all right
|
||||||
|
@ -66,12 +67,13 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
|
|
||||||
public void Initialise(OpenSimBase openSim)
|
public void Initialise(OpenSimBase openSim)
|
||||||
{
|
{
|
||||||
|
m_configSource = openSim.ConfigSource.Source;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (openSim.ConfigSource.Source.Configs["RemoteAdmin"] != null &&
|
if (m_configSource.Configs["RemoteAdmin"] != null &&
|
||||||
openSim.ConfigSource.Source.Configs["RemoteAdmin"].GetBoolean("enabled", false))
|
m_configSource.Configs["RemoteAdmin"].GetBoolean("enabled", false))
|
||||||
{
|
{
|
||||||
m_config = openSim.ConfigSource.Source.Configs["RemoteAdmin"];
|
m_config = m_configSource.Configs["RemoteAdmin"];
|
||||||
m_log.Info("[RADMIN]: Remote Admin Plugin Enabled");
|
m_log.Info("[RADMIN]: Remote Admin Plugin Enabled");
|
||||||
requiredPassword = m_config.GetString("access_password", String.Empty);
|
requiredPassword = m_config.GetString("access_password", String.Empty);
|
||||||
|
|
||||||
|
@ -438,16 +440,29 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
bool persist = Convert.ToBoolean((string)requestData["persist"]);
|
bool persist = Convert.ToBoolean((string)requestData["persist"]);
|
||||||
if (persist)
|
if (persist)
|
||||||
{
|
{
|
||||||
string regionConfigPath = Path.Combine(Path.Combine(Util.configDir(), "Regions"),
|
// default place for region XML files is in the
|
||||||
String.Format(m_config.GetString("region_file_template", "{0}x{1}-{2}.xml"),
|
// Regions directory of th config dir (aka /bin)
|
||||||
region.RegionLocX.ToString(),
|
string regionConfigPath = Path.Combine(Util.configDir(), "Regions");
|
||||||
region.RegionLocY.ToString(),
|
try
|
||||||
regionID.ToString(),
|
{
|
||||||
region.InternalEndPoint.Port.ToString(),
|
// OpenSim.ini can specify a different regions dir
|
||||||
region.RegionName.Replace(" ", "_").Replace(":", "_").Replace("/", "_")));
|
IConfig startupConfig = (IConfig)m_configSource.Configs["Startup"];
|
||||||
|
regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim();
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
// No INI setting recorded.
|
||||||
|
}
|
||||||
|
string regionXmlPath = Path.Combine(regionConfigPath,
|
||||||
|
String.Format(m_config.GetString("region_file_template", "{0}x{1}-{2}.xml"),
|
||||||
|
region.RegionLocX.ToString(),
|
||||||
|
region.RegionLocY.ToString(),
|
||||||
|
regionID.ToString(),
|
||||||
|
region.InternalEndPoint.Port.ToString(),
|
||||||
|
region.RegionName.Replace(" ", "_").Replace(":", "_").Replace("/", "_")));
|
||||||
m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}",
|
m_log.DebugFormat("[RADMIN] CreateRegion: persisting region {0} to {1}",
|
||||||
region.RegionID, regionConfigPath);
|
region.RegionID, regionXmlPath);
|
||||||
region.SaveRegionToFile("dynamic region", regionConfigPath);
|
region.SaveRegionToFile("dynamic region", regionXmlPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_app.CreateRegion(region);
|
m_app.CreateRegion(region);
|
||||||
|
|
|
@ -33,11 +33,11 @@ namespace OpenSim.Framework.RegionLoader.Filesystem
|
||||||
{
|
{
|
||||||
public class RegionLoaderFileSystem : IRegionLoader
|
public class RegionLoaderFileSystem : IRegionLoader
|
||||||
{
|
{
|
||||||
private IConfigSource m_configSouce;
|
private IConfigSource m_configSource;
|
||||||
|
|
||||||
public void SetIniConfigSource(IConfigSource configSource)
|
public void SetIniConfigSource(IConfigSource configSource)
|
||||||
{
|
{
|
||||||
m_configSouce = configSource;
|
m_configSource = configSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
public RegionInfo[] LoadRegions()
|
public RegionInfo[] LoadRegions()
|
||||||
|
@ -46,7 +46,7 @@ namespace OpenSim.Framework.RegionLoader.Filesystem
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
IConfig startupConfig = (IConfig)m_configSouce.Configs["Startup"];
|
IConfig startupConfig = (IConfig)m_configSource.Configs["Startup"];
|
||||||
regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim();
|
regionConfigPath = startupConfig.GetString("regionload_regionsdir", regionConfigPath).Trim();
|
||||||
}
|
}
|
||||||
catch (Exception)
|
catch (Exception)
|
||||||
|
|
Loading…
Reference in New Issue