diff options
author | Justin Clark-Casey (justincc) | 2012-07-18 21:29:12 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-07-18 21:29:12 +0100 |
commit | 6460e587c470361173291337ad222f48c13a10ce (patch) | |
tree | 30a15cc14b348793a16a1d4f121b64059659a6f5 /OpenSim/Region | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-6460e587c470361173291337ad222f48c13a10ce.zip opensim-SC_OLD-6460e587c470361173291337ad222f48c13a10ce.tar.gz opensim-SC_OLD-6460e587c470361173291337ad222f48c13a10ce.tar.bz2 opensim-SC_OLD-6460e587c470361173291337ad222f48c13a10ce.tar.xz |
Pass entire scene object in OnLoginsEnabled event rather than just the region name.
This saves listeners from having to re-retrieve the scene from their own lists, which won't work anyway if multiple regions with the same name have been allowed
Diffstat (limited to 'OpenSim/Region')
4 files changed, 22 insertions, 24 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs index 322a9f8..9033460 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/MapImage/MapImageServiceModule.cs | |||
@@ -164,20 +164,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.MapImage | |||
164 | 164 | ||
165 | #endregion ISharedRegionModule | 165 | #endregion ISharedRegionModule |
166 | 166 | ||
167 | void OnLoginsEnabled(string regionName) | 167 | void OnLoginsEnabled(IScene scene) |
168 | { | 168 | { |
169 | Scene scene = null; | 169 | UploadMapTile(scene); |
170 | foreach (Scene s in m_scenes.Values) | ||
171 | if (s.RegionInfo.RegionName == regionName) | ||
172 | { | ||
173 | scene = s; | ||
174 | break; | ||
175 | } | ||
176 | if (scene != null) | ||
177 | UploadMapTile(scene); | ||
178 | } | 170 | } |
179 | 171 | ||
180 | |||
181 | ///<summary> | 172 | ///<summary> |
182 | /// | 173 | /// |
183 | ///</summary> | 174 | ///</summary> |
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs index f92ed8e..e2380b7 100644 --- a/OpenSim/Region/Framework/Scenes/EventManager.cs +++ b/OpenSim/Region/Framework/Scenes/EventManager.cs | |||
@@ -496,14 +496,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
496 | public delegate void RegionHeartbeatEnd(Scene scene); | 496 | public delegate void RegionHeartbeatEnd(Scene scene); |
497 | public event RegionHeartbeatEnd OnRegionHeartbeatEnd; | 497 | public event RegionHeartbeatEnd OnRegionHeartbeatEnd; |
498 | 498 | ||
499 | public delegate void LoginsEnabled(string regionName); | ||
500 | |||
501 | /// <summary> | 499 | /// <summary> |
502 | /// This should only fire in all circumstances if the RegionReady module is active. | 500 | /// This should only fire in all circumstances if the RegionReady module is active. |
503 | /// </summary> | 501 | /// </summary> |
504 | /// <remarks> | 502 | /// <remarks> |
505 | /// TODO: Fire this even when the RegionReady module is not active. | 503 | /// TODO: Fire this even when the RegionReady module is not active. |
506 | /// </remarks> | 504 | /// </remarks> |
505 | public delegate void LoginsEnabled(IScene scene); | ||
507 | public event LoginsEnabled OnLoginsEnabled; | 506 | public event LoginsEnabled OnLoginsEnabled; |
508 | 507 | ||
509 | public delegate void PrimsLoaded(Scene s); | 508 | public delegate void PrimsLoaded(Scene s); |
@@ -2477,7 +2476,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2477 | } | 2476 | } |
2478 | } | 2477 | } |
2479 | 2478 | ||
2480 | public void TriggerLoginsEnabled (string regionName) | 2479 | public void TriggerLoginsEnabled(Scene scene) |
2481 | { | 2480 | { |
2482 | LoginsEnabled handler = OnLoginsEnabled; | 2481 | LoginsEnabled handler = OnLoginsEnabled; |
2483 | 2482 | ||
@@ -2487,7 +2486,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2487 | { | 2486 | { |
2488 | try | 2487 | try |
2489 | { | 2488 | { |
2490 | d(regionName); | 2489 | d(scene); |
2491 | } | 2490 | } |
2492 | catch (Exception e) | 2491 | catch (Exception e) |
2493 | { | 2492 | { |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index de2b192..8a28ee4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1493,7 +1493,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1493 | { | 1493 | { |
1494 | // need to be able to tell these have changed in RegionReady | 1494 | // need to be able to tell these have changed in RegionReady |
1495 | LoginLock = false; | 1495 | LoginLock = false; |
1496 | EventManager.TriggerLoginsEnabled(RegionInfo.RegionName); | 1496 | EventManager.TriggerLoginsEnabled(this); |
1497 | } | 1497 | } |
1498 | 1498 | ||
1499 | // For RegionReady lockouts | 1499 | // For RegionReady lockouts |
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs index aeab61c..29515de 100644 --- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
59 | private bool m_disable_logins; | 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; |
63 | 63 | ||
64 | #region INonSharedRegionModule interface | 64 | #region INonSharedRegionModule interface |
65 | 65 | ||
@@ -192,7 +192,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
192 | m_scene.RegionInfo.RegionName, c.Message, m_channelNotify); | 192 | m_scene.RegionInfo.RegionName, c.Message, m_channelNotify); |
193 | 193 | ||
194 | m_scene.EventManager.TriggerOnChatBroadcast(this, c); | 194 | m_scene.EventManager.TriggerOnChatBroadcast(this, c); |
195 | m_scene.EventManager.TriggerLoginsEnabled(m_scene.RegionInfo.RegionName); | 195 | m_scene.EventManager.TriggerLoginsEnabled(m_scene); |
196 | m_scene.SceneGridService.InformNeighborsThatRegionisUp(m_scene.RequestModuleInterface<INeighbourService>(), m_scene.RegionInfo); | 196 | m_scene.SceneGridService.InformNeighborsThatRegionisUp(m_scene.RequestModuleInterface<INeighbourService>(), m_scene.RegionInfo); |
197 | } | 197 | } |
198 | } | 198 | } |
@@ -200,20 +200,28 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady | |||
200 | void OnOarFileLoaded(Guid requestId, string message) | 200 | void OnOarFileLoaded(Guid requestId, string message) |
201 | { | 201 | { |
202 | m_oarFileLoading = true; | 202 | m_oarFileLoading = true; |
203 | |||
203 | if (message==String.Empty) | 204 | if (message==String.Empty) |
204 | { | 205 | { |
205 | m_lastOarLoadedOk = true; | 206 | m_lastOarLoadedOk = true; |
206 | } else { | 207 | } |
208 | else | ||
209 | { | ||
207 | m_log.WarnFormat("[RegionReady]: Oar file load errors: {0}", message); | 210 | m_log.WarnFormat("[RegionReady]: Oar file load errors: {0}", message); |
208 | m_lastOarLoadedOk = false; | 211 | m_lastOarLoadedOk = false; |
209 | } | 212 | } |
210 | } | 213 | } |
211 | 214 | ||
212 | // This will be triggerd by Scene if we have no scripts | 215 | /// <summary> |
213 | // m_ScriptsRezzing will be false if there were none | 216 | /// This will be triggered by Scene directly if it contains no scripts on startup. |
214 | // else it will be true and we should wait on the | 217 | /// </summary> |
215 | // empty compile queue | 218 | /// <remarks> |
216 | void OnLoginsEnabled(string regionName) | 219 | /// m_ScriptsRezzing will be false if there were none |
220 | /// else it will be true and we should wait on the | ||
221 | /// empty compile queue | ||
222 | /// </remarks> | ||
223 | /// <param name='scene'></param> | ||
224 | void OnLoginsEnabled(IScene scene) | ||
217 | { | 225 | { |
218 | if (m_scene.StartDisabled == false) | 226 | if (m_scene.StartDisabled == false) |
219 | { | 227 | { |