Only listen to LoginsEnabled event in RegionReadyModule if it has been asked to disable logins until all scripts have been compiled

0.7.3-extended
Justin Clark-Casey (justincc) 2012-07-18 21:03:35 +01:00
parent 5aa9c21e7d
commit 272c3c1069
1 changed files with 25 additions and 27 deletions

View File

@ -56,7 +56,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
private bool m_lastOarLoadedOk; private bool m_lastOarLoadedOk;
private int m_channelNotify = -1000; private int m_channelNotify = -1000;
private bool m_enabled = false; private bool m_enabled = false;
private bool m_disable_logins = false; private bool m_disable_logins;
private string m_uri = string.Empty; private string m_uri = string.Empty;
Scene m_scene = null; Scene m_scene = null;
@ -105,15 +105,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded;
m_scene.EventManager.OnRezScript += OnRezScript; m_scene.EventManager.OnRezScript += OnRezScript;
m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled;
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 == true) if (m_disable_logins)
{ {
m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled;
scene.LoginLock = true; scene.LoginLock = true;
scene.LoginsDisabled = true;
m_log.InfoFormat("[RegionReady]: Logins disabled for {0}",m_scene.RegionInfo.RegionName); m_log.InfoFormat("[RegionReady]: Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name);
if (m_uri != string.Empty) if (m_uri != string.Empty)
{ {
@ -137,8 +137,9 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
if (!m_enabled) if (!m_enabled)
return; return;
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded; m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
if (m_disable_logins)
m_scene.EventManager.OnLoginsEnabled -= OnLoginsEnabled; m_scene.EventManager.OnLoginsEnabled -= OnLoginsEnabled;
if (m_uri != string.Empty) if (m_uri != string.Empty)
@ -164,7 +165,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
#endregion #endregion
void OnEmptyScriptCompileQueue(int numScriptsFailed, string message) void OnEmptyScriptCompileQueue(int numScriptsFailed, string message)
{ {
m_log.InfoFormat("[RegionReady]: Script compile queue empty!"); m_log.InfoFormat("[RegionReady]: Script compile queue empty!");
@ -220,27 +220,25 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
// else it will be true and we should wait on the // else it will be true and we should wait on the
// empty compile queue // empty compile queue
void OnLoginsEnabled(string regionName) void OnLoginsEnabled(string regionName)
{
if (m_disable_logins == true)
{ {
if (m_scene.StartDisabled == false) if (m_scene.StartDisabled == false)
{ {
m_scene.LoginsDisabled = false; m_scene.LoginsDisabled = false;
m_scene.LoginLock = false; m_scene.LoginLock = false;
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
// m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}", // m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
// m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString()); // m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
m_log.InfoFormat("[RegionReady]: Logins enabled for {0}", m_scene.RegionInfo.RegionName); m_log.InfoFormat(
"[RegionReady]: INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name);
if (m_uri != string.Empty) if (m_uri != string.Empty)
{ {
RRAlert("enabled"); RRAlert("enabled");
} }
} }
}
m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
} }
public void OarLoadingAlert(string msg) public void OarLoadingAlert(string msg)