aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Avatar
diff options
context:
space:
mode:
authorUbitUmarov2017-05-31 07:21:21 +0100
committerUbitUmarov2017-05-31 07:21:21 +0100
commit55babdc16090397499081f0428500babe383ff3a (patch)
treeefb2f7ec13abba489d6318ebace8a86c6cde66c6 /OpenSim/Region/CoreModules/Avatar
parentdisable llhttprequests secure con, since it still collides with main ssl sett... (diff)
parentwe don't need to keep refs to baked textures assets (diff)
downloadopensim-SC-55babdc16090397499081f0428500babe383ff3a.zip
opensim-SC-55babdc16090397499081f0428500babe383ff3a.tar.gz
opensim-SC-55babdc16090397499081f0428500babe383ff3a.tar.bz2
opensim-SC-55babdc16090397499081f0428500babe383ff3a.tar.xz
Merge branch 'master' into httptests
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs53
-rw-r--r--OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs12
2 files changed, 34 insertions, 31 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 535d946..9553f5b 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
369 return true; 369 return true;
370 370
371 // uploaded baked textures will be in assets local cache 371 // uploaded baked textures will be in assets local cache
372 IAssetService cache = m_scene.AssetService; 372 IAssetCache cache = m_scene.RequestModuleInterface<IAssetCache>();
373 IBakedTextureModule m_BakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>(); 373 IBakedTextureModule m_BakedTextureModule = m_scene.RequestModuleInterface<IBakedTextureModule>();
374 374
375 int validDirtyBakes = 0; 375 int validDirtyBakes = 0;
@@ -385,7 +385,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
385 385
386 List<UUID> missing = new List<UUID>(); 386 List<UUID> missing = new List<UUID>();
387 387
388 bool haveSkirt = (wearableCache[19].TextureAsset != null); 388 bool haveSkirt = (wearableCache[19].TextureID != UUID.Zero);
389 bool haveNewSkirt = false; 389 bool haveNewSkirt = false;
390 390
391 // Process received baked textures 391 // Process received baked textures
@@ -436,7 +436,11 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
436*/ 436*/
437 wearableCache[idx].TextureAsset = null; 437 wearableCache[idx].TextureAsset = null;
438 if (cache != null) 438 if (cache != null)
439 wearableCache[idx].TextureAsset = cache.GetCached(face.TextureID.ToString()); 439 {
440 AssetBase asb = null;
441 cache.Get(face.TextureID.ToString(), out asb);
442 wearableCache[idx].TextureAsset = asb;
443 }
440 444
441 if (wearableCache[idx].TextureAsset != null) 445 if (wearableCache[idx].TextureAsset != null)
442 { 446 {
@@ -481,25 +485,26 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
481 // if we got a full set of baked textures save all in BakedTextureModule 485 // if we got a full set of baked textures save all in BakedTextureModule
482 if (m_BakedTextureModule != null) 486 if (m_BakedTextureModule != null)
483 { 487 {
484 m_log.Debug("[UpdateBakedCache] start async uploading to bakedModule cache"); 488 m_log.DebugFormat("[UpdateBakedCache] Uploading to Bakes Server: cache hits: {0} changed entries: {1} rebakes {2}",
489 hits.ToString(), validDirtyBakes.ToString(), missing.Count);
485 490
486 m_BakedTextureModule.Store(sp.UUID, wearableCache); 491 m_BakedTextureModule.Store(sp.UUID, wearableCache);
487 } 492 }
488 } 493 }
494 else
495 m_log.DebugFormat("[UpdateBakedCache] cache hits: {0} changed entries: {1} rebakes {2}",
496 hits.ToString(), validDirtyBakes.ToString(), missing.Count);
489 497
490
491 // debug
492 m_log.Debug("[UpdateBakedCache] cache hits: " + hits.ToString() + " changed entries: " + validDirtyBakes.ToString() + " rebakes " + missing.Count);
493/*
494 for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++) 498 for (int iter = 0; iter < AvatarAppearance.BAKE_INDICES.Length; iter++)
495 { 499 {
496 int j = AvatarAppearance.BAKE_INDICES[iter]; 500 int j = AvatarAppearance.BAKE_INDICES[iter];
497 m_log.Debug("[UpdateBCache] {" + iter + "/" + 501 sp.Appearance.WearableCacheItems[j].TextureAsset = null;
498 sp.Appearance.WearableCacheItems[j].TextureIndex + "}: c-" + 502// m_log.Debug("[UpdateBCache] {" + iter + "/" +
499 sp.Appearance.WearableCacheItems[j].CacheId + ", t-" + 503// sp.Appearance.WearableCacheItems[j].TextureIndex + "}: c-" +
500 sp.Appearance.WearableCacheItems[j].TextureID); 504// sp.Appearance.WearableCacheItems[j].CacheId + ", t-" +
505// sp.Appearance.WearableCacheItems[j].TextureID);
501 } 506 }
502*/ 507
503 return (hits == cacheItems.Length); 508 return (hits == cacheItems.Length);
504 } 509 }
505 510
@@ -513,7 +518,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
513 518
514 lock (m_setAppearanceLock) 519 lock (m_setAppearanceLock)
515 { 520 {
516 IAssetService cache = m_scene.AssetService; 521 IAssetCache cache = m_scene.RequestModuleInterface<IAssetCache>();
517 IBakedTextureModule bakedModule = m_scene.RequestModuleInterface<IBakedTextureModule>(); 522 IBakedTextureModule bakedModule = m_scene.RequestModuleInterface<IBakedTextureModule>();
518 WearableCacheItem[] bakedModuleCache = null; 523 WearableCacheItem[] bakedModuleCache = null;
519 524
@@ -553,6 +558,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
553 } 558 }
554 } 559 }
555*/ 560*/
561
556 bool wearableCacheValid = false; 562 bool wearableCacheValid = false;
557 if (wearableCache == null) 563 if (wearableCache == null)
558 { 564 {
@@ -577,10 +583,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
577 hits++; 583 hits++;
578 wearableCache[idx].TextureAsset.Temporary = true; 584 wearableCache[idx].TextureAsset.Temporary = true;
579 wearableCache[idx].TextureAsset.Local = true; 585 wearableCache[idx].TextureAsset.Local = true;
580 cache.Store(wearableCache[idx].TextureAsset); 586 cache.Cache(wearableCache[idx].TextureAsset);
587 wearableCache[idx].TextureAsset = null;
581 continue; 588 continue;
582 } 589 }
583 if (cache.GetCached((wearableCache[idx].TextureID).ToString()) != null) 590
591 if (cache.Check((wearableCache[idx].TextureID).ToString()))
584 { 592 {
585 hits++; 593 hits++;
586 continue; 594 continue;
@@ -645,7 +653,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
645 wearableCache[j].TextureAsset = bakedModuleCache[i].TextureAsset; 653 wearableCache[j].TextureAsset = bakedModuleCache[i].TextureAsset;
646 bakedModuleCache[i].TextureAsset.Temporary = true; 654 bakedModuleCache[i].TextureAsset.Temporary = true;
647 bakedModuleCache[i].TextureAsset.Local = true; 655 bakedModuleCache[i].TextureAsset.Local = true;
648 cache.Store(bakedModuleCache[i].TextureAsset); 656 cache.Cache(bakedModuleCache[i].TextureAsset);
649 } 657 }
650 } 658 }
651 gotbacked = true; 659 gotbacked = true;
@@ -677,6 +685,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
677 685
678 face.TextureID = wearableCache[idx].TextureID; 686 face.TextureID = wearableCache[idx].TextureID;
679 hits++; 687 hits++;
688 wearableCache[idx].TextureAsset = null;
680 } 689 }
681 } 690 }
682 } 691 }
@@ -706,7 +715,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
706 return 0; 715 return 0;
707 716
708 int texturesRebaked = 0; 717 int texturesRebaked = 0;
709// IAssetCache cache = m_scene.RequestModuleInterface<IAssetCache>(); 718 IAssetCache cache = m_scene.RequestModuleInterface<IAssetCache>();
710 719
711 for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++) 720 for (int i = 0; i < AvatarAppearance.BAKE_INDICES.Length; i++)
712 { 721 {
@@ -722,18 +731,12 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
722 731
723 if (missingTexturesOnly) 732 if (missingTexturesOnly)
724 { 733 {
725 if (m_scene.AssetService.Get(face.TextureID.ToString()) != null) 734 if (cache != null && cache.Check(face.TextureID.ToString()))
726 { 735 {
727 continue; 736 continue;
728 } 737 }
729 else 738 else
730 { 739 {
731 // On inter-simulator teleports, this occurs if baked textures are not being stored by the
732 // grid asset service (which means that they are not available to the new region and so have
733 // to be re-requested from the client).
734 //
735 // The only available core OpenSimulator behaviour right now
736 // is not to store these textures, temporarily or otherwise.
737 m_log.DebugFormat( 740 m_log.DebugFormat(
738 "[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.", 741 "[AVFACTORY]: Missing baked texture {0} ({1}) for {2}, requesting rebake.",
739 face.TextureID, idx, sp.Name); 742 face.TextureID, idx, sp.Name);
diff --git a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
index 89e3020..e02ca49 100644
--- a/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/UserProfiles/UserProfileModule.cs
@@ -1839,12 +1839,12 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1839 webRequest.ContentType = "application/json-rpc"; 1839 webRequest.ContentType = "application/json-rpc";
1840 webRequest.Method = "POST"; 1840 webRequest.Method = "POST";
1841 1841
1842 using(Stream dataStream = webRequest.GetRequestStream())
1843 dataStream.Write(content,0,content.Length);
1844
1845 WebResponse webResponse = null; 1842 WebResponse webResponse = null;
1846 try 1843 try
1847 { 1844 {
1845 using(Stream dataStream = webRequest.GetRequestStream())
1846 dataStream.Write(content,0,content.Length);
1847
1848 webResponse = webRequest.GetResponse(); 1848 webResponse = webRequest.GetResponse();
1849 } 1849 }
1850 catch (WebException e) 1850 catch (WebException e)
@@ -1920,12 +1920,12 @@ namespace OpenSim.Region.CoreModules.Avatar.UserProfiles
1920 webRequest.ContentType = "application/json-rpc"; 1920 webRequest.ContentType = "application/json-rpc";
1921 webRequest.Method = "POST"; 1921 webRequest.Method = "POST";
1922 1922
1923 using(Stream dataStream = webRequest.GetRequestStream())
1924 dataStream.Write(content,0,content.Length);
1925
1926 WebResponse webResponse = null; 1923 WebResponse webResponse = null;
1927 try 1924 try
1928 { 1925 {
1926 using(Stream dataStream = webRequest.GetRequestStream())
1927 dataStream.Write(content,0,content.Length);
1928
1929 webResponse = webRequest.GetResponse(); 1929 webResponse = webRequest.GetResponse();
1930 } 1930 }
1931 catch (WebException e) 1931 catch (WebException e)