* Move missing texture request forward so that we don't actually ask the AssetCache for it if we know it's missing.

0.6.0-stable
Justin Clarke Casey 2008-03-17 21:44:54 +00:00
parent 872184fa2a
commit bbddc0dbe7
1 changed files with 26 additions and 21 deletions

View File

@ -101,14 +101,32 @@ namespace OpenSim.Region.Environment.Modules
}
else
{
//m_log.DebugFormat("[USER TEXTURE DOWNLOAD]: Adding download stat {0}", e.RequestedAssetID);
m_scene.AddPendingDownloads(1);
TextureSender requestHandler =
new TextureSender(m_client, e.DiscardLevel, e.PacketNumber);
m_textureSenders.Add(e.RequestedAssetID, requestHandler);
m_scene.AssetCache.GetAsset(e.RequestedAssetID, TextureCallback, true);
// If we've already told the client we're missing the texture, then don't ask the
// asset server for it again - record the fact that it's missing instead.
if (missingTextureRequests.ContainsKey(e.RequestedAssetID))
{
int requests = missingTextureRequests[e.RequestedAssetID] + 1;
if (requests % 20 == 0)
{
m_log.WarnFormat(
"[USER TEXTURE DOWNLOAD SERVICE]: Received {0} requests for the missing texture {1} from client {2}",
requests, e.RequestedAssetID, m_client.AgentId);
}
missingTextureRequests[e.RequestedAssetID] = requests;
}
else
{
//m_log.DebugFormat("[USER TEXTURE DOWNLOAD]: Adding download stat {0}", e.RequestedAssetID);
m_scene.AddPendingDownloads(1);
TextureSender requestHandler =
new TextureSender(m_client, e.DiscardLevel, e.PacketNumber);
m_textureSenders.Add(e.RequestedAssetID, requestHandler);
m_scene.AssetCache.GetAsset(e.RequestedAssetID, TextureCallback, true);
}
}
}
}
@ -159,19 +177,6 @@ namespace OpenSim.Region.Environment.Modules
EnqueueTextureSender(textureNotFoundSender);
missingTextureRequests.Add(textureID, 1);
}
else
{
int requests = missingTextureRequests[textureID] + 1;
if (requests % 20 == 0)
{
m_log.WarnFormat(
"[USER TEXTURE DOWNLOAD SERVICE]: Received {0} requests for the missing texture {1} from client {2}",
requests, textureID, m_client.AgentId);
}
missingTextureRequests[textureID] = requests;
}
}
else
{