diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 1ae7eb71c4..e1e42cf713 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -350,11 +350,21 @@ namespace OpenSim.Framework.Communications.Cache // According to http://wiki.secondlife.com/wiki/AssetUploadRequest, Local signifies that the // information is stored locally. It could disappear, in which case we could send the - // ImageNotInDatabase packet to tell the client this. However, when this was enabled in - // TextureNotFoundSender it ended up crashing clients - we need to go back and try this again. + // ImageNotInDatabase packet to tell the client this. + // + // However, this doesn't quite appear to work with local textures that are part of an avatar's + // appearance texture set. Whilst sending an ImageNotInDatabase does trigger an automatic rebake + // and reupload by the client, if those assets aren't pushed to the asset server anyway, then + // on crossing onto another region server, other avatars can no longer get the required textures. + // There doesn't appear to be any signal from the sim to the newly region border crossed client + // asking it to reupload its local texture assets to that region server. + // + // One can think of other cunning ways around this. For instance, on a region crossing or teleport, + // the original sim could squirt local assets to the new sim. Or the new sim could have pointers + // to the original sim to fetch the 'local' assets (this is getting more complicated). + // + // But for now, we're going to take the easy way out and store local assets globally. // - // In the mean time, we're just going to push local assets to the permanent store instead. - // TODO: Need to come back and address this. // TODO: Also, Temporary is now deprecated. We should start ignoring it and not passing it out from LLClientView. if (!asset.Temporary || asset.Local) { diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index c8a54a7428..538a2e7877 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -829,6 +829,12 @@ namespace OpenSim.Framework /// /// void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData); + + /// + /// Tell the client that the requested texture cannot be found + /// + /// + void SendImageNotFound(UUID imageid); void SendShutdownConnectionNotice(); diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index e0753d5fc6..848d31c7a7 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -2598,6 +2598,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(im, ThrottleOutPacketType.Texture); } + + public void SendImageNotFound(UUID imageid) + { + ImageNotInDatabasePacket notFoundPacket + = (ImageNotInDatabasePacket)PacketPool.Instance.GetPacket(PacketType.ImageNotInDatabase); + + notFoundPacket.ImageID.ID = imageid; + + OutPacket(notFoundPacket, ThrottleOutPacketType.Texture); + } public void SendShutdownConnectionNotice() { diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs index ed714ba4ef..aa4d070f8a 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs @@ -202,7 +202,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload // Make sure that any sender we currently have can get garbage collected sender = null; - //m_log.InfoFormat("[TEXTURE DOWNLOAD] Texture sender queue size: {0}", m_queueSenders.Count()); + //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count()); } } @@ -213,7 +213,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload private void TextureSent(ITextureSender sender) { sender.Sending = false; - //m_log.DebugFormat("[TEXTURE DOWNLOAD]: Removing download stat for {0}", sender.assetID); + //m_log.DebugFormat("[TEXTURE]: Removing download stat for {0}", sender.assetID); m_scene.AddPendingDownloads(-1); } } diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs index 0e14441a5f..c06406470f 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs @@ -25,6 +25,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System.Reflection; +using log4net; using OpenMetaverse; using OpenMetaverse.Packets; using OpenSim.Framework; @@ -37,22 +39,15 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload /// public class TextureNotFoundSender : ITextureSender { - //private static readonly log4net.ILog m_log - // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly log4net.ILog m_log +// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); - // private bool m_cancel = false; - // private IClientAPI m_client; - - // See ITextureSender - - // private bool m_sending = false; - //private UUID m_textureId; - - // See ITextureSender +// private IClientAPI m_client; +// private UUID m_textureId; public TextureNotFoundSender(IClientAPI client, UUID textureID) { - // // m_client = client; + //m_client = client; //m_textureId = textureID; } @@ -61,40 +56,31 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload public bool Sending { get { return false; } - set - { - // m_sending = value; - } + set {} } public bool Cancel { get { return false; } - set - { - // m_cancel = value; - } + set {} } // See ITextureSender public void UpdateRequest(int discardLevel, uint packetNumber) { - // Not need to implement since priority changes don't affect this operation + // No need to implement since priority changes don't affect this operation } // See ITextureSender public bool SendTexturePacket() { - //m_log.InfoFormat( - // "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found", - // m_textureId); - - //ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); - //notFound.ImageID.ID = m_textureId; +// m_log.DebugFormat( +// "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found", +// m_textureId); // XXX Temporarily disabling as this appears to be causing client crashes on at least // 1.19.0(5) of the Linden Second Life client. - // m_client.OutPacket(notFound, ThrottleOutPacketType.Texture); +// m_client.SendImageNotFound(m_textureId); return true; } diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs index 93f4d1bf2e..715dc4b787 100644 --- a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs +++ b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs @@ -121,10 +121,12 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload } else { +// m_log.DebugFormat("[TEXTURE]: Received a request for texture {0}", e.RequestedAssetID); + if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) { // m_log.DebugFormat( -// "[USER TEXTURE DOWNLOAD SERVICE]: Refusing request for {0} from client {1}", +// "[TEXTURE]: Refusing request for {0} from client {1}", // e.RequestedAssetID, m_client.AgentId); return; @@ -139,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload // Commenting out this message for now as it causes too much noise with other // debug messages. // m_log.DebugFormat( -// "[USER TEXTURE DOWNLOAD SERVICE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests", +// "[TEXTURE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests", // e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS); } @@ -196,7 +198,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload missingTextureLimitStrategy.MonitorRequests(textureID); // m_log.DebugFormat( -// "[USER TEXTURE DOWNLOAD SERVICE]: Queueing first TextureNotFoundSender for {0}, client {1}", +// "[TEXTURE]: Queueing first TextureNotFoundSender for {0}, client {1}", // textureID, m_client.AgentId); } @@ -214,14 +216,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload } } - //m_log.InfoFormat("[TEXTURE SENDER] Removing texture sender with uuid {0}", textureID); + //m_log.InfoFormat("[TEXTURE] Removing texture sender with uuid {0}", textureID); m_textureSenders.Remove(textureID); - //m_log.InfoFormat("[TEXTURE SENDER] Current texture senders in dictionary: {0}", m_textureSenders.Count); + //m_log.InfoFormat("[TEXTURE] Current texture senders in dictionary: {0}", m_textureSenders.Count); } else { m_log.WarnFormat( - "[USER TEXTURE DOWNLOAD SERVICE]: Got a texture uuid {0} with no sender object to handle it, this shouldn't happen", + "[TEXTURE]: Got a texture uuid {0} with no sender object to handle it, this shouldn't happen", textureID); } } diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs index 3e7839654b..da7a10c2c9 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs @@ -702,6 +702,10 @@ namespace OpenSim.Region.Environment.Modules.World.NPC public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) { } + + public void SendImageNotFound(UUID imageid) + { + } public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) { diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs index 600cc1bb35..b55e5b6ada 100644 --- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs +++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs @@ -623,7 +623,11 @@ namespace OpenSim.Region.Examples.SimpleModule public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) { } - + + public void SendImageNotFound(UUID imageid) + { + } + public void SendShutdownConnectionNotice() { }