aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-10-28 21:31:23 +0000
committerJustin Clarke Casey2008-10-28 21:31:23 +0000
commit1ff9709ea3d5e7c9ef21f6f59ae0dce62dd7b1c4 (patch)
tree8eeadcfcbee10726afd731a85bf569df3dc0916c
parent* minor: Add documentation to some of the appearance methods, change some log... (diff)
downloadopensim-SC-1ff9709ea3d5e7c9ef21f6f59ae0dce62dd7b1c4.zip
opensim-SC-1ff9709ea3d5e7c9ef21f6f59ae0dce62dd7b1c4.tar.gz
opensim-SC-1ff9709ea3d5e7c9ef21f6f59ae0dce62dd7b1c4.tar.bz2
opensim-SC-1ff9709ea3d5e7c9ef21f6f59ae0dce62dd7b1c4.tar.xz
* Possibly fix grey avatar appearance problems
* And hopefully rebaking all the time should no longer be necessary now * It turns out that when the client baked the texture, the uploaded asset had the Temporary flag to true (Temporary is actually deprecated). * It also had the StoreLocal flag set to true, which signifies that the asset should be stored locally. If it disappears we should reply to the asset request with ImageNotInDatabasePacket * However, last time this was enabled some clients started crashing. This may well no longer be the case and needs to be tested, but in the mean time we will store the asset instead. * This needs to be resolved in a better way, possibly by starting to send the ImageNotInDatabase packet again instead
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs25
-rw-r--r--OpenSim/Framework/AvatarWearable.cs10
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs29
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs7
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs4
5 files changed, 58 insertions, 17 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 0c0cfd5..e1d0bbe 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -28,8 +28,10 @@
28using System; 28using System;
29using System.Collections; 29using System.Collections;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Reflection;
31using System.Runtime.Serialization; 32using System.Runtime.Serialization;
32using System.Security.Permissions; 33using System.Security.Permissions;
34using log4net;
33using OpenMetaverse; 35using OpenMetaverse;
34using OpenMetaverse.Packets; 36using OpenMetaverse.Packets;
35using OpenSim.Framework; 37using OpenSim.Framework;
@@ -39,6 +41,9 @@ namespace OpenSim.Framework
39 [Serializable] 41 [Serializable]
40 public class AvatarAppearance : ISerializable 42 public class AvatarAppearance : ISerializable
41 { 43 {
44// private static readonly ILog m_log
45// = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46
42 // these are guessed at by the list here - 47 // these are guessed at by the list here -
43 // http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll 48 // http://wiki.secondlife.com/wiki/Avatar_Appearance. We'll
44 // correct them over time for when were are wrong. 49 // correct them over time for when were are wrong.
@@ -258,7 +263,7 @@ namespace OpenSim.Framework
258 } 263 }
259 264
260 /// <summary> 265 /// <summary>
261 /// 266 /// Set up appearance textures and avatar parameters, including a height calculation
262 /// </summary> 267 /// </summary>
263 /// <param name="texture"></param> 268 /// <param name="texture"></param>
264 /// <param name="visualParam"></param> 269 /// <param name="visualParam"></param>
@@ -266,7 +271,15 @@ namespace OpenSim.Framework
266 { 271 {
267 Primitive.TextureEntry textureEnt = new Primitive.TextureEntry(texture, 0, texture.Length); 272 Primitive.TextureEntry textureEnt = new Primitive.TextureEntry(texture, 0, texture.Length);
268 m_texture = textureEnt; 273 m_texture = textureEnt;
269 274
275// m_log.DebugFormat("[APPEARANCE]: Setting an avatar appearance with {0} faces", m_texture.FaceTextures.Length);
276// for (int i = 0; i < m_texture.FaceTextures.Length; i++)
277// {
278// Primitive.TextureEntryFace face = m_texture.FaceTextures[i];
279// String textureIdString = (face != null ? face.TextureID.ToString() : "none");
280// m_log.DebugFormat("[APPEARANCE]: Texture {0} is {1}", i, textureIdString);
281// }
282
270 m_visualparams = visualParam.ToArray(); 283 m_visualparams = visualParam.ToArray();
271 284
272 // Teravus : Nifty AV Height Getting Maaaaagical formula. Oh how we love turning 0-255 into meters. 285 // Teravus : Nifty AV Height Getting Maaaaagical formula. Oh how we love turning 0-255 into meters.
@@ -297,10 +310,10 @@ namespace OpenSim.Framework
297 public override String ToString() 310 public override String ToString()
298 { 311 {
299 String s = "[Wearables] =>"; 312 String s = "[Wearables] =>";
300 s += "Body Item: " + BodyItem.ToString() + ";"; 313 s += " Body Item: " + BodyItem.ToString() + ";";
301 s += "Skin Item: " + SkinItem.ToString() + ";"; 314 s += " Skin Item: " + SkinItem.ToString() + ";";
302 s += "Shirt Item: " + ShirtItem.ToString() + ";"; 315 s += " Shirt Item: " + ShirtItem.ToString() + ";";
303 s += "Pants Item: " + PantsItem.ToString() + ";"; 316 s += " Pants Item: " + PantsItem.ToString() + ";";
304 return s; 317 return s;
305 } 318 }
306 319
diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs
index 62971ea..52f162e 100644
--- a/OpenSim/Framework/AvatarWearable.cs
+++ b/OpenSim/Framework/AvatarWearable.cs
@@ -73,19 +73,19 @@ namespace OpenSim.Framework
73 } 73 }
74 74
75 // Body 75 // Body
76 defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); 76 defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9");
77 defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); 77 defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73");
78 78
79 // Skin 79 // Skin
80 defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9"); 80 defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9");
81 defaultWearables[1].AssetID = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb"); 81 defaultWearables[1].AssetID = new UUID("77c41e39-38f9-f75a-024e-585989bbabbb");
82 82
83 // Shirt 83 // Shirt
84 defaultWearables[4].ItemID = new UUID("77c41e39-38f9-f75a-0000-585989bf0000"); 84 defaultWearables[4].ItemID = new UUID("77c41e39-38f9-f75a-0000-585989bf0000");
85 defaultWearables[4].AssetID = new UUID("00000000-38f9-1111-024e-222222111110"); 85 defaultWearables[4].AssetID = new UUID("00000000-38f9-1111-024e-222222111110");
86 86
87 // Pants 87 // Pants
88 defaultWearables[5].ItemID = new UUID("77c41e39-38f9-f75a-0000-5859892f1111"); 88 defaultWearables[5].ItemID = new UUID("77c41e39-38f9-f75a-0000-5859892f1111");
89 defaultWearables[5].AssetID = new UUID("00000000-38f9-1111-024e-222222111120"); 89 defaultWearables[5].AssetID = new UUID("00000000-38f9-1111-024e-222222111120");
90 90
91 return defaultWearables; 91 return defaultWearables;
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index 1a442ea..1ae7eb7 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -334,6 +334,10 @@ namespace OpenSim.Framework.Communications.Cache
334 /// <param name="asset"></param> 334 /// <param name="asset"></param>
335 public void AddAsset(AssetBase asset) 335 public void AddAsset(AssetBase asset)
336 { 336 {
337// m_log.DebugFormat(
338// "[ASSET CACHE]: Uploaded asset {0}, temporary {1}, store local {2}",
339// asset.ID, asset.Temporary, asset.Local);
340
337 if (asset.Type == (int)AssetType.Texture) 341 if (asset.Type == (int)AssetType.Texture)
338 { 342 {
339 if (!Textures.ContainsKey(asset.FullID)) 343 if (!Textures.ContainsKey(asset.FullID))
@@ -344,11 +348,23 @@ namespace OpenSim.Framework.Communications.Cache
344 if (StatsManager.SimExtraStats != null) 348 if (StatsManager.SimExtraStats != null)
345 StatsManager.SimExtraStats.AddTexture(textur); 349 StatsManager.SimExtraStats.AddTexture(textur);
346 350
347 if (!asset.Temporary) 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
353 // ImageNotInDatabase packet to tell the client this. However, when this was enabled in
354 // TextureNotFoundSender it ended up crashing clients - we need to go back and try this again.
355 //
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.
359 if (!asset.Temporary || asset.Local)
348 { 360 {
349 m_assetServer.StoreAsset(asset); 361 m_assetServer.StoreAsset(asset);
350 } 362 }
351 } 363 }
364// else
365// {
366// m_log.DebugFormat("[ASSET CACHE]: Textures already contains {0}", asset.ID);
367// }
352 } 368 }
353 else 369 else
354 { 370 {
@@ -360,11 +376,16 @@ namespace OpenSim.Framework.Communications.Cache
360 if (StatsManager.SimExtraStats != null) 376 if (StatsManager.SimExtraStats != null)
361 StatsManager.SimExtraStats.AddAsset(assetInf); 377 StatsManager.SimExtraStats.AddAsset(assetInf);
362 378
363 if (!asset.Temporary) 379 // See comment above.
380 if (!asset.Temporary || asset.Local)
364 { 381 {
365 m_assetServer.StoreAsset(asset); 382 m_assetServer.StoreAsset(asset);
366 } 383 }
367 } 384 }
385// else
386// {
387// m_log.DebugFormat("[ASSET CACHE]: Assets already contains {0}", asset.ID);
388// }
368 } 389 }
369 } 390 }
370 391
@@ -394,6 +415,8 @@ namespace OpenSim.Framework.Communications.Cache
394 // See IAssetReceiver 415 // See IAssetReceiver
395 public void AssetReceived(AssetBase asset, bool IsTexture) 416 public void AssetReceived(AssetBase asset, bool IsTexture)
396 { 417 {
418// m_log.DebugFormat("[ASSET CACHE]: Received asset {0}", asset.ID);
419
397 //check if it is a texture or not 420 //check if it is a texture or not
398 //then add to the correct cache list 421 //then add to the correct cache list
399 //then check for waiting requests for this asset/texture (in the Requested lists) 422 //then check for waiting requests for this asset/texture (in the Requested lists)
@@ -464,7 +487,7 @@ namespace OpenSim.Framework.Communications.Cache
464 // See IAssetReceiver 487 // See IAssetReceiver
465 public void AssetNotFound(UUID assetID, bool IsTexture) 488 public void AssetNotFound(UUID assetID, bool IsTexture)
466 { 489 {
467 //m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID); 490// m_log.WarnFormat("[ASSET CACHE]: AssetNotFound for {0}", assetID);
468 491
469 if (IsTexture) 492 if (IsTexture)
470 { 493 {
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index aaa5e1c..86ec7e2 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -2239,6 +2239,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP
2239 awb.AssetID = wearables[i].AssetID; 2239 awb.AssetID = wearables[i].AssetID;
2240 awb.ItemID = wearables[i].ItemID; 2240 awb.ItemID = wearables[i].ItemID;
2241 aw.WearableData[i] = awb; 2241 aw.WearableData[i] = awb;
2242
2243// m_log.DebugFormat(
2244// "[APPEARANCE]: Sending wearable item/asset {0} {1} (index {2}) for {3}",
2245// awb.ItemID, awb.AssetID, i, Name);
2242 } 2246 }
2243 2247
2244 OutPacket(aw, ThrottleOutPacketType.Task); 2248 OutPacket(aw, ThrottleOutPacketType.Task);
@@ -4205,6 +4209,8 @@ Console.WriteLine(msgpack.ToString());
4205 4209
4206 if (handlerRequestWearables != null) 4210 if (handlerRequestWearables != null)
4207 { 4211 {
4212 m_log.DebugFormat("[APPEARANCE]: Wearables requested by {0}", Name);
4213
4208 handlerRequestWearables(); 4214 handlerRequestWearables();
4209 } 4215 }
4210 4216
@@ -7076,7 +7082,6 @@ Console.WriteLine(msgpack.ToString());
7076 7082
7077 public void SendAsset(AssetRequestToClient req) 7083 public void SendAsset(AssetRequestToClient req)
7078 { 7084 {
7079
7080 //Console.WriteLine("sending asset " + req.RequestAssetID); 7085 //Console.WriteLine("sending asset " + req.RequestAssetID);
7081 TransferInfoPacket Transfer = new TransferInfoPacket(); 7086 TransferInfoPacket Transfer = new TransferInfoPacket();
7082 Transfer.TransferInfo.ChannelType = 2; 7087 Transfer.TransferInfo.ChannelType = 2;
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 7bc0360..5a28f2f 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -1851,7 +1851,7 @@ namespace OpenSim.Region.Environment.Scenes
1851 m_log.DebugFormat("[APPEARANCE]: Sending wearables to {0}", Name); 1851 m_log.DebugFormat("[APPEARANCE]: Sending wearables to {0}", Name);
1852 1852
1853 ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++); 1853 ControllingClient.SendWearables(m_appearance.Wearables, m_appearance.Serial++);
1854 // ControllingClient.SendAppearance( 1854 //ControllingClient.SendAppearance(
1855 // m_appearance.Owner, 1855 // m_appearance.Owner,
1856 // m_appearance.VisualParams, 1856 // m_appearance.VisualParams,
1857 // m_appearance.Texture.ToBytes() 1857 // m_appearance.Texture.ToBytes()
@@ -1896,7 +1896,7 @@ namespace OpenSim.Region.Environment.Scenes
1896 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance); 1896 m_scene.CommsManager.AvatarService.UpdateUserAppearance(m_controllingClient.AgentId, m_appearance);
1897 1897
1898 SendAppearanceToAllOtherAgents(); 1898 SendAppearanceToAllOtherAgents();
1899 SendWearables(); 1899 //SendWearables();
1900 } 1900 }
1901 1901
1902 public void SetWearable(int wearableId, AvatarWearable wearable) 1902 public void SetWearable(int wearableId, AvatarWearable wearable)