prevent self call to llSetScriptState(ownname,FALSE) from blocking entire engine

melanie
UbitUmarov 2016-11-13 19:25:32 +00:00
parent b6329fb784
commit 4ebb4e371f
4 changed files with 14 additions and 6 deletions

View File

@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Interfaces
void SetMinEventDelay(UUID itemID, double delay); void SetMinEventDelay(UUID itemID, double delay);
int GetStartParameter(UUID itemID); int GetStartParameter(UUID itemID);
void SetScriptState(UUID itemID, bool state); void SetScriptState(UUID itemID, bool state, bool self);
bool GetScriptState(UUID itemID); bool GetScriptState(UUID itemID);
void SetState(UUID itemID, string newState); void SetState(UUID itemID, string newState);
void ApiResetScript(UUID itemID); void ApiResetScript(UUID itemID);

View File

@ -521,7 +521,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
if ((item = GetScriptByName(name)) != UUID.Zero) if ((item = GetScriptByName(name)) != UUID.Zero)
{ {
m_ScriptEngine.SetScriptState(item, run == 0 ? false : true); m_ScriptEngine.SetScriptState(item, run == 0 ? false : true, item == m_item.ItemID);
} }
else else
{ {

View File

@ -1854,15 +1854,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine
return instance; return instance;
} }
public void SetScriptState(UUID itemID, bool running) public void SetScriptState(UUID itemID, bool running, bool self)
{ {
IScriptInstance instance = GetInstance(itemID); IScriptInstance instance = GetInstance(itemID);
if (instance != null) if (instance != null)
{ {
if (running) if (running)
instance.Start(); instance.Start();
else else
instance.Stop(100); {
if(self)
{
instance.Running = false;
throw new EventAbortException();
}
else
instance.Stop(100);
}
} }
} }

View File

@ -221,7 +221,7 @@ namespace OpenSim.Tests.Common
throw new System.NotImplementedException (); throw new System.NotImplementedException ();
} }
public void SetScriptState(UUID itemID, bool state) public void SetScriptState(UUID itemID, bool state, bool self)
{ {
throw new System.NotImplementedException (); throw new System.NotImplementedException ();
} }