mirror of
https://github.com/opensim/opensim.git
synced 2026-06-06 02:55:47 +08:00
Register the UrlModule for script engine events OnScriptRemoved and OnObjectRemoved just once in the UrlModule itself, rather than repeatedly for every script.
Doing this in every script is unnecessary since the event trigger is parameterized by the item id. All that would happen is 2000 scripts would trigger 1999 unnecessary calls, and a large number of initialized scripts may eventually trigger a StackOverflowException. Registration moved to UrlModule so that the handler is registered for all script engine implementations. This required moving the OnScriptRemoved and OnObjectRemoved events (only used by UrlModule in core) from IScriptEngine to IScriptModule to avoid circular references.
This commit is contained in:
@@ -31,8 +31,21 @@ using OpenMetaverse;
|
||||
|
||||
namespace OpenSim.Region.Framework.Interfaces
|
||||
{
|
||||
public delegate void ScriptRemoved(UUID script);
|
||||
public delegate void ObjectRemoved(UUID prim);
|
||||
|
||||
public interface IScriptModule: INonSharedRegionModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Triggered when a script is removed from the script module.
|
||||
/// </summary>
|
||||
event ScriptRemoved OnScriptRemoved;
|
||||
|
||||
/// <summary>
|
||||
/// Triggered when an object is removed via the script module.
|
||||
/// </summary>
|
||||
event ObjectRemoved OnObjectRemoved;
|
||||
|
||||
string ScriptEngineName { get; }
|
||||
|
||||
string GetXMLState(UUID itemID);
|
||||
|
||||
Reference in New Issue
Block a user