aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Framework/Servers/ServerBase.cs4
-rw-r--r--OpenSim/Framework/VersionInfo.cs9
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs18
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs68
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs23
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs8
-rw-r--r--OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs2
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs13
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs8
-rw-r--r--OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Properties/AssemblyInfo.cs1
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs2
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs106
-rw-r--r--OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs2
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs39
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs4
-rw-r--r--OpenSim/Services/Interfaces/IAvatarService.cs12
-rw-r--r--OpenSim/Services/Interfaces/ISimulationService.cs14
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs5
21 files changed, 235 insertions, 122 deletions
diff --git a/OpenSim/Framework/Servers/ServerBase.cs b/OpenSim/Framework/Servers/ServerBase.cs
index 6e089ca..b330384 100644
--- a/OpenSim/Framework/Servers/ServerBase.cs
+++ b/OpenSim/Framework/Servers/ServerBase.cs
@@ -873,8 +873,8 @@ namespace OpenSim.Framework.Servers
873 873
874 public string GetVersionText() 874 public string GetVersionText()
875 { 875 {
876 return String.Format("Version: {0} (interface version {1}, SIMULATION/{2})", 876 return String.Format("Version: {0} (SIMULATION/{1} - SIMULATION/{2})",
877 m_version, VersionInfo.MajorInterfaceVersion, VersionInfo.SimulationServiceVersion); 877 m_version, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax);
878 } 878 }
879 879
880 /// <summary> 880 /// <summary>
diff --git a/OpenSim/Framework/VersionInfo.cs b/OpenSim/Framework/VersionInfo.cs
index 54c4508..a145d34 100644
--- a/OpenSim/Framework/VersionInfo.cs
+++ b/OpenSim/Framework/VersionInfo.cs
@@ -61,7 +61,9 @@ namespace OpenSim
61 /// This is the external interface version. It is separate from the OpenSimulator project version. 61 /// This is the external interface version. It is separate from the OpenSimulator project version.
62 /// 62 ///
63 /// </value> 63 /// </value>
64 public readonly static int MajorInterfaceVersion = 8; 64 /// Commented because it's not used anymore, see below for new
65 /// versioning method.
66 //public readonly static int MajorInterfaceVersion = 8;
65 67
66 /// <summary> 68 /// <summary>
67 /// This rules versioning regarding teleports, and compatibility between simulators in that regard. 69 /// This rules versioning regarding teleports, and compatibility between simulators in that regard.
@@ -80,6 +82,9 @@ namespace OpenSim
80 /// "SIMULATION/0.1" 82 /// "SIMULATION/0.1"
81 /// - this is an older teleport protocol used in OpenSimulator 0.7.5 and before. 83 /// - this is an older teleport protocol used in OpenSimulator 0.7.5 and before.
82 /// </remarks> 84 /// </remarks>
83 public readonly static float SimulationServiceVersion = 0.3f; 85 public readonly static float SimulationServiceVersionAcceptedMin = 0.3f;
86 public readonly static float SimulationServiceVersionAcceptedMax = 0.4f;
87 public readonly static float SimulationServiceVersionSupportedMin = 0.3f;
88 public readonly static float SimulationServiceVersionSupportedMax = 0.4f;
84 } 89 }
85} 90}
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
index 7d9609f..34b38b9 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -802,6 +802,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
802 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0)); 802 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
803 } 803 }
804 804
805/*
805 [Test] 806 [Test]
806 public void TestSameSimulatorNeighbouringRegionsTeleportV1() 807 public void TestSameSimulatorNeighbouringRegionsTeleportV1()
807 { 808 {
@@ -841,7 +842,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
841 sceneB, config, new CapabilitiesModule(), etmB, attModB, new BasicInventoryAccessModule()); 842 sceneB, config, new CapabilitiesModule(), etmB, attModB, new BasicInventoryAccessModule());
842 843
843 // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour 844 // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour
844 lscm.ServiceVersion = "SIMULATION/0.1"; 845 lscm.ServiceVersion = 0.1f;
845 846
846 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(sceneA, 0x1); 847 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(sceneA, 0x1);
847 848
@@ -909,6 +910,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
909 // Check events 910 // Check events
910 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0)); 911 Assert.That(m_numberOfAttachEventsFired, Is.EqualTo(0));
911 } 912 }
913*/
912 914
913 [Test] 915 [Test]
914 public void TestSameSimulatorNeighbouringRegionsTeleportV2() 916 public void TestSameSimulatorNeighbouringRegionsTeleportV2()
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index 0b5d95b..0472f31 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -63,18 +63,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
63 { 63 {
64 m_config = config.Configs["Chat"]; 64 m_config = config.Configs["Chat"];
65 65
66 if (null == m_config) 66 if (m_config != null)
67 { 67 {
68 m_log.Info("[CHAT]: no config found, plugin disabled"); 68 if (!m_config.GetBoolean("enabled", true))
69 m_enabled = false; 69 {
70 return; 70 m_log.Info("[CHAT]: plugin disabled by configuration");
71 } 71 m_enabled = false;
72 72 return;
73 if (!m_config.GetBoolean("enabled", true)) 73 }
74 {
75 m_log.Info("[CHAT]: plugin disabled by configuration");
76 m_enabled = false;
77 return;
78 } 74 }
79 75
80 m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance); 76 m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 9be6d45..8a4ac1b 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -57,14 +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 private string m_myVersion = "";
68 /// <summary> 60 /// <summary>
69 /// 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.
70 /// </summary> 62 /// </summary>
@@ -243,8 +235,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
243 MaxTransferDistance = DefaultMaxTransferDistance; 235 MaxTransferDistance = DefaultMaxTransferDistance;
244 } 236 }
245 237
246 m_myVersion = string.Format("{0}/{1}", OutgoingTransferVersionName, OutgoingTransferVersion);
247
248 m_entityTransferStateMachine = new EntityTransferStateMachine(this); 238 m_entityTransferStateMachine = new EntityTransferStateMachine(this);
249 239
250 m_Enabled = true; 240 m_Enabled = true;
@@ -736,10 +726,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
736 sp.Name, sp.Scene.Name, finalDestination.RegionName); 726 sp.Name, sp.Scene.Name, finalDestination.RegionName);
737 727
738 string reason; 728 string reason;
739 string version; 729 EntityTransferContext ctx = new EntityTransferContext();
740 730
741 if (!Scene.SimulationService.QueryAccess( 731 if (!Scene.SimulationService.QueryAccess(
742 finalDestination, sp.ControllingClient.AgentId, homeURI, true, position,m_myVersion, sp.Scene.GetFormatsOffered(), out version, out reason)) 732 finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, sp.Scene.GetFormatsOffered(), ctx, out reason))
743 { 733 {
744 sp.ControllingClient.SendTeleportFailed(reason); 734 sp.ControllingClient.SendTeleportFailed(reason);
745 735
@@ -756,8 +746,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
756 m_interRegionTeleportAttempts.Value++; 746 m_interRegionTeleportAttempts.Value++;
757 747
758 m_log.DebugFormat( 748 m_log.DebugFormat(
759 "[ENTITY TRANSFER MODULE]: {0} transfer version is {1}/{2}, {3} version is {4}", 749 "[ENTITY TRANSFER MODULE]: {0} transfer protocol version to {1} is {2} / {3}",
760 sp.Scene.Name, OutgoingTransferVersionName, OutgoingTransferVersion, finalDestination.RegionName, version); 750 sp.Scene.Name, finalDestination.RegionName, ctx.OutboundVersion, ctx.InboundVersion);
761 751
762 // Fixing a bug where teleporting while sitting results in the avatar ending up removed from 752 // Fixing a bug where teleporting while sitting results in the avatar ending up removed from
763 // both regions 753 // both regions
@@ -837,21 +827,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
837 agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath(); 827 agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
838 } 828 }
839 829
840 // We're going to fallback to V1 if the destination gives us anything smaller than 0.2 or we're forcing 830 // We're going to fallback to V1 if the destination gives us anything smaller than 0.2
841 // use of the earlier protocol 831 if (ctx.OutboundVersion >= 0.2f)
842 float versionNumber = 0.1f; 832 TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange , ctx, out reason);
843 string[] versionComponents = version.Split(new char[] { '/' });
844 if (versionComponents.Length >= 2)
845 float.TryParse(versionComponents[1], out versionNumber);
846
847 if (versionNumber >= 0.2f)
848 TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange , version, out reason);
849 else 833 else
850 TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange, version, out reason); 834 TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, OutSideViewRange, ctx, out reason);
851 } 835 }
852 836
853 private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, 837 private void TransferAgent_V1(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination,
854 IPEndPoint endPoint, uint teleportFlags, bool OutSideViewRange, string version, out string reason) 838 IPEndPoint endPoint, uint teleportFlags, bool OutSideViewRange, EntityTransferContext ctx, out string reason)
855 { 839 {
856 ulong destinationHandle = finalDestination.RegionHandle; 840 ulong destinationHandle = finalDestination.RegionHandle;
857 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); 841 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
@@ -1045,13 +1029,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1045 } 1029 }
1046 1030
1047 1031
1032/*
1033 // TODO: This may be 0.6. Check if still needed
1048 // For backwards compatibility 1034 // For backwards compatibility
1049 if (version == "Unknown" || version == string.Empty) 1035 if (version == 0f)
1050 { 1036 {
1051 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it 1037 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
1052 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old simulator, sending attachments one by one..."); 1038 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: Old simulator, sending attachments one by one...");
1053 CrossAttachmentsIntoNewRegion(finalDestination, sp, true); 1039 CrossAttachmentsIntoNewRegion(finalDestination, sp, true);
1054 } 1040 }
1041*/
1055 1042
1056 m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp); 1043 m_entityTransferStateMachine.UpdateInTransit(sp.UUID, AgentTransferState.CleaningUp);
1057 1044
@@ -1087,7 +1074,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1087 } 1074 }
1088 1075
1089 private void TransferAgent_V2(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination, 1076 private void TransferAgent_V2(ScenePresence sp, AgentCircuitData agentCircuit, GridRegion reg, GridRegion finalDestination,
1090 IPEndPoint endPoint, uint teleportFlags, bool OutSideViewRange, string version, out string reason) 1077 IPEndPoint endPoint, uint teleportFlags, bool OutSideViewRange, EntityTransferContext ctx, out string reason)
1091 { 1078 {
1092 ulong destinationHandle = finalDestination.RegionHandle; 1079 ulong destinationHandle = finalDestination.RegionHandle;
1093 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode); 1080 AgentCircuitData currentAgentCircuit = sp.Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.CircuitCode);
@@ -1494,9 +1481,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1494 // now only works for crossings 1481 // now only works for crossings
1495 1482
1496 public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, 1483 public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos,
1497 out string version, out Vector3 newpos, out string failureReason) 1484 EntityTransferContext ctx, out Vector3 newpos, out string failureReason)
1498 { 1485 {
1499 version = String.Empty;
1500 newpos = pos; 1486 newpos = pos;
1501 failureReason = string.Empty; 1487 failureReason = string.Empty;
1502 1488
@@ -1532,8 +1518,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1532 string homeURI = scene.GetAgentHomeURI(agentID); 1518 string homeURI = scene.GetAgentHomeURI(agentID);
1533 1519
1534 if (!scene.SimulationService.QueryAccess( 1520 if (!scene.SimulationService.QueryAccess(
1535 neighbourRegion, agentID, homeURI, false, newpos, m_myVersion, 1521 neighbourRegion, agentID, homeURI, false, newpos,
1536 new List<UUID>(), out version, out failureReason)) 1522 scene.GetFormatsOffered(), ctx, out failureReason))
1537 { 1523 {
1538 // remember the fail 1524 // remember the fail
1539 m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); 1525 m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID);
@@ -1571,13 +1557,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1571 uint x; 1557 uint x;
1572 uint y; 1558 uint y;
1573 Vector3 newpos; 1559 Vector3 newpos;
1574 string version; 1560 EntityTransferContext ctx = new EntityTransferContext();
1575 string failureReason; 1561 string failureReason;
1576 1562
1577 Vector3 pos = agent.AbsolutePosition + agent.Velocity; 1563 Vector3 pos = agent.AbsolutePosition + agent.Velocity;
1578 1564
1579 GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, pos, 1565 GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, pos,
1580 out version, out newpos, out failureReason); 1566 ctx, out newpos, out failureReason);
1581 if (neighbourRegion == null) 1567 if (neighbourRegion == null)
1582 { 1568 {
1583 if (failureReason != String.Empty) 1569 if (failureReason != String.Empty)
@@ -1680,7 +1666,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1680 /// </summary> 1666 /// </summary>
1681 public ScenePresence CrossAgentToNewRegionAsync( 1667 public ScenePresence CrossAgentToNewRegionAsync(
1682 ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, 1668 ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
1683 bool isFlying, string version) 1669 bool isFlying, EntityTransferContext ctx)
1684 { 1670 {
1685 try 1671 try
1686 { 1672 {
@@ -1699,7 +1685,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1699 m_entityTransferStateMachine.ResetFromTransit(agent.UUID); 1685 m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
1700 } 1686 }
1701 1687
1702 CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, version); 1688 CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, ctx);
1703 } 1689 }
1704 catch (Exception e) 1690 catch (Exception e)
1705 { 1691 {
@@ -1765,7 +1751,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1765 } 1751 }
1766 1752
1767 public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, 1753 public void CrossAgentToNewRegionPost(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
1768 bool isFlying, string version) 1754 bool isFlying, EntityTransferContext ctx)
1769 { 1755 {
1770 1756
1771 string agentcaps; 1757 string agentcaps;
@@ -1827,6 +1813,16 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1827 1813
1828 agent.CloseChildAgents(false, neighbourRegion.RegionHandle, neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY); 1814 agent.CloseChildAgents(false, neighbourRegion.RegionHandle, neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY);
1829 1815
1816 // TODO: Check since what version this wasn't needed anymore. May be as old as 0.6
1817/*
1818 // Backwards compatibility. Best effort
1819 if (version == 0f)
1820 {
1821 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
1822 Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
1823 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
1824 }
1825*/
1830 1826
1831 // the user may change their profile information in other region, 1827 // the user may change their profile information in other region,
1832 // so the userinfo in UserProfileCache is not reliable any more, delete it 1828 // so the userinfo in UserProfileCache is not reliable any more, delete it
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index de0ae4c..6cb15f6 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -46,11 +46,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 46 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
47 47
48 /// <summary> 48 /// <summary>
49 /// Version of this service.
50 /// </summary>
51 public string ServiceVersion { get; set; }
52
53 /// <summary>
54 /// Map region ID to scene. 49 /// Map region ID to scene.
55 /// </summary> 50 /// </summary>
56 private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>(); 51 private Dictionary<UUID, Scene> m_scenes = new Dictionary<UUID, Scene>();
@@ -81,8 +76,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
81 76
82 public void InitialiseService(IConfigSource configSource) 77 public void InitialiseService(IConfigSource configSource)
83 { 78 {
84 ServiceVersion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion);
85 m_log.InfoFormat("[LOCAL SIMULATION CONNECTOR]: Initialized with connector protocol version {0}", ServiceVersion);
86 } 79 }
87 80
88 public void PostInitialise() 81 public void PostInitialise()
@@ -251,11 +244,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
251 return true; 244 return true;
252 } 245 }
253 246
254 247 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, EntityTransferContext ctx, out string reason)
255 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, List<UUID> features, out string version, out string reason)
256 { 248 {
257 reason = "Communications failure"; 249 reason = "Communications failure";
258 version = ServiceVersion;
259 if (destination == null) 250 if (destination == null)
260 return false; 251 return false;
261 252
@@ -264,19 +255,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
264// m_log.DebugFormat( 255// m_log.DebugFormat(
265// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", 256// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
266// s.RegionInfo.RegionName, destination.RegionHandle); 257// s.RegionInfo.RegionName, destination.RegionHandle);
267 uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX; 258 uint sizeX = m_scenes[destination.RegionID].RegionInfo.RegionSizeX;
268 259 uint sizeY = m_scenes[destination.RegionID].RegionInfo.RegionSizeY;
269 float theirVersionNumber = 0f;
270 string[] versionComponents = theirversion.Split(new char[] { '/' });
271 if (versionComponents.Length >= 2)
272 float.TryParse(versionComponents[1], out theirVersionNumber);
273 260
274 // Var regions here, and the requesting simulator is in an older version. 261 // Var regions here, and the requesting simulator is in an older version.
275 // We will forbide this, because it crashes the viewers 262 // We will forbide this, because it crashes the viewers
276 if (theirVersionNumber < 0.3f && size > 256) 263 if (ctx.OutboundVersion < 0.3f && (sizeX != 256 || sizeY != 256))
277 { 264 {
278 reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; 265 reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading.";
279 m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber); 266 m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from older simulator was denied");
280 return false; 267 return false;
281 268
282 } 269 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
index c1daae9..cf19edd 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
@@ -205,22 +205,20 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
205 return m_remoteConnector.UpdateAgent(destination, cAgentData); 205 return m_remoteConnector.UpdateAgent(destination, cAgentData);
206 } 206 }
207 207
208 208 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, EntityTransferContext ctx, out string reason)
209 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason)
210 { 209 {
211 reason = "Communications failure"; 210 reason = "Communications failure";
212 version = "Unknown";
213 211
214 if (destination == null) 212 if (destination == null)
215 return false; 213 return false;
216 214
217 // Try local first 215 // Try local first
218 if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason)) 216 if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, ctx, out reason))
219 return true; 217 return true;
220 218
221 // else do the remote thing 219 // else do the remote thing
222 if (!m_localBackend.IsLocalRegion(destination.RegionID)) 220 if (!m_localBackend.IsLocalRegion(destination.RegionID))
223 return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason); 221 return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, ctx, out reason);
224 222
225 return false; 223 return false;
226 } 224 }
diff --git a/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs
index 8d192ba..b9bcb8b 100644
--- a/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs
@@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
100 100
101 m_console.Commands.AddCommand( 101 m_console.Commands.AddCommand(
102 "Regions", false, "region set", 102 "Regions", false, "region set",
103 "region get", 103 "region set",
104 "Set control information for the currently selected region.", 104 "Set control information for the currently selected region.",
105 "Currently, the following parameters can be set:\n" 105 "Currently, the following parameters can be set:\n"
106 + "agent-limit <int> - Current root agent limit. This is persisted over restart.\n" 106 + "agent-limit <int> - Current root agent limit. This is persisted over restart.\n"
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
index 61d199f..d172780 100644
--- a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
@@ -35,7 +35,7 @@ using OpenSim.Region.Framework.Scenes;
35 35
36namespace OpenSim.Region.Framework.Interfaces 36namespace OpenSim.Region.Framework.Interfaces
37{ 37{
38 public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); 38 public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, EntityTransferContext ctx);
39 public delegate ScenePresence CrossAsyncDelegate(ScenePresence agent, bool isFlying); 39 public delegate ScenePresence CrossAsyncDelegate(ScenePresence agent, bool isFlying);
40 40
41 public interface IEntityTransferModule 41 public interface IEntityTransferModule
@@ -93,13 +93,14 @@ namespace OpenSim.Region.Framework.Interfaces
93 93
94 void EnableChildAgent(ScenePresence agent, GridRegion region); 94 void EnableChildAgent(ScenePresence agent, GridRegion region);
95 95
96 GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out string version, out Vector3 newpos); 96 GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, EntityTransferContext ctx,
97 GridRegion GetObjectDestination(SceneObjectGroup grp, Vector3 targetPosition, out Vector3 newpos); 97 out Vector3 newpos, out string reason);
98 bool checkAgentAccessToRegion(ScenePresence agent, GridRegion destiny, Vector3 position, out string version, out string reason); 98 GridRegion GetObjectDestination(SceneObjectGroup grp, Vector3 targetPosition, out Vector3 newpos);
99// void Cross(SceneObjectGroup sog, Vector3 position, bool silent); 99 bool checkAgentAccessToRegion(ScenePresence agent, GridRegion destiny, Vector3 position, EntityTransferContext ctx, out string reason);
100
100 bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent, bool removeScripts); 101 bool CrossPrimGroupIntoNewRegion(GridRegion destination, Vector3 newPosition, SceneObjectGroup grp, bool silent, bool removeScripts);
101 102
102 ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); 103 ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, EntityTransferContext ctx);
103 104
104 bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition); 105 bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition);
105 } 106 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index c97c838..e780f86 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -42,6 +42,7 @@ using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Region.PhysicsModules.SharedBase; 42using OpenSim.Region.PhysicsModules.SharedBase;
43using OpenSim.Region.Framework.Scenes.Serialization; 43using OpenSim.Region.Framework.Scenes.Serialization;
44using PermissionMask = OpenSim.Framework.PermissionMask; 44using PermissionMask = OpenSim.Framework.PermissionMask;
45using OpenSim.Services.Interfaces;
45 46
46namespace OpenSim.Region.Framework.Scenes 47namespace OpenSim.Region.Framework.Scenes
47{ 48{
@@ -534,7 +535,8 @@ namespace OpenSim.Region.Framework.Scenes
534 /// <returns></returns> 535 /// <returns></returns>
535 public bool IsAttachmentCheckFull() 536 public bool IsAttachmentCheckFull()
536 { 537 {
537 return (IsAttachment || (m_rootPart.Shape.PCode == (byte)PCodeEnum.Primitive && m_rootPart.Shape.State != 0)); 538 return (IsAttachment ||
539 (m_rootPart.Shape.PCode == (byte)PCodeEnum.Primitive && m_rootPart.Shape.State != 0));
538 } 540 }
539 541
540 private struct avtocrossInfo 542 private struct avtocrossInfo
@@ -679,7 +681,7 @@ namespace OpenSim.Region.Framework.Scenes
679 } 681 }
680 682
681 string reason = String.Empty; 683 string reason = String.Empty;
682 string version = String.Empty; 684 EntityTransferContext ctx = new EntityTransferContext();
683 685
684 foreach (ScenePresence av in sog.m_sittingAvatars) 686 foreach (ScenePresence av in sog.m_sittingAvatars)
685 { 687 {
@@ -691,7 +693,7 @@ namespace OpenSim.Region.Framework.Scenes
691 693
692 // We set the avatar position as being the object 694 // We set the avatar position as being the object
693 // position to get the region to send to 695 // position to get the region to send to
694 if(!entityTransfer.checkAgentAccessToRegion(av, destination, newpos, out version, out reason)) 696 if(!entityTransfer.checkAgentAccessToRegion(av, destination, newpos, ctx, out reason))
695 { 697 {
696 return sog; 698 return sog;
697 } 699 }
@@ -731,7 +733,7 @@ namespace OpenSim.Region.Framework.Scenes
731 733
732// CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync; 734// CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync;
733// d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d); 735// d.BeginInvoke(av, val, destination, av.Flying, version, CrossAgentToNewRegionCompleted, d);
734 entityTransfer.CrossAgentToNewRegionAsync(av, newpos, destination, av.Flying, version); 736 entityTransfer.CrossAgentToNewRegionAsync(av, newpos, destination, av.Flying, ctx);
735 if (av.IsChildAgent) 737 if (av.IsChildAgent)
736 { 738 {
737 // avatar crossed do some extra cleanup 739 // avatar crossed do some extra cleanup
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 65511bc..52f9b51 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2121,8 +2121,9 @@ namespace OpenSim.Region.Framework.Scenes
2121 } 2121 }
2122 else 2122 else
2123 { 2123 {
2124 if ((!isPhantom || isPhysical || _VolumeDetectActive) && !ParentGroup.IsAttachment 2124 if ((!isPhantom || isPhysical || _VolumeDetectActive)
2125 && !(Shape.PathCurve == (byte)Extrusion.Flexible)) 2125 && !ParentGroup.IsAttachmentCheckFull()
2126 && !(Shape.PathCurve == (byte)Extrusion.Flexible))
2126 { 2127 {
2127 AddToPhysics(isPhysical, isPhantom, building, isPhysical); 2128 AddToPhysics(isPhysical, isPhantom, building, isPhysical);
2128 UpdatePhysicsSubscribedEvents(); // not sure if appliable here 2129 UpdatePhysicsSubscribedEvents(); // not sure if appliable here
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
index 226ed6e..b8f7458 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTeleportTests.cs
@@ -105,6 +105,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
105// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt)); 105// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
106 } 106 }
107 107
108/*
108 [Test] 109 [Test]
109 public void TestSameSimulatorIsolatedRegionsV1() 110 public void TestSameSimulatorIsolatedRegionsV1()
110 { 111 {
@@ -136,7 +137,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
136 SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm); 137 SceneHelpers.SetupSceneModules(new Scene[] { sceneA, sceneB }, config, lscm);
137 138
138 // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour 139 // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour
139 lscm.ServiceVersion = "SIMULATION/0.1"; 140 lscm.ServiceVersion = 0.1f;
140 141
141 Vector3 teleportPosition = new Vector3(10, 11, 12); 142 Vector3 teleportPosition = new Vector3(10, 11, 12);
142 Vector3 teleportLookAt = new Vector3(20, 21, 22); 143 Vector3 teleportLookAt = new Vector3(20, 21, 22);
@@ -178,6 +179,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
178 // position instead). 179 // position instead).
179// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt)); 180// Assert.That(sp.Lookat, Is.EqualTo(teleportLookAt));
180 } 181 }
182*/
181 183
182 [Test] 184 [Test]
183 public void TestSameSimulatorIsolatedRegionsV2() 185 public void TestSameSimulatorIsolatedRegionsV2()
@@ -488,6 +490,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
488// TestHelpers.DisableLogging(); 490// TestHelpers.DisableLogging();
489 } 491 }
490 492
493/*
491 [Test] 494 [Test]
492 public void TestSameSimulatorNeighbouringRegionsV1() 495 public void TestSameSimulatorNeighbouringRegionsV1()
493 { 496 {
@@ -519,7 +522,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
519 SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB); 522 SceneHelpers.SetupSceneModules(sceneB, config, new CapabilitiesModule(), etmB);
520 523
521 // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour 524 // FIXME: Hack - this is here temporarily to revert back to older entity transfer behaviour
522 lscm.ServiceVersion = "SIMULATION/0.1"; 525 lscm.ServiceVersion = 0.1f;
523 526
524 Vector3 teleportPosition = new Vector3(10, 11, 12); 527 Vector3 teleportPosition = new Vector3(10, 11, 12);
525 Vector3 teleportLookAt = new Vector3(20, 21, 22); 528 Vector3 teleportLookAt = new Vector3(20, 21, 22);
@@ -573,6 +576,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
573 576
574// TestHelpers.DisableLogging(); 577// TestHelpers.DisableLogging();
575 } 578 }
579*/
576 580
577 [Test] 581 [Test]
578 public void TestSameSimulatorNeighbouringRegionsV2() 582 public void TestSameSimulatorNeighbouringRegionsV2()
diff --git a/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Properties/AssemblyInfo.cs b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Properties/AssemblyInfo.cs
index c244f95..b9cd6f5 100644
--- a/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/PhysicsModules/ConvexDecompositionDotNet/Properties/AssemblyInfo.cs
@@ -33,3 +33,4 @@ using System.Runtime.InteropServices;
33// by using the '*' as shown below: 33// by using the '*' as shown below:
34// [assembly: AssemblyVersion("1.0.*")] 34// [assembly: AssemblyVersion("1.0.*")]
35[assembly: AssemblyVersion("0.8.3.*")] 35[assembly: AssemblyVersion("0.8.3.*")]
36
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs
index 743a6f6..6199387 100644
--- a/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs
+++ b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs
@@ -172,7 +172,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
172 /// <param name="req"></param> 172 /// <param name="req"></param>
173 private void RayCast(ODERayCastRequest req) 173 private void RayCast(ODERayCastRequest req)
174 { 174 {
175 // NOTE: limit ray lenght or collisions will take all avaiable stack space 175 // NOTE: limit ray length or collisions will take all avaiable stack space
176 // this value may still be too large, depending on machine configuration 176 // this value may still be too large, depending on machine configuration
177 // of maximum stack 177 // of maximum stack
178 float len = req.length; 178 float len = req.length;
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 30418be..0e6710d 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -145,9 +145,90 @@ namespace OpenSim.Server.Handlers.Simulation
145 if (args.ContainsKey("agent_home_uri")) 145 if (args.ContainsKey("agent_home_uri"))
146 agentHomeURI = args["agent_home_uri"].AsString(); 146 agentHomeURI = args["agent_home_uri"].AsString();
147 147
148 string theirVersion = string.Empty; 148 // Decode the legacy (string) version and extract the number
149 float theirVersion = 0f;
149 if (args.ContainsKey("my_version")) 150 if (args.ContainsKey("my_version"))
150 theirVersion = args["my_version"].AsString(); 151 {
152 string theirVersionStr = args["my_version"].AsString();
153 string[] parts = theirVersionStr.Split(new char[] {'/'});
154 if (parts.Length > 1)
155 theirVersion = float.Parse(parts[1]);
156 }
157
158 // Decode the new versioning data
159 float minVersionRequired = 0f;
160 float maxVersionRequired = 0f;
161 float minVersionProvided = 0f;
162 float maxVersionProvided = 0f;
163
164 if (args.ContainsKey("simulation_service_supported_min"))
165 minVersionProvided = (float)args["simulation_service_supported_min"].AsReal();
166 if (args.ContainsKey("simulation_service_supported_max"))
167 maxVersionProvided = (float)args["simulation_service_supported_max"].AsReal();
168
169 if (args.ContainsKey("simulation_service_accepted_min"))
170 minVersionRequired = (float)args["simulation_service_accepted_min"].AsReal();
171 if (args.ContainsKey("simulation_service_accepted_max"))
172 maxVersionRequired = (float)args["simulation_service_accepted_max"].AsReal();
173
174 responsedata["int_response_code"] = HttpStatusCode.OK;
175 OSDMap resp = new OSDMap(3);
176
177 float version = 0f;
178
179 float outboundVersion = 0f;
180 float inboundVersion = 0f;
181
182 if (minVersionProvided == 0f) // string version or older
183 {
184 // If there is no version in the packet at all we're looking at 0.6 or
185 // even more ancient. Refuse it.
186 if(theirVersion == 0f)
187 {
188 resp["success"] = OSD.FromBoolean(false);
189 resp["reason"] = OSD.FromString("Your region is running a old version of opensim no longer supported. Consider updating it");
190 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
191 return;
192 }
193
194 version = theirVersion;
195
196 if (version < VersionInfo.SimulationServiceVersionAcceptedMin ||
197 version > VersionInfo.SimulationServiceVersionAcceptedMax )
198 {
199 resp["success"] = OSD.FromBoolean(false);
200 resp["reason"] = OSD.FromString(String.Format("Your region protocol version is {0} and we accept only {1} - {2}. No version overlap.", theirVersion, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax));
201 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
202 return;
203 }
204 }
205 else
206 {
207 // Test for no overlap
208 if (minVersionProvided > VersionInfo.SimulationServiceVersionAcceptedMax ||
209 maxVersionProvided < VersionInfo.SimulationServiceVersionAcceptedMin)
210 {
211 resp["success"] = OSD.FromBoolean(false);
212 resp["reason"] = OSD.FromString(String.Format("Your region provide protocol versions {0} - {1} and we accept only {2} - {3}. No version overlap.", minVersionProvided, maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMin, VersionInfo.SimulationServiceVersionAcceptedMax));
213 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
214 return;
215 }
216 if (minVersionRequired > VersionInfo.SimulationServiceVersionSupportedMax ||
217 maxVersionRequired < VersionInfo.SimulationServiceVersionSupportedMin)
218 {
219 resp["success"] = OSD.FromBoolean(false);
220 resp["reason"] = OSD.FromString(String.Format("You require region protocol versions {0} - {1} and we provide only {2} - {3}. No version overlap.", minVersionRequired, maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMin, VersionInfo.SimulationServiceVersionSupportedMax));
221 responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp, true);
222 return;
223 }
224
225 // Determine versions to use
226 // This is intentionally inverted. Inbound and Outbound refer to the direction of the transfer.
227 // Therefore outbound means from the sender to the receier and inbound means from the receiver to the sender.
228 // So outbound is what we will accept and inbound is what we will send. Confused yet?
229 outboundVersion = Math.Min(maxVersionProvided, VersionInfo.SimulationServiceVersionAcceptedMax);
230 inboundVersion = Math.Min(maxVersionRequired, VersionInfo.SimulationServiceVersionSupportedMax);
231 }
151 232
152 List<UUID> features = new List<UUID>(); 233 List<UUID> features = new List<UUID>();
153 234
@@ -163,16 +244,25 @@ namespace OpenSim.Server.Handlers.Simulation
163 destination.RegionID = regionID; 244 destination.RegionID = regionID;
164 245
165 string reason; 246 string reason;
166 string version; 247 // We're sending the version numbers down to the local connector to do the varregion check.
167 bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, theirVersion, features, out version, out reason); 248 EntityTransferContext ctx = new EntityTransferContext();
168 249 ctx.InboundVersion = inboundVersion;
169 responsedata["int_response_code"] = HttpStatusCode.OK; 250 ctx.OutboundVersion = outboundVersion;
251 if (minVersionProvided == 0f)
252 {
253 ctx.InboundVersion = version;
254 ctx.OutboundVersion = version;
255 }
170 256
171 OSDMap resp = new OSDMap(3); 257 bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, ctx, out reason);
172 258
173 resp["success"] = OSD.FromBoolean(result); 259 resp["success"] = OSD.FromBoolean(result);
174 resp["reason"] = OSD.FromString(reason); 260 resp["reason"] = OSD.FromString(reason);
175 resp["version"] = OSD.FromString(version); 261 string legacyVersion = String.Format("SIMULATION/{0}", version);
262 resp["version"] = OSD.FromString(legacyVersion);
263 resp["negotiated_inbound_version"] = OSD.FromReal(inboundVersion);
264 resp["negotiated_outbound_version"] = OSD.FromReal(outboundVersion);
265 resp["variable_wearables_count_supported"] = OSD.FromBoolean(true);
176 266
177 OSDArray featuresWanted = new OSDArray(); 267 OSDArray featuresWanted = new OSDArray();
178 foreach (UUID feature in features) 268 foreach (UUID feature in features)
diff --git a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
index 243da52..c7d658a 100644
--- a/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
+++ b/OpenSim/Services/Connectors/Inventory/XInventoryServicesConnector.cs
@@ -524,7 +524,9 @@ namespace OpenSim.Services.Connectors
524 { 524 {
525 InventoryItemBase retrieved = null; 525 InventoryItemBase retrieved = null;
526 if (m_ItemCache.TryGetValue(item.ID, out retrieved)) 526 if (m_ItemCache.TryGetValue(item.ID, out retrieved))
527 {
527 return retrieved; 528 return retrieved;
529 }
528 530
529 try 531 try
530 { 532 {
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 493d7e0..ebffa28 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -283,11 +283,9 @@ namespace OpenSim.Services.Connectors.Simulation
283 } 283 }
284 284
285 285
286 286 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> featuresAvailable, EntityTransferContext ctx, out string reason)
287 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string myversion, List<UUID> featuresAvailable, out string version, out string reason)
288 { 287 {
289 reason = "Failed to contact destination"; 288 reason = "Failed to contact destination";
290 version = "Unknown";
291 289
292 // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position); 290 // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position);
293 291
@@ -300,7 +298,14 @@ namespace OpenSim.Services.Connectors.Simulation
300 OSDMap request = new OSDMap(); 298 OSDMap request = new OSDMap();
301 request.Add("viaTeleport", OSD.FromBoolean(viaTeleport)); 299 request.Add("viaTeleport", OSD.FromBoolean(viaTeleport));
302 request.Add("position", OSD.FromString(position.ToString())); 300 request.Add("position", OSD.FromString(position.ToString()));
303 request.Add("my_version", OSD.FromString(myversion)); 301 // To those who still understad this field, we're telling them
302 // the lowest version just to be safe
303 request.Add("my_version", OSD.FromString(String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersionSupportedMin)));
304 // New simulation service negotiation
305 request.Add("simulation_service_supported_min", OSD.FromReal(VersionInfo.SimulationServiceVersionSupportedMin));
306 request.Add("simulation_service_supported_max", OSD.FromReal(VersionInfo.SimulationServiceVersionSupportedMax));
307 request.Add("simulation_service_accepted_min", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMin));
308 request.Add("simulation_service_accepted_max", OSD.FromReal(VersionInfo.SimulationServiceVersionAcceptedMax));
304 309
305 OSDArray features = new OSDArray(); 310 OSDArray features = new OSDArray();
306 foreach (UUID feature in featuresAvailable) 311 foreach (UUID feature in featuresAvailable)
@@ -324,15 +329,30 @@ namespace OpenSim.Services.Connectors.Simulation
324 success = data["success"]; 329 success = data["success"];
325 330
326 reason = data["reason"].AsString(); 331 reason = data["reason"].AsString();
327 if (data["version"] != null && data["version"].AsString() != string.Empty) 332 // We will need to plumb this and start sing the outbound version as well
328 version = data["version"].AsString(); 333 // TODO: lay the pipe for version plumbing
334 if (data.ContainsKey("negotiated_inbound_version") && data["negotiated_inbound_version"] != null)
335 {
336 ctx.InboundVersion = (float)data["negotiated_inbound_version"].AsReal();
337 ctx.OutboundVersion = (float)data["negotiated_outbound_version"].AsReal();
338 }
339 else if (data["version"] != null && data["version"].AsString() != string.Empty)
340 {
341 string versionString = data["version"].AsString();
342 String[] parts = versionString.Split(new char[] {'/'});
343 if (parts.Length > 1)
344 {
345 ctx.InboundVersion = float.Parse(parts[1]);
346 ctx.OutboundVersion = float.Parse(parts[1]);
347 }
348 }
329 349
330 m_log.DebugFormat( 350 m_log.DebugFormat(
331 "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3} ({4})", 351 "[REMOTE SIMULATION CONNECTOR]: QueryAccess to {0} returned {1}, reason {2}, version {3}/{4}",
332 uri, success, reason, version, data["version"].AsString()); 352 uri, success, reason, ctx.InboundVersion, ctx.OutboundVersion);
333 } 353 }
334 354
335 if (!success) 355 if (!success || ctx.InboundVersion == 0f || ctx.OutboundVersion == 0f)
336 { 356 {
337 // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the 357 // If we don't check this then OpenSimulator 0.7.3.1 and some period before will never see the
338 // actual failure message 358 // actual failure message
@@ -451,7 +471,6 @@ namespace OpenSim.Services.Connectors.Simulation
451 args["destination_name"] = OSD.FromString(destination.RegionName); 471 args["destination_name"] = OSD.FromString(destination.RegionName);
452 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString()); 472 args["destination_uuid"] = OSD.FromString(destination.RegionID.ToString());
453 473
454
455 OSDMap result = WebUtil.PostToService(uri, args, 40000, false); 474 OSDMap result = WebUtil.PostToService(uri, args, 40000, false);
456 475
457 if (result == null) 476 if (result == null)
diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs
index bee3db3..692ef06 100644
--- a/OpenSim/Services/HypergridService/GatekeeperService.cs
+++ b/OpenSim/Services/HypergridService/GatekeeperService.cs
@@ -452,12 +452,12 @@ namespace OpenSim.Services.HypergridService
452 452
453 m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag); 453 m_log.DebugFormat("[GATEKEEPER SERVICE]: Launching {0}, Teleport Flags: {1}", aCircuit.Name, loginFlag);
454 454
455 string version; 455 EntityTransferContext ctx = new EntityTransferContext();
456 456
457 string myversion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion); 457 string myversion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion);
458 if (!m_SimulationService.QueryAccess( 458 if (!m_SimulationService.QueryAccess(
459 destination, aCircuit.AgentID, aCircuit.ServiceURLs["HomeURI"].ToString(), 459 destination, aCircuit.AgentID, aCircuit.ServiceURLs["HomeURI"].ToString(),
460 true, aCircuit.startpos, myversion, new List<UUID>(), out version, out reason)) 460 true, aCircuit.startpos, new List<UUID>(), ctx, out reason))
461 return false; 461 return false;
462 462
463 return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason); 463 return m_SimulationService.CreateAgent(source, destination, aCircuit, (uint)loginFlag, out reason);
diff --git a/OpenSim/Services/Interfaces/IAvatarService.cs b/OpenSim/Services/Interfaces/IAvatarService.cs
index 3663a7a..bd66dad 100644
--- a/OpenSim/Services/Interfaces/IAvatarService.cs
+++ b/OpenSim/Services/Interfaces/IAvatarService.cs
@@ -162,12 +162,11 @@ namespace OpenSim.Services.Interfaces
162 } 162 }
163 163
164 // Visual Params 164 // Visual Params
165 // string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT]; 165 //string[] vps = new string[AvatarAppearance.VISUALPARAM_COUNT];
166 // byte[] binary = appearance.VisualParams; 166 //byte[] binary = appearance.VisualParams;
167 167
168 // for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++) 168 // for (int i = 0 ; i < AvatarAppearance.VISUALPARAM_COUNT ; i++)
169 169
170
171 byte[] binary = appearance.VisualParams; 170 byte[] binary = appearance.VisualParams;
172 string[] vps = new string[binary.Length]; 171 string[] vps = new string[binary.Length];
173 172
@@ -285,14 +284,13 @@ namespace OpenSim.Services.Interfaces
285 if (Data.ContainsKey("VisualParams")) 284 if (Data.ContainsKey("VisualParams"))
286 { 285 {
287 string[] vps = Data["VisualParams"].Split(new char[] {','}); 286 string[] vps = Data["VisualParams"].Split(new char[] {','});
288 // byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT]; 287 //byte[] binary = new byte[AvatarAppearance.VISUALPARAM_COUNT];
289 288
290 // for (int i = 0 ; i < vps.Length && i < binary.Length ; i++) 289 //for (int i = 0 ; i < vps.Length && i < binary.Length ; i++)
291 byte[] binary = new byte[vps.Length]; 290 byte[] binary = new byte[vps.Length];
292 291
293 for (int i = 0; i < vps.Length; i++) 292 for (int i = 0; i < vps.Length; i++)
294 293 binary[i] = (byte)Convert.ToInt32(vps[i]);
295 binary[i] = (byte)Convert.ToInt32(vps[i]);
296 294
297 appearance.VisualParams = binary; 295 appearance.VisualParams = binary;
298 } 296 }
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs
index 3573bea..257b578 100644
--- a/OpenSim/Services/Interfaces/ISimulationService.cs
+++ b/OpenSim/Services/Interfaces/ISimulationService.cs
@@ -34,6 +34,18 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
34 34
35namespace OpenSim.Services.Interfaces 35namespace OpenSim.Services.Interfaces
36{ 36{
37 public class EntityTransferContext
38 {
39 public EntityTransferContext()
40 {
41 InboundVersion = VersionInfo.SimulationServiceVersionAcceptedMax;
42 OutboundVersion = VersionInfo.SimulationServiceVersionSupportedMax;
43 }
44
45 public float InboundVersion { get; set; }
46 public float OutboundVersion { get; set; }
47 }
48
37 public interface ISimulationService 49 public interface ISimulationService
38 { 50 {
39 /// <summary> 51 /// <summary>
@@ -93,7 +105,7 @@ namespace OpenSim.Services.Interfaces
93 /// <param name="version">Version that the target simulator is running</param> 105 /// <param name="version">Version that the target simulator is running</param>
94 /// <param name="reason">[out] Optional error message</param> 106 /// <param name="reason">[out] Optional error message</param>
95 /// <returns>True: ok; False: not allowed</returns> 107 /// <returns>True: ok; False: not allowed</returns>
96 bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason); 108 bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, EntityTransferContext ctx, out string reason);
97 109
98 /// <summary> 110 /// <summary>
99 /// Message from receiving region to departing region, telling it got contacted by the client. 111 /// Message from receiving region to departing region, telling it got contacted by the client.
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs
index 5829212..619a527 100644
--- a/OpenSim/Services/LLLoginService/LLLoginService.cs
+++ b/OpenSim/Services/LLLoginService/LLLoginService.cs
@@ -993,11 +993,10 @@ namespace OpenSim.Services.LLLoginService
993 993
994 private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason) 994 private bool LaunchAgentDirectly(ISimulationService simConnector, GridRegion region, AgentCircuitData aCircuit, TeleportFlags flags, out string reason)
995 { 995 {
996 string myversion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion); 996 EntityTransferContext ctx = new EntityTransferContext();
997 string version;
998 997
999 if (!simConnector.QueryAccess( 998 if (!simConnector.QueryAccess(
1000 region, aCircuit.AgentID, null, true, aCircuit.startpos, myversion, new List<UUID>(), out version, out reason)) 999 region, aCircuit.AgentID, null, true, aCircuit.startpos, new List<UUID>(), ctx, out reason))
1001 return false; 1000 return false;
1002 1001
1003 return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason); 1002 return simConnector.CreateAgent(null, region, aCircuit, (uint)flags, out reason);