aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorDiva Canto2011-06-08 15:18:14 -0700
committerDiva Canto2011-06-08 15:18:14 -0700
commit9759b2a4bb5e5e2bed4c74cea05be58640c8e7c3 (patch)
treea65fadc5299dcdcf98e507ceb017dde94f4b3e2a /OpenSim/Region/Framework
parentDeleted wrong debug message. (diff)
downloadopensim-SC_OLD-9759b2a4bb5e5e2bed4c74cea05be58640c8e7c3.zip
opensim-SC_OLD-9759b2a4bb5e5e2bed4c74cea05be58640c8e7c3.tar.gz
opensim-SC_OLD-9759b2a4bb5e5e2bed4c74cea05be58640c8e7c3.tar.bz2
opensim-SC_OLD-9759b2a4bb5e5e2bed4c74cea05be58640c8e7c3.tar.xz
Added EventManager.OnPrimsLoaded, an event that modules can hook up onto so that they know when the scene's objects have been loaded from the DB.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/EventManager.cs24
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs1
2 files changed, 25 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index b43d5f0..b67937d 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -392,6 +392,9 @@ namespace OpenSim.Region.Framework.Scenes
392 public delegate void LoginsEnabled(string regionName); 392 public delegate void LoginsEnabled(string regionName);
393 public event LoginsEnabled OnLoginsEnabled; 393 public event LoginsEnabled OnLoginsEnabled;
394 394
395 public delegate void PrimsLoaded(Scene s);
396 public event PrimsLoaded OnPrimsLoaded;
397
395 public class MoneyTransferArgs : EventArgs 398 public class MoneyTransferArgs : EventArgs
396 { 399 {
397 public UUID sender; 400 public UUID sender;
@@ -2242,5 +2245,26 @@ namespace OpenSim.Region.Framework.Scenes
2242 } 2245 }
2243 } 2246 }
2244 } 2247 }
2248
2249 public void TriggerPrimsLoaded(Scene s)
2250 {
2251 PrimsLoaded handler = OnPrimsLoaded;
2252
2253 if (handler != null)
2254 {
2255 foreach (PrimsLoaded d in handler.GetInvocationList())
2256 {
2257 try
2258 {
2259 d(s);
2260 }
2261 catch (Exception e)
2262 {
2263 m_log.ErrorFormat("[EVENT MANAGER]: Delegate for PrimsLoaded failed - continuing {0} - {1}",
2264 e.Message, e.StackTrace);
2265 }
2266 }
2267 }
2268 }
2245 } 2269 }
2246} 2270}
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 588d627..f122b58 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1754,6 +1754,7 @@ namespace OpenSim.Region.Framework.Scenes
1754 1754
1755 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)"); 1755 m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
1756 LoadingPrims = false; 1756 LoadingPrims = false;
1757 EventManager.TriggerPrimsLoaded(this);
1757 } 1758 }
1758 1759
1759 1760