Merge branch 'master' into careminster

This commit is contained in:
Melanie
2013-02-04 19:21:39 +00:00
20 changed files with 491 additions and 318 deletions

View File

@@ -790,32 +790,43 @@ namespace OpenSim.Region.CoreModules.Asset
{
UuidGatherer gatherer = new UuidGatherer(m_AssetService);
HashSet<UUID> uniqueUuids = new HashSet<UUID>();
Dictionary<UUID, AssetType> assets = new Dictionary<UUID, AssetType>();
foreach (Scene s in m_Scenes)
{
StampRegionStatusFile(s.RegionInfo.RegionID);
s.ForEachSOG(delegate(SceneObjectGroup e)
{
{
gatherer.GatherAssetUuids(e, assets);
foreach (UUID assetID in assets.Keys)
{
uniqueUuids.Add(assetID);
string filename = GetFileName(assetID.ToString());
if (File.Exists(filename))
{
File.SetLastAccessTime(filename, DateTime.Now);
}
else if (storeUncached)
{
AssetBase cachedAsset = m_AssetService.Get(assetID.ToString());
if (cachedAsset == null && assets[assetID] != AssetType.Unknown)
m_log.DebugFormat(
"[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",
assetID, assets[assetID], e.Name, e.AbsolutePosition, s.Name);
}
}
assets.Clear();
});
}
foreach (UUID assetID in assets.Keys)
{
string filename = GetFileName(assetID.ToString());
if (File.Exists(filename))
{
File.SetLastAccessTime(filename, DateTime.Now);
}
else if (storeUncached)
{
m_AssetService.Get(assetID.ToString());
}
}
return assets.Keys.Count;
return uniqueUuids.Count;
}
/// <summary>

View File

@@ -75,7 +75,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
public void Close() { }
public void PostInitialise() { }
///<summary>
///
///</summary>
@@ -136,7 +135,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
///</summary>
public void AddRegion(Scene scene)
{
if (! m_enabled)
if (!m_enabled)
return;
// Every shared region module has to maintain an indepedent list of
@@ -209,6 +208,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage
using (Image mapTile = tileGenerator.CreateMapTile())
{
// XXX: The MapImageModule will return a null if the user has chosen not to create map tiles and there
// is no static map tile.
if (mapTile == null)
return;
using (MemoryStream stream = new MemoryStream())
{
mapTile.Save(stream, ImageFormat.Jpeg);

View File

@@ -113,7 +113,6 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
//t = System.Environment.TickCount - t;
//m_log.InfoFormat("[MAPTILE] generation of 10 maptiles needed {0} ms", t);
if (drawPrimVolume)
{
DrawObjectVolume(m_scene, mapbmp);
@@ -121,7 +120,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
}
else
{
mapbmp = fetchTexture(m_scene.RegionInfo.RegionSettings.TerrainImageID);
mapbmp = FetchTexture(m_scene.RegionInfo.RegionSettings.TerrainImageID);
}
return mapbmp;
}
@@ -232,11 +231,19 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap
// }
// }
private Bitmap fetchTexture(UUID id)
private Bitmap FetchTexture(UUID id)
{
AssetBase asset = m_scene.AssetService.Get(id.ToString());
m_log.DebugFormat("[MAPTILE]: Fetched static texture {0}, found: {1}", id, asset != null);
if (asset == null) return null;
if (asset != null)
{
m_log.DebugFormat("[MAPTILE]: Static map image texture {0} found for {1}", id, m_scene.Name);
}
else
{
m_log.WarnFormat("[MAPTILE]: Static map image texture {0} not found for {1}", id, m_scene.Name);
return null;
}
ManagedImage managedImage;
Image image;