From 20eb8e54ac511b5e8988cb3c3701c824b41170c4 Mon Sep 17 00:00:00 2001 From: diva Date: Mon, 23 Feb 2009 00:51:31 +0000 Subject: A little bit more tweaking with appearance. Now passing both the wearables and the textures referred to in the Texture faces of AvatarAppearance. The textures are still not being acted upon on the other side, but they will. Note: will make avies coming from older sims casper or grey. Upgrade! Related to mantis #3204. --- .../Framework/Scenes/ChildAgentDataUpdate.cs | 91 +++++++++------------- 1 file changed, 38 insertions(+), 53 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs') diff --git a/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs b/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs index 38eceb1..be3069a 100644 --- a/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs +++ b/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs @@ -207,39 +207,6 @@ namespace OpenSim.Region.Framework.Scenes } } - //public class AgentAnimationData - //{ - // public UUID Animation; - // public UUID ObjectID; - - // public AgentAnimationData(UUID anim, UUID obj) - // { - // Animation = anim; - // ObjectID = obj; - // } - - // public AgentAnimationData(OSDMap args) - // { - // UnpackUpdateMessage(args); - // } - - // public OSDMap PackUpdateMessage() - // { - // OSDMap anim = new OSDMap(); - // anim["animation"] = OSD.FromUUID(Animation); - // anim["object_id"] = OSD.FromUUID(ObjectID); - // return anim; - // } - - // public void UnpackUpdateMessage(OSDMap args) - // { - // if (args["animation"] != null) - // Animation = args["animation"].AsUUID(); - // if (args["object_id"] != null) - // ObjectID = args["object_id"].AsUUID(); - // } - //} - public class AgentData : IAgentData { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -276,16 +243,17 @@ namespace OpenSim.Region.Framework.Scenes public bool AlwaysRun; public UUID PreyAgent; public Byte AgentAccess; - public UUID[] AgentTextures; public UUID ActiveGroupID; public AgentGroupData[] Groups; public Animation[] Anims; public UUID GranterID; - public Dictionary NVPairs; + // Appearance + public UUID[] AgentTextures; public byte[] VisualParams; + public UUID[] Wearables; public string CallbackURI; @@ -325,14 +293,6 @@ namespace OpenSim.Region.Framework.Scenes args["prey_agent"] = OSD.FromUUID(PreyAgent); args["agent_access"] = OSD.FromString(AgentAccess.ToString()); - if ((AgentTextures != null) && (AgentTextures.Length > 0)) - { - OSDArray textures = new OSDArray(AgentTextures.Length); - foreach (UUID uuid in AgentTextures) - textures.Add(OSD.FromUUID(uuid)); - args["agent_textures"] = textures; - } - args["active_group_id"] = OSD.FromUUID(ActiveGroupID); if ((Groups != null) && (Groups.Length > 0)) @@ -351,10 +311,26 @@ namespace OpenSim.Region.Framework.Scenes args["animations"] = anims; } + if ((AgentTextures != null) && (AgentTextures.Length > 0)) + { + OSDArray textures = new OSDArray(AgentTextures.Length); + foreach (UUID uuid in AgentTextures) + textures.Add(OSD.FromUUID(uuid)); + args["agent_textures"] = textures; + } + if ((VisualParams != null) && (VisualParams.Length > 0)) args["visual_params"] = OSD.FromBinary(VisualParams); - // Last few fields are still missing: granter and NVPais + // We might not pass this in all cases... + if ((Wearables != null) && (Wearables.Length > 0)) + { + OSDArray wears = new OSDArray(Wearables.Length); + foreach (UUID uuid in Wearables) + wears.Add(OSD.FromUUID(uuid)); + args["wearables"] = wears; + } + if ((CallbackURI != null) && (!CallbackURI.Equals(""))) args["callback_uri"] = OSD.FromString(CallbackURI); @@ -441,15 +417,6 @@ namespace OpenSim.Region.Framework.Scenes if (args["agent_access"] != null) Byte.TryParse(args["agent_access"].AsString(), out AgentAccess); - if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) - { - OSDArray textures = (OSDArray)(args["agent_textures"]); - AgentTextures = new UUID[textures.Count]; - int i = 0; - foreach (OSD o in textures) - AgentTextures[i++] = o.AsUUID(); - } - if (args["active_group_id"] != null) ActiveGroupID = args["active_group_id"].AsUUID(); @@ -481,9 +448,27 @@ namespace OpenSim.Region.Framework.Scenes } } + if ((args["agent_textures"] != null) && (args["agent_textures"]).Type == OSDType.Array) + { + OSDArray textures = (OSDArray)(args["agent_textures"]); + AgentTextures = new UUID[textures.Count]; + int i = 0; + foreach (OSD o in textures) + AgentTextures[i++] = o.AsUUID(); + } + if (args["visual_params"] != null) VisualParams = args["visual_params"].AsBinary(); + if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) + { + OSDArray wears = (OSDArray)(args["wearables"]); + Wearables = new UUID[wears.Count]; + int i = 0; + foreach (OSD o in wears) + Wearables[i++] = o.AsUUID(); + } + if (args["callback_uri"] != null) CallbackURI = args["callback_uri"].AsString(); } -- cgit v1.1