diff options
author | Diva Canto | 2009-08-16 16:17:19 -0700 |
---|---|---|
committer | Diva Canto | 2009-08-16 16:17:19 -0700 |
commit | e02062051d38e56ec22952e25a558039b5e54ab3 (patch) | |
tree | 5736388c72743843fd208cc30c5785898dd7b906 /OpenSim/Framework/ChildAgentDataUpdate.cs | |
parent | Merge branch 'master' of ssh://diva@opensimulator.org/var/git/opensim into in... (diff) | |
download | opensim-SC-e02062051d38e56ec22952e25a558039b5e54ab3.zip opensim-SC-e02062051d38e56ec22952e25a558039b5e54ab3.tar.gz opensim-SC-e02062051d38e56ec22952e25a558039b5e54ab3.tar.bz2 opensim-SC-e02062051d38e56ec22952e25a558039b5e54ab3.tar.xz |
Making attachments work again. Tons of debug more. This needs more testing and a lot of cleaning.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/ChildAgentDataUpdate.cs | 64 |
1 files changed, 63 insertions, 1 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index aacd127..825ab81 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs | |||
@@ -226,6 +226,46 @@ namespace OpenSim.Framework | |||
226 | } | 226 | } |
227 | } | 227 | } |
228 | 228 | ||
229 | public class AttachmentData | ||
230 | { | ||
231 | public int AttachPoint; | ||
232 | public UUID ItemID; | ||
233 | public UUID AssetID; | ||
234 | |||
235 | public AttachmentData(int point, UUID item, UUID asset) | ||
236 | { | ||
237 | AttachPoint = point; | ||
238 | ItemID = item; | ||
239 | AssetID = asset; | ||
240 | } | ||
241 | |||
242 | public AttachmentData(OSDMap args) | ||
243 | { | ||
244 | UnpackUpdateMessage(args); | ||
245 | } | ||
246 | |||
247 | public OSDMap PackUpdateMessage() | ||
248 | { | ||
249 | OSDMap attachdata = new OSDMap(); | ||
250 | attachdata["point"] = OSD.FromInteger(AttachPoint); | ||
251 | attachdata["item"] = OSD.FromUUID(ItemID); | ||
252 | attachdata["asset"] = OSD.FromUUID(AssetID); | ||
253 | |||
254 | return attachdata; | ||
255 | } | ||
256 | |||
257 | |||
258 | public void UnpackUpdateMessage(OSDMap args) | ||
259 | { | ||
260 | if (args["point"] != null) | ||
261 | AttachPoint = args["point"].AsInteger(); | ||
262 | if (args["item"] != null) | ||
263 | ItemID = args["item"].AsUUID(); | ||
264 | if (args["asset"] != null) | ||
265 | AssetID = args["asset"].AsUUID(); | ||
266 | } | ||
267 | } | ||
268 | |||
229 | public class AgentData : IAgentData | 269 | public class AgentData : IAgentData |
230 | { | 270 | { |
231 | private UUID m_id; | 271 | private UUID m_id; |
@@ -272,6 +312,7 @@ namespace OpenSim.Framework | |||
272 | public byte[] AgentTextures; | 312 | public byte[] AgentTextures; |
273 | public byte[] VisualParams; | 313 | public byte[] VisualParams; |
274 | public UUID[] Wearables; | 314 | public UUID[] Wearables; |
315 | public AttachmentData[] Attachments; | ||
275 | 316 | ||
276 | public string CallbackURI; | 317 | public string CallbackURI; |
277 | 318 | ||
@@ -352,6 +393,13 @@ namespace OpenSim.Framework | |||
352 | args["wearables"] = wears; | 393 | args["wearables"] = wears; |
353 | } | 394 | } |
354 | 395 | ||
396 | if ((Attachments != null) && (Attachments.Length > 0)) | ||
397 | { | ||
398 | OSDArray attachs = new OSDArray(Attachments.Length); | ||
399 | foreach (AttachmentData att in Attachments) | ||
400 | attachs.Add(att.PackUpdateMessage()); | ||
401 | args["attachments"] = attachs; | ||
402 | } | ||
355 | 403 | ||
356 | if ((CallbackURI != null) && (!CallbackURI.Equals(""))) | 404 | if ((CallbackURI != null) && (!CallbackURI.Equals(""))) |
357 | args["callback_uri"] = OSD.FromString(CallbackURI); | 405 | args["callback_uri"] = OSD.FromString(CallbackURI); |
@@ -492,7 +540,21 @@ namespace OpenSim.Framework | |||
492 | foreach (OSD o in wears) | 540 | foreach (OSD o in wears) |
493 | Wearables[i++] = o.AsUUID(); | 541 | Wearables[i++] = o.AsUUID(); |
494 | } | 542 | } |
495 | 543 | ||
544 | if ((args["attachments"] != null) && (args["attachments"]).Type == OSDType.Array) | ||
545 | { | ||
546 | OSDArray attachs = (OSDArray)(args["attachments"]); | ||
547 | Attachments = new AttachmentData[attachs.Count]; | ||
548 | int i = 0; | ||
549 | foreach (OSD o in attachs) | ||
550 | { | ||
551 | if (o.Type == OSDType.Map) | ||
552 | { | ||
553 | Attachments[i++] = new AttachmentData((OSDMap)o); | ||
554 | } | ||
555 | } | ||
556 | } | ||
557 | |||
496 | if (args["callback_uri"] != null) | 558 | if (args["callback_uri"] != null) |
497 | CallbackURI = args["callback_uri"].AsString(); | 559 | CallbackURI = args["callback_uri"].AsString(); |
498 | } | 560 | } |