From 4ac857f9025a8308b0e14adbddffd89b467caf17 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 10 Nov 2012 08:48:31 -0800 Subject: [PATCH] One more module: EventQueueGetModule. Also making it non-optional for this dll. --- .../Caps/EventQueue/EventQueueGetModule.cs | 93 ++++++++----------- bin/OpenSimDefaults.ini | 3 - 2 files changed, 39 insertions(+), 57 deletions(-) diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index 47cb04953f..b96b1db6f9 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -55,8 +55,8 @@ namespace OpenSim.Region.ClientStack.Linden public OSDMap body; } - //[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] - public class EventQueueGetModule : IEventQueue, IRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] + public class EventQueueGetModule : IEventQueue, INonSharedRegionModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -66,8 +66,6 @@ namespace OpenSim.Region.ClientStack.Linden public int DebugLevel { get; set; } protected Scene m_scene; - private IConfigSource m_gConfig; - bool enabledYN; private Dictionary m_ids = new Dictionary(); @@ -75,60 +73,46 @@ namespace OpenSim.Region.ClientStack.Linden private Dictionary m_QueueUUIDAvatarMapping = new Dictionary(); private Dictionary m_AvatarQueueUUIDMapping = new Dictionary(); - #region IRegionModule methods - public virtual void Initialise(Scene scene, IConfigSource config) + #region INonSharedRegionModule methods + public virtual void Initialise(IConfigSource config) { - m_gConfig = config; - - IConfig startupConfig = m_gConfig.Configs["Startup"]; - - ReadConfigAndPopulate(scene, startupConfig, "Startup"); - - if (enabledYN) - { - m_scene = scene; - scene.RegisterModuleInterface(this); - - // Register fallback handler - // Why does EQG Fail on region crossings! - - //scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack); - -// scene.EventManager.OnNewClient += OnNewClient; - - // TODO: Leaving these open, or closing them when we - // become a child is incorrect. It messes up TP in a big - // way. CAPS/EQ need to be active as long as the UDP - // circuit is there. - - scene.EventManager.OnClientClosed += ClientClosed; - - scene.EventManager.OnMakeChildAgent += MakeChildAgent; - scene.EventManager.OnRegisterCaps += OnRegisterCaps; - - MainConsole.Instance.Commands.AddCommand( - "Debug", - false, - "debug eq", - "debug eq [0|1|2]", - "Turn on event queue debugging\n" - + " <= 0 - turns off all event queue logging\n" - + " >= 1 - turns on outgoing event logging\n" - + " >= 2 - turns on poll notification", - HandleDebugEq); - } - else - { - m_gConfig = null; - } } - private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) + public void AddRegion(Scene scene) { - enabledYN = startupConfig.GetBoolean("EventQueue", true); + m_scene = scene; + scene.RegisterModuleInterface(this); + + scene.EventManager.OnClientClosed += ClientClosed; + scene.EventManager.OnMakeChildAgent += MakeChildAgent; + scene.EventManager.OnRegisterCaps += OnRegisterCaps; + + MainConsole.Instance.Commands.AddCommand( + "Debug", + false, + "debug eq", + "debug eq [0|1|2]", + "Turn on event queue debugging\n" + + " <= 0 - turns off all event queue logging\n" + + " >= 1 - turns on outgoing event logging\n" + + " >= 2 - turns on poll notification", + HandleDebugEq); } - public void PostInitialise() + public void RemoveRegion(Scene scene) + { + if (m_scene != scene) + return; + + scene.EventManager.OnClientClosed -= ClientClosed; + scene.EventManager.OnMakeChildAgent -= MakeChildAgent; + scene.EventManager.OnRegisterCaps -= OnRegisterCaps; + + scene.UnregisterModuleInterface(this); + m_scene = null; + } + + public void RegionLoaded(Scene scene) { } @@ -141,10 +125,11 @@ namespace OpenSim.Region.ClientStack.Linden get { return "EventQueueGetModule"; } } - public bool IsSharedModule + public Type ReplaceableInterface { - get { return false; } + get { return null; } } + #endregion protected void HandleDebugEq(string module, string[] args) diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index fa284bdef1..4b589857d5 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -57,9 +57,6 @@ ; ## CLIENTS ; ## - ; Enables EventQueueGet Service. - EventQueue = true - ; Set this to the DLL containing the client stack to use. clientstack_plugin="OpenSim.Region.ClientStack.LindenUDP.dll"