From fe63fad394b89314777f2c2713c349b3a3017256 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 3 Sep 2010 22:26:15 +0100
Subject: minor: remove mono compiler warning
---
OpenSim/Services/InventoryService/HGInventoryService.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/OpenSim/Services/InventoryService/HGInventoryService.cs b/OpenSim/Services/InventoryService/HGInventoryService.cs
index 6e6b019..d62c008 100644
--- a/OpenSim/Services/InventoryService/HGInventoryService.cs
+++ b/OpenSim/Services/InventoryService/HGInventoryService.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Services.InventoryService
LogManager.GetLogger(
MethodBase.GetCurrentMethod().DeclaringType);
- protected IXInventoryData m_Database;
+ protected new IXInventoryData m_Database;
public HGInventoryService(IConfigSource config)
: base(config)
--
cgit v1.1
From b8da15c10448993a0bb81e8d1b1a31250515c1eb Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 3 Sep 2010 22:38:40 +0100
Subject: In RemoveAdminPlugin, use a .ini file template in
XmlRpcCreateRegionMethod rather than an older XML one
This is a patch from http://opensimulator.org/mantis/view.php?id=4973. Thanks randomhuman
---
.../RemoteController/RemoteAdminPlugin.cs | 30 ++++++++++++++++++----
OpenSim/Framework/RegionInfo.cs | 15 +++++++----
bin/OpenSim.ini.example | 2 +-
3 files changed, 36 insertions(+), 11 deletions(-)
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index da3d3c2..c713e19 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -470,6 +470,9 @@ namespace OpenSim.ApplicationPlugins.RemoteController
/// - estate_name
/// the name of the estate to join (or to create if it doesn't
/// already exist)
+ /// - region_file
+ /// The name of the file to persist the region specifications to.
+ /// If omitted, the region_file_template setting from OpenSim.ini will be used. (optional)
///
///
/// XmlRpcCreateRegionMethod returns
@@ -583,7 +586,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
bool persist = Convert.ToBoolean((string) requestData["persist"]);
if (persist)
{
- // default place for region XML files is in the
+ // default place for region configuration files is in the
// Regions directory of the config dir (aka /bin)
string regionConfigPath = Path.Combine(Util.configDir(), "Regions");
try
@@ -596,19 +599,36 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
// No INI setting recorded.
}
- string regionXmlPath = Path.Combine(regionConfigPath,
+
+ string regionIniPath;
+
+ if (requestData.Contains("region_file"))
+ {
+ // Make sure that the file to be created is in a subdirectory of the region storage directory.
+ string requestedFilePath = Path.Combine(regionConfigPath, (string) requestData["region_file"]);
+ string requestedDirectory = Path.GetDirectoryName(Path.GetFullPath(requestedFilePath));
+ if (requestedDirectory.StartsWith(Path.GetFullPath(regionConfigPath)))
+ regionIniPath = requestedFilePath;
+ else
+ throw new Exception("Invalid location for region file.");
+ }
+ else
+ {
+ regionIniPath = Path.Combine(regionConfigPath,
String.Format(
m_config.GetString("region_file_template",
- "{0}x{1}-{2}.xml"),
+ "{0}x{1}-{2}.ini"),
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}",
- region.RegionID, regionXmlPath);
- region.SaveRegionToFile("dynamic region", regionXmlPath);
+ region.RegionID, regionIniPath);
+ region.SaveRegionToFile("dynamic region", regionIniPath);
}
else
{
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs
index ea1a594..12c58c3 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -805,7 +805,7 @@ namespace OpenSim.Framework
IConfig config = source.Configs[RegionName];
if (config != null)
- source.Configs.Remove(RegionName);
+ source.Configs.Remove(config);
config = source.AddConfig(RegionName);
@@ -864,10 +864,15 @@ namespace OpenSim.Framework
return;
}
- configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe,
- ignoreIncomingConfiguration, false);
- configMember.performConfigurationRetrieve();
- RegionFile = filename;
+ else if (filename.ToLower().EndsWith(".xml"))
+ {
+ configMember = new ConfigurationMember(filename, description, loadConfigurationOptionsFromMe,
+ ignoreIncomingConfiguration, false);
+ configMember.performConfigurationRetrieve();
+ RegionFile = filename;
+ }
+ else
+ throw new Exception("Invalid file type for region persistence.");
}
public void loadConfigurationOptionsFromMe()
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 71c7e55..08726ea 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -640,7 +640,7 @@
; {2} - region UUID
; {3} - region port
; {4} - region name with " ", ":", "/" mapped to "_"
- region_file_template = "{0}x{1}-{2}.xml"
+ region_file_template = "{0}x{1}-{2}.ini"
; we can limit the number of regions that XmlRpcCreateRegion will
; allow by setting this to a positive, non-0 number: as long as the
--
cgit v1.1