aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorUbitUmarov2016-08-02 18:19:34 +0100
committerUbitUmarov2016-08-02 18:19:34 +0100
commitc035871e76707ffd4d232e60e643d4941fe99add (patch)
treec8506b7e1207eb53dd250fa020b1b02bdecdf3f2 /OpenSim/Region/CoreModules
parentMerge branch 'master' into httptests (diff)
parent(mantis 7983) update local cache when storing a baked tex on assets server (diff)
downloadopensim-SC-c035871e76707ffd4d232e60e643d4941fe99add.zip
opensim-SC-c035871e76707ffd4d232e60e643d4941fe99add.tar.gz
opensim-SC-c035871e76707ffd4d232e60e643d4941fe99add.tar.bz2
opensim-SC-c035871e76707ffd4d232e60e643d4941fe99add.tar.xz
Merge branch 'master' into httptests
Diffstat (limited to 'OpenSim/Region/CoreModules')
-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",