diff options
author | Justin Clarke Casey | 2008-12-29 16:56:48 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-12-29 16:56:48 +0000 |
commit | 266d0fbaaeac0dad06da98ceda8d19b8f3d732d6 (patch) | |
tree | 45f2ad93db485b5144c3fc86662891432c3a877a /OpenSim/Framework/AssetLoader | |
parent | Revamp the return logic to close a privilege escalation loophole. (diff) | |
download | opensim-SC-266d0fbaaeac0dad06da98ceda8d19b8f3d732d6.zip opensim-SC-266d0fbaaeac0dad06da98ceda8d19b8f3d732d6.tar.gz opensim-SC-266d0fbaaeac0dad06da98ceda8d19b8f3d732d6.tar.bz2 opensim-SC-266d0fbaaeac0dad06da98ceda8d19b8f3d732d6.tar.xz |
* 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
Diffstat (limited to 'OpenSim/Framework/AssetLoader')
-rw-r--r-- | OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs | 14 |
1 files changed, 5 insertions, 9 deletions
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 | |||
86 | } | 86 | } |
87 | } | 87 | } |
88 | 88 | ||
89 | public void ForEachDefaultXmlAsset(Action<AssetBase> action) | ||
90 | { | ||
91 | string assetSetFilename = Path.Combine(Util.assetsDir(), "AssetSets.xml"); | ||
92 | |||
93 | ForEachDefaultXmlAsset(assetSetFilename, action); | ||
94 | } | ||
95 | 89 | ||
96 | public void ForEachDefaultXmlAsset(string assetSetFilename, Action<AssetBase> action) | 90 | public void ForEachDefaultXmlAsset(string assetSetFilename, Action<AssetBase> action) |
97 | { | 91 | { |
@@ -99,16 +93,18 @@ namespace OpenSim.Framework.AssetLoader.Filesystem | |||
99 | if (File.Exists(assetSetFilename)) | 93 | if (File.Exists(assetSetFilename)) |
100 | { | 94 | { |
101 | string assetSetPath = "ERROR"; | 95 | string assetSetPath = "ERROR"; |
102 | 96 | string assetRootPath = ""; | |
103 | try | 97 | try |
104 | { | 98 | { |
105 | XmlConfigSource source = new XmlConfigSource(assetSetFilename); | 99 | XmlConfigSource source = new XmlConfigSource(assetSetFilename); |
100 | assetRootPath = Path.GetFullPath(source.SavePath); | ||
101 | assetRootPath = Path.GetDirectoryName(assetRootPath); | ||
106 | 102 | ||
107 | for (int i = 0; i < source.Configs.Count; i++) | 103 | for (int i = 0; i < source.Configs.Count; i++) |
108 | { | 104 | { |
109 | assetSetPath = source.Configs[i].GetString("file", String.Empty); | 105 | assetSetPath = source.Configs[i].GetString("file", String.Empty); |
110 | 106 | ||
111 | LoadXmlAssetSet(Path.Combine(Util.assetsDir(), assetSetPath), assets); | 107 | LoadXmlAssetSet(Path.Combine(assetRootPath, assetSetPath), assets); |
112 | } | 108 | } |
113 | } | 109 | } |
114 | catch (XmlException e) | 110 | catch (XmlException e) |
@@ -118,7 +114,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem | |||
118 | } | 114 | } |
119 | else | 115 | else |
120 | { | 116 | { |
121 | m_log.Error("[ASSETS]: Asset set control file assets/AssetSets.xml does not exist! No assets loaded."); | 117 | m_log.ErrorFormat("[ASSETS]: Asset set control file {0} does not exist! No assets loaded.", assetSetFilename); |
122 | } | 118 | } |
123 | 119 | ||
124 | assets.ForEach(action); | 120 | assets.ForEach(action); |