diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 47 |
1 files changed, 16 insertions, 31 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 155a085..ab9f200 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -57,13 +57,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
57 | public const int DefaultMaxTransferDistance = 4095; | 57 | public const int DefaultMaxTransferDistance = 4095; |
58 | public const bool WaitForAgentArrivedAtDestinationDefault = true; | 58 | public const bool WaitForAgentArrivedAtDestinationDefault = true; |
59 | 59 | ||
60 | public static readonly string OutgoingTransferVersionName = "SIMULATION"; | ||
61 | |||
62 | /// <summary> | ||
63 | /// Determine the entity transfer version we will use for teleports. | ||
64 | /// </summary> | ||
65 | public static readonly float OutgoingTransferVersion = VersionInfo.SimulationServiceVersion; | ||
66 | |||
67 | /// <summary> | 60 | /// <summary> |
68 | /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. | 61 | /// The maximum distance, in standard region units (256m) that an agent is allowed to transfer. |
69 | /// </summary> | 62 | /// </summary> |
@@ -726,10 +719,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
726 | sp.Name, sp.Scene.Name, finalDestination.RegionName); | 719 | sp.Name, sp.Scene.Name, finalDestination.RegionName); |
727 | 720 | ||
728 | string reason; | 721 | string reason; |
729 | string version; | 722 | float version; |
730 | string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion); | ||
731 | if (!Scene.SimulationService.QueryAccess( | 723 | if (!Scene.SimulationService.QueryAccess( |
732 | finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, sp.Scene.GetFormatsOffered(), out version, out reason)) | 724 | finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, sp.Scene.GetFormatsOffered(), out version, out reason)) |
733 | { | 725 | { |
734 | sp.ControllingClient.SendTeleportFailed(reason); | 726 | sp.ControllingClient.SendTeleportFailed(reason); |
735 | 727 | ||
@@ -746,8 +738,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
746 | m_interRegionTeleportAttempts.Value++; | 738 | m_interRegionTeleportAttempts.Value++; |
747 | 739 | ||
748 | m_log.DebugFormat( | 740 | m_log.DebugFormat( |
749 | "[ENTITY TRANSFER MODULE]: {0} transfer version is {1}/{2}, {3} version is {4}", | 741 | "[ENTITY TRANSFER MODULE]: {0} transfer version is SIMULATION/{2}, {3} version is {4}", |
750 | sp.Scene.Name, OutgoingTransferVersionName, OutgoingTransferVersion, finalDestination.RegionName, version); | 742 | sp.Scene.Name, version, finalDestination.RegionName, version); |
751 | 743 | ||
752 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from | 744 | // Fixing a bug where teleporting while sitting results in the avatar ending up removed from |
753 | // both regions | 745 | // both regions |
@@ -795,21 +787,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
795 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); | 787 | agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); |
796 | } | 788 | } |
797 | 789 | ||
798 | // We're going to fallback to V1 if the destination gives us anything smaller than 0.2 or we're forcing | 790 | // We're going to fallback to V1 if the destination gives us anything smaller than 0.2 |
799 | // use of the earlier protocol | 791 | if (version >= 0.2f) |
800 | float versionNumber = 0.1f; | ||
801 | string[] versionComponents = version.Split(new char[] { '/' }); | ||
802 | if (versionComponents.Length >= 2) | ||
803 | float.TryParse(versionComponents[1], out versionNumber); | ||
804 | |||
805 | if (versionNumber >= 0.2f) | ||
806 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 792 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
807 | else | 793 | else |
808 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 794 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
809 | } | 795 | } |
810 | 796 | ||
811 | private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, | 797 | private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, |
812 | IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, string version, out string reason) | 798 | IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, float version, out string reason) |
813 | { | 799 | { |
814 | ulong destinationHandle = finalDestination.RegionHandle; | 800 | ulong destinationHandle = finalDestination.RegionHandle; |
815 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | 801 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); |
@@ -1023,7 +1009,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1023 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); | 1009 | m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); |
1024 | 1010 | ||
1025 | // For backwards compatibility | 1011 | // For backwards compatibility |
1026 | if (version == "Unknown" || version == string.Empty) | 1012 | if (version == 0f) |
1027 | { | 1013 | { |
1028 | // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it | 1014 | // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it |
1029 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old simulator, sending attachments one by one..."); | 1015 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old simulator, sending attachments one by one..."); |
@@ -1064,7 +1050,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1064 | } | 1050 | } |
1065 | 1051 | ||
1066 | private void TransferAgent_V2(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, | 1052 | private void TransferAgent_V2(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, |
1067 | IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, string version, out string reason) | 1053 | IPEndPoint endPoint, uint teleportFlags, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, float version, out string reason) |
1068 | { | 1054 | { |
1069 | ulong destinationHandle = finalDestination.RegionHandle; | 1055 | ulong destinationHandle = finalDestination.RegionHandle; |
1070 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); | 1056 | AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); |
@@ -1444,9 +1430,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1444 | // point is actually in. | 1430 | // point is actually in. |
1445 | // Returns the coordinates and information of the new region or 'null' of it doesn't exist. | 1431 | // Returns the coordinates and information of the new region or 'null' of it doesn't exist. |
1446 | public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, | 1432 | public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, |
1447 | out string version, out Vector3 newpos, out string failureReason) | 1433 | out float version, out Vector3 newpos, out string failureReason) |
1448 | { | 1434 | { |
1449 | version = String.Empty; | 1435 | version = 0f; |
1450 | newpos = pos; | 1436 | newpos = pos; |
1451 | failureReason = string.Empty; | 1437 | failureReason = string.Empty; |
1452 | string homeURI = scene.GetAgentHomeURI(agentID); | 1438 | string homeURI = scene.GetAgentHomeURI(agentID); |
@@ -1482,9 +1468,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1482 | } | 1468 | } |
1483 | 1469 | ||
1484 | // Check to see if we have access to the target region. | 1470 | // Check to see if we have access to the target region. |
1485 | string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion); | ||
1486 | if (neighbourRegion != null | 1471 | if (neighbourRegion != null |
1487 | && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, myversion, scene.GetFormatsOffered(), out version, out failureReason)) | 1472 | && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, scene.GetFormatsOffered(), out version, out failureReason)) |
1488 | { | 1473 | { |
1489 | // remember banned | 1474 | // remember banned |
1490 | m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); | 1475 | m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); |
@@ -1515,7 +1500,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1515 | public bool Cross(ScenePresence agent, bool isFlying) | 1500 | public bool Cross(ScenePresence agent, bool isFlying) |
1516 | { | 1501 | { |
1517 | Vector3 newpos; | 1502 | Vector3 newpos; |
1518 | string version; | 1503 | float version; |
1519 | string failureReason; | 1504 | string failureReason; |
1520 | 1505 | ||
1521 | GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition, | 1506 | GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition, |
@@ -1627,7 +1612,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1627 | /// </summary> | 1612 | /// </summary> |
1628 | public ScenePresence CrossAgentToNewRegionAsync( | 1613 | public ScenePresence CrossAgentToNewRegionAsync( |
1629 | ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, | 1614 | ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, |
1630 | bool isFlying, string version) | 1615 | bool isFlying, float version) |
1631 | { | 1616 | { |
1632 | try | 1617 | try |
1633 | { | 1618 | { |
@@ -1703,7 +1688,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1703 | } | 1688 | } |
1704 | 1689 | ||
1705 | public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, | 1690 | public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, |
1706 | bool isFlying, string version) | 1691 | bool isFlying, float version) |
1707 | { | 1692 | { |
1708 | agent.ControllingClient.RequestClientInfo(); | 1693 | agent.ControllingClient.RequestClientInfo(); |
1709 | 1694 | ||
@@ -1756,7 +1741,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1756 | agent.SendOtherAgentsAppearanceToClient(); | 1741 | agent.SendOtherAgentsAppearanceToClient(); |
1757 | 1742 | ||
1758 | // Backwards compatibility. Best effort | 1743 | // Backwards compatibility. Best effort |
1759 | if (version == "Unknown" || version == string.Empty) | 1744 | if (version == 0f) |
1760 | { | 1745 | { |
1761 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one..."); | 1746 | m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one..."); |
1762 | Thread.Sleep(3000); // wait a little now that we're not waiting for the callback | 1747 | Thread.Sleep(3000); // wait a little now that we're not waiting for the callback |