aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2014-08-07 08:47:03 +0100
committerUbitUmarov2014-08-07 08:47:03 +0100
commitdfa9ba0937f6e2d30e1d541d64533ede4ecb671e (patch)
tree39219012afb0e847debf29fe0c9170b445bc4056 /OpenSim/Region
parent reply to cached checks with same serial number (diff)
downloadopensim-SC-dfa9ba0937f6e2d30e1d541d64533ede4ecb671e.zip
opensim-SC-dfa9ba0937f6e2d30e1d541d64533ede4ecb671e.tar.gz
opensim-SC-dfa9ba0937f6e2d30e1d541d64533ede4ecb671e.tar.bz2
opensim-SC-dfa9ba0937f6e2d30e1d541d64533ede4ecb671e.tar.xz
minor clean, dont check for cache if we aren't using it..
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs104
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs28
2 files changed, 27 insertions, 105 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index def1f8e..e9a087b 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -12011,120 +12011,60 @@ namespace OpenSim.Region.ClientStack.LindenUDP
12011 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse); 12011 AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse);
12012 12012
12013 if (cachedtex.AgentData.SessionID != SessionId) 12013 if (cachedtex.AgentData.SessionID != SessionId)
12014 return false; 12014 return false;
12015 12015
12016 // TODO: don't create new blocks if recycling an old packet 12016 // TODO: don't create new blocks if recycling an old packet
12017 cachedresp.AgentData.AgentID = AgentId; 12017 cachedresp.AgentData.AgentID = AgentId;
12018 cachedresp.AgentData.SessionID = m_sessionId; 12018 cachedresp.AgentData.SessionID = m_sessionId;
12019// cachedresp.AgentData.SerialNum = m_cachedTextureSerial;
12020// m_cachedTextureSerial++;
12021 cachedresp.AgentData.SerialNum = cachedtex.AgentData.SerialNum; 12019 cachedresp.AgentData.SerialNum = cachedtex.AgentData.SerialNum;
12022 cachedresp.WearableData = 12020 cachedresp.WearableData =
12023 new AgentCachedTextureResponsePacket.WearableDataBlock[cachedtex.WearableData.Length]; 12021 new AgentCachedTextureResponsePacket.WearableDataBlock[cachedtex.WearableData.Length];
12024 12022
12025 //IAvatarFactoryModule fac = m_scene.RequestModuleInterface<IAvatarFactoryModule>();
12026 // var item = fac.GetBakedTextureFaces(AgentId);
12027 //WearableCacheItem[] items = fac.GetCachedItems(AgentId);
12028
12029 IAssetService cache = m_scene.AssetService;
12030 //bakedTextureModule = null;
12031 int maxWearablesLoop = cachedtex.WearableData.Length; 12023 int maxWearablesLoop = cachedtex.WearableData.Length;
12032 if (maxWearablesLoop > AvatarWearable.MAX_WEARABLES) 12024 if (maxWearablesLoop > AvatarWearable.MAX_WEARABLES)
12033 maxWearablesLoop = AvatarWearable.MAX_WEARABLES; 12025 maxWearablesLoop = AvatarWearable.MAX_WEARABLES;
12034 12026
12035 int cacheHits = 0; 12027 int cacheHits = 0;
12036 12028
12037 if (cache != null) 12029 // 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
12038 {
12039 // 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
12040
12041 WearableCacheItem[] cacheItems = null;
12042
12043 ScenePresence p = m_scene.GetScenePresence(AgentId);
12044
12045 if (p!= null && p.Appearance != null)
12046 {
12047 /* we should only check bakedTextureModule at login or when appearance changes
12048 if (p.Appearance.WearableCacheItems == null) // currently with a caching only bakemodule Appearance.Wearables.dirty as no use
12049 {
12050 IBakedTextureModule bakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>();
12051 if (bakedTextureModule != null)
12052 {
12053 m_log.Debug("[ HandleAgentTextureCached] bakedTextureModule");
12054 try
12055 {
12056 cacheItems = bakedTextureModule.Get(AgentId);
12057 p.Appearance.WearableCacheItems = cacheItems;
12058 p.Appearance.WearableCacheItemsDirty = false;
12059 12030
12060 if (cacheItems != null) 12031 WearableCacheItem[] cacheItems = null;
12061 {
12062 foreach (WearableCacheItem item in cacheItems)
12063 {
12064 if (item.TextureAsset != null)
12065 {
12066 item.TextureAsset.Temporary = true;
12067 item.TextureAsset.Local = true;
12068 cache.Store(item.TextureAsset);
12069 }
12070 }
12071 }
12072 }
12073 12032
12074 catch (Exception) 12033 ScenePresence p = m_scene.GetScenePresence(AgentId);
12075 {
12076 cacheItems = null;
12077 }
12078 }
12079 }
12080 12034
12081 else if (p.Appearance.WearableCacheItems != null) 12035 if (p != null && p.Appearance != null)
12082 { 12036 {
12083 cacheItems = p.Appearance.WearableCacheItems; 12037 cacheItems = p.Appearance.WearableCacheItems;
12084 } 12038 }
12085*/
12086 cacheItems = p.Appearance.WearableCacheItems;
12087 }
12088 12039
12089 if (cacheItems != null) 12040 if (cacheItems != null)
12041 {
12042 for (int i = 0; i < maxWearablesLoop; i++)
12090 { 12043 {
12091 for (int i = 0; i < maxWearablesLoop; i++) 12044 int idx = cachedtex.WearableData[i].TextureIndex;
12092 {
12093 int idx = cachedtex.WearableData[i].TextureIndex;
12094 12045
12095 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); 12046 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
12096 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; 12047 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex;
12097 cachedresp.WearableData[i].HostName = new byte[0]; 12048 cachedresp.WearableData[i].HostName = new byte[0];
12098 if (cachedtex.WearableData[i].ID == cacheItems[idx].CacheId) 12049 if (cachedtex.WearableData[i].ID == cacheItems[idx].CacheId)
12099 { 12050 {
12100 cachedresp.WearableData[i].TextureID = cacheItems[idx].TextureID; 12051 cachedresp.WearableData[i].TextureID = cacheItems[idx].TextureID;
12101 cacheHits++; 12052 cacheHits++;
12102 }
12103 else
12104 {
12105 cachedresp.WearableData[i].TextureID = UUID.Zero;
12106 }
12107 } 12053 }
12108 } 12054 else
12109 else
12110 {
12111 for (int i = 0; i < maxWearablesLoop; i++)
12112 { 12055 {
12113 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
12114 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex;
12115 cachedresp.WearableData[i].TextureID = UUID.Zero; 12056 cachedresp.WearableData[i].TextureID = UUID.Zero;
12116 //UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46");
12117 cachedresp.WearableData[i].HostName = new byte[0];
12118 } 12057 }
12119 } 12058 }
12120 } 12059 }
12121 else // no cache 12060 else
12122 { 12061 {
12123 for (int i = 0; i < maxWearablesLoop; i++) 12062 for (int i = 0; i < maxWearablesLoop; i++)
12124 { 12063 {
12125 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock(); 12064 cachedresp.WearableData[i] = new AgentCachedTextureResponsePacket.WearableDataBlock();
12126 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex; 12065 cachedresp.WearableData[i].TextureIndex = cachedtex.WearableData[i].TextureIndex;
12127 cachedresp.WearableData[i].TextureID = UUID.Zero; 12066 cachedresp.WearableData[i].TextureID = UUID.Zero;
12067 //UUID.Parse("8334fb6e-c2f5-46ee-807d-a435f61a8d46");
12128 cachedresp.WearableData[i].HostName = new byte[0]; 12068 cachedresp.WearableData[i].HostName = new byte[0];
12129 } 12069 }
12130 } 12070 }
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index edf62db..2e5c58a 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -493,18 +493,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
493 493
494 wearableCache = WearableCacheItem.GetDefaultCacheItem(); 494 wearableCache = WearableCacheItem.GetDefaultCacheItem();
495 495
496 // debug 496 int hits = 0;
497 for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++)
498 {
499 int j = AvatarAppearance.BAKE_INDICES[iter];
500 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[iter];
501 if(face != null)
502 m_log.Debug("[ValidateBakedCache] {" + iter + "/" + j + " t - " + face.TextureID);
503 else
504 m_log.Debug("[ValidateBakedCache] {" + iter + "/" + j + " t - No texture");
505 }
506
507 int hits = 0;
508 // Cache wearable data for teleport. 497 // Cache wearable data for teleport.
509 // Only makes sense if there's a bake module and a cache module 498 // Only makes sense if there's a bake module and a cache module
510 if (bakedModule != null && cache != null) 499 if (bakedModule != null && cache != null)
@@ -546,7 +535,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
546 int idx = AvatarAppearance.BAKE_INDICES[i]; 535 int idx = AvatarAppearance.BAKE_INDICES[i];
547 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx]; 536 Primitive.TextureEntryFace face = sp.Appearance.Texture.FaceTextures[idx];
548 537
549 // No face, so lets check our baked service cache, teleport or login. 538 // No face, so lets check our cache
550 if (face == null || face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE) 539 if (face == null || face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
551 { 540 {
552 sp.Appearance.Texture.FaceTextures[idx] = sp.Appearance.Texture.CreateFace((uint)idx); 541 sp.Appearance.Texture.FaceTextures[idx] = sp.Appearance.Texture.CreateFace((uint)idx);
@@ -560,8 +549,9 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
560 { 549 {
561 sp.Appearance.Texture.FaceTextures[idx].TextureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE; 550 sp.Appearance.Texture.FaceTextures[idx].TextureID = AppearanceManager.DEFAULT_AVATAR_TEXTURE;
562 face = sp.Appearance.Texture.FaceTextures[idx]; 551 face = sp.Appearance.Texture.FaceTextures[idx];
563 wearableCache[idx].CacheId = UUID.Zero; 552// lets try not invalidating the cache entry
564 wearableCache[idx].TextureAsset = null; 553// wearableCache[idx].CacheId = UUID.Zero;
554// wearableCache[idx].TextureAsset = null;
565 continue; 555 continue;
566 } 556 }
567 } 557 }
@@ -624,14 +614,6 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
624 if (face == null) 614 if (face == null)
625 continue; 615 continue;
626 616
627// m_log.DebugFormat(
628// "[AVFACTORY]: Looking for texture {0}, id {1} for {2} {3}",
629// face.TextureID, idx, client.Name, client.AgentId);
630
631 // if the texture is one of the "defaults" then skip it
632 // this should probably be more intelligent (skirt texture doesnt matter
633 // if the avatar isnt wearing a skirt) but if any of the main baked
634 // textures is default then the rest should be as well
635 if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE) 617 if (face.TextureID == UUID.Zero || face.TextureID == AppearanceManager.DEFAULT_AVATAR_TEXTURE)
636 continue; 618 continue;
637 619