From 266d0fbaaeac0dad06da98ceda8d19b8f3d732d6 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 29 Dec 2008 16:56:48 +0000 Subject: * Apply http://opensimulator.org/mantis/view.php?id=2927 with some changes * This allows configuration of the assetset and library control file paths to be other than ./inventory/Libraries.xml and ./assets/AssetSets.xml * This is controlled via the LibrariesXMLFile and AssetSetsXMLFile configuration settings in [StandAlone] in OpenSim.ini (in standalone) and via the user and asset config xml files for grid mode * Thanks to SirKimba for the patch --- .../AssetLoader/Filesystem/AssetLoaderFileSystem.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'OpenSim/Framework/AssetLoader/Filesystem') diff --git a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs index 6fe9fb4..9d0f697 100644 --- a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs +++ b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs @@ -86,12 +86,6 @@ namespace OpenSim.Framework.AssetLoader.Filesystem } } - public void ForEachDefaultXmlAsset(Action action) - { - string assetSetFilename = Path.Combine(Util.assetsDir(), "AssetSets.xml"); - - ForEachDefaultXmlAsset(assetSetFilename, action); - } public void ForEachDefaultXmlAsset(string assetSetFilename, Action action) { @@ -99,16 +93,18 @@ namespace OpenSim.Framework.AssetLoader.Filesystem if (File.Exists(assetSetFilename)) { string assetSetPath = "ERROR"; - + string assetRootPath = ""; try { XmlConfigSource source = new XmlConfigSource(assetSetFilename); + assetRootPath = Path.GetFullPath(source.SavePath); + assetRootPath = Path.GetDirectoryName(assetRootPath); for (int i = 0; i < source.Configs.Count; i++) { assetSetPath = source.Configs[i].GetString("file", String.Empty); - LoadXmlAssetSet(Path.Combine(Util.assetsDir(), assetSetPath), assets); + LoadXmlAssetSet(Path.Combine(assetRootPath, assetSetPath), assets); } } catch (XmlException e) @@ -118,7 +114,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem } else { - m_log.Error("[ASSETS]: Asset set control file assets/AssetSets.xml does not exist! No assets loaded."); + m_log.ErrorFormat("[ASSETS]: Asset set control file {0} does not exist! No assets loaded.", assetSetFilename); } assets.ForEach(action); -- cgit v1.1