mirror of
https://github.com/opensim/opensim.git
synced 2026-08-13 05:05:43 +08:00
Revert "Updates all IRegionModules to the new style region modules."
This reverts commit ec3c31e61e.
This commit is contained in:
@@ -32,7 +32,6 @@ using System.Net;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenMetaverse.Packets;
|
||||
@@ -53,13 +52,11 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
|
||||
public OSDMap body;
|
||||
}
|
||||
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class EventQueueGetModule : IEventQueue, INonSharedRegionModule
|
||||
public class EventQueueGetModule : IEventQueue, IRegionModule
|
||||
{
|
||||
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
|
||||
protected Scene m_scene = null;
|
||||
private IConfigSource m_gConfig;
|
||||
private IConfig m_startupConfig;
|
||||
bool enabledYN = false;
|
||||
|
||||
private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>();
|
||||
@@ -68,31 +65,23 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
|
||||
private Dictionary<UUID, UUID> m_QueueUUIDAvatarMapping = new Dictionary<UUID, UUID>();
|
||||
private Dictionary<UUID, UUID> m_AvatarQueueUUIDMapping = new Dictionary<UUID, UUID>();
|
||||
|
||||
#region INonSharedRegionModule methods
|
||||
public virtual void Initialise(IConfigSource config)
|
||||
#region IRegionModule methods
|
||||
public virtual void Initialise(Scene scene, IConfigSource config)
|
||||
{
|
||||
m_gConfig = config;
|
||||
|
||||
m_startupConfig = m_gConfig.Configs["Startup"];
|
||||
}
|
||||
IConfig startupConfig = m_gConfig.Configs["Startup"];
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
{
|
||||
ReadConfigAndPopulate(scene, m_startupConfig, "Startup");
|
||||
ReadConfigAndPopulate(scene, startupConfig, "Startup");
|
||||
|
||||
if (enabledYN)
|
||||
{
|
||||
m_scene = scene;
|
||||
scene.RegisterModuleInterface<IEventQueue>(this);
|
||||
|
||||
|
||||
// Register fallback handler
|
||||
// Why does EQG Fail on region crossings!
|
||||
|
||||
|
||||
//scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack);
|
||||
|
||||
scene.EventManager.OnNewClient += OnNewClient;
|
||||
@@ -110,14 +99,7 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
|
||||
{
|
||||
m_gConfig = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p)
|
||||
@@ -125,6 +107,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
|
||||
enabledYN = startupConfig.GetBoolean("EventQueue", true);
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void Close()
|
||||
{
|
||||
}
|
||||
@@ -134,6 +120,10 @@ namespace OpenSim.Region.CoreModules.Framework.EventQueue
|
||||
get { return "EventQueueGetModule"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -25,12 +25,10 @@
|
||||
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using log4net;
|
||||
using Mono.Addins;
|
||||
using Nini.Config;
|
||||
using OpenMetaverse;
|
||||
using OpenSim.Framework;
|
||||
@@ -41,8 +39,7 @@ using OpenSim.Region.Framework.Scenes;
|
||||
|
||||
namespace OpenSim.Region.CoreModules.Framework.Monitoring
|
||||
{
|
||||
[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
|
||||
public class MonitorModule : INonSharedRegionModule
|
||||
public class MonitorModule : IRegionModule
|
||||
{
|
||||
private Scene m_scene;
|
||||
private readonly List<IMonitor> m_monitors = new List<IMonitor>();
|
||||
@@ -65,19 +62,9 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
|
||||
}
|
||||
}
|
||||
|
||||
#region Implementation of INonSharedRegionModule
|
||||
#region Implementation of IRegionModule
|
||||
|
||||
public void Initialise(IConfigSource source)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Type ReplaceableInterface
|
||||
{
|
||||
get { return null; }
|
||||
}
|
||||
|
||||
public void AddRegion(Scene scene)
|
||||
public void Initialise(Scene scene, IConfigSource source)
|
||||
{
|
||||
m_scene = scene;
|
||||
|
||||
@@ -90,51 +77,6 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
|
||||
MainServer.Instance.AddHTTPHandler("/monitorstats/" + m_scene.RegionInfo.RegionID + "/", StatsPage);
|
||||
}
|
||||
|
||||
public void RegionLoaded(Scene scene)
|
||||
{
|
||||
m_monitors.Add(new AgentCountMonitor(m_scene));
|
||||
m_monitors.Add(new ChildAgentCountMonitor(m_scene));
|
||||
m_monitors.Add(new GCMemoryMonitor());
|
||||
m_monitors.Add(new ObjectCountMonitor(m_scene));
|
||||
m_monitors.Add(new PhysicsFrameMonitor(m_scene));
|
||||
m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene));
|
||||
m_monitors.Add(new PWSMemoryMonitor());
|
||||
m_monitors.Add(new ThreadCountMonitor());
|
||||
m_monitors.Add(new TotalFrameMonitor(m_scene));
|
||||
m_monitors.Add(new EventFrameMonitor(m_scene));
|
||||
m_monitors.Add(new LandFrameMonitor(m_scene));
|
||||
m_monitors.Add(new LastFrameTimeMonitor(m_scene));
|
||||
|
||||
m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor));
|
||||
|
||||
foreach (IAlert alert in m_alerts)
|
||||
{
|
||||
alert.OnTriggerAlert += OnTriggerAlert;
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRegion(Scene scene)
|
||||
{
|
||||
MainServer.Instance.RemoveHTTPHandler("", "/monitorstats/" + m_scene.RegionInfo.RegionID + "/");
|
||||
m_monitors.Clear();
|
||||
|
||||
foreach (IAlert alert in m_alerts)
|
||||
{
|
||||
alert.OnTriggerAlert -= OnTriggerAlert;
|
||||
}
|
||||
m_alerts.Clear();
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Region Health Monitoring Module"; }
|
||||
}
|
||||
|
||||
public Hashtable StatsPage(Hashtable request)
|
||||
{
|
||||
// If request was for a specific monitor
|
||||
@@ -190,10 +132,49 @@ namespace OpenSim.Region.CoreModules.Framework.Monitoring
|
||||
return ereply;
|
||||
}
|
||||
|
||||
public void PostInitialise()
|
||||
{
|
||||
m_monitors.Add(new AgentCountMonitor(m_scene));
|
||||
m_monitors.Add(new ChildAgentCountMonitor(m_scene));
|
||||
m_monitors.Add(new GCMemoryMonitor());
|
||||
m_monitors.Add(new ObjectCountMonitor(m_scene));
|
||||
m_monitors.Add(new PhysicsFrameMonitor(m_scene));
|
||||
m_monitors.Add(new PhysicsUpdateFrameMonitor(m_scene));
|
||||
m_monitors.Add(new PWSMemoryMonitor());
|
||||
m_monitors.Add(new ThreadCountMonitor());
|
||||
m_monitors.Add(new TotalFrameMonitor(m_scene));
|
||||
m_monitors.Add(new EventFrameMonitor(m_scene));
|
||||
m_monitors.Add(new LandFrameMonitor(m_scene));
|
||||
m_monitors.Add(new LastFrameTimeMonitor(m_scene));
|
||||
|
||||
m_alerts.Add(new DeadlockAlert(m_monitors.Find(x => x is LastFrameTimeMonitor) as LastFrameTimeMonitor));
|
||||
|
||||
foreach (IAlert alert in m_alerts)
|
||||
{
|
||||
alert.OnTriggerAlert += OnTriggerAlert;
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerAlert(System.Type reporter, string reason, bool fatal)
|
||||
{
|
||||
m_log.Error("[Monitor] " + reporter.Name + " for " + m_scene.RegionInfo.RegionName + " reports " + reason + " (Fatal: " + fatal + ")");
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Region Health Monitoring Module"; }
|
||||
}
|
||||
|
||||
public bool IsSharedModule
|
||||
{
|
||||
get { return false; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user