Don't start KeyframeMotion timers until all the regions are ready. This prevents problems in megaregions (prims that think they've crossed over to other regions).
parent
120f872d2b
commit
0237d9113d
|
@ -47,7 +47,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
public class KeyframeTimer
|
public class KeyframeTimer
|
||||||
{
|
{
|
||||||
private static Dictionary<Scene, KeyframeTimer>m_timers =
|
private static Dictionary<Scene, KeyframeTimer> m_timers =
|
||||||
new Dictionary<Scene, KeyframeTimer>();
|
new Dictionary<Scene, KeyframeTimer>();
|
||||||
|
|
||||||
private Timer m_timer;
|
private Timer m_timer;
|
||||||
|
@ -67,8 +67,15 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
m_timer.Interval = TickDuration;
|
m_timer.Interval = TickDuration;
|
||||||
m_timer.AutoReset = true;
|
m_timer.AutoReset = true;
|
||||||
m_timer.Elapsed += OnTimer;
|
m_timer.Elapsed += OnTimer;
|
||||||
|
}
|
||||||
|
|
||||||
m_timer.Start();
|
public void Start()
|
||||||
|
{
|
||||||
|
lock (m_timer)
|
||||||
|
{
|
||||||
|
if (!m_timer.Enabled)
|
||||||
|
m_timer.Start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnTimer(object sender, ElapsedEventArgs ea)
|
private void OnTimer(object sender, ElapsedEventArgs ea)
|
||||||
|
@ -120,6 +127,25 @@ namespace OpenSim.Region.Framework.Scenes
|
||||||
{
|
{
|
||||||
timer = new KeyframeTimer(motion.Scene);
|
timer = new KeyframeTimer(motion.Scene);
|
||||||
m_timers[motion.Scene] = timer;
|
m_timers[motion.Scene] = timer;
|
||||||
|
|
||||||
|
if (!SceneManager.Instance.AllRegionsReady)
|
||||||
|
{
|
||||||
|
// Start the timers only once all the regions are ready. This is required
|
||||||
|
// when using megaregions, because the megaregion is correctly configured
|
||||||
|
// only after all the regions have been loaded. (If we don't do this then
|
||||||
|
// when the prim moves it might think that it crossed into a region.)
|
||||||
|
SceneManager.Instance.OnRegionsReadyStatusChange += delegate(SceneManager sm)
|
||||||
|
{
|
||||||
|
if (sm.AllRegionsReady)
|
||||||
|
timer.Start();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check again, in case the regions were started while we were adding the event handler
|
||||||
|
if (SceneManager.Instance.AllRegionsReady)
|
||||||
|
{
|
||||||
|
timer.Start();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue