* re-enabled AssetNotFound code

* turned script asset fetching asynchronous
ThreadPoolClientBranch
lbsa71 2008-02-20 13:11:19 +00:00
parent 4c2e304ce6
commit 4c6e5a5090
2 changed files with 95 additions and 91 deletions

View File

@ -457,21 +457,22 @@ namespace OpenSim.Framework.Communications.Cache
public void AssetNotFound(LLUUID assetID) public void AssetNotFound(LLUUID assetID)
{ {
m_log.ErrorFormat("[ASSET CACHE]: Unhandled AssetNotFound for {0}", assetID); //m_log.ErrorFormat("[ASSET CACHE]: Unhandled AssetNotFound for {0}", assetID);
//if (this.RequestedTextures.ContainsKey(assetID)) AssetRequest req;
//{
// m_log.WarnFormat("[ASSET CACHE]: sending image not found for {0}", assetID); if (RequestedTextures.TryGetValue(assetID, out req))
// AssetRequest req = this.RequestedTextures[assetID]; {
// ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); m_log.WarnFormat("[ASSET CACHE]: sending image not found for {0}", assetID);
// notFound.ImageID.ID = assetID; ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
// req.RequestUser.OutPacket(notFound); notFound.ImageID.ID = assetID;
// this.RequestedTextures.Remove(assetID); req.RequestUser.OutPacket(notFound, ThrottleOutPacketType.Unknown);
//} RequestedTextures.Remove(assetID);
//else }
//{ else
// m_log.ErrorFormat("[ASSET CACHE]: Cound not send image not found for {0}", assetID); {
//} m_log.ErrorFormat("[ASSET CACHE]: Asset [{0}] not found, but couldn't find any users to send to ", assetID);
}
} }
private int CalculateNumPackets(byte[] data) private int CalculateNumPackets(byte[] data)

View File

@ -33,6 +33,7 @@ using System.Xml.Serialization;
using libsecondlife; using libsecondlife;
using OpenSim.Framework; using OpenSim.Framework;
using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Console; using OpenSim.Framework.Console;
using OpenSim.Region.Environment.Interfaces; using OpenSim.Region.Environment.Interfaces;
using OpenSim.Region.Environment.Scenes.Scripting; using OpenSim.Region.Environment.Scenes.Scripting;
@ -155,25 +156,27 @@ namespace OpenSim.Region.Environment.Scenes
if (!((m_parentGroup.Scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts)) if (!((m_parentGroup.Scene.RegionInfo.EstateSettings.regionFlags & Simulator.RegionFlags.SkipScripts) == Simulator.RegionFlags.SkipScripts))
{ {
AssetBase rezAsset = m_parentGroup.Scene.AssetCache.GetAsset(item.AssetID, false); AssetCache cache = m_parentGroup.Scene.AssetCache;
if (rezAsset != null) cache.GetAsset(item.AssetID, delegate(LLUUID assetID, AssetBase asset)
{ {
if (asset.FullID == LLUUID.Zero)
string script = Helpers.FieldToUTF8String(rezAsset.Data);
m_parentGroup.Scene.EventManager.TriggerRezScript(LocalID, item.ItemID, script);
m_parentGroup.AddActiveScriptCount(1);
}
else
{ {
m_log.ErrorFormat( m_log.ErrorFormat(
"[PRIMINVENTORY]: " + "[PRIMINVENTORY]: " +
"Couldn't start script {0}, {1} since asset ID {2} could not be found", "Couldn't start script {0}, {1} since asset ID {2} could not be found",
item.Name, item.ItemID, item.AssetID); item.Name, item.ItemID, item.AssetID);
} }
} else
{
string script = Helpers.FieldToUTF8String(asset.Data);
m_parentGroup.Scene.EventManager.TriggerRezScript(LocalID,item.ItemID,script);
m_parentGroup.AddActiveScriptCount(1);
ScheduleFullUpdate(); ScheduleFullUpdate();
} }
});
}
}
/// <summary> /// <summary>
/// Start a script which is in this prim's inventory. /// Start a script which is in this prim's inventory.