aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack')
-rw-r--r--OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs91
1 files changed, 38 insertions, 53 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs
index 47cb049..b96b1db 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
97// scene.EventManager.OnNewClient += OnNewClient;
98
99 // TODO: Leaving these open, or closing them when we
100 // become a child is incorrect. It messes up TP in a big
101 // way. CAPS/EQ need to be active as long as the UDP
102 // circuit is there.
103 80
104 scene.EventManager.OnClientClosed += ClientClosed; 81 public void AddRegion(Scene scene)
105 82 {
106 scene.EventManager.OnMakeChildAgent += MakeChildAgent; 83 m_scene = scene;
107 scene.EventManager.OnRegisterCaps += OnRegisterCaps; 84 scene.RegisterModuleInterface<IEventQueue>(this);
108 85
109 MainConsole.Instance.Commands.AddCommand( 86 scene.EventManager.OnClientClosed += ClientClosed;
110 "Debug", 87 scene.EventManager.OnMakeChildAgent += MakeChildAgent;
111 false, 88 scene.EventManager.OnRegisterCaps += OnRegisterCaps;
112 "debug eq", 89
113 "debug eq [0|1|2]", 90 MainConsole.Instance.Commands.AddCommand(
114 "Turn on event queue debugging\n" 91 "Debug",
115 + " <= 0 - turns off all event queue logging\n" 92 false,
116 + " >= 1 - turns on outgoing event logging\n" 93 "debug eq",
117 + " >= 2 - turns on poll notification", 94 "debug eq [0|1|2]",
118 HandleDebugEq); 95 "Turn on event queue debugging\n"
119 } 96 + " <= 0 - turns off all event queue logging\n"
120 else 97 + " >= 1 - turns on outgoing event logging\n"
121 { 98 + " >= 2 - turns on poll notification",
122 m_gConfig = null; 99 HandleDebugEq);
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)