aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/ChildAgentDataUpdate.cs
diff options
context:
space:
mode:
authorMelanie Thielker2010-07-11 14:26:57 +0200
committerMelanie2010-07-11 14:50:14 +0100
commit26621ca500a43918b589cff13c9c3ab41f16a8a2 (patch)
treecf72a50e306385019c80950140e586c8a80b3b38 /OpenSim/Framework/ChildAgentDataUpdate.cs
parentRemove localID from script controls data. It won't transfer to another (diff)
downloadopensim-SC-26621ca500a43918b589cff13c9c3ab41f16a8a2.zip
opensim-SC-26621ca500a43918b589cff13c9c3ab41f16a8a2.tar.gz
opensim-SC-26621ca500a43918b589cff13c9c3ab41f16a8a2.tar.bz2
opensim-SC-26621ca500a43918b589cff13c9c3ab41f16a8a2.tar.xz
Add scripted controllers into agent intersim messaging
Diffstat (limited to 'OpenSim/Framework/ChildAgentDataUpdate.cs')
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs65
1 files changed, 65 insertions, 0 deletions
diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs
index a1ac84c..89ee39c 100644
--- a/OpenSim/Framework/ChildAgentDataUpdate.cs
+++ b/OpenSim/Framework/ChildAgentDataUpdate.cs
@@ -265,6 +265,46 @@ namespace OpenSim.Framework
265 } 265 }
266 } 266 }
267 267
268 public class ControllerData
269 {
270 public UUID ItemID;
271 public uint IgnoreControls;
272 public uint EventControls;
273
274 public ControllerData(UUID item, uint ignore, uint ev)
275 {
276 ItemID = item;
277 IgnoreControls = ignore;
278 EventControls = ev;
279 }
280
281 public ControllerData(OSDMap args)
282 {
283 UnpackUpdateMessage(args);
284 }
285
286 public OSDMap PackUpdateMessage()
287 {
288 OSDMap controldata = new OSDMap();
289 controldata["item"] = OSD.FromUUID(ItemID);
290 controldata["ignore"] = OSD.FromInteger(IgnoreControls);
291 controldata["event"] = OSD.FromInteger(EventControls);
292
293 return controldata;
294 }
295
296
297 public void UnpackUpdateMessage(OSDMap args)
298 {
299 if (args["item"] != null)
300 ItemID = args["item"].AsUUID();
301 if (args["ignore"] != null)
302 IgnoreControls = (uint)args["ignore"].AsInteger();
303 if (args["event"] != null)
304 EventControls = (uint)args["event"].AsInteger();
305 }
306 }
307
268 public class AgentData : IAgentData 308 public class AgentData : IAgentData
269 { 309 {
270 private UUID m_id; 310 private UUID m_id;
@@ -313,6 +353,9 @@ namespace OpenSim.Framework
313 public UUID[] Wearables; 353 public UUID[] Wearables;
314 public AttachmentData[] Attachments; 354 public AttachmentData[] Attachments;
315 355
356 // Scripted
357 public ControllerData[] Controllers;
358
316 public string CallbackURI; 359 public string CallbackURI;
317 360
318 public virtual OSDMap Pack() 361 public virtual OSDMap Pack()
@@ -403,6 +446,14 @@ namespace OpenSim.Framework
403 args["attachments"] = attachs; 446 args["attachments"] = attachs;
404 } 447 }
405 448
449 if ((Controllers != null) && (Controllers.Length > 0))
450 {
451 OSDArray controls = new OSDArray(Controllers.Length);
452 foreach (ControllerData ctl in Controllers)
453 controls.Add(ctl.PackUpdateMessage());
454 args["controllers"] = controls;
455 }
456
406 457
407 if ((CallbackURI != null) && (!CallbackURI.Equals(""))) 458 if ((CallbackURI != null) && (!CallbackURI.Equals("")))
408 args["callback_uri"] = OSD.FromString(CallbackURI); 459 args["callback_uri"] = OSD.FromString(CallbackURI);
@@ -559,6 +610,20 @@ namespace OpenSim.Framework
559 } 610 }
560 } 611 }
561 612
613 if ((args["controllers"] != null) && (args["controllers"]).Type == OSDType.Array)
614 {
615 OSDArray controls = (OSDArray)(args["controllers"]);
616 Controllers = new ControllerData[controls.Count];
617 int i = 0;
618 foreach (OSD o in controls)
619 {
620 if (o.Type == OSDType.Map)
621 {
622 Controllers[i++] = new ControllerData((OSDMap)o);
623 }
624 }
625 }
626
562 if (args["callback_uri"] != null) 627 if (args["callback_uri"] != null)
563 CallbackURI = args["callback_uri"].AsString(); 628 CallbackURI = args["callback_uri"].AsString();
564 } 629 }