aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
diff options
context:
space:
mode:
authorUbitUmarov2016-08-02 17:45:06 +0100
committerUbitUmarov2016-08-02 17:45:06 +0100
commita99df75a3009a839c36102a2625aed3c0fcd17c5 (patch)
treec95496c1f6f1bc9594f090fce1503ea65f5511e5 /OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
parent stop a spamming robust debug message (diff)
downloadopensim-SC_OLD-a99df75a3009a839c36102a2625aed3c0fcd17c5.zip
opensim-SC_OLD-a99df75a3009a839c36102a2625aed3c0fcd17c5.tar.gz
opensim-SC_OLD-a99df75a3009a839c36102a2625aed3c0fcd17c5.tar.bz2
opensim-SC_OLD-a99df75a3009a839c36102a2625aed3c0fcd17c5.tar.xz
(mantis 7983) update local cache when storing a baked tex on assets server
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs20
1 files changed, 11 insertions, 9 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 08b276d..41a3f52 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -288,23 +288,24 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
288 if (bakedTextures.Count == 0) 288 if (bakedTextures.Count == 0)
289 return false; 289 return false;
290 290
291 IImprovedAssetCache cache = sp.Scene.RequestModuleInterface<IImprovedAssetCache>();
292 if(cache == null)
293 return true; // no baked local caching so nothing to do
294
291 foreach (BakeType bakeType in bakedTextures.Keys) 295 foreach (BakeType bakeType in bakedTextures.Keys)
292 { 296 {
293 Primitive.TextureEntryFace bakedTextureFace = bakedTextures[bakeType]; 297 Primitive.TextureEntryFace bakedTextureFace = bakedTextures[bakeType];
294 298
295 if (bakedTextureFace == null) 299 if (bakedTextureFace == null)
296 {
297 // This can happen legitimately, since some baked textures might not exist
298 //m_log.WarnFormat(
299 // "[AV FACTORY]: No texture ID set for {0} for {1} in {2} not found when trying to save permanently",
300 // bakeType, sp.Name, m_scene.RegionInfo.RegionName);
301 continue; 300 continue;
302 }
303 301
304 AssetBase asset = m_scene.AssetService.Get(bakedTextureFace.TextureID.ToString()); 302 AssetBase asset = cache.Get(bakedTextureFace.TextureID.ToString());
305 303
306 if (asset != null) 304 if (asset != null && asset.Local)
307 { 305 {
306 // cache does not update asset contents
307 cache.Expire(bakedTextureFace.TextureID.ToString());
308
308 // Replace an HG ID with the simple asset ID so that we can persist textures for foreign HG avatars 309 // Replace an HG ID with the simple asset ID so that we can persist textures for foreign HG avatars
309 asset.ID = asset.FullID.ToString(); 310 asset.ID = asset.FullID.ToString();
310 311
@@ -312,7 +313,8 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
312 asset.Local = false; 313 asset.Local = false;
313 m_scene.AssetService.Store(asset); 314 m_scene.AssetService.Store(asset);
314 } 315 }
315 else 316
317 if (asset == null)
316 { 318 {
317 m_log.WarnFormat( 319 m_log.WarnFormat(
318 "[AV FACTORY]: Baked texture id {0} not found for bake {1} for avatar {2} in {3} when trying to save permanently", 320 "[AV FACTORY]: Baked texture id {0} not found for bake {1} for avatar {2} in {3} when trying to save permanently",