aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/AgentCircuitData.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Framework/AgentCircuitData.cs')
-rw-r--r--OpenSim/Framework/AgentCircuitData.cs65
1 files changed, 32 insertions, 33 deletions
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
206 206
207 args["service_session_id"] = OSD.FromString(ServiceSessionID); 207 args["service_session_id"] = OSD.FromString(ServiceSessionID);
208 args["start_pos"] = OSD.FromString(startpos.ToString()); 208 args["start_pos"] = OSD.FromString(startpos.ToString());
209 args["appearance_serial"] = OSD.FromInteger(Appearance.Serial);
210 args["client_ip"] = OSD.FromString(IPAddress); 209 args["client_ip"] = OSD.FromString(IPAddress);
211 args["viewer"] = OSD.FromString(Viewer); 210 args["viewer"] = OSD.FromString(Viewer);
212 args["channel"] = OSD.FromString(Channel); 211 args["channel"] = OSD.FromString(Channel);
213 args["mac"] = OSD.FromString(Mac); 212 args["mac"] = OSD.FromString(Mac);
214 args["id0"] = OSD.FromString(Id0); 213 args["id0"] = OSD.FromString(Id0);
215 214
216/* 215 // Eventually this code should be deprecated, use full appearance
216 // packing in packed_appearance
217 if (Appearance != null) 217 if (Appearance != null)
218 { 218 {
219 args["appearance_serial"] = OSD.FromInteger(Appearance.Serial);
220
219 //System.Console.WriteLine("XXX Before packing Wearables"); 221 //System.Console.WriteLine("XXX Before packing Wearables");
220 if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0)) 222 if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0))
221 { 223 {
@@ -230,20 +232,19 @@ namespace OpenSim.Framework
230 } 232 }
231 233
232 //System.Console.WriteLine("XXX Before packing Attachments"); 234 //System.Console.WriteLine("XXX Before packing Attachments");
233 Dictionary<int, AvatarAttachment> attachments = Appearance.Attachments; 235 List<AvatarAttachment> attachments = Appearance.GetAttachments();
234 if ((attachments != null) && (attachments.Count > 0)) 236 if ((attachments != null) && (attachments.Count > 0))
235 { 237 {
236 OSDArray attachs = new OSDArray(attachments.Count); 238 OSDArray attachs = new OSDArray(attachments.Count);
237 foreach (KeyValuePair<int, AvatarAttachment> kvp in attachments) 239 foreach (AvatarAttachment attach in attachments)
238 { 240 {
239 AvatarAttachment adata = new AvatarAttachment(kvp.Value); 241 attachs.Add(attach.Pack());
240 attachs.Add(adata.Pack());
241 //System.Console.WriteLine("XXX att.pt=" + kvp.Key + "; itemID=" + kvp.Value[0] + "; assetID=" + kvp.Value[1]); 242 //System.Console.WriteLine("XXX att.pt=" + kvp.Key + "; itemID=" + kvp.Value[0] + "; assetID=" + kvp.Value[1]);
242 } 243 }
243 args["attachments"] = attachs; 244 args["attachments"] = attachs;
244 } 245 }
245 } 246 }
246*/ 247
247 if (Appearance != null) 248 if (Appearance != null)
248 { 249 {
249 OSDMap appmap = Appearance.Pack(); 250 OSDMap appmap = Appearance.Pack();
@@ -339,27 +340,9 @@ namespace OpenSim.Framework
339 try { 340 try {
340 // Unpack various appearance elements 341 // Unpack various appearance elements
341 Appearance = new AvatarAppearance(AgentID); 342 Appearance = new AvatarAppearance(AgentID);
342 if (args["packed_appearance"] != null) 343
343 { 344 // Eventually this code should be deprecated, use full appearance
344 if (args["packed_appearance"].Type == OSDType.Map) 345 // packing in packed_appearance
345 {
346 Appearance.Unpack((OSDMap)args["packed_appearance"]);
347 m_log.WarnFormat("[AGENTCIRCUITDATA] unpacked appearance");
348 }
349 else
350 m_log.WarnFormat("[AGENTCIRCUITDATA] packed_appearance is not a map:\n{0}",args["packed_appearance"].ToString());
351 }
352// DEBUG ON
353 else
354 m_log.Warn("[AGENTCIRCUITDATA] failed to find a valid packed_appearance");
355// DEBUG OFF
356 } catch (Exception e)
357 {
358 m_log.ErrorFormat("[AGENTCIRCUITDATA] failed to unpack appearance; {0}",e.Message);
359 }
360
361
362/*
363 if (args["appearance_serial"] != null) 346 if (args["appearance_serial"] != null)
364 Appearance.Serial = args["appearance_serial"].AsInteger(); 347 Appearance.Serial = args["appearance_serial"].AsInteger();
365 348
@@ -376,18 +359,34 @@ namespace OpenSim.Framework
376 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) 359 if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array)
377 { 360 {
378 OSDArray attachs = (OSDArray)(args["attachments"]); 361 OSDArray attachs = (OSDArray)(args["attachments"]);
379 AvatarAttachment[] attachments = new AvatarAttachment[attachs.Count];
380 int i = 0;
381 foreach (OSD o in attachs) 362 foreach (OSD o in attachs)
382 { 363 {
383 if (o.Type == OSDType.Map) 364 if (o.Type == OSDType.Map)
384 { 365 {
385 attachments[i++] = new AvatarAttachment((OSDMap)o); 366 Appearance.AppendAttachment(new AvatarAttachment((OSDMap)o));
386 } 367 }
387 } 368 }
388 Appearance.SetAttachments(attachments);
389 } 369 }
390*/ 370
371 if (args["packed_appearance"] != null)
372 {
373 if (args["packed_appearance"].Type == OSDType.Map)
374 {
375 Appearance.Unpack((OSDMap)args["packed_appearance"]);
376 m_log.WarnFormat("[AGENTCIRCUITDATA] unpacked appearance");
377 }
378 else
379 m_log.WarnFormat("[AGENTCIRCUITDATA] packed_appearance is not a map:\n{0}",args["packed_appearance"].ToString());
380 }
381// DEBUG ON
382 else
383 m_log.Warn("[AGENTCIRCUITDATA] failed to find a valid packed_appearance");
384// DEBUG OFF
385 } catch (Exception e)
386 {
387 m_log.ErrorFormat("[AGENTCIRCUITDATA] failed to unpack appearance; {0}",e.Message);
388 }
389
391 ServiceURLs = new Dictionary<string, object>(); 390 ServiceURLs = new Dictionary<string, object>();
392 if (args.ContainsKey("service_urls") && args["service_urls"] != null && (args["service_urls"]).Type == OSDType.Array) 391 if (args.ContainsKey("service_urls") && args["service_urls"] != null && (args["service_urls"]).Type == OSDType.Array)
393 { 392 {