aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2013-02-04 19:21:39 +0000
committerMelanie2013-02-04 19:21:39 +0000
commit7482ad1c22e44e03c1a36f1d67d862084c20dae6 (patch)
tree9450dd7cbe79e1d34b6d0519d994b1fd16a253ed /OpenSim/Region/CoreModules
parentMerge branch 'master' into careminster (diff)
parentMerge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff)
downloadopensim-SC_OLD-7482ad1c22e44e03c1a36f1d67d862084c20dae6.zip
opensim-SC_OLD-7482ad1c22e44e03c1a36f1d67d862084c20dae6.tar.gz
opensim-SC_OLD-7482ad1c22e44e03c1a36f1d67d862084c20dae6.tar.bz2
opensim-SC_OLD-7482ad1c22e44e03c1a36f1d67d862084c20dae6.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs41
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs17
3 files changed, 44 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
index a0f1e8c..730643d 100644
--- a/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
+++ b/OpenSim/Region/CoreModules/Asset/FlotsamAssetCache.cs
@@ -790,32 +790,43 @@ namespace OpenSim.Region.CoreModules.Asset
790 { 790 {
791 UuidGatherer gatherer = new UuidGatherer(m_AssetService); 791 UuidGatherer gatherer = new UuidGatherer(m_AssetService);
792 792
793 HashSet<UUID> uniqueUuids = new HashSet<UUID>();
793 Dictionary<UUID, AssetType> assets = new Dictionary<UUID, AssetType>(); 794 Dictionary<UUID, AssetType> assets = new Dictionary<UUID, AssetType>();
795
794 foreach (Scene s in m_Scenes) 796 foreach (Scene s in m_Scenes)
795 { 797 {
796 StampRegionStatusFile(s.RegionInfo.RegionID); 798 StampRegionStatusFile(s.RegionInfo.RegionID);
797 799
798 s.ForEachSOG(delegate(SceneObjectGroup e) 800 s.ForEachSOG(delegate(SceneObjectGroup e)
799 { 801 {
800 gatherer.GatherAssetUuids(e, assets); 802 gatherer.GatherAssetUuids(e, assets);
801 });
802 }
803 803
804 foreach (UUID assetID in assets.Keys) 804 foreach (UUID assetID in assets.Keys)
805 { 805 {
806 string filename = GetFileName(assetID.ToString()); 806 uniqueUuids.Add(assetID);
807 807
808 if (File.Exists(filename)) 808 string filename = GetFileName(assetID.ToString());
809 { 809
810 File.SetLastAccessTime(filename, DateTime.Now); 810 if (File.Exists(filename))
811 } 811 {
812 else if (storeUncached) 812 File.SetLastAccessTime(filename, DateTime.Now);
813 { 813 }
814 m_AssetService.Get(assetID.ToString()); 814 else if (storeUncached)
815 } 815 {
816 AssetBase cachedAsset = m_AssetService.Get(assetID.ToString());
817 if (cachedAsset == null && assets[assetID] != AssetType.Unknown)
818 m_log.DebugFormat(
819 "[FLOTSAM ASSET CACHE]: Could not find asset {0}, type {1} referenced by object {2} at {3} in scene {4} when pre-caching all scene assets",
820 assetID, assets[assetID], e.Name, e.AbsolutePosition, s.Name);
821 }
822 }
823
824 assets.Clear();
825 });
816 } 826 }
817 827
818 return assets.Keys.Count; 828
829 return uniqueUuids.Count;
819 } 830 }
820 831
821 /// <summary> 832 /// <summary>
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
index 5836eb9..b61062f 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs
@@ -75,7 +75,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
75 public void Close() { } 75 public void Close() { }
76 public void PostInitialise() { } 76 public void PostInitialise() { }
77 77
78
79 ///<summary> 78 ///<summary>
80 /// 79 ///
81 ///</summary> 80 ///</summary>
@@ -136,7 +135,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
136 ///</summary> 135 ///</summary>
137 public void AddRegion(Scene scene) 136 public void AddRegion(Scene scene)
138 { 137 {
139 if (! m_enabled) 138 if (!m_enabled)
140 return; 139 return;
141 140
142 // Every shared region module has to maintain an indepedent list of 141 // Every shared region module has to maintain an indepedent list of
@@ -209,6 +208,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
209 208
210 using (Image mapTile = tileGenerator.CreateMapTile()) 209 using (Image mapTile = tileGenerator.CreateMapTile())
211 { 210 {
211 // XXX: The MapImageModule will return a null if the user has chosen not to create map tiles and there
212 // is no static map tile.
213 if (mapTile == null)
214 return;
215
212 using (MemoryStream stream = new MemoryStream()) 216 using (MemoryStream stream = new MemoryStream())
213 { 217 {
214 mapTile.Save(stream, ImageFormat.Jpeg); 218 mapTile.Save(stream, ImageFormat.Jpeg);
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
index d412efc..e7065dc 100644
--- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs
@@ -113,7 +113,6 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
113 //t = System.Environment.TickCount - t; 113 //t = System.Environment.TickCount - t;
114 //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t); 114 //m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t);
115 115
116
117 if (drawPrimVolume) 116 if (drawPrimVolume)
118 { 117 {
119 DrawObjectVolume(m_scene, mapbmp); 118 DrawObjectVolume(m_scene, mapbmp);
@@ -121,7 +120,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
121 } 120 }
122 else 121 else
123 { 122 {
124 mapbmp = fetchTexture(m_scene.RegionInfo.RegionSettings.TerrainImageID); 123 mapbmp = FetchTexture(m_scene.RegionInfo.RegionSettings.TerrainImageID);
125 } 124 }
126 return mapbmp; 125 return mapbmp;
127 } 126 }
@@ -232,11 +231,19 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
232// } 231// }
233// } 232// }
234 233
235 private Bitmap fetchTexture(UUID id) 234 private Bitmap FetchTexture(UUID id)
236 { 235 {
237 AssetBase asset = m_scene.AssetService.Get(id.ToString()); 236 AssetBase asset = m_scene.AssetService.Get(id.ToString());
238 m_log.DebugFormat("[MAPTILE]: Fetched static texture {0}, found: {1}", id, asset != null); 237
239 if (asset == null) return null; 238 if (asset != null)
239 {
240 m_log.DebugFormat("[MAPTILE]: Static map image texture {0} found for {1}", id, m_scene.Name);
241 }
242 else
243 {
244 m_log.WarnFormat("[MAPTILE]: Static map image texture {0} not found for {1}", id, m_scene.Name);
245 return null;
246 }
240 247
241 ManagedImage managedImage; 248 ManagedImage managedImage;
242 Image image; 249 Image image;