aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authordiva2009-02-22 01:26:11 +0000
committerdiva2009-02-22 01:26:11 +0000
commit99b051ccbe7b0f43e8bd5cc8c0012b40e24cb752 (patch)
treef303bef4e1b7ed4d2d576c1e7fd05f7ceb644ee5
parentUpdate svn properties, add copyright headers, minor formatting cleanup. (diff)
downloadopensim-SC_OLD-99b051ccbe7b0f43e8bd5cc8c0012b40e24cb752.zip
opensim-SC_OLD-99b051ccbe7b0f43e8bd5cc8c0012b40e24cb752.tar.gz
opensim-SC_OLD-99b051ccbe7b0f43e8bd5cc8c0012b40e24cb752.tar.bz2
opensim-SC_OLD-99b051ccbe7b0f43e8bd5cc8c0012b40e24cb752.tar.xz
Addresses some issues with appearance after TPs. Appearance.Owner was not being set, and that's what's being used in SendAppearanceToOtherAgent. Mantis #3204.
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/AvatarAppearance.cs20
-rw-r--r--OpenSim/Grid/UserServer/UserLoginService.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs12
4 files changed, 28 insertions, 8 deletions
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs
index 52041bb..d8fcf74 100644
--- a/OpenSim/Framework/AvatarAppearance.cs
+++ b/OpenSim/Framework/AvatarAppearance.cs
@@ -241,6 +241,11 @@ namespace OpenSim.Framework
241 } 241 }
242 242
243 public AvatarAppearance() 243 public AvatarAppearance()
244 : this(UUID.Zero)
245 {
246 }
247
248 public AvatarAppearance(UUID owner)
244 { 249 {
245 m_wearables = new AvatarWearable[MAX_WEARABLES]; 250 m_wearables = new AvatarWearable[MAX_WEARABLES];
246 for (int i = 0; i < MAX_WEARABLES; i++) 251 for (int i = 0; i < MAX_WEARABLES; i++)
@@ -249,7 +254,7 @@ namespace OpenSim.Framework
249 m_wearables[i] = new AvatarWearable(); 254 m_wearables[i] = new AvatarWearable();
250 } 255 }
251 m_serial = 0; 256 m_serial = 0;
252 m_owner = UUID.Zero; 257 m_owner = owner;
253 m_visualparams = new byte[VISUALPARAM_COUNT]; 258 m_visualparams = new byte[VISUALPARAM_COUNT];
254 SetDefaultWearables(); 259 SetDefaultWearables();
255 m_texture = GetDefaultTexture(); 260 m_texture = GetDefaultTexture();
@@ -286,7 +291,18 @@ namespace OpenSim.Framework
286 + 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height 291 + 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height
287 + 0.3836f * (float)m_visualparams[125] / 255.0f // Leg length 292 + 0.3836f * (float)m_visualparams[125] / 255.0f // Leg length
288 - m_avatarHeight / 2) * 0.3f - 0.04f; 293 - m_avatarHeight / 2) * 0.3f - 0.04f;
289 //System.Console.WriteLine("[APPEARANCE]: Height {0} Hip offset {1}", m_avatarHeight, m_hipOffset); 294 //System.Console.WriteLine(">>>>>>> [APPEARANCE]: Height {0} Hip offset {1}", m_avatarHeight, m_hipOffset);
295 //System.Console.WriteLine("------------- Set Appearance Texture ---------------");
296 //Primitive.TextureEntryFace[] faces = Texture.FaceTextures;
297 //foreach (Primitive.TextureEntryFace face in faces)
298 //{
299 // if (face != null)
300 // System.Console.WriteLine(" ++ " + face.TextureID);
301 // else
302 // System.Console.WriteLine(" ++ NULL ");
303 //}
304 //System.Console.WriteLine("----------------------------");
305
290 } 306 }
291 307
292 public virtual void SetWearable(int wearableId, AvatarWearable wearable) 308 public virtual void SetWearable(int wearableId, AvatarWearable wearable)
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs
index c180565..0bec2a1 100644
--- a/OpenSim/Grid/UserServer/UserLoginService.cs
+++ b/OpenSim/Grid/UserServer/UserLoginService.cs
@@ -406,7 +406,7 @@ namespace OpenSim.Grid.UserServer
406 else 406 else
407 { 407 {
408 m_log.DebugFormat("[LOGIN]: Appearance not for {0} {1}. Creating default.", user.FirstName, user.SurName); 408 m_log.DebugFormat("[LOGIN]: Appearance not for {0} {1}. Creating default.", user.FirstName, user.SurName);
409 appearance = new AvatarAppearance(); 409 appearance = new AvatarAppearance(user.ID);
410 } 410 }
411 411
412 ArrayList SendParams = new ArrayList(); 412 ArrayList SendParams = new ArrayList();
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 9144bb9..0caec5b 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -2118,7 +2118,7 @@ namespace OpenSim.Region.Framework.Scenes
2118 if (appearance == null) 2118 if (appearance == null)
2119 { 2119 {
2120 m_log.DebugFormat("[APPEARANCE]: Appearance not found in {0}, returning default", RegionInfo.RegionName); 2120 m_log.DebugFormat("[APPEARANCE]: Appearance not found in {0}, returning default", RegionInfo.RegionName);
2121 appearance = new AvatarAppearance(); 2121 appearance = new AvatarAppearance(client.AgentId);
2122 } 2122 }
2123 2123
2124 } 2124 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 62aae2c..429b615 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -854,7 +854,7 @@ namespace OpenSim.Region.Framework.Scenes
854 { 854 {
855 m_log.ErrorFormat("[SCENE PRESENCE]: null appearance in MakeRoot in {0}", Scene.RegionInfo.RegionName); 855 m_log.ErrorFormat("[SCENE PRESENCE]: null appearance in MakeRoot in {0}", Scene.RegionInfo.RegionName);
856 // emergency; this really shouldn't happen 856 // emergency; this really shouldn't happen
857 m_appearance = new AvatarAppearance(); 857 m_appearance = new AvatarAppearance(UUID);
858 } 858 }
859 859
860 // Don't send an animation pack here, since on a region crossing this will sometimes cause a flying 860 // Don't send an animation pack here, since on a region crossing this will sometimes cause a flying
@@ -2708,15 +2708,19 @@ namespace OpenSim.Region.Framework.Scenes
2708 try 2708 try
2709 { 2709 {
2710 AvatarWearable[] wearables = new AvatarWearable[cAgent.AgentTextures.Length / 2]; 2710 AvatarWearable[] wearables = new AvatarWearable[cAgent.AgentTextures.Length / 2];
2711 Primitive.TextureEntry te = new Primitive.TextureEntry(UUID.Random());
2712 for (uint n = 0; n < cAgent.AgentTextures.Length; n += 2) 2711 for (uint n = 0; n < cAgent.AgentTextures.Length; n += 2)
2713 { 2712 {
2714 UUID itemId = cAgent.AgentTextures[n]; 2713 UUID itemId = cAgent.AgentTextures[n];
2715 UUID assetId = cAgent.AgentTextures[n + 1]; 2714 UUID assetId = cAgent.AgentTextures[n + 1];
2716 wearables[i] = new AvatarWearable(itemId, assetId); 2715 wearables[i++] = new AvatarWearable(itemId, assetId);
2717 te.CreateFace(i++).TextureID = assetId; 2716 //te.CreateFace(i++).TextureID = assetId;
2718 } 2717 }
2719 m_appearance.Wearables = wearables; 2718 m_appearance.Wearables = wearables;
2719
2720 // We're setting it here to default, but the viewer will soon send a SetAppearance that will
2721 // set things straight. We should probably pass these textures too...
2722 Primitive.TextureEntry te = AvatarAppearance.GetDefaultTexture(); //new Primitive.TextureEntry(UUID.Random());
2723
2720 m_appearance.SetAppearance(te.ToBytes(), new List<byte>(cAgent.VisualParams)); 2724 m_appearance.SetAppearance(te.ToBytes(), new List<byte>(cAgent.VisualParams));
2721 } 2725 }
2722 catch (Exception e) 2726 catch (Exception e)