From 1fabdcc43cc2d62ff03888166582b25884056e94 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 26 Jul 2013 01:04:16 +0100 Subject: If a returning teleport starts to reuse a downgraded child connection that was a previous root agent, do not close that child agent at the end of the 15 sec teleport timer. This prevents an issue if the user teleports back to the neighbour simulator of a source before 15 seconds have elapsed. This more closely emulates observed linden behaviour, though the timeout there is 50 secs and applies to all the pre-teleport agents. Currently sticks a DoNotClose flag on ScenePresence though this may be temporary as possibly it could be incorporated into the ETM state machine --- OpenSim/Region/Framework/Scenes/Scene.cs | 29 +++++++++++++++--------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 ++++++ 2 files changed, 25 insertions(+), 11 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 84fdef0..f4622b6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3682,19 +3682,26 @@ namespace OpenSim.Region.Framework.Scenes { ScenePresence sp = GetScenePresence(agent.AgentID); - if (sp != null && !sp.IsChildAgent) + if (sp != null) { - // We have a zombie from a crashed session. - // Or the same user is trying to be root twice here, won't work. - // Kill it. - m_log.WarnFormat( - "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", - sp.Name, sp.UUID, RegionInfo.RegionName); - - if (sp.ControllingClient != null) - sp.ControllingClient.Close(true); + if (!sp.IsChildAgent) + { + // We have a zombie from a crashed session. + // Or the same user is trying to be root twice here, won't work. + // Kill it. + m_log.WarnFormat( + "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", + sp.Name, sp.UUID, RegionInfo.RegionName); + + if (sp.ControllingClient != null) + sp.ControllingClient.Close(true); - sp = null; + sp = null; + } + else + { + sp.DoNotClose = true; + } } // Optimistic: add or update the circuit data with the new agent circuit data and teleport flags. diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f9190d9..d3e1946 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -717,6 +717,13 @@ namespace OpenSim.Region.Framework.Scenes } } + /// + /// Used by the entity transfer module to signal when the presence should not be closed because a subsequent + /// teleport is reusing the connection. + /// + /// May be refactored or move somewhere else soon. + public bool DoNotClose { get; set; } + private float m_speedModifier = 1.0f; public float SpeedModifier -- cgit v1.1 From 72ed49af5f864e50fa4453849a94dd9d46533cba Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 26 Jul 2013 01:38:04 +0100 Subject: Reset DoNotClose scene presence teleport flag before pausing. Rename DoNotClose to DoNotCloseAfterTeleport --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f4622b6..705660d 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3700,7 +3700,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - sp.DoNotClose = true; + sp.DoNotCloseAfterTeleport = true; } } diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index d3e1946..4044f0c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -722,7 +722,7 @@ namespace OpenSim.Region.Framework.Scenes /// teleport is reusing the connection. /// /// May be refactored or move somewhere else soon. - public bool DoNotClose { get; set; } + public bool DoNotCloseAfterTeleport { get; set; } private float m_speedModifier = 1.0f; -- cgit v1.1 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). --- OpenSim/Region/Framework/Scenes/Scene.cs | 61 +++++++++++++++----------------- 1 file changed, 29 insertions(+), 32 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 705660d..6d0b13f 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2805,6 +2805,7 @@ namespace OpenSim.Region.Framework.Scenes { ScenePresence sp; bool vialogin; + bool reallyNew = true; // Validation occurs in LLUDPServer // @@ -2856,6 +2857,7 @@ namespace OpenSim.Region.Framework.Scenes m_log.WarnFormat( "[SCENE]: Already found {0} scene presence for {1} in {2} when asked to add new scene presence", sp.IsChildAgent ? "child" : "root", sp.Name, RegionInfo.RegionName); + reallyNew = false; } // We must set this here so that TriggerOnNewClient and TriggerOnClientLogin can determine whether the @@ -2867,7 +2869,9 @@ namespace OpenSim.Region.Framework.Scenes // places. However, we still need to do it here for NPCs. CacheUserName(sp, aCircuit); - EventManager.TriggerOnNewClient(client); + if (reallyNew) + EventManager.TriggerOnNewClient(client); + if (vialogin) EventManager.TriggerOnClientLogin(client); } @@ -3426,15 +3430,8 @@ namespace OpenSim.Region.Framework.Scenes if (closeChildAgents && isChildAgent) { // Tell a single agent to disconnect from the region. - IEventQueue eq = RequestModuleInterface(); - if (eq != null) - { - eq.DisableSimulator(RegionInfo.RegionHandle, avatar.UUID); - } - else - { - avatar.ControllingClient.SendShutdownConnectionNotice(); - } + // Let's do this via UDP + avatar.ControllingClient.SendShutdownConnectionNotice(); } // Only applies to root agents. @@ -3686,21 +3683,29 @@ namespace OpenSim.Region.Framework.Scenes { if (!sp.IsChildAgent) { - // We have a zombie from a crashed session. - // Or the same user is trying to be root twice here, won't work. - // Kill it. - m_log.WarnFormat( - "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", - sp.Name, sp.UUID, RegionInfo.RegionName); - - if (sp.ControllingClient != null) - sp.ControllingClient.Close(true); + // We have a root agent. Is it in transit? + if (!EntityTransferModule.IsInTransit(sp.UUID)) + { + // We have a zombie from a crashed session. + // Or the same user is trying to be root twice here, won't work. + // Kill it. + m_log.WarnFormat( + "[SCENE]: Existing root scene presence detected for {0} {1} in {2} when connecting. Removing existing presence.", + sp.Name, sp.UUID, RegionInfo.RegionName); + + if (sp.ControllingClient != null) + sp.ControllingClient.Close(true); - sp = null; + sp = null; + } + else + m_log.WarnFormat("[SCENE]: Existing root scene presence for {0} {1} in {2}, but agent is in trasit", sp.Name, sp.UUID, RegionInfo.RegionName); } else { + // We have a child agent here sp.DoNotCloseAfterTeleport = true; + //m_log.WarnFormat("[SCENE]: Existing child scene presence for {0} {1} in {2}", sp.Name, sp.UUID, RegionInfo.RegionName); } } @@ -3785,9 +3790,12 @@ namespace OpenSim.Region.Framework.Scenes agent.AgentID, RegionInfo.RegionName); sp.AdjustKnownSeeds(); - + if (CapsModule != null) + { CapsModule.SetAgentCapsSeeds(agent); + CapsModule.CreateCaps(agent.AgentID); + } } } @@ -5545,17 +5553,6 @@ namespace OpenSim.Region.Framework.Scenes { reason = "You are banned from the region"; - if (EntityTransferModule.IsInTransit(agentID)) - { - reason = "Agent is still in transit from this region"; - - m_log.WarnFormat( - "[SCENE]: Denying agent {0} entry into {1} since region still has them registered as in transit", - agentID, RegionInfo.RegionName); - - return false; - } - if (Permissions.IsGod(agentID)) { reason = String.Empty; -- cgit v1.1 From dd2c211e62b25f19386c1f4b5bc7ace40efa429a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 26 Jul 2013 07:40:55 -0700 Subject: Comment debug message --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6d0b13f..dec493b 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -3698,8 +3698,8 @@ namespace OpenSim.Region.Framework.Scenes sp = null; } - else - m_log.WarnFormat("[SCENE]: Existing root scene presence for {0} {1} in {2}, but agent is in trasit", sp.Name, sp.UUID, RegionInfo.RegionName); + //else + // m_log.WarnFormat("[SCENE]: Existing root scene presence for {0} {1} in {2}, but agent is in trasit", sp.Name, sp.UUID, RegionInfo.RegionName); } else { -- cgit v1.1 From a08f01fa8323e18a63e920158c7f51ae78ac0e93 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 26 Jul 2013 18:43:15 +0100 Subject: Fix NPC regression test failures. These were genuine failures caused by ScenePresence.CompleteMovement() waiting for an UpdateAgent from NPC introduction that would never come. Instead, we do not wait if the agent is an NPC. --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 4044f0c..17da0d9 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1357,11 +1357,13 @@ namespace OpenSim.Region.Framework.Scenes client.Name, Scene.RegionInfo.RegionName, AbsolutePosition); // Make sure it's not a login agent. We don't want to wait for updates during login - if ((m_teleportFlags & TeleportFlags.ViaLogin) == 0) + if (PresenceType != PresenceType.Npc && (m_teleportFlags & TeleportFlags.ViaLogin) == 0) + { // Let's wait until UpdateAgent (called by departing region) is done if (!WaitForUpdateAgent(client)) // The sending region never sent the UpdateAgent data, we have to refuse return; + } Vector3 look = Velocity; -- cgit v1.1 From 056a6ee7653b17d8c1d92519f34f029bcd602143 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 26 Jul 2013 19:22:30 +0100 Subject: Fix regression tests relating to agent transfer by making simulator use last week's SIMULATOR/0.1 protocol for now. --- OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index 297c66b..afd2779 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs @@ -136,6 +136,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneHelpers.SetupSceneModules(sceneB, config, etmB); SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); + // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour + lscm.ServiceVersion = "SIMULATION/0.1"; + Vector3 teleportPosition = new Vector3(10, 11, 12); Vector3 teleportLookAt = new Vector3(20, 21, 22); @@ -454,6 +457,9 @@ namespace OpenSim.Region.Framework.Scenes.Tests SceneHelpers.SetupSceneModules(sceneA, config, new CapabilitiesModule(), etmA); SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB); + // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour + lscm.ServiceVersion = "SIMULATION/0.1"; + Vector3 teleportPosition = new Vector3(10, 11, 12); Vector3 teleportLookAt = new Vector3(20, 21, 22); -- cgit v1.1 From 840be97e40179c17d57e1943555643b57f47ae5a Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 26 Jul 2013 20:52:30 +0100 Subject: Fix failure in TestCreateDuplicateRootScenePresence(). This is a test setup failure since code paths when adding a duplicate root scene presence now require the EntityTransferModule to be present. Test fixed by adding this module to test setup --- .../Framework/Scenes/Tests/ScenePresenceAgentTests.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs index bbfbbfc..bbe34d2 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAgentTests.cs @@ -119,7 +119,20 @@ namespace OpenSim.Region.Framework.Scenes.Tests UUID spUuid = TestHelpers.ParseTail(0x1); + // The etm is only invoked by this test to check whether an agent is still in transit if there is a dupe + EntityTransferModule etm = new EntityTransferModule(); + + IConfigSource config = new IniConfigSource(); + IConfig modulesConfig = config.AddConfig("Modules"); + modulesConfig.Set("EntityTransferModule", etm.Name); + IConfig entityTransferConfig = config.AddConfig("EntityTransfer"); + + // In order to run a single threaded regression test we do not want the entity transfer module waiting + // for a callback from the destination scene before removing its avatar data. + entityTransferConfig.Set("wait_for_callback", false); + TestScene scene = new SceneHelpers().SetupScene(); + SceneHelpers.SetupSceneModules(scene, config, etm); SceneHelpers.AddScenePresence(scene, spUuid); SceneHelpers.AddScenePresence(scene, spUuid); -- 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. --- OpenSim/Region/Framework/Interfaces/IEventQueue.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs index 5512642..3780ece 100644 --- a/OpenSim/Region/Framework/Interfaces/IEventQueue.cs +++ b/OpenSim/Region/Framework/Interfaces/IEventQueue.cs @@ -53,7 +53,7 @@ namespace OpenSim.Region.Framework.Interfaces UUID fromAgent, string message, UUID toAgent, string fromName, byte dialog, uint timeStamp, bool offline, int parentEstateID, Vector3 position, uint ttl, UUID transactionID, bool fromGroup, byte[] binaryBucket); - void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID toAgent, bool canVoiceChat, + void ChatterBoxSessionAgentListUpdates(UUID sessionID, UUID fromAgent, UUID anotherAgent, bool canVoiceChat, bool isModerator, bool textMute); void ParcelProperties(ParcelPropertiesMessage parcelPropertiesMessage, UUID avatarID); void GroupMembership(AgentGroupDataUpdatePacket groupUpdate, UUID avatarID); -- cgit v1.1 From 7b0b5c9d97dea840e1ede6e2318b3c049c804983 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 28 Jul 2013 13:49:58 -0700 Subject: Added BasicSearchModule.cs which handles OnDirFindQuery events. Removed that handler from both Groups modules in core, and replaced them with an operation on IGroupsModule. --- OpenSim/Region/Framework/Interfaces/IGroupsModule.cs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs index 6885327..9ae5e87 100644 --- a/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IGroupsModule.cs @@ -97,5 +97,7 @@ namespace OpenSim.Region.Framework.Interfaces void InviteGroupRequest(IClientAPI remoteClient, UUID GroupID, UUID InviteeID, UUID RoleID); void InviteGroup(IClientAPI remoteClient, UUID agentID, UUID GroupID, UUID InviteeID, UUID RoleID); void NotifyChange(UUID GroupID); + + List FindGroups(IClientAPI remoteClient, string query); } } \ No newline at end of file -- cgit v1.1