Bug fix in HG asset posts. Get the inner assets not just from mem cache but from asset service, because the inner ones may not be in mem cache.

0.6.5-rc1
diva 2009-04-18 22:46:48 +00:00
parent 5ae8ad55cd
commit 06f0515d14
1 changed files with 24 additions and 18 deletions

View File

@ -153,10 +153,11 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
return false; return false;
} }
private bool PostAsset(GridAssetClient asscli, UUID assetID) private bool PostAsset(GridAssetClient asscli, UUID assetID, bool isTexture)
{ {
AssetBase asset1; AssetBase asset1;
m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset1); //m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out asset1);
asset1 = m_scene.CommsManager.AssetCache.GetAsset(assetID, isTexture);
if (asset1 != null) if (asset1 != null)
{ {
@ -377,13 +378,17 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
m_assetServers.Add(userAssetURL, asscli); m_assetServers.Add(userAssetURL, asscli);
} }
m_log.Debug("[HGScene]: Posting object " + assetID + " to asset server " + userAssetURL); m_log.Debug("[HGScene]: Posting object " + assetID + " to asset server " + userAssetURL);
bool success = PostAsset(asscli, assetID); AssetBase ass1 = null;
m_scene.CommsManager.AssetCache.TryGetCachedAsset(assetID, out ass1);
if (ass1 != null)
{
bool success = PostAsset(asscli, assetID, (ass1.Type == (sbyte)AssetType.Texture));
// Now the inside // Now the inside
Dictionary<UUID, bool> ids = SniffUUIDs(assetID); Dictionary<UUID, bool> ids = SniffUUIDs(assetID);
Dump(ids); Dump(ids);
foreach (KeyValuePair<UUID, bool> kvp in ids) foreach (KeyValuePair<UUID, bool> kvp in ids)
PostAsset(asscli, kvp.Key); PostAsset(asscli, kvp.Key, kvp.Value);
if (success) if (success)
{ {
@ -394,8 +399,9 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid
else else
m_log.Warn("[HGScene]: Could not post asset to remote asset server " + userAssetURL); m_log.Warn("[HGScene]: Could not post asset to remote asset server " + userAssetURL);
//if (!m_assetMap.ContainsKey(itemID)) }
// m_assetMap.Add(itemID, asscli); else
m_log.Debug("[HGScene]: Something wrong with asset");
} }
else else
m_log.Warn("[HGScene]: Unable to locate foreign user's asset server"); m_log.Warn("[HGScene]: Unable to locate foreign user's asset server");