let changed allowed drop have lldetectedkey[0] return the dropped item id, Yengine and still testing"

0.9.1.0-post-fixes
UbitUmarov 2019-02-21 22:54:17 +00:00
parent b7507b70bc
commit ece3843798
5 changed files with 22 additions and 9 deletions

View File

@ -539,7 +539,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <see cref="SceneObjectPart.TriggerScriptChangedEvent"/>
/// </remarks>
public event ScriptChangedEvent OnScriptChangedEvent;
public delegate void ScriptChangedEvent(uint localID, uint change);
public delegate void ScriptChangedEvent(uint localID, uint change, object data);
public delegate void ScriptControlEvent(UUID item, UUID avatarID, uint held, uint changed);
@ -1185,7 +1185,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
public void TriggerOnScriptChangedEvent(uint localID, uint change)
public void TriggerOnScriptChangedEvent(uint localID, uint change, object parameter = null)
{
ScriptChangedEvent handlerScriptChangedEvent = OnScriptChangedEvent;
if (handlerScriptChangedEvent != null)
@ -1194,7 +1194,7 @@ namespace OpenSim.Region.Framework.Scenes
{
try
{
d(localID, change);
d(localID, change, parameter);
}
catch (Exception e)
{

View File

@ -4439,10 +4439,10 @@ namespace OpenSim.Region.Framework.Scenes
SceneObjectSerializer.SOPToXml2(xmlWriter, this, new Dictionary<string, object>());
}
public void TriggerScriptChangedEvent(Changed val)
public void TriggerScriptChangedEvent(Changed val, object data = null)
{
if (ParentGroup != null && ParentGroup.Scene != null)
ParentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(LocalId, (uint)val);
ParentGroup.Scene.EventManager.TriggerOnScriptChangedEvent(LocalId, (uint)val, data);
}
public void TrimPermissions()

View File

@ -816,7 +816,7 @@ namespace OpenSim.Region.Framework.Scenes
m_items.Add(item.ItemID, item);
m_items.LockItemsForWrite(false);
if (allowedDrop)
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP);
m_part.TriggerScriptChangedEvent(Changed.ALLOWED_DROP, item.ItemID);
else
m_part.TriggerScriptChangedEvent(Changed.INVENTORY);

View File

@ -215,7 +215,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
det));
}
public void changed(uint localID, uint change)
public void changed(uint localID, uint change, object parameter)
{
// Add to queue for all scripts in localID, Object pass change.
myScriptEngine.PostObjectEvent(localID, new EventParams(

View File

@ -182,13 +182,26 @@ namespace OpenSim.Region.ScriptEngine.Yengine
new DetectParams[] { det }));
}
public void changed(uint localID, uint change)
public void changed(uint localID, uint change, object data)
{
int ch = (int)change;
// Add to queue for all scripts in localID, Object pass change.
this.PostObjectEvent(localID, new EventParams(
if(data == null)
{
PostObjectEvent(localID, new EventParams(
"changed", new object[] { ch },
zeroDetectParams));
return;
}
if ( data is UUID)
{
DetectParams det = new DetectParams();
det.Key = (UUID)data;
PostObjectEvent(localID, new EventParams(
"changed", new object[] { ch },
new DetectParams[] { det }));
return;
}
}
// state_entry: not processed here