diff options
Diffstat (limited to 'OpenSim/Framework/AgentCircuitData.cs')
-rw-r--r-- | OpenSim/Framework/AgentCircuitData.cs | 66 |
1 files changed, 31 insertions, 35 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index be98380..640a646 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 | ||
@@ -368,26 +351,39 @@ namespace OpenSim.Framework | |||
368 | OSDArray wears = (OSDArray)(args["wearables"]); | 351 | OSDArray wears = (OSDArray)(args["wearables"]); |
369 | for (int i = 0; i < wears.Count / 2; i++) | 352 | for (int i = 0; i < wears.Count / 2; i++) |
370 | { | 353 | { |
371 | Appearance.Wearables[i].ItemID = wears[i*2].AsUUID(); | 354 | AvatarWearable awear = new AvatarWearable(wears[i*2].AsUUID(),wears[(i*2)+1].AsUUID()); |
372 | Appearance.Wearables[i].AssetID = wears[(i*2)+1].AsUUID(); | 355 | Appearance.SetWearable(i,awear); |
373 | } | 356 | } |
374 | } | 357 | } |
375 | 358 | ||
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.ContainsKey("packed_appearance") && (args["packed_appearance"].Type == OSDType.Map)) | ||
372 | { | ||
373 | Appearance.Unpack((OSDMap)args["packed_appearance"]); | ||
374 | // DEBUG ON | ||
375 | m_log.WarnFormat("[AGENTCIRCUITDATA] unpacked appearance"); | ||
376 | // DEBUG OFF | ||
377 | } | ||
378 | // DEBUG ON | ||
379 | else | ||
380 | m_log.Warn("[AGENTCIRCUITDATA] failed to find a valid packed_appearance"); | ||
381 | // DEBUG OFF | ||
382 | } catch (Exception e) | ||
383 | { | ||
384 | m_log.ErrorFormat("[AGENTCIRCUITDATA] failed to unpack appearance; {0}",e.Message); | ||
385 | } | ||
386 | |||
391 | ServiceURLs = new Dictionary<string, object>(); | 387 | ServiceURLs = new Dictionary<string, object>(); |
392 | if (args.ContainsKey("service_urls") && args["service_urls"] != null && (args["service_urls"]).Type == OSDType.Array) | 388 | if (args.ContainsKey("service_urls") && args["service_urls"] != null && (args["service_urls"]).Type == OSDType.Array) |
393 | { | 389 | { |