From 8a3157aa6a83b7b84811cd4675ba9fc8e6fbd32e Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Wed, 29 Oct 2008 18:38:10 +0000 Subject: * Check in (disabled) results of not persisting avatar textures but rather sending ImageNotFound to clients if avatar textures are missing * Whilst this does automatically get the client to rebake, on crossing a region border the 'local' assets are left behind * There may be a cunning solution (such as squirting the assets on region crossing, or having them fetched from the original region) but instead I'm going to opt for the easy solution of keeping them in the asset database, for now --- .../Agent/TextureDownload/TextureDownloadModule.cs | 4 +-- .../Agent/TextureDownload/TextureNotFoundSender.cs | 42 ++++++++-------------- .../TextureDownload/UserTextureDownloadService.cs | 14 ++++---- .../Environment/Modules/World/NPC/NPCAvatar.cs | 4 +++ 4 files changed, 28 insertions(+), 36 deletions(-) (limited to 'OpenSim/Region/Environment') diff --git a/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs index ed714ba..aa4d070 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 0e14441..c064064 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 93f4d1b..715dc4b 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 3e78396..da7a10c 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) { -- cgit v1.1