Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
commit
b9749d5aaf
|
@ -312,11 +312,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
part.SetScriptEvents(ItemID,
|
part.SetScriptEvents(ItemID,
|
||||||
(int)m_Script.GetStateEventFlags(State));
|
(int)m_Script.GetStateEventFlags(State));
|
||||||
|
|
||||||
Running = false;
|
if (!Running)
|
||||||
|
|
||||||
if (ShuttingDown)
|
|
||||||
m_startOnInit = false;
|
m_startOnInit = false;
|
||||||
|
|
||||||
|
Running = false;
|
||||||
|
|
||||||
// we get new rez events on sim restart, too
|
// we get new rez events on sim restart, too
|
||||||
// but if there is state, then we fire the change
|
// but if there is state, then we fire the change
|
||||||
// event
|
// event
|
||||||
|
@ -352,12 +352,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
|
|
||||||
public void Init()
|
public void Init()
|
||||||
{
|
{
|
||||||
if (!m_startOnInit)
|
if (ShuttingDown)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (m_startedFromSavedState)
|
if (m_startedFromSavedState)
|
||||||
{
|
{
|
||||||
Start();
|
if (m_startOnInit)
|
||||||
|
Start();
|
||||||
if (m_postOnRez)
|
if (m_postOnRez)
|
||||||
{
|
{
|
||||||
PostEvent(new EventParams("on_rez",
|
PostEvent(new EventParams("on_rez",
|
||||||
|
@ -389,7 +390,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Start();
|
if (m_startOnInit)
|
||||||
|
Start();
|
||||||
PostEvent(new EventParams("state_entry",
|
PostEvent(new EventParams("state_entry",
|
||||||
new Object[0], new DetectParams[0]));
|
new Object[0], new DetectParams[0]));
|
||||||
if (m_postOnRez)
|
if (m_postOnRez)
|
||||||
|
|
|
@ -108,6 +108,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
private bool m_KillTimedOutScripts;
|
private bool m_KillTimedOutScripts;
|
||||||
private string m_ScriptEnginesPath = null;
|
private string m_ScriptEnginesPath = null;
|
||||||
|
|
||||||
|
private ExpiringCache<UUID, bool> m_runFlags = new ExpiringCache<UUID, bool>();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Is the entire simulator in the process of shutting down?
|
/// Is the entire simulator in the process of shutting down?
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -1196,6 +1198,14 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
if (instance != null)
|
if (instance != null)
|
||||||
instance.Init();
|
instance.Init();
|
||||||
|
|
||||||
|
bool runIt;
|
||||||
|
if (m_runFlags.TryGetValue(itemID, out runIt))
|
||||||
|
{
|
||||||
|
if (!runIt)
|
||||||
|
StopScript(itemID);
|
||||||
|
m_runFlags.Remove(itemID);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1568,6 +1578,8 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
IScriptInstance instance = GetInstance(itemID);
|
IScriptInstance instance = GetInstance(itemID);
|
||||||
if (instance != null)
|
if (instance != null)
|
||||||
instance.Start();
|
instance.Start();
|
||||||
|
else
|
||||||
|
m_runFlags.AddOrUpdate(itemID, true, 240);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StopScript(UUID itemID)
|
public void StopScript(UUID itemID)
|
||||||
|
@ -1579,6 +1591,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
|
||||||
// cause issues on mono 2.6, 2.10 and possibly later where locks are not released properly on abort.
|
// cause issues on mono 2.6, 2.10 and possibly later where locks are not released properly on abort.
|
||||||
instance.Stop(1000);
|
instance.Stop(1000);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_runFlags.AddOrUpdate(itemID, false, 240);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DetectParams GetDetectParams(UUID itemID, int idx)
|
public DetectParams GetDetectParams(UUID itemID, int idx)
|
||||||
|
|
Loading…
Reference in New Issue