aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs87
1 files changed, 36 insertions, 51 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index 5bbdce8..05d5577 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
55 public OSDMap body; 55 public OSDMap body;
56 } 56 }
57 57
58 //[Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")] 58 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule")]
59 public class EventQueueGetModule : IEventQueue, IRegionModule 59 public class EventQueueGetModule : IEventQueue, INonSharedRegionModule
60 { 60 {
61 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 61 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
62 62
@@ -66,8 +66,6 @@ namespace OpenSim.Region.ClientStack.Linden
66 public int DebugLevel { get; set; } 66 public int DebugLevel { get; set; }
67 67
68 protected Scene m_scene; 68 protected Scene m_scene;
69 private IConfigSource m_gConfig;
70 bool enabledYN;
71 69
72 private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>(); 70 private Dictionary<UUID, int> m_ids = new Dictionary<UUID, int>();
73 71
@@ -75,60 +73,46 @@ namespace OpenSim.Region.ClientStack.Linden
75 private Dictionary<UUID, UUID> m_QueueUUIDAvatarMapping = new Dictionary<UUID, UUID>(); 73 private Dictionary<UUID, UUID> m_QueueUUIDAvatarMapping = new Dictionary<UUID, UUID>();
76 private Dictionary<UUID, UUID> m_AvatarQueueUUIDMapping = new Dictionary<UUID, UUID>(); 74 private Dictionary<UUID, UUID> m_AvatarQueueUUIDMapping = new Dictionary<UUID, UUID>();
77 75
78 #region IRegionModule methods 76 #region INonSharedRegionModule methods
79 public virtual void Initialise(Scene scene, IConfigSource config) 77 public virtual void Initialise(IConfigSource config)
80 { 78 {
81 m_gConfig = config; 79 }
82
83 IConfig startupConfig = m_gConfig.Configs["Startup"];
84
85 ReadConfigAndPopulate(scene, startupConfig, "Startup");
86
87 if (enabledYN)
88 {
89 m_scene = scene;
90 scene.RegisterModuleInterface<IEventQueue>(this);
91
92 // Register fallback handler
93 // Why does EQG Fail on region crossings!
94
95 //scene.CommsManager.HttpServer.AddLLSDHandler("/CAPS/EQG/", EventQueueFallBack);
96 80
97// scene.EventManager.OnNewClient += OnNewClient; 81 public void AddRegion(Scene scene)
82 {
83 m_scene = scene;
84 scene.RegisterModuleInterface<IEventQueue>(this);
98 85
99 // TODO: Leaving these open, or closing them when we 86 scene.EventManager.OnClientClosed += ClientClosed;
100 // become a child is incorrect. It messes up TP in a big 87 scene.EventManager.OnMakeChildAgent += MakeChildAgent;
101 // way. CAPS/EQ need to be active as long as the UDP 88 scene.EventManager.OnRegisterCaps += OnRegisterCaps;
102 // circuit is there.
103 89
104 scene.EventManager.OnClientClosed += ClientClosed; 90 MainConsole.Instance.Commands.AddCommand(
105 91 "Debug",
106 scene.EventManager.OnMakeChildAgent += MakeChildAgent; 92 false,
107 scene.EventManager.OnRegisterCaps += OnRegisterCaps; 93 "debug eq",
108 94 "debug eq [0|1|2]",
109 MainConsole.Instance.Commands.AddCommand( 95 "Turn on event queue debugging\n"
110 "Debug", 96 + " <= 0 - turns off all event queue logging\n"
111 false, 97 + " >= 1 - turns on outgoing event logging\n"
112 "debug eq", 98 + " >= 2 - turns on poll notification",
113 "debug eq [0|1|2]", 99 HandleDebugEq);
114 "Turn on event queue debugging\n"
115 + " <= 0 - turns off all event queue logging\n"
116 + " >= 1 - turns on outgoing event logging\n"
117 + " >= 2 - turns on poll notification",
118 HandleDebugEq);
119 }
120 else
121 {
122 m_gConfig = null;
123 }
124 } 100 }
125 101
126 private void ReadConfigAndPopulate(Scene scene, IConfig startupConfig, string p) 102 public void RemoveRegion(Scene scene)
127 { 103 {
128 enabledYN = startupConfig.GetBoolean("EventQueue", true); 104 if (m_scene != scene)
105 return;
106
107 scene.EventManager.OnClientClosed -= ClientClosed;
108 scene.EventManager.OnMakeChildAgent -= MakeChildAgent;
109 scene.EventManager.OnRegisterCaps -= OnRegisterCaps;
110
111 scene.UnregisterModuleInterface<IEventQueue>(this);
112 m_scene = null;
129 } 113 }
130 114
131 public void PostInitialise() 115 public void RegionLoaded(Scene scene)
132 { 116 {
133 } 117 }
134 118
@@ -141,10 +125,11 @@ namespace OpenSim.Region.ClientStack.Linden
141 get { return "EventQueueGetModule"; } 125 get { return "EventQueueGetModule"; }
142 } 126 }
143 127
144 public bool IsSharedModule 128 public Type ReplaceableInterface
145 { 129 {
146 get { return false; } 130 get { return null; }
147 } 131 }
132
148 #endregion 133 #endregion
149 134
150 protected void HandleDebugEq(string module, string[] args) 135 protected void HandleDebugEq(string module, string[] args)