aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
diff options
context:
space:
mode:
authorMelanie2012-07-11 03:56:50 +0100
committerMelanie2012-07-11 03:56:50 +0100
commit0bc8238a6c25bc42438caee0cf42deec00f26b8e (patch)
treea046cace418e2e7714818c60242698d0dd9cb4f4 /OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
parentMerge branch 'avination' into careminster (diff)
parentIf a part has a sit target and an avatar is already sitting, allow another av... (diff)
downloadopensim-SC_OLD-0bc8238a6c25bc42438caee0cf42deec00f26b8e.zip
opensim-SC_OLD-0bc8238a6c25bc42438caee0cf42deec00f26b8e.tar.gz
opensim-SC_OLD-0bc8238a6c25bc42438caee0cf42deec00f26b8e.tar.bz2
opensim-SC_OLD-0bc8238a6c25bc42438caee0cf42deec00f26b8e.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Framework/Watchdog.cs OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs OpenSim/Region/Framework/Scenes/Scene.cs OpenSim/Region/Framework/Scenes/SceneObjectPart.cs OpenSim/Region/Framework/Scenes/ScenePresence.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs59
1 files changed, 56 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
index 1dff088..e5e29d0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs
@@ -292,7 +292,7 @@ namespace OpenSim.Region.Framework.Scenes
292 } 292 }
293 293
294 /// <summary> 294 /// <summary>
295 /// Stop all the scripts in this prim. 295 /// Stop and remove all the scripts in this prim.
296 /// </summary> 296 /// </summary>
297 /// <param name="sceneObjectBeingDeleted"> 297 /// <param name="sceneObjectBeingDeleted">
298 /// Should be true if these scripts are being removed because the scene 298 /// Should be true if these scripts are being removed because the scene
@@ -309,6 +309,14 @@ namespace OpenSim.Region.Framework.Scenes
309 } 309 }
310 310
311 /// <summary> 311 /// <summary>
312 /// Stop all the scripts in this prim.
313 /// </summary>
314 public void StopScriptInstances()
315 {
316 GetInventoryItems(InventoryType.LSL).ForEach(i => StopScriptInstance(i));
317 }
318
319 /// <summary>
312 /// Start a script which is in this prim's inventory. 320 /// Start a script which is in this prim's inventory.
313 /// </summary> 321 /// </summary>
314 /// <param name="item"></param> 322 /// <param name="item"></param>
@@ -596,7 +604,7 @@ namespace OpenSim.Region.Framework.Scenes
596 } 604 }
597 605
598 /// <summary> 606 /// <summary>
599 /// Stop a script which is in this prim's inventory. 607 /// Stop and remove a script which is in this prim's inventory.
600 /// </summary> 608 /// </summary>
601 /// <param name="itemId"></param> 609 /// <param name="itemId"></param>
602 /// <param name="sceneObjectBeingDeleted"> 610 /// <param name="sceneObjectBeingDeleted">
@@ -615,7 +623,7 @@ namespace OpenSim.Region.Framework.Scenes
615 } 623 }
616 else 624 else
617 { 625 {
618 m_log.ErrorFormat( 626 m_log.WarnFormat(
619 "[PRIM INVENTORY]: " + 627 "[PRIM INVENTORY]: " +
620 "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}", 628 "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
621 itemId, m_part.Name, m_part.UUID, 629 itemId, m_part.Name, m_part.UUID,
@@ -624,6 +632,51 @@ namespace OpenSim.Region.Framework.Scenes
624 } 632 }
625 633
626 /// <summary> 634 /// <summary>
635 /// Stop a script which is in this prim's inventory.
636 /// </summary>
637 /// <param name="itemId"></param>
638 /// <param name="sceneObjectBeingDeleted">
639 /// Should be true if this script is being removed because the scene
640 /// object is being deleted. This will prevent spurious updates to the client.
641 /// </param>
642 public void StopScriptInstance(UUID itemId)
643 {
644 TaskInventoryItem scriptItem;
645
646 lock (m_items)
647 m_items.TryGetValue(itemId, out scriptItem);
648
649 if (scriptItem != null)
650 {
651 StopScriptInstance(scriptItem);
652 }
653 else
654 {
655 m_log.WarnFormat(
656 "[PRIM INVENTORY]: " +
657 "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
658 itemId, m_part.Name, m_part.UUID,
659 m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
660 }
661 }
662
663 /// <summary>
664 /// Stop a script which is in this prim's inventory.
665 /// </summary>
666 /// <param name="itemId"></param>
667 /// <param name="sceneObjectBeingDeleted">
668 /// Should be true if this script is being removed because the scene
669 /// object is being deleted. This will prevent spurious updates to the client.
670 /// </param>
671 public void StopScriptInstance(TaskInventoryItem item)
672 {
673 m_part.ParentGroup.Scene.EventManager.TriggerStopScript(m_part.LocalId, item.ItemID);
674
675 // At the moment, even stopped scripts are counted as active, which is probably wrong.
676// m_part.ParentGroup.AddActiveScriptCount(-1);
677 }
678
679 /// <summary>
627 /// Check if the inventory holds an item with a given name. 680 /// Check if the inventory holds an item with a given name.
628 /// </summary> 681 /// </summary>
629 /// <param name="name"></param> 682 /// <param name="name"></param>