diff options
author | onefang | 2019-09-11 16:36:50 +1000 |
---|---|---|
committer | onefang | 2019-09-11 16:36:50 +1000 |
commit | 50cd1ffd32f69228e566f2b0b89f86ea0d9fe489 (patch) | |
tree | 52f2ab0c04f1a5d7d6ac5dc872981b4b156447e7 /OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs | |
parent | Renamed branch to SledjChisl. (diff) | |
parent | Bump to release flavour, build 0. (diff) | |
download | opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.zip opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.gz opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.bz2 opensim-SC_OLD-50cd1ffd32f69228e566f2b0b89f86ea0d9fe489.tar.xz |
Merge branch 'SledjChisl'
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs | 53 |
1 files changed, 31 insertions, 22 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index 870c0bb..b096146 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs | |||
@@ -46,7 +46,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RegionReadyModule")] | 46 | [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "RegionReadyModule")] |
47 | public class RegionReadyModule : IRegionReadyModule, INonSharedRegionModule | 47 | public class RegionReadyModule : IRegionReadyModule, INonSharedRegionModule |
48 | { | 48 | { |
49 | private static readonly ILog m_log = | 49 | private static readonly ILog m_log = |
50 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 50 | LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
51 | 51 | ||
52 | private IConfig m_config = null; | 52 | private IConfig m_config = null; |
@@ -57,24 +57,24 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
57 | private bool m_enabled = false; | 57 | private bool m_enabled = false; |
58 | private bool m_disable_logins; | 58 | private bool m_disable_logins; |
59 | private string m_uri = string.Empty; | 59 | private string m_uri = string.Empty; |
60 | 60 | ||
61 | Scene m_scene; | 61 | Scene m_scene; |
62 | 62 | ||
63 | #region INonSharedRegionModule interface | 63 | #region INonSharedRegionModule interface |
64 | 64 | ||
65 | public Type ReplaceableInterface | 65 | public Type ReplaceableInterface |
66 | { | 66 | { |
67 | get { return null; } | 67 | get { return null; } |
68 | } | 68 | } |
69 | 69 | ||
70 | public void Initialise(IConfigSource config) | 70 | public void Initialise(IConfigSource config) |
71 | { | 71 | { |
72 | m_config = config.Configs["RegionReady"]; | 72 | m_config = config.Configs["RegionReady"]; |
73 | if (m_config != null) | 73 | if (m_config != null) |
74 | { | 74 | { |
75 | m_enabled = m_config.GetBoolean("enabled", false); | 75 | m_enabled = m_config.GetBoolean("enabled", false); |
76 | 76 | ||
77 | if (m_enabled) | 77 | if (m_enabled) |
78 | { | 78 | { |
79 | m_channelNotify = m_config.GetInt("channel_notify", m_channelNotify); | 79 | m_channelNotify = m_config.GetInt("channel_notify", m_channelNotify); |
80 | m_disable_logins = m_config.GetBoolean("login_disable", false); | 80 | m_disable_logins = m_config.GetBoolean("login_disable", false); |
@@ -103,10 +103,10 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
103 | if (m_disable_logins) | 103 | if (m_disable_logins) |
104 | { | 104 | { |
105 | m_scene.LoginLock = true; | 105 | m_scene.LoginLock = true; |
106 | m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; | 106 | //// m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; |
107 | 107 | ||
108 | // This should always show up to the user but should not trigger warn/errors as these messages are | 108 | // This should always show up to the user but should not trigger warn/errors as these messages are |
109 | // expected and are not simulator problems. Ideally, there would be a status level in log4net but | 109 | // expected and are not simulator problems. Ideally, there would be a status level in log4net but |
110 | // failing that, we will print out to console instead. | 110 | // failing that, we will print out to console instead. |
111 | MainConsole.Instance.OutputFormat("Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name); | 111 | MainConsole.Instance.OutputFormat("Region {0} - LOGINS DISABLED DURING INITIALIZATION.", m_scene.Name); |
112 | 112 | ||
@@ -115,6 +115,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
115 | RRAlert("disabled"); | 115 | RRAlert("disabled"); |
116 | } | 116 | } |
117 | } | 117 | } |
118 | m_scene.EventManager.OnEmptyScriptCompileQueue += OnEmptyScriptCompileQueue; | ||
118 | } | 119 | } |
119 | 120 | ||
120 | public void RemoveRegion(Scene scene) | 121 | public void RemoveRegion(Scene scene) |
@@ -152,12 +153,12 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
152 | { | 153 | { |
153 | m_log.DebugFormat("[RegionReady]: Script compile queue empty!"); | 154 | m_log.DebugFormat("[RegionReady]: Script compile queue empty!"); |
154 | 155 | ||
155 | if (m_firstEmptyCompileQueue || m_oarFileLoading) | 156 | if (m_firstEmptyCompileQueue || m_oarFileLoading) |
156 | { | 157 | { |
157 | OSChatMessage c = new OSChatMessage(); | 158 | OSChatMessage c = new OSChatMessage(); |
158 | if (m_firstEmptyCompileQueue) | 159 | if (m_firstEmptyCompileQueue) |
159 | c.Message = "server_startup,"; | 160 | c.Message = "server_startup,"; |
160 | else | 161 | else |
161 | c.Message = "oar_file_load,"; | 162 | c.Message = "oar_file_load,"; |
162 | m_firstEmptyCompileQueue = false; | 163 | m_firstEmptyCompileQueue = false; |
163 | m_oarFileLoading = false; | 164 | m_oarFileLoading = false; |
@@ -165,7 +166,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
165 | m_scene.Backup(false); | 166 | m_scene.Backup(false); |
166 | 167 | ||
167 | c.From = "RegionReady"; | 168 | c.From = "RegionReady"; |
168 | if (m_lastOarLoadedOk) | 169 | if (m_lastOarLoadedOk) |
169 | c.Message += "1,"; | 170 | c.Message += "1,"; |
170 | else | 171 | else |
171 | c.Message += "0,"; | 172 | c.Message += "0,"; |
@@ -193,7 +194,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
193 | { | 194 | { |
194 | m_oarFileLoading = true; | 195 | m_oarFileLoading = true; |
195 | 196 | ||
196 | if (message==String.Empty) | 197 | if (message==String.Empty) |
197 | { | 198 | { |
198 | m_lastOarLoadedOk = true; | 199 | m_lastOarLoadedOk = true; |
199 | } | 200 | } |
@@ -214,6 +215,14 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
214 | m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; | 215 | m_scene.EventManager.OnEmptyScriptCompileQueue -= OnEmptyScriptCompileQueue; |
215 | m_scene.LoginLock = false; | 216 | m_scene.LoginLock = false; |
216 | 217 | ||
218 | GC.Collect(); | ||
219 | GC.WaitForPendingFinalizers(); | ||
220 | GC.Collect(); | ||
221 | |||
222 | //// Scene.cs already does this. | ||
223 | //// m_scene.SceneGridService.InformNeighborsThatRegionisUp( | ||
224 | //// m_scene.RequestModuleInterface<INeighbourService>(), m_scene.RegionInfo); | ||
225 | |||
217 | if (!m_scene.StartDisabled) | 226 | if (!m_scene.StartDisabled) |
218 | { | 227 | { |
219 | m_scene.LoginsEnabled = true; | 228 | m_scene.LoginsEnabled = true; |
@@ -222,15 +231,15 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
222 | // m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString()); | 231 | // m_scene.RegionInfo.RegionName, m_oarFileLoading.ToString()); |
223 | 232 | ||
224 | // Putting this out to console to make it eye-catching for people who are running OpenSimulator | 233 | // Putting this out to console to make it eye-catching for people who are running OpenSimulator |
225 | // without info log messages enabled. Making this a warning is arguably misleading since it isn't a | 234 | // without info log messages enabled. Making this a warning is arguably misleading since it isn't a |
226 | // warning, and monitor scripts looking for warn/error/fatal messages will received false positives. | 235 | // warning, and monitor scripts looking for warn/error/fatal messages will received false positives. |
227 | // Arguably, log4net needs a status log level (like Apache). | 236 | // Arguably, log4net needs a status log level (like Apache). |
228 | MainConsole.Instance.OutputFormat("INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name); | 237 | if (m_disable_logins) |
238 | m_log.InfoFormat("[RegionReady]: INITIALIZATION COMPLETE FOR {0} - LOGINS ENABLED", m_scene.Name); | ||
239 | else | ||
240 | m_log.InfoFormat("[RegionReady]: INITIALIZATION COMPLETE FOR {0}", m_scene.Name); | ||
229 | } | 241 | } |
230 | 242 | ||
231 | m_scene.SceneGridService.InformNeighborsThatRegionisUp( | ||
232 | m_scene.RequestModuleInterface<INeighbourService>(), m_scene.RegionInfo); | ||
233 | |||
234 | if (m_uri != string.Empty) | 243 | if (m_uri != string.Empty) |
235 | { | 244 | { |
236 | RRAlert("enabled"); | 245 | RRAlert("enabled"); |
@@ -252,7 +261,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
252 | // m_scene.EventManager.OnRezScript += OnRezScript; | 261 | // m_scene.EventManager.OnRezScript += OnRezScript; |
253 | // m_oarFileLoading = true; | 262 | // m_oarFileLoading = true; |
254 | // m_firstEmptyCompileQueue = true; | 263 | // m_firstEmptyCompileQueue = true; |
255 | // | 264 | // |
256 | // m_scene.LoginsDisabled = true; | 265 | // m_scene.LoginsDisabled = true; |
257 | // m_scene.LoginLock = true; | 266 | // m_scene.LoginLock = true; |
258 | // if ( m_uri != string.Empty ) | 267 | // if ( m_uri != string.Empty ) |