From 31ec5dde45b69e416f2e09b536cdf3717a2ad79f Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Mon, 14 Jan 2019 17:25:32 +0000 Subject: [PATCH] test a change to TP protocol --- OpenSim/Framework/VersionInfo.cs | 4 +- .../EntityTransfer/EntityTransferModule.cs | 72 ++++++++++--------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/OpenSim/Framework/VersionInfo.cs b/OpenSim/Framework/VersionInfo.cs index eac5aae9f1..ac1f3a0f05 100644 --- a/OpenSim/Framework/VersionInfo.cs +++ b/OpenSim/Framework/VersionInfo.cs @@ -85,8 +85,8 @@ namespace OpenSim /// - this is an older teleport protocol used in OpenSimulator 0.7.5 and before. /// public readonly static float SimulationServiceVersionAcceptedMin = 0.3f; - public readonly static float SimulationServiceVersionAcceptedMax = 0.6f; + public readonly static float SimulationServiceVersionAcceptedMax = 0.7f; public readonly static float SimulationServiceVersionSupportedMin = 0.3f; - public readonly static float SimulationServiceVersionSupportedMax = 0.6f; + public readonly static float SimulationServiceVersionSupportedMax = 0.7f; } } diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 059cd6aed2..75e7916dcb 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1098,13 +1098,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer { ulong destinationHandle = finalDestination.RegionHandle; - List childRegionsToClose = sp.GetChildAgentsToClose(destinationHandle, finalDestination.RegionSizeX, finalDestination.RegionSizeY); - - if(agentCircuit.ChildrenCapSeeds != null) + List childRegionsToClose = null; + if (ctx.OutboundVersion < 0.7) { - foreach(ulong handler in childRegionsToClose) + childRegionsToClose = sp.GetChildAgentsToClose(destinationHandle, finalDestination.RegionSizeX, finalDestination.RegionSizeY); + + if(agentCircuit.ChildrenCapSeeds != null) { - agentCircuit.ChildrenCapSeeds.Remove(handler); + foreach(ulong handler in childRegionsToClose) + { + agentCircuit.ChildrenCapSeeds.Remove(handler); + } } } @@ -1214,47 +1218,37 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); - /* now some viewers also need time bf closing child regions - * so this is moved down and delay added - - if (logout) - sp.closeAllChildAgents(); - else - sp.CloseChildAgents(childRegionsToClose); - */ - sp.HasMovedAway(!(OutSideViewRange || logout)); //HG hook AgentHasMovedAway(sp, logout); -// ulong sourceRegionHandle = sp.RegionHandle; - // Now let's make it officially a child agent sp.MakeChildAgent(destinationHandle); - Thread.Sleep(2800); - - if (logout) - sp.closeAllChildAgents(); - else - sp.CloseChildAgents(childRegionsToClose); - - // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone - // goes by HG hook - if (NeedsClosing(reg, OutSideViewRange)) + if(ctx.OutboundVersion < 0.7) { - if (!sp.Scene.IncomingPreCloseClient(sp)) + if (logout) + sp.closeAllChildAgents(); + else + sp.CloseChildAgents(childRegionsToClose); + + // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone + // goes by HG hook + if (NeedsClosing(reg, OutSideViewRange)) { - sp.IsInTransit = false; - return; - } + if (!sp.Scene.IncomingPreCloseClient(sp)) + { + sp.IsInTransit = false; + return; + } // viewers and target region take extra time to process the tp -// Thread.Sleep(2000); - m_log.DebugFormat( + Thread.Sleep(15000); + m_log.DebugFormat( "[ENTITY TRANSFER MODULE]: Closing agent {0} in {1} after teleport", sp.Name, Scene.Name); - sp.Scene.CloseAgent(sp.UUID, false); + sp.Scene.CloseAgent(sp.UUID, false); + } } sp.IsInTransit = false; } @@ -2083,11 +2077,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer List cagents = new List(); List newneighbours = new List(); + bool notHG = (sp.TeleportFlags & Constants.TeleportFlags.ViaHGLogin) != 0; + foreach (GridRegion neighbour in neighbours) { ulong handler = neighbour.RegionHandle; - if (previousRegionNeighbourHandles.Contains(handler)) + if (notHG && previousRegionNeighbourHandles.Contains(handler)) { // agent already knows this region previousRegionNeighbourHandles.Remove(handler); @@ -2163,6 +2159,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer int count = 0; IPEndPoint ipe; + if(previousRegionNeighbourHandles.Count > 0) + { + List toclose = new List(previousRegionNeighbourHandles); + sp.CloseChildAgents(toclose); + } + foreach (GridRegion neighbour in neighbours) { ulong handler = neighbour.RegionHandle; @@ -2179,7 +2181,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer } count++; } - else if (!previousRegionNeighbourHandles.Contains(handler)) + else if (notHG && !previousRegionNeighbourHandles.Contains(handler)) { spScene.SimulationService.UpdateAgent(neighbour, agentpos); }