From 720a69a49bf02208ea2763a043056aba00a676e5 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 31 May 2017 04:47:59 +0100 Subject: remove the option to store baked textures on assets service, thats suicide use xbakes --- .../Avatar/AvatarFactory/AvatarFactoryModule.cs | 38 +++++++++++----------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'OpenSim/Region/CoreModules/Avatar') diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs index 535d946..14607e9 100644 --- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs @@ -369,7 +369,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory return true; // uploaded baked textures will be in assets local cache - IAssetService cache = m_scene.AssetService; + IAssetCache cache = m_scene.RequestModuleInterface(); IBakedTextureModule m_BakedTextureModule = m_scene.RequestModuleInterface(); int validDirtyBakes = 0; @@ -436,7 +436,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory */ wearableCache[idx].TextureAsset = null; if (cache != null) - wearableCache[idx].TextureAsset = cache.GetCached(face.TextureID.ToString()); + { + AssetBase asb = null; + cache.Get(face.TextureID.ToString(), out asb); + wearableCache[idx].TextureAsset = asb; + } if (wearableCache[idx].TextureAsset != null) { @@ -481,15 +485,15 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory // if we got a full set of baked textures save all in BakedTextureModule if (m_BakedTextureModule != null) { - m_log.Debug("[UpdateBakedCache] start async uploading to bakedModule cache"); + m_log.DebugFormat("[UpdateBakedCache] Uploading to Bakes Server: cache hits: {0} changed entries: {1} rebakes {2}", + hits.ToString(), validDirtyBakes.ToString(), missing.Count); m_BakedTextureModule.Store(sp.UUID, wearableCache); } } - - - // debug - m_log.Debug("[UpdateBakedCache] cache hits: " + hits.ToString() + " changed entries: " + validDirtyBakes.ToString() + " rebakes " + missing.Count); + else + m_log.DebugFormat("[UpdateBakedCache] cache hits: {0} changed entries: {1} rebakes {2}", + hits.ToString(), validDirtyBakes.ToString(), missing.Count); /* for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++) { @@ -513,7 +517,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory lock (m_setAppearanceLock) { - IAssetService cache = m_scene.AssetService; + IAssetCache cache = m_scene.RequestModuleInterface(); IBakedTextureModule bakedModule = m_scene.RequestModuleInterface(); WearableCacheItem[] bakedModuleCache = null; @@ -553,6 +557,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory } } */ + bool wearableCacheValid = false; if (wearableCache == null) { @@ -577,10 +582,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory hits++; wearableCache[idx].TextureAsset.Temporary = true; wearableCache[idx].TextureAsset.Local = true; - cache.Store(wearableCache[idx].TextureAsset); + cache.Cache(wearableCache[idx].TextureAsset); continue; } - if (cache.GetCached((wearableCache[idx].TextureID).ToString()) != null) + + if (cache.Check((wearableCache[idx].TextureID).ToString())) { hits++; continue; @@ -645,7 +651,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory wearableCache[j].TextureAsset = bakedModuleCache[i].TextureAsset; bakedModuleCache[i].TextureAsset.Temporary = true; bakedModuleCache[i].TextureAsset.Local = true; - cache.Store(bakedModuleCache[i].TextureAsset); + cache.Cache(bakedModuleCache[i].TextureAsset); } } gotbacked = true; @@ -706,7 +712,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory return 0; int texturesRebaked = 0; -// IAssetCache cache = m_scene.RequestModuleInterface(); + IAssetCache cache = m_scene.RequestModuleInterface(); for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) { @@ -722,18 +728,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory if (missingTexturesOnly) { - if (m_scene.AssetService.Get(face.TextureID.ToString()) != null) + if (cache != null && cache.Check(face.TextureID.ToString())) { continue; } else { - // On inter-simulator teleports, this occurs if baked textures are not being stored by the - // grid asset service (which means that they are not available to the new region and so have - // to be re-requested from the client). - // - // The only available core OpenSimulator behaviour right now - // is not to store these textures, temporarily or otherwise. m_log.DebugFormat( "[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.", face.TextureID, idx, sp.Name); -- cgit v1.1