aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/AssetService
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/AssetService')
-rw-r--r--OpenSim/Services/AssetService/AssetService.cs19
-rw-r--r--OpenSim/Services/AssetService/Properties/AssemblyInfo.cs2
-rw-r--r--OpenSim/Services/AssetService/XAssetService.cs11
3 files changed, 27 insertions, 5 deletions
diff --git a/OpenSim/Services/AssetService/AssetService.cs b/OpenSim/Services/AssetService/AssetService.cs
index 90c30c8..c57db48 100644
--- a/OpenSim/Services/AssetService/AssetService.cs
+++ b/OpenSim/Services/AssetService/AssetService.cs
@@ -153,9 +153,24 @@ namespace OpenSim.Services.AssetService
153 return true; 153 return true;
154 } 154 }
155 155
156 public virtual bool[] AssetsExist(string[] ids)
157 {
158 try
159 {
160 UUID[] uuid = Array.ConvertAll(ids, id => UUID.Parse(id));
161 return m_Database.AssetsExist(uuid);
162 }
163 catch (Exception e)
164 {
165 m_log.Error("[ASSET SERVICE]: Exception getting assets ", e);
166 return new bool[ids.Length];
167 }
168 }
169
156 public virtual string Store(AssetBase asset) 170 public virtual string Store(AssetBase asset)
157 { 171 {
158 if (!m_Database.ExistsAsset(asset.FullID)) 172 bool exists = m_Database.AssetsExist(new[] { asset.FullID })[0];
173 if (!exists)
159 { 174 {
160// m_log.DebugFormat( 175// m_log.DebugFormat(
161// "[ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length); 176// "[ASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length);
@@ -189,4 +204,4 @@ namespace OpenSim.Services.AssetService
189 return m_Database.Delete(id); 204 return m_Database.Delete(id);
190 } 205 }
191 } 206 }
192} \ No newline at end of file 207}
diff --git a/OpenSim/Services/AssetService/Properties/AssemblyInfo.cs b/OpenSim/Services/AssetService/Properties/AssemblyInfo.cs
index 72c2ac4..9717319 100644
--- a/OpenSim/Services/AssetService/Properties/AssemblyInfo.cs
+++ b/OpenSim/Services/AssetService/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
29// Build Number 29// Build Number
30// Revision 30// Revision
31// 31//
32[assembly: AssemblyVersion("0.8.0.*")] 32[assembly: AssemblyVersion("0.8.2.*")]
33 33
diff --git a/OpenSim/Services/AssetService/XAssetService.cs b/OpenSim/Services/AssetService/XAssetService.cs
index 6047616..f58b769 100644
--- a/OpenSim/Services/AssetService/XAssetService.cs
+++ b/OpenSim/Services/AssetService/XAssetService.cs
@@ -175,9 +175,16 @@ namespace OpenSim.Services.AssetService
175 return true; 175 return true;
176 } 176 }
177 177
178 public virtual bool[] AssetsExist(string[] ids)
179 {
180 UUID[] uuid = Array.ConvertAll(ids, id => UUID.Parse(id));
181 return m_Database.AssetsExist(uuid);
182 }
183
178 public virtual string Store(AssetBase asset) 184 public virtual string Store(AssetBase asset)
179 { 185 {
180 if (!m_Database.ExistsAsset(asset.FullID)) 186 bool exists = m_Database.AssetsExist(new[] { asset.FullID })[0];
187 if (!exists)
181 { 188 {
182// m_log.DebugFormat( 189// m_log.DebugFormat(
183// "[XASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length); 190// "[XASSET SERVICE]: Storing asset {0} {1}, bytes {2}", asset.Name, asset.FullID, asset.Data.Length);
@@ -217,4 +224,4 @@ namespace OpenSim.Services.AssetService
217 m_ChainedAssetService.Delete(asset.ID); 224 m_ChainedAssetService.Delete(asset.ID);
218 } 225 }
219 } 226 }
220} \ No newline at end of file 227}