From f0eeb47262c116b893644ee532bebb4dd52dec77 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 Apr 2014 20:54:34 +0100 Subject: Add the "StateChange" function to the async comand manager to differentiate between state changes and script exit/reset. --- .../Api/Implementation/AsyncCommandManager.cs | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index 998f40b..40a05cf 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs @@ -300,6 +300,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } + public static void StateChange(IScriptEngine engine, uint localID, UUID itemID) + { + // Remove a specific script + + // Remove dataserver events + m_Dataserver[engine].RemoveEvents(localID, itemID); + + IWorldComm comms = engine.World.RequestModuleInterface(); + if (comms != null) + comms.DeleteListener(itemID); + + IXMLRPC xmlrpc = engine.World.RequestModuleInterface(); + if (xmlrpc != null) + { + xmlrpc.DeleteChannels(itemID); + xmlrpc.CancelSRDRequests(itemID); + } + // Remove Sensors + m_SensorRepeat[engine].UnSetSenseRepeaterEvents(localID, itemID); + + } + /// /// Get the sensor repeat plugin for this script engine. /// @@ -439,4 +461,4 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } } } -} \ No newline at end of file +} -- cgit v1.1