diff options
author | diva | 2009-02-24 23:06:15 +0000 |
---|---|---|
committer | diva | 2009-02-24 23:06:15 +0000 |
commit | e84ac65b58b63ae4af18ab8ebd9a82664ff4ea21 (patch) | |
tree | 5915fc594231d83b3f0700b38e196d313c776723 | |
parent | More work on modulising the User Server. (diff) | |
download | opensim-SC-e84ac65b58b63ae4af18ab8ebd9a82664ff4ea21.zip opensim-SC-e84ac65b58b63ae4af18ab8ebd9a82664ff4ea21.tar.gz opensim-SC-e84ac65b58b63ae4af18ab8ebd9a82664ff4ea21.tar.bz2 opensim-SC-e84ac65b58b63ae4af18ab8ebd9a82664ff4ea21.tar.xz |
Close-to-final tweaking with appearance. This time sending *everything*. Addresses mantis #3223.
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs | 36 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 29 |
2 files changed, 29 insertions, 36 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs b/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs index be3069a..17d3bb9 100644 --- a/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs +++ b/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs | |||
@@ -251,7 +251,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
251 | public UUID GranterID; | 251 | public UUID GranterID; |
252 | 252 | ||
253 | // Appearance | 253 | // Appearance |
254 | public UUID[] AgentTextures; | 254 | public byte[] AgentTextures; |
255 | public byte[] VisualParams; | 255 | public byte[] VisualParams; |
256 | public UUID[] Wearables; | 256 | public UUID[] Wearables; |
257 | 257 | ||
@@ -311,13 +311,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
311 | args["animations"] = anims; | 311 | args["animations"] = anims; |
312 | } | 312 | } |
313 | 313 | ||
314 | //if ((AgentTextures != null) && (AgentTextures.Length > 0)) | ||
315 | //{ | ||
316 | // OSDArray textures = new OSDArray(AgentTextures.Length); | ||
317 | // foreach (UUID uuid in AgentTextures) | ||
318 | // textures.Add(OSD.FromUUID(uuid)); | ||
319 | // args["agent_textures"] = textures; | ||
320 | //} | ||
321 | |||
314 | if ((AgentTextures != null) && (AgentTextures.Length > 0)) | 322 | if ((AgentTextures != null) && (AgentTextures.Length > 0)) |
315 | { | 323 | args["texture_entry"] = OSD.FromBinary(AgentTextures); |
316 | OSDArray textures = new OSDArray(AgentTextures.Length); | ||
317 | foreach (UUID uuid in AgentTextures) | ||
318 | textures.Add(OSD.FromUUID(uuid)); | ||
319 | args["agent_textures"] = textures; | ||
320 | } | ||
321 | 324 | ||
322 | if ((VisualParams != null) && (VisualParams.Length > 0)) | 325 | if ((VisualParams != null) && (VisualParams.Length > 0)) |
323 | args["visual_params"] = OSD.FromBinary(VisualParams); | 326 | args["visual_params"] = OSD.FromBinary(VisualParams); |
@@ -448,14 +451,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
448 | } | 451 | } |
449 | } | 452 | } |
450 | 453 | ||
451 | if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) | 454 | //if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) |
452 | { | 455 | //{ |
453 | OSDArray textures = (OSDArray)(args["agent_textures"]); | 456 | // OSDArray textures = (OSDArray)(args["agent_textures"]); |
454 | AgentTextures = new UUID[textures.Count]; | 457 | // AgentTextures = new UUID[textures.Count]; |
455 | int i = 0; | 458 | // int i = 0; |
456 | foreach (OSD o in textures) | 459 | // foreach (OSD o in textures) |
457 | AgentTextures[i++] = o.AsUUID(); | 460 | // AgentTextures[i++] = o.AsUUID(); |
458 | } | 461 | //} |
462 | |||
463 | if (args["texture_entry"] != null) | ||
464 | AgentTextures = args["texture_entry"].AsBinary(); | ||
459 | 465 | ||
460 | if (args["visual_params"] != null) | 466 | if (args["visual_params"] != null) |
461 | VisualParams = args["visual_params"].AsBinary(); | 467 | VisualParams = args["visual_params"].AsBinary(); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 672567b..6fade39 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -2688,20 +2688,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2688 | 2688 | ||
2689 | cAgent.VisualParams = m_appearance.VisualParams; | 2689 | cAgent.VisualParams = m_appearance.VisualParams; |
2690 | 2690 | ||
2691 | // Textures is not really needed in the base case, I think. But it's handy for | 2691 | if (m_appearance.Texture != null) |
2692 | // the Hypergrid and other decentralized models, so that we know which | 2692 | cAgent.AgentTextures = m_appearance.Texture.ToBytes(); |
2693 | // textures to fecth from the user's asset server. | ||
2694 | i = 0; | ||
2695 | UUID[] textures = new UUID[m_appearance.Texture.FaceTextures.Length]; | ||
2696 | foreach (Primitive.TextureEntryFace face in m_appearance.Texture.FaceTextures) | ||
2697 | { | ||
2698 | if (face != null) | ||
2699 | textures[i] = face.TextureID; | ||
2700 | else | ||
2701 | textures[i] = UUID.Zero; | ||
2702 | ++i; | ||
2703 | } | ||
2704 | cAgent.AgentTextures = textures; | ||
2705 | } | 2693 | } |
2706 | catch (Exception e) | 2694 | catch (Exception e) |
2707 | { | 2695 | { |
@@ -2758,13 +2746,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
2758 | } | 2746 | } |
2759 | m_appearance.Wearables = wears; | 2747 | m_appearance.Wearables = wears; |
2760 | 2748 | ||
2761 | // We're setting it here to default, but the viewer will soon send a SetAppearance that will | 2749 | byte[] te = null; |
2762 | // set things straight. We should probably parse these textures too, we have them... | 2750 | if (cAgent.AgentTextures != null) |
2763 | // In any case, the least we need to do is to check if this is HG and fetch the textures | 2751 | te = cAgent.AgentTextures; |
2764 | // so that they can then be distributed to the other clients that ask for them later. | 2752 | else |
2765 | Primitive.TextureEntry te = AvatarAppearance.GetDefaultTexture(); //new Primitive.TextureEntry(UUID.Random()); | 2753 | te = AvatarAppearance.GetDefaultTexture().ToBytes(); |
2766 | 2754 | m_appearance.SetAppearance(te, new List<byte>(cAgent.VisualParams)); | |
2767 | m_appearance.SetAppearance(te.ToBytes(), new List<byte>(cAgent.VisualParams)); | ||
2768 | } | 2755 | } |
2769 | catch (Exception e) | 2756 | catch (Exception e) |
2770 | { | 2757 | { |