aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs50
1 files changed, 37 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index dd8c719..85437f6 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2646,20 +2646,43 @@ namespace OpenSim.Region.Framework.Scenes
2646 2646
2647 try 2647 try
2648 { 2648 {
2649 // We might not pass the Wearables in all cases...
2650 // They're only needed so that persistent changes to the appearance
2651 // are preserved in the new region where the user is moving to.
2652 // But in Hypergrid we might not let this happen.
2649 int i = 0; 2653 int i = 0;
2650 UUID[] textures = new UUID[m_appearance.Wearables.Length * 2]; 2654 UUID[] wears = new UUID[m_appearance.Wearables.Length * 2];
2651 foreach (AvatarWearable aw in m_appearance.Wearables) 2655 foreach (AvatarWearable aw in m_appearance.Wearables)
2652 { 2656 {
2653 if (aw != null) 2657 if (aw != null)
2654 { 2658 {
2655 textures[i++] = aw.ItemID; 2659 wears[i++] = aw.ItemID;
2656 textures[i++] = aw.AssetID; 2660 wears[i++] = aw.AssetID;
2657 } 2661 }
2658 else 2662 else
2659 m_log.DebugFormat("[SCENE PRESENCE]: Null wearable in CopyTo"); 2663 {
2664 wears[i++] = UUID.Zero;
2665 wears[i++] = UUID.Zero;
2666 }
2660 } 2667 }
2661 cAgent.AgentTextures = textures; 2668 cAgent.Wearables = wears;
2669
2662 cAgent.VisualParams = m_appearance.VisualParams; 2670 cAgent.VisualParams = m_appearance.VisualParams;
2671
2672 // Textures is not really needed in the base case, I think. But it's handy for
2673 // the Hypergrid and other decentralized models, so that we know which
2674 // textures to fecth from the user's asset server.
2675 i = 0;
2676 UUID[] textures = new UUID[m_appearance.Texture.FaceTextures.Length];
2677 foreach (Primitive.TextureEntryFace face in m_appearance.Texture.FaceTextures)
2678 {
2679 if (face != null)
2680 textures[i] = face.TextureID;
2681 else
2682 textures[i] = UUID.Zero;
2683 ++i;
2684 }
2685 cAgent.AgentTextures = textures;
2663 } 2686 }
2664 catch (Exception e) 2687 catch (Exception e)
2665 { 2688 {
@@ -2707,18 +2730,19 @@ namespace OpenSim.Region.Framework.Scenes
2707 uint i = 0; 2730 uint i = 0;
2708 try 2731 try
2709 { 2732 {
2710 AvatarWearable[] wearables = new AvatarWearable[cAgent.AgentTextures.Length / 2]; 2733 AvatarWearable[] wears = new AvatarWearable[cAgent.Wearables.Length / 2];
2711 for (uint n = 0; n < cAgent.AgentTextures.Length; n += 2) 2734 for (uint n = 0; n < cAgent.Wearables.Length; n += 2)
2712 { 2735 {
2713 UUID itemId = cAgent.AgentTextures[n]; 2736 UUID itemId = cAgent.Wearables[n];
2714 UUID assetId = cAgent.AgentTextures[n + 1]; 2737 UUID assetId = cAgent.Wearables[n + 1];
2715 wearables[i++] = new AvatarWearable(itemId, assetId); 2738 wears[i++] = new AvatarWearable(itemId, assetId);
2716 //te.CreateFace(i++).TextureID = assetId;
2717 } 2739 }
2718 m_appearance.Wearables = wearables; 2740 m_appearance.Wearables = wears;
2719 2741
2720 // We're setting it here to default, but the viewer will soon send a SetAppearance that will 2742 // 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... 2743 // set things straight. We should probably parse these textures too, we have them...
2744 // In any case, the least we need to do is to check if this is HG and fetch the textures
2745 // so that they can then be distributed to the other clients that ask for them later.
2722 Primitive.TextureEntry te = AvatarAppearance.GetDefaultTexture(); //new Primitive.TextureEntry(UUID.Random()); 2746 Primitive.TextureEntry te = AvatarAppearance.GetDefaultTexture(); //new Primitive.TextureEntry(UUID.Random());
2723 2747
2724 m_appearance.SetAppearance(te.ToBytes(), new List<byte>(cAgent.VisualParams)); 2748 m_appearance.SetAppearance(te.ToBytes(), new List<byte>(cAgent.VisualParams));