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.
parent
90f657d77d
commit
9759b2a4bb
|
@ -392,6 +392,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
public delegate void LoginsEnabled(string regionName);
|
||||
public event LoginsEnabled OnLoginsEnabled;
|
||||
|
||||
public delegate void PrimsLoaded(Scene s);
|
||||
public event PrimsLoaded OnPrimsLoaded;
|
||||
|
||||
public class MoneyTransferArgs : EventArgs
|
||||
{
|
||||
public UUID sender;
|
||||
|
@ -2242,5 +2245,26 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerPrimsLoaded(Scene s)
|
||||
{
|
||||
PrimsLoaded handler = OnPrimsLoaded;
|
||||
|
||||
if (handler != null)
|
||||
{
|
||||
foreach (PrimsLoaded d in handler.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d(s);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat("[EVENT MANAGER]: Delegate for PrimsLoaded failed - continuing {0} - {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1754,6 +1754,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
|
||||
LoadingPrims = false;
|
||||
EventManager.TriggerPrimsLoaded(this);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue