diff options
author | Melanie | 2013-07-29 02:08:05 +0100 |
---|---|---|
committer | Melanie | 2013-07-29 02:08:05 +0100 |
commit | bf283208df4a6936de85b2746112bb568d9c9d25 (patch) | |
tree | dafe50ad8e55ac30c41f5e7ebd11992f2772c294 /OpenSim/Region/ClientStack/Linden | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Same issue. (diff) | |
download | opensim-SC_OLD-bf283208df4a6936de85b2746112bb568d9c9d25.zip opensim-SC_OLD-bf283208df4a6936de85b2746112bb568d9c9d25.tar.gz opensim-SC_OLD-bf283208df4a6936de85b2746112bb568d9c9d25.tar.bz2 opensim-SC_OLD-bf283208df4a6936de85b2746112bb568d9c9d25.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs
OpenSim/Region/Framework/Scenes/Scene.cs
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | 70 |
1 files changed, 16 insertions, 54 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index e98a470..4272375 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | |||
@@ -91,7 +91,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
91 | scene.RegisterModuleInterface<IEventQueue>(this); | 91 | scene.RegisterModuleInterface<IEventQueue>(this); |
92 | 92 | ||
93 | scene.EventManager.OnClientClosed += ClientClosed; | 93 | scene.EventManager.OnClientClosed += ClientClosed; |
94 | scene.EventManager.OnMakeChildAgent += MakeChildAgent; | ||
95 | scene.EventManager.OnRegisterCaps += OnRegisterCaps; | 94 | scene.EventManager.OnRegisterCaps += OnRegisterCaps; |
96 | 95 | ||
97 | MainConsole.Instance.Commands.AddCommand( | 96 | MainConsole.Instance.Commands.AddCommand( |
@@ -120,7 +119,6 @@ namespace OpenSim.Region.ClientStack.Linden | |||
120 | return; | 119 | return; |
121 | 120 | ||
122 | scene.EventManager.OnClientClosed -= ClientClosed; | 121 | scene.EventManager.OnClientClosed -= ClientClosed; |
123 | scene.EventManager.OnMakeChildAgent -= MakeChildAgent; | ||
124 | scene.EventManager.OnRegisterCaps -= OnRegisterCaps; | 122 | scene.EventManager.OnRegisterCaps -= OnRegisterCaps; |
125 | 123 | ||
126 | scene.UnregisterModuleInterface<IEventQueue>(this); | 124 | scene.UnregisterModuleInterface<IEventQueue>(this); |
@@ -189,14 +187,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
189 | { | 187 | { |
190 | if (!queues.ContainsKey(agentId)) | 188 | if (!queues.ContainsKey(agentId)) |
191 | { | 189 | { |
192 | /* | ||
193 | m_log.DebugFormat( | 190 | m_log.DebugFormat( |
194 | "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", | 191 | "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", |
195 | agentId, m_scene.RegionInfo.RegionName); | 192 | agentId, m_scene.RegionInfo.RegionName); |
196 | */ | ||
197 | queues[agentId] = new Queue<OSD>(); | 193 | queues[agentId] = new Queue<OSD>(); |
198 | } | 194 | } |
199 | 195 | ||
200 | return queues[agentId]; | 196 | return queues[agentId]; |
201 | } | 197 | } |
202 | } | 198 | } |
@@ -228,8 +224,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
228 | { | 224 | { |
229 | Queue<OSD> queue = GetQueue(avatarID); | 225 | Queue<OSD> queue = GetQueue(avatarID); |
230 | if (queue != null) | 226 | if (queue != null) |
227 | { | ||
231 | lock (queue) | 228 | lock (queue) |
232 | queue.Enqueue(ev); | 229 | queue.Enqueue(ev); |
230 | } | ||
231 | else | ||
232 | m_log.WarnFormat("[EVENTQUEUE]: (Enqueue) No queue found for agent {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName); | ||
233 | } | 233 | } |
234 | catch (NullReferenceException e) | 234 | catch (NullReferenceException e) |
235 | { | 235 | { |
@@ -244,48 +244,15 @@ namespace OpenSim.Region.ClientStack.Linden | |||
244 | 244 | ||
245 | private void ClientClosed(UUID agentID, Scene scene) | 245 | private void ClientClosed(UUID agentID, Scene scene) |
246 | { | 246 | { |
247 | // m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); | 247 | //m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); |
248 | |||
249 | int count = 0; | ||
250 | while (queues.ContainsKey(agentID) && queues[agentID].Count > 0 && count++ < 5) | ||
251 | { | ||
252 | Thread.Sleep(1000); | ||
253 | } | ||
254 | 248 | ||
255 | lock (queues) | 249 | lock (queues) |
256 | { | ||
257 | queues.Remove(agentID); | 250 | queues.Remove(agentID); |
258 | } | ||
259 | 251 | ||
260 | List<UUID> removeitems = new List<UUID>(); | 252 | List<UUID> removeitems = new List<UUID>(); |
261 | lock (m_AvatarQueueUUIDMapping) | 253 | lock (m_AvatarQueueUUIDMapping) |
262 | m_AvatarQueueUUIDMapping.Remove(agentID); | 254 | m_AvatarQueueUUIDMapping.Remove(agentID); |
263 | 255 | ||
264 | // lock (m_AvatarQueueUUIDMapping) | ||
265 | // { | ||
266 | // foreach (UUID ky in m_AvatarQueueUUIDMapping.Keys) | ||
267 | // { | ||
268 | //// m_log.DebugFormat("[EVENTQUEUE]: Found key {0} in m_AvatarQueueUUIDMapping while looking for {1}", ky, AgentID); | ||
269 | // if (ky == agentID) | ||
270 | // { | ||
271 | // removeitems.Add(ky); | ||
272 | // } | ||
273 | // } | ||
274 | // | ||
275 | // foreach (UUID ky in removeitems) | ||
276 | // { | ||
277 | // UUID eventQueueGetUuid = m_AvatarQueueUUIDMapping[ky]; | ||
278 | // m_AvatarQueueUUIDMapping.Remove(ky); | ||
279 | // | ||
280 | // string eqgPath = GenerateEqgCapPath(eventQueueGetUuid); | ||
281 | // MainServer.Instance.RemovePollServiceHTTPHandler("", eqgPath); | ||
282 | // | ||
283 | //// m_log.DebugFormat( | ||
284 | //// "[EVENT QUEUE GET MODULE]: Removed EQG handler {0} for {1} in {2}", | ||
285 | //// eqgPath, agentID, m_scene.RegionInfo.RegionName); | ||
286 | // } | ||
287 | // } | ||
288 | |||
289 | UUID searchval = UUID.Zero; | 256 | UUID searchval = UUID.Zero; |
290 | 257 | ||
291 | removeitems.Clear(); | 258 | removeitems.Clear(); |
@@ -305,19 +272,9 @@ namespace OpenSim.Region.ClientStack.Linden | |||
305 | foreach (UUID ky in removeitems) | 272 | foreach (UUID ky in removeitems) |
306 | m_QueueUUIDAvatarMapping.Remove(ky); | 273 | m_QueueUUIDAvatarMapping.Remove(ky); |
307 | } | 274 | } |
308 | } | ||
309 | 275 | ||
310 | private void MakeChildAgent(ScenePresence avatar) | 276 | // m_log.DebugFormat("[EVENTQUEUE]: Deleted queues for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); |
311 | { | 277 | |
312 | //m_log.DebugFormat("[EVENTQUEUE]: Make Child agent {0} in region {1}.", avatar.UUID, m_scene.RegionInfo.RegionName); | ||
313 | //lock (m_ids) | ||
314 | // { | ||
315 | //if (m_ids.ContainsKey(avatar.UUID)) | ||
316 | //{ | ||
317 | // close the event queue. | ||
318 | //m_ids[avatar.UUID] = -1; | ||
319 | //} | ||
320 | //} | ||
321 | } | 278 | } |
322 | 279 | ||
323 | /// <summary> | 280 | /// <summary> |
@@ -417,7 +374,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
417 | if (DebugLevel >= 2) | 374 | if (DebugLevel >= 2) |
418 | m_log.WarnFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.RegionInfo.RegionName); | 375 | m_log.WarnFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.RegionInfo.RegionName); |
419 | 376 | ||
420 | Queue<OSD> queue = TryGetQueue(pAgentId); | 377 | Queue<OSD> queue = GetQueue(pAgentId); |
378 | if (queue == null) | ||
379 | { | ||
380 | return NoEvents(requestID, pAgentId); | ||
381 | } | ||
382 | |||
421 | OSD element; | 383 | OSD element; |
422 | lock (queue) | 384 | lock (queue) |
423 | { | 385 | { |
@@ -788,12 +750,12 @@ namespace OpenSim.Region.ClientStack.Linden | |||
788 | 750 | ||
789 | } | 751 | } |
790 | 752 | ||
791 | public void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, | 753 | public void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID anotherAgent, bool canVoiceChat, |
792 | bool isModerator, bool textMute) | 754 | bool isModerator, bool textMute) |
793 | { | 755 | { |
794 | OSD item = EventQueueHelper.ChatterBoxSessionAgentListUpdates(sessionID, fromAgent, canVoiceChat, | 756 | OSD item = EventQueueHelper.ChatterBoxSessionAgentListUpdates(sessionID, fromAgent, canVoiceChat, |
795 | isModerator, textMute); | 757 | isModerator, textMute); |
796 | Enqueue(item, toAgent); | 758 | Enqueue(item, fromAgent); |
797 | //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item); | 759 | //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item); |
798 | } | 760 | } |
799 | 761 | ||