aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-07-18 21:03:35 +0100
committerJustin Clark-Casey (justincc)2012-07-18 21:03:35 +0100
commitcd6d7429f86eda4040cde664de4d690945d8be6b (patch)
tree2f7c2c982b9ad5ad17a4c30c95aa5eaad8582fbf /OpenSim
parentClose() the ScenePresence after we've removed it from the scene graph, to cut... (diff)
downloadopensim-SC_OLD-cd6d7429f86eda4040cde664de4d690945d8be6b.zip
opensim-SC_OLD-cd6d7429f86eda4040cde664de4d690945d8be6b.tar.gz
opensim-SC_OLD-cd6d7429f86eda4040cde664de4d690945d8be6b.tar.bz2
opensim-SC_OLD-cd6d7429f86eda4040cde664de4d690945d8be6b.tar.xz
Only listen to LoginsEnabled event in RegionReadyModule if it has been asked to disable logins until all scripts have been compiled
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs48
1 files changed, 22 insertions, 26 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
index 600cafb..aeab61c 100644
--- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
@@ -56,7 +56,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
56 private bool m_lastOarLoadedOk; 56 private bool m_lastOarLoadedOk;
57 private int m_channelNotify = -1000; 57 private int m_channelNotify = -1000;
58 private bool m_enabled = false; 58 private bool m_enabled = false;
59 private bool m_disable_logins = false; 59 private bool m_disable_logins;
60 private string m_uri = string.Empty; 60 private string m_uri = string.Empty;
61 61
62 Scene m_scene = null; 62 Scene m_scene = null;
@@ -100,24 +100,23 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
100 100
101 m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded; 101 m_scene.EventManager.OnOarFileLoaded += OnOarFileLoaded;
102 m_scene.EventManager.OnRezScript += OnRezScript; 102 m_scene.EventManager.OnRezScript += OnRezScript;
103 m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled;
104 103
105 m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName); 104 m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName);
106 105
107 if (m_disable_logins == true) 106 if (m_disable_logins)
108 { 107 {
108 m_scene.EventManager.OnLoginsEnabled += OnLoginsEnabled;
109 scene.LoginLock = true; 109 scene.LoginLock = true;
110 scene.LoginsDisabled = true; 110 m_log.InfoFormat("[RegionReady]: Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name);
111 m_log.InfoFormat("[RegionReady]: Region {0} - logins disabled during initialization.",m_scene.RegionInfo.RegionName);
112 111
113 if(m_uri != string.Empty) 112 if (m_uri != string.Empty)
114 { 113 {
115 RRAlert("disabled"); 114 RRAlert("disabled");
116 } 115 }
117 } 116 }
118 } 117 }
119 118
120 void OnRezScript (uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource) 119 void OnRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource)
121 { 120 {
122 if (!m_ScriptRez) 121 if (!m_ScriptRez)
123 { 122 {
@@ -132,11 +131,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
132 if (!m_enabled) 131 if (!m_enabled)
133 return; 132 return;
134 133
135 m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
136 m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded; 134 m_scene.EventManager.OnOarFileLoaded -= OnOarFileLoaded;
137 m_scene.EventManager.OnLoginsEnabled -= OnLoginsEnabled;
138 135
139 if(m_uri != string.Empty) 136 if (m_disable_logins)
137 m_scene.EventManager.OnLoginsEnabled -= OnLoginsEnabled;
138
139 if (m_uri != string.Empty)
140 { 140 {
141 RRAlert("shutdown"); 141 RRAlert("shutdown");
142 } 142 }
@@ -159,7 +159,6 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
159 159
160 #endregion 160 #endregion
161 161
162
163 void OnEmptyScriptCompileQueue(int numScriptsFailed, string message) 162 void OnEmptyScriptCompileQueue(int numScriptsFailed, string message)
164 { 163 {
165 m_log.DebugFormat("[RegionReady]: Script compile queue empty!"); 164 m_log.DebugFormat("[RegionReady]: Script compile queue empty!");
@@ -216,27 +215,24 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
216 // empty compile queue 215 // empty compile queue
217 void OnLoginsEnabled(string regionName) 216 void OnLoginsEnabled(string regionName)
218 { 217 {
219 if (m_disable_logins == true) 218 if (m_scene.StartDisabled == false)
220 { 219 {
221 if (m_scene.StartDisabled == false) 220 m_scene.LoginsDisabled = false;
222 { 221 m_scene.LoginLock = false;
223 m_scene.LoginsDisabled = false;
224 m_scene.LoginLock = false;
225 222
226 m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; 223 // m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}",
224 // m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString());
227 225
228 // m_log.InfoFormat("[RegionReady]: Logins enabled for {0}, Oar {1}", 226 m_log.InfoFormat(
229 // m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString()); 227 "[RegionReady]: INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name);
230 228
231 m_log.InfoFormat( 229 if (m_uri != string.Empty)
232 "[RegionReady]: INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name); 230 {
233 231 RRAlert("enabled");
234 if (m_uri != string.Empty)
235 {
236 RRAlert("enabled");
237 }
238 } 232 }
239 } 233 }
234
235 m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue;
240 } 236 }
241 237
242 public void OarLoadingAlert(string msg) 238 public void OarLoadingAlert(string msg)