From 657cceb8847f94a9af0c8b2358124105d778486c Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Mon, 25 Oct 2010 09:41:08 -0700 Subject: Intermediate commit for backward compatability; does not compile yet --- OpenSim/Framework/AgentCircuitData.cs | 65 +++++++++++++++++------------------ 1 file changed, 32 insertions(+), 33 deletions(-) (limited to 'OpenSim/Framework/AgentCircuitData.cs') diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index be98380..30a9548 100644 --- a/OpenSim/Framework/AgentCircuitData.cs +++ b/OpenSim/Framework/AgentCircuitData.cs @@ -206,16 +206,18 @@ namespace OpenSim.Framework args["service_session_id"] = OSD.FromString(ServiceSessionID); args["start_pos"] = OSD.FromString(startpos.ToString()); - args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); args["client_ip"] = OSD.FromString(IPAddress); args["viewer"] = OSD.FromString(Viewer); args["channel"] = OSD.FromString(Channel); args["mac"] = OSD.FromString(Mac); args["id0"] = OSD.FromString(Id0); -/* + // Eventually this code should be deprecated, use full appearance + // packing in packed_appearance if (Appearance != null) { + args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); + //System.Console.WriteLine("XXX Before packing Wearables"); if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0)) { @@ -230,20 +232,19 @@ namespace OpenSim.Framework } //System.Console.WriteLine("XXX Before packing Attachments"); - Dictionary attachments = Appearance.Attachments; + List attachments = Appearance.GetAttachments(); if ((attachments != null) && (attachments.Count > 0)) { OSDArray attachs = new OSDArray(attachments.Count); - foreach (KeyValuePair kvp in attachments) + foreach (AvatarAttachment attach in attachments) { - AvatarAttachment adata = new AvatarAttachment(kvp.Value); - attachs.Add(adata.Pack()); + attachs.Add(attach.Pack()); //System.Console.WriteLine("XXX att.pt=" + kvp.Key + "; itemID=" + kvp.Value[0] + "; assetID=" + kvp.Value[1]); } args["attachments"] = attachs; } } -*/ + if (Appearance != null) { OSDMap appmap = Appearance.Pack(); @@ -339,27 +340,9 @@ namespace OpenSim.Framework try { // Unpack various appearance elements Appearance = new AvatarAppearance(AgentID); - if (args["packed_appearance"] != null) - { - if (args["packed_appearance"].Type == OSDType.Map) - { - Appearance.Unpack((OSDMap)args["packed_appearance"]); - m_log.WarnFormat("[AGENTCIRCUITDATA] unpacked appearance"); - } - else - m_log.WarnFormat("[AGENTCIRCUITDATA] packed_appearance is not a map:\n{0}",args["packed_appearance"].ToString()); - } -// DEBUG ON - else - m_log.Warn("[AGENTCIRCUITDATA] failed to find a valid packed_appearance"); -// DEBUG OFF - } catch (Exception e) - { - m_log.ErrorFormat("[AGENTCIRCUITDATA] failed to unpack appearance; {0}",e.Message); - } - - -/* + + // Eventually this code should be deprecated, use full appearance + // packing in packed_appearance if (args["appearance_serial"] != null) Appearance.Serial = args["appearance_serial"].AsInteger(); @@ -376,18 +359,34 @@ namespace OpenSim.Framework if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) { OSDArray attachs = (OSDArray)(args["attachments"]); - AvatarAttachment[] attachments = new AvatarAttachment[attachs.Count]; - int i = 0; foreach (OSD o in attachs) { if (o.Type == OSDType.Map) { - attachments[i++] = new AvatarAttachment((OSDMap)o); + Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o)); } } - Appearance.SetAttachments(attachments); } -*/ + + if (args["packed_appearance"] != null) + { + if (args["packed_appearance"].Type == OSDType.Map) + { + Appearance.Unpack((OSDMap)args["packed_appearance"]); + m_log.WarnFormat("[AGENTCIRCUITDATA] unpacked appearance"); + } + else + m_log.WarnFormat("[AGENTCIRCUITDATA] packed_appearance is not a map:\n{0}",args["packed_appearance"].ToString()); + } +// DEBUG ON + else + m_log.Warn("[AGENTCIRCUITDATA] failed to find a valid packed_appearance"); +// DEBUG OFF + } catch (Exception e) + { + m_log.ErrorFormat("[AGENTCIRCUITDATA] failed to unpack appearance; {0}",e.Message); + } + ServiceURLs = new Dictionary(); if (args.ContainsKey("service_urls") && args["service_urls"] != null && (args["service_urls"]).Type == OSDType.Array) { -- cgit v1.1