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.
This commit is contained in:
Justin Clarke Casey
2008-02-18 11:14:53 +00:00
parent 5fb1809384
commit 1cbef0b908
5 changed files with 50 additions and 0 deletions

View File

@@ -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<ListenerInfo> 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++)