From 1cbef0b9084bce0816c7ef471b3b58d1dbf9de7c Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 18 Feb 2008 11:14:53 +0000 Subject: Patch from Michael Osias IBM (jimbo2120) In his own words: If a prim becomes a listener or remote channel and the script is deleted, it cannot become a listener or channel again with a new script. This patch fixes that. --- .../Region/Environment/Modules/WorldCommModule.cs | 22 ++++++++++++++++++++++ OpenSim/Region/Environment/Modules/XMLRPCModule.cs | 19 +++++++++++++++++++ 2 files changed, 41 insertions(+) (limited to 'OpenSim/Region/Environment/Modules') diff --git a/OpenSim/Region/Environment/Modules/WorldCommModule.cs b/OpenSim/Region/Environment/Modules/WorldCommModule.cs index 6b9ae46..a426eda 100644 --- a/OpenSim/Region/Environment/Modules/WorldCommModule.cs +++ b/OpenSim/Region/Environment/Modules/WorldCommModule.cs @@ -70,6 +70,7 @@ namespace OpenSim.Region.Environment.Modules { private Scene m_scene; private object CommListLock = new object(); + private object ListLock = new object(); private string m_name = "WorldCommModule"; private ListenerManager m_listenerManager; private Queue m_pending; @@ -136,6 +137,15 @@ namespace OpenSim.Region.Environment.Modules m_listenerManager.Remove(handle); } + public void DeleteListener(LLUUID itemID) + { + lock (ListLock) + { + m_listenerManager.DeleteListener(itemID); + } + + } + // This method scans nearby objects and determines if they are listeners, // and if so if this message fits the filter. If it does, then // enqueue the message for delivery to the objects listen event handler. @@ -303,6 +313,18 @@ namespace OpenSim.Region.Environment.Modules m_listeners.Remove(handle); } + public void DeleteListener(LLUUID itemID) + { + foreach (ListenerInfo li in m_listeners.Values) + { + if (li.GetItemID().Equals(itemID)) + { + Remove(li.GetHandle()); + return; + } + } + } + private int GetNewHandle() { for (int i = 0; i < int.MaxValue - 1; i++) diff --git a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs index 762e76d..edd1df8 100644 --- a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs +++ b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs @@ -188,6 +188,24 @@ namespace OpenSim.Region.Environment.Modules return channel; } + public void DeleteChannel(LLUUID itemID) + { + + foreach (RPCChannelInfo li in m_openChannels.Values) + { + + if (li.GetItemID().Equals(itemID)) + { + + m_openChannels.Remove(li.GetChannelID()); + return; + + } + + } + + } + /********************************************** * Remote Data Reply * @@ -408,5 +426,6 @@ namespace OpenSim.Region.Environment.Modules { return m_localID; } + } } -- cgit v1.1