aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-29 18:38:10 +0000
committerJustin Clarke Casey2008-10-29 18:38:10 +0000
commit8a3157aa6a83b7b84811cd4675ba9fc8e6fbd32e (patch)
tree76fe871eb5c1f1602fd7df1ec2cdeb89602ecb51
parentViewer side normals and UV fixes on profile cuts. Sync with primmesher.dll fo... (diff)
downloadopensim-SC-8a3157aa6a83b7b84811cd4675ba9fc8e6fbd32e.zip
opensim-SC-8a3157aa6a83b7b84811cd4675ba9fc8e6fbd32e.tar.gz
opensim-SC-8a3157aa6a83b7b84811cd4675ba9fc8e6fbd32e.tar.bz2
opensim-SC-8a3157aa6a83b7b84811cd4675ba9fc8e6fbd32e.tar.xz
* 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
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs18
-rw-r--r--OpenSim/Framework/IClientAPI.cs6
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs10
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureDownloadModule.cs4
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/TextureNotFoundSender.cs42
-rw-r--r--OpenSim/Region/Environment/Modules/Agent/TextureDownload/UserTextureDownloadService.cs14
-rw-r--r--OpenSim/Region/Environment/Modules/World/NPC/NPCAvatar.cs4
-rw-r--r--OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs6
8 files changed, 63 insertions, 41 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 1ae7eb7..e1e42cf 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -350,11 +350,21 @@ namespace OpenSim.Framework.Communications.Cache
350 350
351 // According to http://wiki.secondlife.com/wiki/AssetUploadRequest, Local signifies that the 351 // According to http://wiki.secondlife.com/wiki/AssetUploadRequest, Local signifies that the
352 // information is stored locally. It could disappear, in which case we could send the 352 // information is stored locally. It could disappear, in which case we could send the
353 // ImageNotInDatabase packet to tell the client this. However, when this was enabled in 353 // ImageNotInDatabase packet to tell the client this.
354 // TextureNotFoundSender it ended up crashing clients - we need to go back and try this again. 354 //
355 // However, this doesn't quite appear to work with local textures that are part of an avatar's
356 // appearance texture set. Whilst sending an ImageNotInDatabase does trigger an automatic rebake
357 // and reupload by the client, if those assets aren't pushed to the asset server anyway, then
358 // on crossing onto another region server, other avatars can no longer get the required textures.
359 // There doesn't appear to be any signal from the sim to the newly region border crossed client
360 // asking it to reupload its local texture assets to that region server.
361 //
362 // One can think of other cunning ways around this. For instance, on a region crossing or teleport,
363 // the original sim could squirt local assets to the new sim. Or the new sim could have pointers
364 // to the original sim to fetch the 'local' assets (this is getting more complicated).
365 //
366 // But for now, we're going to take the easy way out and store local assets globally.
355 // 367 //
356 // In the mean time, we're just going to push local assets to the permanent store instead.
357 // TODO: Need to come back and address this.
358 // TODO: Also, Temporary is now deprecated. We should start ignoring it and not passing it out from LLClientView. 368 // TODO: Also, Temporary is now deprecated. We should start ignoring it and not passing it out from LLClientView.
359 if (!asset.Temporary || asset.Local) 369 if (!asset.Temporary || asset.Local)
360 { 370 {
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index c8a54a7..538a2e7 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -829,6 +829,12 @@ namespace OpenSim.Framework
829 /// <param name="imageUuid"></param> 829 /// <param name="imageUuid"></param>
830 /// <param name="imageData"></param> 830 /// <param name="imageData"></param>
831 void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData); 831 void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData);
832
833 /// <summary>
834 /// Tell the client that the requested texture cannot be found
835 /// </summary>
836 /// <param name="imageId"></param>
837 void SendImageNotFound(UUID imageid);
832 838
833 void SendShutdownConnectionNotice(); 839 void SendShutdownConnectionNotice();
834 840
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index e0753d5..848d31c 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2598,6 +2598,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2598 2598
2599 OutPacket(im, ThrottleOutPacketType.Texture); 2599 OutPacket(im, ThrottleOutPacketType.Texture);
2600 } 2600 }
2601
2602 public void SendImageNotFound(UUID imageid)
2603 {
2604 ImageNotInDatabasePacket notFoundPacket
2605 = (ImageNotInDatabasePacket)PacketPool.Instance.GetPacket(PacketType.ImageNotInDatabase);
2606
2607 notFoundPacket.ImageID.ID = imageid;
2608
2609 OutPacket(notFoundPacket, ThrottleOutPacketType.Texture);
2610 }
2601 2611
2602 public void SendShutdownConnectionNotice() 2612 public void SendShutdownConnectionNotice()
2603 { 2613 {
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
202 // Make sure that any sender we currently have can get garbage collected 202 // Make sure that any sender we currently have can get garbage collected
203 sender = null; 203 sender = null;
204 204
205 //m_log.InfoFormat("[TEXTURE DOWNLOAD] Texture sender queue size: {0}", m_queueSenders.Count()); 205 //m_log.InfoFormat("[TEXTURE] Texture sender queue size: {0}", m_queueSenders.Count());
206 } 206 }
207 } 207 }
208 208
@@ -213,7 +213,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
213 private void TextureSent(ITextureSender sender) 213 private void TextureSent(ITextureSender sender)
214 { 214 {
215 sender.Sending = false; 215 sender.Sending = false;
216 //m_log.DebugFormat("[TEXTURE DOWNLOAD]: Removing download stat for {0}", sender.assetID); 216 //m_log.DebugFormat("[TEXTURE]: Removing download stat for {0}", sender.assetID);
217 m_scene.AddPendingDownloads(-1); 217 m_scene.AddPendingDownloads(-1);
218 } 218 }
219 } 219 }
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 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28using System.Reflection;
29using log4net;
28using OpenMetaverse; 30using OpenMetaverse;
29using OpenMetaverse.Packets; 31using OpenMetaverse.Packets;
30using OpenSim.Framework; 32using OpenSim.Framework;
@@ -37,22 +39,15 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
37 /// </summary> 39 /// </summary>
38 public class TextureNotFoundSender : ITextureSender 40 public class TextureNotFoundSender : ITextureSender
39 { 41 {
40 //private static readonly log4net.ILog m_log 42// private static readonly log4net.ILog m_log
41 // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 43// = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
42 44
43 // private bool m_cancel = false; 45// private IClientAPI m_client;
44 // private IClientAPI m_client; 46// private UUID m_textureId;
45
46 // See ITextureSender
47
48 // private bool m_sending = false;
49 //private UUID m_textureId;
50
51 // See ITextureSender
52 47
53 public TextureNotFoundSender(IClientAPI client, UUID textureID) 48 public TextureNotFoundSender(IClientAPI client, UUID textureID)
54 { 49 {
55 // // m_client = client; 50 //m_client = client;
56 //m_textureId = textureID; 51 //m_textureId = textureID;
57 } 52 }
58 53
@@ -61,40 +56,31 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
61 public bool Sending 56 public bool Sending
62 { 57 {
63 get { return false; } 58 get { return false; }
64 set 59 set {}
65 {
66 // m_sending = value;
67 }
68 } 60 }
69 61
70 public bool Cancel 62 public bool Cancel
71 { 63 {
72 get { return false; } 64 get { return false; }
73 set 65 set {}
74 {
75 // m_cancel = value;
76 }
77 } 66 }
78 67
79 // See ITextureSender 68 // See ITextureSender
80 public void UpdateRequest(int discardLevel, uint packetNumber) 69 public void UpdateRequest(int discardLevel, uint packetNumber)
81 { 70 {
82 // Not need to implement since priority changes don't affect this operation 71 // No need to implement since priority changes don't affect this operation
83 } 72 }
84 73
85 // See ITextureSender 74 // See ITextureSender
86 public bool SendTexturePacket() 75 public bool SendTexturePacket()
87 { 76 {
88 //m_log.InfoFormat( 77// m_log.DebugFormat(
89 // "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found", 78// "[TEXTURE NOT FOUND SENDER]: Informing the client that texture {0} cannot be found",
90 // m_textureId); 79// m_textureId);
91
92 //ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
93 //notFound.ImageID.ID = m_textureId;
94 80
95 // XXX Temporarily disabling as this appears to be causing client crashes on at least 81 // XXX Temporarily disabling as this appears to be causing client crashes on at least
96 // 1.19.0(5) of the Linden Second Life client. 82 // 1.19.0(5) of the Linden Second Life client.
97 // m_client.OutPacket(notFound, ThrottleOutPacketType.Texture); 83// m_client.SendImageNotFound(m_textureId);
98 84
99 return true; 85 return true;
100 } 86 }
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
121 } 121 }
122 else 122 else
123 { 123 {
124// m_log.DebugFormat("[TEXTURE]: Received a request for texture {0}", e.RequestedAssetID);
125
124 if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID)) 126 if (!foundTextureLimitStrategy.AllowRequest(e.RequestedAssetID))
125 { 127 {
126// m_log.DebugFormat( 128// m_log.DebugFormat(
127// "[USER TEXTURE DOWNLOAD SERVICE]: Refusing request for {0} from client {1}", 129// "[TEXTURE]: Refusing request for {0} from client {1}",
128// e.RequestedAssetID, m_client.AgentId); 130// e.RequestedAssetID, m_client.AgentId);
129 131
130 return; 132 return;
@@ -139,7 +141,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
139 // Commenting out this message for now as it causes too much noise with other 141 // Commenting out this message for now as it causes too much noise with other
140 // debug messages. 142 // debug messages.
141// m_log.DebugFormat( 143// m_log.DebugFormat(
142// "[USER TEXTURE DOWNLOAD SERVICE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests", 144// "[TEXTURE]: Dropping requests for notified missing texture {0} for client {1} since we have received more than {2} requests",
143// e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS); 145// e.RequestedAssetID, m_client.AgentId, MAX_ALLOWED_TEXTURE_REQUESTS);
144 } 146 }
145 147
@@ -196,7 +198,7 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
196 missingTextureLimitStrategy.MonitorRequests(textureID); 198 missingTextureLimitStrategy.MonitorRequests(textureID);
197 199
198// m_log.DebugFormat( 200// m_log.DebugFormat(
199// "[USER TEXTURE DOWNLOAD SERVICE]: Queueing first TextureNotFoundSender for {0}, client {1}", 201// "[TEXTURE]: Queueing first TextureNotFoundSender for {0}, client {1}",
200// textureID, m_client.AgentId); 202// textureID, m_client.AgentId);
201 } 203 }
202 204
@@ -214,14 +216,14 @@ namespace OpenSim.Region.Environment.Modules.Agent.TextureDownload
214 } 216 }
215 } 217 }
216 218
217 //m_log.InfoFormat("[TEXTURE SENDER] Removing texture sender with uuid {0}", textureID); 219 //m_log.InfoFormat("[TEXTURE] Removing texture sender with uuid {0}", textureID);
218 m_textureSenders.Remove(textureID); 220 m_textureSenders.Remove(textureID);
219 //m_log.InfoFormat("[TEXTURE SENDER] Current texture senders in dictionary: {0}", m_textureSenders.Count); 221 //m_log.InfoFormat("[TEXTURE] Current texture senders in dictionary: {0}", m_textureSenders.Count);
220 } 222 }
221 else 223 else
222 { 224 {
223 m_log.WarnFormat( 225 m_log.WarnFormat(
224 "[USER TEXTURE DOWNLOAD SERVICE]: Got a texture uuid {0} with no sender object to handle it, this shouldn't happen", 226 "[TEXTURE]: Got a texture uuid {0} with no sender object to handle it, this shouldn't happen",
225 textureID); 227 textureID);
226 } 228 }
227 } 229 }
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
702 public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec) 702 public void SendImageFirstPart(ushort numParts, UUID ImageUUID, uint ImageSize, byte[] ImageData, byte imageCodec)
703 { 703 {
704 } 704 }
705
706 public void SendImageNotFound(UUID imageid)
707 {
708 }
705 709
706 public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) 710 public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
707 { 711 {
diff --git a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
index 600cc1b..b55e5b6 100644
--- a/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
+++ b/OpenSim/Region/Examples/SimpleModule/MyNpcCharacter.cs
@@ -623,7 +623,11 @@ namespace OpenSim.Region.Examples.SimpleModule
623 public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData) 623 public void SendImageNextPart(ushort partNumber, UUID imageUuid, byte[] imageData)
624 { 624 {
625 } 625 }
626 626
627 public void SendImageNotFound(UUID imageid)
628 {
629 }
630
627 public void SendShutdownConnectionNotice() 631 public void SendShutdownConnectionNotice()
628 { 632 {
629 } 633 }