aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs37
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs26
5 files changed, 30 insertions, 58 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 53f0f2e..245f258 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -82,16 +82,9 @@ namespace OpenSim.Region.Framework.Scenes
82 m_log.Info("[PRIM INVENTORY]: Starting scripts in scene"); 82 m_log.Info("[PRIM INVENTORY]: Starting scripts in scene");
83 83
84 IScriptModule[] engines = RequestModuleInterfaces<IScriptModule>(); 84 IScriptModule[] engines = RequestModuleInterfaces<IScriptModule>();
85 if (engines != null) 85
86 { 86 foreach (IScriptModule engine in engines)
87 foreach (IScriptModule engine in engines) 87 engine.StartProcessing();
88 {
89 if (engine != null)
90 {
91 engine.StartProcessing();
92 }
93 }
94 }
95 } 88 }
96 89
97 public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item) 90 public void AddUploadedInventoryItem(UUID agentID, InventoryItemBase item)
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index 73e9392..0fd5164 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -451,7 +451,7 @@ namespace OpenSim.Region.Framework.Scenes
451 } 451 }
452 else 452 else
453 { 453 {
454 return new T[] { default(T) }; 454 return new T[] {};
455 } 455 }
456 } 456 }
457 457
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index e214f57..11040b7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -252,7 +252,6 @@ namespace OpenSim.Region.Framework.Scenes
252 private byte[] m_TextureAnimation; 252 private byte[] m_TextureAnimation;
253 private byte m_clickAction; 253 private byte m_clickAction;
254 private Color m_color = Color.Black; 254 private Color m_color = Color.Black;
255 private string m_description = String.Empty;
256 private readonly List<uint> m_lastColliders = new List<uint>(); 255 private readonly List<uint> m_lastColliders = new List<uint>();
257 private int m_linkNum; 256 private int m_linkNum;
258 257
@@ -331,11 +330,14 @@ namespace OpenSim.Region.Framework.Scenes
331 /// </summary> 330 /// </summary>
332 public SceneObjectPart() 331 public SceneObjectPart()
333 { 332 {
334 // It's not necessary to persist this
335 m_TextureAnimation = Utils.EmptyBytes; 333 m_TextureAnimation = Utils.EmptyBytes;
336 m_particleSystem = Utils.EmptyBytes; 334 m_particleSystem = Utils.EmptyBytes;
337 Rezzed = DateTime.UtcNow; 335 Rezzed = DateTime.UtcNow;
338 336 Description = String.Empty;
337
338 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
339 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
340 // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log
339 m_inventory = new SceneObjectPartInventory(this); 341 m_inventory = new SceneObjectPartInventory(this);
340 } 342 }
341 343
@@ -349,11 +351,10 @@ namespace OpenSim.Region.Framework.Scenes
349 /// <param name="offsetPosition"></param> 351 /// <param name="offsetPosition"></param>
350 public SceneObjectPart( 352 public SceneObjectPart(
351 UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition, 353 UUID ownerID, PrimitiveBaseShape shape, Vector3 groupPosition,
352 Quaternion rotationOffset, Vector3 offsetPosition) 354 Quaternion rotationOffset, Vector3 offsetPosition) : this()
353 { 355 {
354 m_name = "Object"; 356 m_name = "Object";
355 357
356 Rezzed = DateTime.UtcNow;
357 CreationDate = (int)Utils.DateTimeToUnixTime(Rezzed); 358 CreationDate = (int)Utils.DateTimeToUnixTime(Rezzed);
358 LastOwnerID = CreatorID = OwnerID = ownerID; 359 LastOwnerID = CreatorID = OwnerID = ownerID;
359 UUID = UUID.Random(); 360 UUID = UUID.Random();
@@ -368,19 +369,10 @@ namespace OpenSim.Region.Framework.Scenes
368 Velocity = Vector3.Zero; 369 Velocity = Vector3.Zero;
369 AngularVelocity = Vector3.Zero; 370 AngularVelocity = Vector3.Zero;
370 Acceleration = Vector3.Zero; 371 Acceleration = Vector3.Zero;
371 m_TextureAnimation = Utils.EmptyBytes;
372 m_particleSystem = Utils.EmptyBytes;
373
374 // Prims currently only contain a single folder (Contents). From looking at the Second Life protocol,
375 // this appears to have the same UUID (!) as the prim. If this isn't the case, one can't drag items from
376 // the prim into an agent inventory (Linden client reports that the "Object not found for drop" in its log
377
378 Flags = 0; 372 Flags = 0;
379 CreateSelected = true; 373 CreateSelected = true;
380 374
381 TrimPermissions(); 375 TrimPermissions();
382
383 m_inventory = new SceneObjectPartInventory(this);
384 } 376 }
385 377
386 #endregion Constructors 378 #endregion Constructors
@@ -938,19 +930,7 @@ namespace OpenSim.Region.Framework.Scenes
938 set { m_acceleration = value; } 930 set { m_acceleration = value; }
939 } 931 }
940 932
941 public string Description 933 public string Description { get; set; }
942 {
943 get { return m_description; }
944 set
945 {
946 m_description = value;
947 PhysicsActor actor = PhysActor;
948 if (actor != null)
949 {
950 actor.SOPDescription = value;
951 }
952 }
953 }
954 934
955 /// <value> 935 /// <value>
956 /// Text color. 936 /// Text color.
@@ -1595,8 +1575,7 @@ namespace OpenSim.Region.Framework.Scenes
1595 // Basic Physics returns null.. joy joy joy. 1575 // Basic Physics returns null.. joy joy joy.
1596 if (PhysActor != null) 1576 if (PhysActor != null)
1597 { 1577 {
1598 PhysActor.SOPName = this.Name; // save object name and desc into the PhysActor so ODE internals know the joint/body info 1578 PhysActor.SOPName = this.Name; // save object into the PhysActor so ODE internals know the joint/body info
1599 PhysActor.SOPDescription = this.Description;
1600 PhysActor.SetMaterial(Material); 1579 PhysActor.SetMaterial(Material);
1601 DoPhysicsPropertyUpdate(RigidBody, true); 1580 DoPhysicsPropertyUpdate(RigidBody, true);
1602 PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0); 1581 PhysActor.SetVolumeDetect(VolumeDetectActive ? 1 : 0);
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 309f543..c485e87 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -282,8 +282,6 @@ namespace OpenSim.Region.Framework.Scenes
282 ArrayList ret = new ArrayList(); 282 ArrayList ret = new ArrayList();
283 283
284 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); 284 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
285 if (engines == null) // No engine at all
286 return ret;
287 285
288 foreach (IScriptModule e in engines) 286 foreach (IScriptModule e in engines)
289 { 287 {
@@ -397,7 +395,7 @@ namespace OpenSim.Region.Framework.Scenes
397 private void RestoreSavedScriptState(UUID oldID, UUID newID) 395 private void RestoreSavedScriptState(UUID oldID, UUID newID)
398 { 396 {
399 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); 397 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
400 if (engines == null) // No engine at all 398 if (engines.Length == 0) // No engine at all
401 return; 399 return;
402 400
403 if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID)) 401 if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID))
@@ -437,6 +435,7 @@ namespace OpenSim.Region.Framework.Scenes
437 435
438 m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml; 436 m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml;
439 } 437 }
438
440 foreach (IScriptModule e in engines) 439 foreach (IScriptModule e in engines)
441 { 440 {
442 if (e != null) 441 if (e != null)
@@ -445,6 +444,7 @@ namespace OpenSim.Region.Framework.Scenes
445 break; 444 break;
446 } 445 }
447 } 446 }
447
448 m_part.ParentGroup.m_savedScriptState.Remove(oldID); 448 m_part.ParentGroup.m_savedScriptState.Remove(oldID);
449 } 449 }
450 } 450 }
@@ -1327,7 +1327,7 @@ namespace OpenSim.Region.Framework.Scenes
1327 1327
1328 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); 1328 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
1329 1329
1330 if (engines == null) // No engine at all 1330 if (engines.Length == 0) // No engine at all
1331 return ret; 1331 return ret;
1332 1332
1333 Items.LockItemsForRead(true); 1333 Items.LockItemsForRead(true);
@@ -1365,7 +1365,7 @@ namespace OpenSim.Region.Framework.Scenes
1365 public void ResumeScripts() 1365 public void ResumeScripts()
1366 { 1366 {
1367 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); 1367 IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>();
1368 if (engines == null) 1368 if (engines.Length == 0)
1369 return; 1369 return;
1370 1370
1371 1371
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index d89c1c0..0eaac64 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3535,23 +3535,23 @@ namespace OpenSim.Region.Framework.Scenes
3535 /// <param name="args">The arguments for the event</param> 3535 /// <param name="args">The arguments for the event</param>
3536 public void SendScriptEventToAttachments(string eventName, Object[] args) 3536 public void SendScriptEventToAttachments(string eventName, Object[] args)
3537 { 3537 {
3538 if (m_scriptEngines != null) 3538 if (m_scriptEngines.Length == 0)
3539 return;
3540
3541 lock (m_attachments)
3539 { 3542 {
3540 lock (m_attachments) 3543 foreach (SceneObjectGroup grp in m_attachments)
3541 { 3544 {
3542 foreach (SceneObjectGroup grp in m_attachments) 3545 // 16384 is CHANGED_ANIMATION
3546 //
3547 // Send this to all attachment root prims
3548 //
3549 foreach (IScriptModule m in m_scriptEngines)
3543 { 3550 {
3544 // 16384 is CHANGED_ANIMATION 3551 if (m == null) // No script engine loaded
3545 // 3552 continue;
3546 // Send this to all attachment root prims
3547 //
3548 foreach (IScriptModule m in m_scriptEngines)
3549 {
3550 if (m == null) // No script engine loaded
3551 continue;
3552 3553
3553 m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION }); 3554 m.PostObjectEvent(grp.RootPart.UUID, "changed", new Object[] { (int)Changed.ANIMATION });
3554 }
3555 } 3555 }
3556 } 3556 }
3557 } 3557 }