* 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
0.6.0-stable
Justin Clarke Casey 2008-10-29 18:38:10 +00:00
parent 5cf6a7f118
commit 8a3157aa6a
8 changed files with 63 additions and 41 deletions

View File

@ -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)
{

View File

@ -829,6 +829,12 @@ namespace OpenSim.Framework
/// <param name="imageUuid"></param>
/// <param name="imageData"></param>
void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData);
/// <summary>
/// Tell the client that the requested texture cannot be found
/// </summary>
/// <param name="imageId"></param>
void SendImageNotFound(UUID imageid);
void SendShutdownConnectionNotice();

View File

@ -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()
{

View File

@ -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);
}
}

View File

@ -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
/// </summary>
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;
}

View File

@ -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);
}
}

View File

@ -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)
{

View File

@ -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()
{
}