minor clean, dont check for cache if we aren't using it..
parent
1408c9eee7
commit
dfa9ba0937
|
@ -12016,73 +12016,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
// TODO: don't create new blocks if recycling an old packet
|
||||
cachedresp.AgentData.AgentID = AgentId;
|
||||
cachedresp.AgentData.SessionID = m_sessionId;
|
||||
// cachedresp.AgentData.SerialNum = m_cachedTextureSerial;
|
||||
// m_cachedTextureSerial++;
|
||||
cachedresp.AgentData.SerialNum = cachedtex.AgentData.SerialNum;
|
||||
cachedresp.WearableData =
|
||||
new AgentCachedTextureResponsePacket.WearableDataBlock[cachedtex.WearableData.Length];
|
||||
|
||||
//IAvatarFactoryModule fac = m_scene.RequestModuleInterface<IAvatarFactoryModule>();
|
||||
// var item = fac.GetBakedTextureFaces(AgentId);
|
||||
//WearableCacheItem[] items = fac.GetCachedItems(AgentId);
|
||||
|
||||
IAssetService cache = m_scene.AssetService;
|
||||
//bakedTextureModule = null;
|
||||
int maxWearablesLoop = cachedtex.WearableData.Length;
|
||||
if (maxWearablesLoop > AvatarWearable.MAX_WEARABLES)
|
||||
maxWearablesLoop = AvatarWearable.MAX_WEARABLES;
|
||||
|
||||
int cacheHits = 0;
|
||||
|
||||
if (cache != null)
|
||||
{
|
||||
// We need to make sure the asset stored in the bake is available on this server also by it's assetid before we map it to a Cacheid
|
||||
|
||||
WearableCacheItem[] cacheItems = null;
|
||||
|
||||
ScenePresence p = m_scene.GetScenePresence(AgentId);
|
||||
|
||||
if (p!= null && p.Appearance != null)
|
||||
if (p != null && p.Appearance != null)
|
||||
{
|
||||
/* we should only check bakedTextureModule at login or when appearance changes
|
||||
if (p.Appearance.WearableCacheItems == null) // currently with a caching only bakemodule Appearance.Wearables.dirty as no use
|
||||
{
|
||||
IBakedTextureModule bakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>();
|
||||
if (bakedTextureModule != null)
|
||||
{
|
||||
m_log.Debug("[ HandleAgentTextureCached] bakedTextureModule");
|
||||
try
|
||||
{
|
||||
cacheItems = bakedTextureModule.Get(AgentId);
|
||||
p.Appearance.WearableCacheItems = cacheItems;
|
||||
p.Appearance.WearableCacheItemsDirty = false;
|
||||
|
||||
if (cacheItems != null)
|
||||
{
|
||||
foreach (WearableCacheItem item in cacheItems)
|
||||
{
|
||||
if (item.TextureAsset != null)
|
||||
{
|
||||
item.TextureAsset.Temporary = true;
|
||||
item.TextureAsset.Local = true;
|
||||
cache.Store(item.TextureAsset);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
catch (Exception)
|
||||
{
|
||||
cacheItems = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
else if (p.Appearance.WearableCacheItems != null)
|
||||
{
|
||||
cacheItems = p.Appearance.WearableCacheItems;
|
||||
}
|
||||
*/
|
||||
cacheItems = p.Appearance.WearableCacheItems;
|
||||
}
|
||||
|
||||
|
@ -12117,17 +12068,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP
|
|||
cachedresp.WearableData[i].HostName = new byte[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
else // no cache
|
||||
{
|
||||
for (int i = 0; i < maxWearablesLoop; i++)
|
||||
{
|
||||
cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
|
||||
cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex;
|
||||
cachedresp.WearableData[i].TextureID = UUID.Zero;
|
||||
cachedresp.WearableData[i].HostName = new byte[0];
|
||||
}
|
||||
}
|
||||
|
||||
m_log.DebugFormat("texture cached: hits {0}", cacheHits);
|
||||
|
||||
|
|
|
@ -493,17 +493,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
|||
|
||||
wearableCache = WearableCacheItem.GetDefaultCacheItem();
|
||||
|
||||
// debug
|
||||
for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++)
|
||||
{
|
||||
int j = AvatarAppearance.BAKE_INDICES[iter];
|
||||
Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[iter];
|
||||
if(face != null)
|
||||
m_log.Debug("[ValidateBakedCache] {" + iter + "/" + j + " t - " + face.TextureID);
|
||||
else
|
||||
m_log.Debug("[ValidateBakedCache] {" + iter + "/" + j + " t - No texture");
|
||||
}
|
||||
|
||||
int hits = 0;
|
||||
// Cache wearable data for teleport.
|
||||
// Only makes sense if there's a bake module and a cache module
|
||||
|
@ -546,7 +535,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
|||
int idx = AvatarAppearance.BAKE_INDICES[i];
|
||||
Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
|
||||
|
||||
// No face, so lets check our baked service cache, teleport or login.
|
||||
// No face, so lets check our cache
|
||||
if (face == null || face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
|
||||
{
|
||||
sp.Appearance.Texture.FaceTextures[idx] = sp.Appearance.Texture.CreateFace((uint)idx);
|
||||
|
@ -560,8 +549,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
|||
{
|
||||
sp.Appearance.Texture.FaceTextures[idx].TextureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE;
|
||||
face = sp.Appearance.Texture.FaceTextures[idx];
|
||||
wearableCache[idx].CacheId = UUID.Zero;
|
||||
wearableCache[idx].TextureAsset = null;
|
||||
// lets try not invalidating the cache entry
|
||||
// wearableCache[idx].CacheId = UUID.Zero;
|
||||
// wearableCache[idx].TextureAsset = null;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -624,14 +614,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
|
|||
if (face == null)
|
||||
continue;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}",
|
||||
// face.TextureID, idx, client.Name, client.AgentId);
|
||||
|
||||
// if the texture is one of the "defaults" then skip it
|
||||
// this should probably be more intelligent (skirt texture doesnt matter
|
||||
// if the avatar isnt wearing a skirt) but if any of the main baked
|
||||
// textures is default then the rest should be as well
|
||||
if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
|
||||
continue;
|
||||
|
||||
|
|
Loading…
Reference in New Issue