* 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
This commit is contained in:
Justin Clarke Casey
2008-12-29 16:56:48 +00:00
parent 817a10d0aa
commit 266d0fbaae
12 changed files with 87 additions and 42 deletions

View File

@@ -86,12 +86,6 @@ namespace OpenSim.Framework.AssetLoader.Filesystem
}
}
public void ForEachDefaultXmlAsset(Action<AssetBase> action)
{
string assetSetFilename = Path.Combine(Util.assetsDir(), "AssetSets.xml");
ForEachDefaultXmlAsset(assetSetFilename, action);
}
public void ForEachDefaultXmlAsset(string assetSetFilename, Action<AssetBase> 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);