diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 53 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | 2 |
2 files changed, 50 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 9302784..c1c8672 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -56,6 +56,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
56 | public const int DefaultMaxTransferDistance = 4095; | 56 | public const int DefaultMaxTransferDistance = 4095; |
57 | public const bool WaitForAgentArrivedAtDestinationDefault = true; | 57 | public const bool WaitForAgentArrivedAtDestinationDefault = true; |
58 | 58 | ||
59 | public string OutgoingTransferVersionName { get; set; } | ||
60 | |||
61 | /// <summary> | ||
62 | /// Determine the maximum entity transfer version we will use for teleports. | ||
63 | /// </summary> | ||
64 | public float MaxOutgoingTransferVersion { get; set; } | ||
65 | |||
59 | /// <summary> | 66 | /// <summary> |
60 | /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. | 67 | /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. |
61 | /// </summary> | 68 | /// </summary> |
@@ -151,9 +158,35 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
151 | /// <param name="source"></param> | 158 | /// <param name="source"></param> |
152 | protected virtual void InitialiseCommon(IConfigSource source) | 159 | protected virtual void InitialiseCommon(IConfigSource source) |
153 | { | 160 | { |
161 | string transferVersionName = "SIMULATION"; | ||
162 | float maxTransferVersion = 0.2f; | ||
163 | |||
154 | IConfig transferConfig = source.Configs["EntityTransfer"]; | 164 | IConfig transferConfig = source.Configs["EntityTransfer"]; |
155 | if (transferConfig != null) | 165 | if (transferConfig != null) |
156 | { | 166 | { |
167 | string rawVersion | ||
168 | = transferConfig.GetString( | ||
169 | "MaxOutgoingTransferVersion", | ||
170 | string.Format("{0}/{1}", transferVersionName, maxTransferVersion)); | ||
171 | |||
172 | string[] rawVersionComponents = rawVersion.Split(new char[] { '/' }); | ||
173 | |||
174 | bool versionValid = false; | ||
175 | |||
176 | if (rawVersionComponents.Length >= 2) | ||
177 | versionValid = float.TryParse(rawVersionComponents[1], out maxTransferVersion); | ||
178 | |||
179 | if (!versionValid) | ||
180 | { | ||
181 | m_log.ErrorFormat( | ||
182 | "[ENTITY TRANSFER MODULE]: MaxOutgoingTransferVersion {0} is invalid, using {1}", | ||
183 | rawVersion, string.Format("{0}/{1}", transferVersionName, maxTransferVersion)); | ||
184 | } | ||
185 | else | ||
186 | { | ||
187 | transferVersionName = rawVersionComponents[0]; | ||
188 | } | ||
189 | |||
157 | DisableInterRegionTeleportCancellation | 190 | DisableInterRegionTeleportCancellation |
158 | = transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false); | 191 | = transferConfig.GetBoolean("DisableInterRegionTeleportCancellation", false); |
159 | 192 | ||
@@ -167,6 +200,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
167 | MaxTransferDistance = DefaultMaxTransferDistance; | 200 | MaxTransferDistance = DefaultMaxTransferDistance; |
168 | } | 201 | } |
169 | 202 | ||
203 | OutgoingTransferVersionName = transferVersionName; | ||
204 | MaxOutgoingTransferVersion = maxTransferVersion; | ||
205 | |||
170 | m_entityTransferStateMachine = new EntityTransferStateMachine(this); | 206 | m_entityTransferStateMachine = new EntityTransferStateMachine(this); |
171 | 207 | ||
172 | m_Enabled = true; | 208 | m_Enabled = true; |
@@ -623,7 +659,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
623 | if (!sp.ValidateAttachments()) | 659 | if (!sp.ValidateAttachments()) |
624 | m_log.DebugFormat( | 660 | m_log.DebugFormat( |
625 | "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for teleport of {0} from {1} to {2}. Continuing.", | 661 | "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for teleport of {0} from {1} to {2}. Continuing.", |
626 | sp.Name, sp.Scene.RegionInfo.RegionName, finalDestination.RegionName); | 662 | sp.Name, sp.Scene.Name, finalDestination.RegionName); |
627 | 663 | ||
628 | string reason; | 664 | string reason; |
629 | string version; | 665 | string version; |
@@ -634,7 +670,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
634 | 670 | ||
635 | m_log.DebugFormat( | 671 | m_log.DebugFormat( |
636 | "[ENTITY TRANSFER MODULE]: {0} was stopped from teleporting from {1} to {2} because {3}", | 672 | "[ENTITY TRANSFER MODULE]: {0} was stopped from teleporting from {1} to {2} because {3}", |
637 | sp.Name, sp.Scene.RegionInfo.RegionName, finalDestination.RegionName, reason); | 673 | sp.Name, sp.Scene.Name, finalDestination.RegionName, reason); |
638 | 674 | ||
639 | return; | 675 | return; |
640 | } | 676 | } |
@@ -644,7 +680,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
644 | // as server attempts. | 680 | // as server attempts. |
645 | m_interRegionTeleportAttempts.Value++; | 681 | m_interRegionTeleportAttempts.Value++; |
646 | 682 | ||
647 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Destination is running version {0}", version); | 683 | m_log.DebugFormat( |
684 | "[ENTITY TRANSFER MODULE]: {0} max transfer version is {1}/{2}, {3} max version is {4}", | ||
685 | sp.Scene.Name, OutgoingTransferVersionName, MaxOutgoingTransferVersion, finalDestination.RegionName, version); | ||
648 | 686 | ||
649 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from | 687 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from |
650 | // both regions | 688 | // both regions |
@@ -689,7 +727,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
689 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); | 727 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); |
690 | } | 728 | } |
691 | 729 | ||
692 | if (version.Equals("SIMULATION/0.2")) | 730 | // We're going to fallback to V1 if the destination gives us anything smaller than 0.2 or we're forcing |
731 | // use of the earlier protocol | ||
732 | float versionNumber = 0.1f; | ||
733 | string[] versionComponents = version.Split(new char[] { '/' }); | ||
734 | if (versionComponents.Length >= 2) | ||
735 | float.TryParse(versionComponents[1], out versionNumber); | ||
736 | |||
737 | if (versionNumber == 0.2f && MaxOutgoingTransferVersion >= versionNumber) | ||
693 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 738 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
694 | else | 739 | else |
695 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 740 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs index 8c25dbc..3ba34dd 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs | |||
@@ -185,7 +185,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
185 | public void TestSameSimulatorIsolatedRegionsV2() | 185 | public void TestSameSimulatorIsolatedRegionsV2() |
186 | { | 186 | { |
187 | TestHelpers.InMethod(); | 187 | TestHelpers.InMethod(); |
188 | // TestHelpers.EnableLogging(); | 188 | TestHelpers.EnableLogging(); |
189 | 189 | ||
190 | UUID userId = TestHelpers.ParseTail(0x1); | 190 | UUID userId = TestHelpers.ParseTail(0x1); |
191 | 191 | ||