diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/AgentCircuitData.cs | 54 | ||||
-rw-r--r-- | OpenSim/Framework/AvatarAppearance.cs | 15 | ||||
-rw-r--r-- | OpenSim/Framework/ChildAgentDataUpdate.cs | 7 |
3 files changed, 74 insertions, 2 deletions
diff --git a/OpenSim/Framework/AgentCircuitData.cs b/OpenSim/Framework/AgentCircuitData.cs index c0168e2..ad29950 100644 --- a/OpenSim/Framework/AgentCircuitData.cs +++ b/OpenSim/Framework/AgentCircuitData.cs | |||
@@ -155,6 +155,31 @@ namespace OpenSim.Framework | |||
155 | args["secure_session_id"] = OSD.FromUUID(SecureSessionID); | 155 | args["secure_session_id"] = OSD.FromUUID(SecureSessionID); |
156 | args["session_id"] = OSD.FromUUID(SessionID); | 156 | args["session_id"] = OSD.FromUUID(SessionID); |
157 | args["start_pos"] = OSD.FromString(startpos.ToString()); | 157 | args["start_pos"] = OSD.FromString(startpos.ToString()); |
158 | args["appearance_serial"] = OSD.FromInteger(Appearance.Serial); | ||
159 | |||
160 | // We might not pass this in all cases... | ||
161 | if ((Appearance.Wearables != null) && (Appearance.Wearables.Length > 0)) | ||
162 | { | ||
163 | OSDArray wears = new OSDArray(Appearance.Wearables.Length); | ||
164 | foreach (AvatarWearable awear in Appearance.Wearables) | ||
165 | { | ||
166 | wears.Add(OSD.FromUUID(awear.ItemID)); | ||
167 | wears.Add(OSD.FromUUID(awear.AssetID)); | ||
168 | } | ||
169 | args["wearables"] = wears; | ||
170 | } | ||
171 | |||
172 | Dictionary<int, UUID[]> attachments = Appearance.GetAttachmentDictionary(); | ||
173 | if ((attachments != null) && (attachments.Count > 0)) | ||
174 | { | ||
175 | OSDArray attachs = new OSDArray(attachments.Count); | ||
176 | foreach (KeyValuePair<int, UUID[]> kvp in attachments) | ||
177 | { | ||
178 | AttachmentData adata = new AttachmentData(kvp.Key, kvp.Value[0], kvp.Value[1]); | ||
179 | attachs.Add(adata.PackUpdateMessage()); | ||
180 | } | ||
181 | args["attachments"] = attachs; | ||
182 | } | ||
158 | 183 | ||
159 | return args; | 184 | return args; |
160 | } | 185 | } |
@@ -209,8 +234,35 @@ namespace OpenSim.Framework | |||
209 | if (args["session_id"] != null) | 234 | if (args["session_id"] != null) |
210 | SessionID = args["session_id"].AsUUID(); | 235 | SessionID = args["session_id"].AsUUID(); |
211 | if (args["start_pos"] != null) | 236 | if (args["start_pos"] != null) |
212 | Vector3.TryParse(args["start_pos"].AsString(), out startpos); | 237 | Vector3.TryParse(args["start_pos"].AsString(), out startpos); |
213 | 238 | ||
239 | Appearance = new AvatarAppearance(AgentID); | ||
240 | if (args["appearance_serial"] != null) | ||
241 | Appearance.Serial = args["appearance_serial"].AsInteger(); | ||
242 | if ((args["wearables"] != null) && (args["wearables"]).Type == OSDType.Array) | ||
243 | { | ||
244 | OSDArray wears = (OSDArray)(args["wearables"]); | ||
245 | for (int i = 0; i < wears.Count / 2; i++) | ||
246 | { | ||
247 | Appearance.Wearables[i].ItemID = wears[i*2].AsUUID(); | ||
248 | Appearance.Wearables[i].AssetID = wears[(i*2)+1].AsUUID(); | ||
249 | } | ||
250 | } | ||
251 | |||
252 | if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) | ||
253 | { | ||
254 | OSDArray attachs = (OSDArray)(args["attachments"]); | ||
255 | AttachmentData[] attachments = new AttachmentData[attachs.Count]; | ||
256 | int i = 0; | ||
257 | foreach (OSD o in attachs) | ||
258 | { | ||
259 | if (o.Type == OSDType.Map) | ||
260 | { | ||
261 | attachments[i++] = new AttachmentData((OSDMap)o); | ||
262 | } | ||
263 | } | ||
264 | Appearance.SetAttachments(attachments); | ||
265 | } | ||
214 | 266 | ||
215 | } | 267 | } |
216 | } | 268 | } |
diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index 56fcc15..5ec9283 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs | |||
@@ -566,6 +566,16 @@ namespace OpenSim.Framework | |||
566 | 566 | ||
567 | private Dictionary<int, UUID[]> m_attachments = new Dictionary<int, UUID[]>(); | 567 | private Dictionary<int, UUID[]> m_attachments = new Dictionary<int, UUID[]>(); |
568 | 568 | ||
569 | public void SetAttachments(AttachmentData[] data) | ||
570 | { | ||
571 | foreach (AttachmentData a in data) | ||
572 | { | ||
573 | m_attachments[a.AttachPoint] = new UUID[2]; | ||
574 | m_attachments[a.AttachPoint][0] = a.ItemID; | ||
575 | m_attachments[a.AttachPoint][1] = a.AssetID; | ||
576 | } | ||
577 | } | ||
578 | |||
569 | public void SetAttachments(Hashtable data) | 579 | public void SetAttachments(Hashtable data) |
570 | { | 580 | { |
571 | m_attachments.Clear(); | 581 | m_attachments.Clear(); |
@@ -595,6 +605,11 @@ namespace OpenSim.Framework | |||
595 | } | 605 | } |
596 | } | 606 | } |
597 | 607 | ||
608 | public Dictionary<int, UUID[]> GetAttachmentDictionary() | ||
609 | { | ||
610 | return m_attachments; | ||
611 | } | ||
612 | |||
598 | public Hashtable GetAttachments() | 613 | public Hashtable GetAttachments() |
599 | { | 614 | { |
600 | if (m_attachments.Count == 0) | 615 | if (m_attachments.Count == 0) |
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index b6b7996..fee71f0 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -334,6 +334,7 @@ namespace OpenSim.Framework | |||
334 | args["left_axis"] = OSD.FromString(LeftAxis.ToString()); | 334 | args["left_axis"] = OSD.FromString(LeftAxis.ToString()); |
335 | args["up_axis"] = OSD.FromString(UpAxis.ToString()); | 335 | args["up_axis"] = OSD.FromString(UpAxis.ToString()); |
336 | 336 | ||
337 | |||
337 | args["changed_grid"] = OSD.FromBoolean(ChangedGrid); | 338 | args["changed_grid"] = OSD.FromBoolean(ChangedGrid); |
338 | args["far"] = OSD.FromReal(Far); | 339 | args["far"] = OSD.FromReal(Far); |
339 | args["aspect"] = OSD.FromReal(Aspect); | 340 | args["aspect"] = OSD.FromReal(Aspect); |
@@ -353,7 +354,7 @@ namespace OpenSim.Framework | |||
353 | args["agent_access"] = OSD.FromString(AgentAccess.ToString()); | 354 | args["agent_access"] = OSD.FromString(AgentAccess.ToString()); |
354 | 355 | ||
355 | args["active_group_id"] = OSD.FromUUID(ActiveGroupID); | 356 | args["active_group_id"] = OSD.FromUUID(ActiveGroupID); |
356 | 357 | ||
357 | if ((Groups != null) && (Groups.Length > 0)) | 358 | if ((Groups != null) && (Groups.Length > 0)) |
358 | { | 359 | { |
359 | OSDArray groups = new OSDArray(Groups.Length); | 360 | OSDArray groups = new OSDArray(Groups.Length); |
@@ -378,6 +379,7 @@ namespace OpenSim.Framework | |||
378 | // args["agent_textures"] = textures; | 379 | // args["agent_textures"] = textures; |
379 | //} | 380 | //} |
380 | 381 | ||
382 | |||
381 | if ((AgentTextures != null) && (AgentTextures.Length > 0)) | 383 | if ((AgentTextures != null) && (AgentTextures.Length > 0)) |
382 | args["texture_entry"] = OSD.FromBinary(AgentTextures); | 384 | args["texture_entry"] = OSD.FromBinary(AgentTextures); |
383 | 385 | ||
@@ -393,6 +395,7 @@ namespace OpenSim.Framework | |||
393 | args["wearables"] = wears; | 395 | args["wearables"] = wears; |
394 | } | 396 | } |
395 | 397 | ||
398 | |||
396 | if ((Attachments != null) && (Attachments.Length > 0)) | 399 | if ((Attachments != null) && (Attachments.Length > 0)) |
397 | { | 400 | { |
398 | OSDArray attachs = new OSDArray(Attachments.Length); | 401 | OSDArray attachs = new OSDArray(Attachments.Length); |
@@ -401,9 +404,11 @@ namespace OpenSim.Framework | |||
401 | args["attachments"] = attachs; | 404 | args["attachments"] = attachs; |
402 | } | 405 | } |
403 | 406 | ||
407 | |||
404 | if ((CallbackURI != null) && (!CallbackURI.Equals(""))) | 408 | if ((CallbackURI != null) && (!CallbackURI.Equals(""))) |
405 | args["callback_uri"] = OSD.FromString(CallbackURI); | 409 | args["callback_uri"] = OSD.FromString(CallbackURI); |
406 | 410 | ||
411 | |||
407 | return args; | 412 | return args; |
408 | } | 413 | } |
409 | 414 | ||