mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 14:16:07 +08:00
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
This commit is contained in:
@@ -292,7 +292,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stop all the scripts in this prim.
|
||||
/// Stop and remove all the scripts in this prim.
|
||||
/// </summary>
|
||||
/// <param name="sceneObjectBeingDeleted">
|
||||
/// Should be true if these scripts are being removed because the scene
|
||||
@@ -308,6 +308,14 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stop all the scripts in this prim.
|
||||
/// </summary>
|
||||
public void StopScriptInstances()
|
||||
{
|
||||
GetInventoryItems(InventoryType.LSL).ForEach(i => StopScriptInstance(i));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Start a script which is in this prim's inventory.
|
||||
/// </summary>
|
||||
@@ -596,7 +604,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stop a script which is in this prim's inventory.
|
||||
/// Stop and remove a script which is in this prim's inventory.
|
||||
/// </summary>
|
||||
/// <param name="itemId"></param>
|
||||
/// <param name="sceneObjectBeingDeleted">
|
||||
@@ -615,7 +623,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
m_log.WarnFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
|
||||
itemId, m_part.Name, m_part.UUID,
|
||||
@@ -623,6 +631,51 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stop a script which is in this prim's inventory.
|
||||
/// </summary>
|
||||
/// <param name="itemId"></param>
|
||||
/// <param name="sceneObjectBeingDeleted">
|
||||
/// Should be true if this script is being removed because the scene
|
||||
/// object is being deleted. This will prevent spurious updates to the client.
|
||||
/// </param>
|
||||
public void StopScriptInstance(UUID itemId)
|
||||
{
|
||||
TaskInventoryItem scriptItem;
|
||||
|
||||
lock (m_items)
|
||||
m_items.TryGetValue(itemId, out scriptItem);
|
||||
|
||||
if (scriptItem != null)
|
||||
{
|
||||
StopScriptInstance(scriptItem);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_log.WarnFormat(
|
||||
"[PRIM INVENTORY]: " +
|
||||
"Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2} at {3} in {4}",
|
||||
itemId, m_part.Name, m_part.UUID,
|
||||
m_part.AbsolutePosition, m_part.ParentGroup.Scene.RegionInfo.RegionName);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stop a script which is in this prim's inventory.
|
||||
/// </summary>
|
||||
/// <param name="itemId"></param>
|
||||
/// <param name="sceneObjectBeingDeleted">
|
||||
/// Should be true if this script is being removed because the scene
|
||||
/// object is being deleted. This will prevent spurious updates to the client.
|
||||
/// </param>
|
||||
public void StopScriptInstance(TaskInventoryItem item)
|
||||
{
|
||||
m_part.ParentGroup.Scene.EventManager.TriggerStopScript(m_part.LocalId, item.ItemID);
|
||||
|
||||
// At the moment, even stopped scripts are counted as active, which is probably wrong.
|
||||
// m_part.ParentGroup.AddActiveScriptCount(-1);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the inventory holds an item with a given name.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user