Fix bug where region ready would be triggered a second time if a script was rezzed on a previously script-free region.

There is no need to listen for OnRezScript in RegionReadyModule since OnEmptyScriptCompileQueue will only fire if scripts were compiled.
0.7.3-extended
Justin Clark-Casey (justincc) 2012-07-18 22:17:39 +01:00
parent 92a01a7e70
commit 7f2e6a55c4
1 changed files with 22 additions and 30 deletions

View File

@ -104,14 +104,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
m_lastOarLoadedOk = true; m_lastOarLoadedOk = true;
m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded;
m_scene.EventManager.OnRezScript += OnRezScript;
m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName); m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName);
if (m_disable_logins) if (m_disable_logins)
{ {
m_scene.LoginLock = true;
m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled; m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled;
scene.LoginLock = true; m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
m_log.InfoFormat("[RegionReady]: Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name); m_log.InfoFormat("[RegionReady]: Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name);
@ -122,16 +122,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
} }
} }
void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
{
if (!m_ScriptRez)
{
m_ScriptRez = true;
m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
m_scene.EventManager.OnRezScript -= OnRezScript;
}
}
public void RemoveRegion(Scene scene) public void RemoveRegion(Scene scene)
{ {
if (!m_enabled) if (!m_enabled)
@ -140,7 +130,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded; m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
if (m_disable_logins) if (m_disable_logins)
{
m_scene.EventManager.OnLoginsEnabled -= OnLoginsEnabled; m_scene.EventManager.OnLoginsEnabled -= OnLoginsEnabled;
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
}
if (m_uri != string.Empty) if (m_uri != string.Empty)
{ {
@ -255,25 +248,24 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
{ {
// Let's bypass this for now until some better feedback can be established // Let's bypass this for now until some better feedback can be established
// //
return;
if (msg == "load") // if (msg == "load")
{ // {
m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; // m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue;
m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; // m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded;
m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled; // m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled;
m_scene.EventManager.OnRezScript += OnRezScript; // m_scene.EventManager.OnRezScript += OnRezScript;
m_oarFileLoading = true; // m_oarFileLoading = true;
m_firstEmptyCompileQueue = true; // m_firstEmptyCompileQueue = true;
//
m_scene.LoginsDisabled = true; // m_scene.LoginsDisabled = true;
m_scene.LoginLock = true; // m_scene.LoginLock = true;
if ( m_uri != string.Empty ) // if ( m_uri != string.Empty )
{ // {
RRAlert("loading oar"); // RRAlert("loading oar");
RRAlert("disabled"); // RRAlert("disabled");
} // }
} // }
} }
public void RRAlert(string status) public void RRAlert(string status)