aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie Thielker2010-07-11 14:26:57 +0200
committerMelanie Thielker2010-07-11 14:26:57 +0200
commit7f0f11304f0979355d75538ab7326b687b62e76e (patch)
tree8052972a9b15d07364a80b33baf74c86092ac791 /OpenSim
parentMerge branch 'master' into careminster-presence-refactor (diff)
downloadopensim-SC_OLD-7f0f11304f0979355d75538ab7326b687b62e76e.zip
opensim-SC_OLD-7f0f11304f0979355d75538ab7326b687b62e76e.tar.gz
opensim-SC_OLD-7f0f11304f0979355d75538ab7326b687b62e76e.tar.bz2
opensim-SC_OLD-7f0f11304f0979355d75538ab7326b687b62e76e.tar.xz
Add scripted controllers into agent intersim messaging
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/ChildAgentDataUpdate.cs65
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs33
3 files changed, 102 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 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index b552cdc..e87766e 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -4145,6 +4145,10 @@ namespace OpenSim.Region.Framework.Scenes
4145 case 16: 4145 case 16:
4146 _nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) & 4146 _nextOwnerMask = ApplyMask(_nextOwnerMask, set, mask) &
4147 baseMask; 4147 baseMask;
4148 // Prevent the client from creating no mod, no copy
4149 // objects
4150 if ((_nextOwnerMask & (uint)PermissionMask.Copy) == 0)
4151 _nextOwnerMask |= (uint)PermissionMask.Transfer;
4148 break; 4152 break;
4149 } 4153 }
4150 SendFullUpdateToAllClients(); 4154 SendFullUpdateToAllClients();
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 5ac7755..efe3365 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3365,6 +3365,18 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
3365 cAgent.Attachments = attachs; 3365 cAgent.Attachments = attachs;
3366 } 3366 }
3367 3367
3368 lock (scriptedcontrols)
3369 {
3370 ControllerData[] controls = new ControllerData[scriptedcontrols.Count];
3371 int i = 0;
3372
3373 foreach (ScriptControllers c in scriptedcontrols.Values)
3374 {
3375 controls[i++] = new ControllerData(c.itemID, (uint)c.ignoreControls, (uint)c.eventControls);
3376 }
3377 cAgent.Controllers = controls;
3378 }
3379
3368 // Animations 3380 // Animations
3369 try 3381 try
3370 { 3382 {
@@ -3446,6 +3458,27 @@ Console.WriteLine("Scripted Sit ofset {0}", m_pos);
3446 } 3458 }
3447 catch { } 3459 catch { }
3448 3460
3461 try
3462 {
3463 lock (scriptedcontrols)
3464 {
3465 if (cAgent.Controllers != null)
3466 {
3467 scriptedcontrols.Clear();
3468
3469 foreach (ControllerData c in cAgent.Controllers)
3470 {
3471 ScriptControllers sc = new ScriptControllers();
3472 sc.itemID = c.ItemID;
3473 sc.ignoreControls = (ScriptControlled)c.IgnoreControls;
3474 sc.eventControls = (ScriptControlled)c.EventControls;
3475
3476 scriptedcontrols[sc.itemID] = sc;
3477 }
3478 }
3479 }
3480 }
3481 catch { }
3449 // Animations 3482 // Animations
3450 try 3483 try
3451 { 3484 {