From 878ce1e6b2b96043052015732286141f5b71310b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 25 Jul 2013 23:44:58 -0700 Subject: This should fix all issues with teleports. One should be able to TP as fast as needed. (Although sometimes Justin's state machine kicks in and doesn't let you) The EventQueues are a hairy mess, and it's very easy to mess things up. But it looks like this commit makes them work right. Here's what's going on: - Child and root agents are only closed after 15 sec, maybe - If the user comes back, they aren't closed, and everything is reused - On the receiving side, clients and scene presences are reused if they already exist - Caps are always recreated (this is where I spent most of my time!). It turns out that, because the agents carry the seeds around, the seed gets the same URL, except for the root agent coming back to a far away region, which gets a new seed (because we don't know what was its seed in the departing region, and we can't send it back to the client when the agent returns there). --- .../Linden/Caps/EventQueue/EventQueueGetModule.cs | 58 ++++++---------------- 1 file changed, 14 insertions(+), 44 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index c5e28ad..d02496f 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 scene.RegisterModuleInterface(this); scene.EventManager.OnClientClosed += ClientClosed; - scene.EventManager.OnMakeChildAgent += MakeChildAgent; scene.EventManager.OnRegisterCaps += OnRegisterCaps; MainConsole.Instance.Commands.AddCommand( @@ -120,7 +119,6 @@ namespace OpenSim.Region.ClientStack.Linden return; scene.EventManager.OnClientClosed -= ClientClosed; - scene.EventManager.OnMakeChildAgent -= MakeChildAgent; scene.EventManager.OnRegisterCaps -= OnRegisterCaps; scene.UnregisterModuleInterface(this); @@ -189,14 +187,12 @@ namespace OpenSim.Region.ClientStack.Linden { if (!queues.ContainsKey(agentId)) { - /* m_log.DebugFormat( "[EVENTQUEUE]: Adding new queue for agent {0} in region {1}", agentId, m_scene.RegionInfo.RegionName); - */ queues[agentId] = new Queue(); } - + return queues[agentId]; } } @@ -228,8 +224,12 @@ namespace OpenSim.Region.ClientStack.Linden { Queue queue = GetQueue(avatarID); if (queue != null) + { lock (queue) queue.Enqueue(ev); + } + else + m_log.WarnFormat("[EVENTQUEUE]: (Enqueue) No queue found for agent {0} in region {1}", avatarID, m_scene.RegionInfo.RegionName); } catch (NullReferenceException e) { @@ -244,7 +244,7 @@ namespace OpenSim.Region.ClientStack.Linden private void ClientClosed(UUID agentID, Scene scene) { -// m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); + //m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); int count = 0; while (queues.ContainsKey(agentID) && queues[agentID].Count > 0 && count++ < 5) @@ -261,31 +261,6 @@ namespace OpenSim.Region.ClientStack.Linden lock (m_AvatarQueueUUIDMapping) m_AvatarQueueUUIDMapping.Remove(agentID); -// lock (m_AvatarQueueUUIDMapping) -// { -// foreach (UUID ky in m_AvatarQueueUUIDMapping.Keys) -// { -//// m_log.DebugFormat("[EVENTQUEUE]: Found key {0} in m_AvatarQueueUUIDMapping while looking for {1}", ky, AgentID); -// if (ky == agentID) -// { -// removeitems.Add(ky); -// } -// } -// -// foreach (UUID ky in removeitems) -// { -// UUID eventQueueGetUuid = m_AvatarQueueUUIDMapping[ky]; -// m_AvatarQueueUUIDMapping.Remove(ky); -// -// string eqgPath = GenerateEqgCapPath(eventQueueGetUuid); -// MainServer.Instance.RemovePollServiceHTTPHandler("", eqgPath); -// -//// m_log.DebugFormat( -//// "[EVENT QUEUE GET MODULE]: Removed EQG handler {0} for {1} in {2}", -//// eqgPath, agentID, m_scene.RegionInfo.RegionName); -// } -// } - UUID searchval = UUID.Zero; removeitems.Clear(); @@ -305,19 +280,9 @@ namespace OpenSim.Region.ClientStack.Linden foreach (UUID ky in removeitems) m_QueueUUIDAvatarMapping.Remove(ky); } - } - private void MakeChildAgent(ScenePresence avatar) - { - //m_log.DebugFormat("[EVENTQUEUE]: Make Child agent {0} in region {1}.", avatar.UUID, m_scene.RegionInfo.RegionName); - //lock (m_ids) - // { - //if (m_ids.ContainsKey(avatar.UUID)) - //{ - // close the event queue. - //m_ids[avatar.UUID] = -1; - //} - //} + // m_log.DebugFormat("[EVENTQUEUE]: Deleted queues for {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); + } /// @@ -417,7 +382,12 @@ namespace OpenSim.Region.ClientStack.Linden if (DebugLevel >= 2) m_log.WarnFormat("POLLED FOR EQ MESSAGES BY {0} in {1}", pAgentId, m_scene.RegionInfo.RegionName); - Queue queue = TryGetQueue(pAgentId); + Queue queue = GetQueue(pAgentId); + if (queue == null) + { + return NoEvents(requestID, pAgentId); + } + OSD element; lock (queue) { -- cgit v1.1 From d5367a219daa0b946b3394e342734945d5ef7f1b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 26 Jul 2013 07:39:57 -0700 Subject: Slight improvement: no need to delay the removal of the queues in EQ, because DisableSimulator is now being sent via UDP --- .../ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | 8 -------- 1 file changed, 8 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index d02496f..c69f758 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -246,16 +246,8 @@ namespace OpenSim.Region.ClientStack.Linden { //m_log.DebugFormat("[EVENTQUEUE]: Closed client {0} in region {1}", agentID, m_scene.RegionInfo.RegionName); - int count = 0; - while (queues.ContainsKey(agentID) && queues[agentID].Count > 0 && count++ < 5) - { - Thread.Sleep(1000); - } - lock (queues) - { queues.Remove(agentID); - } List removeitems = new List(); lock (m_AvatarQueueUUIDMapping) -- cgit v1.1 From 69975763d2a735eb2696d2e27e5796a472a208ea Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 27 Jul 2013 15:38:56 -0700 Subject: Several major improvements to group (V2) chat. Specifically: handle join/drop appropriately, invitechatboxes. The major departure from flotsam is to send only one message per destination region, as opposed to one message per group member. This reduces messaging considerably in large groups that have clusters of members in certain regions. --- .../Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs index c69f758..d7afe1a 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/EventQueue/EventQueueGetModule.cs @@ -750,12 +750,12 @@ namespace OpenSim.Region.ClientStack.Linden } - public void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, + public void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID anotherAgent, bool canVoiceChat, bool isModerator, bool textMute) { OSD item = EventQueueHelper.ChatterBoxSessionAgentListUpdates(sessionID, fromAgent, canVoiceChat, isModerator, textMute); - Enqueue(item, toAgent); + Enqueue(item, fromAgent); //m_log.InfoFormat("########### eq ChatterBoxSessionAgentListUpdates #############\n{0}", item); } -- cgit v1.1