aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMelanie Thielker2015-10-31 00:01:35 +0100
committerMelanie Thielker2015-10-31 00:01:35 +0100
commitdc6d9eadf33b9a0321664d676030b07b2bd04bed (patch)
tree86d8bd48a294b7e0adaf0c6c85c69f4752382c9f /OpenSim/Region
parentfix services handling of visualparameters, avoiding possible crashs (mantis 7... (diff)
downloadopensim-SC-dc6d9eadf33b9a0321664d676030b07b2bd04bed.zip
opensim-SC-dc6d9eadf33b9a0321664d676030b07b2bd04bed.tar.gz
opensim-SC-dc6d9eadf33b9a0321664d676030b07b2bd04bed.tar.bz2
opensim-SC-dc6d9eadf33b9a0321664d676030b07b2bd04bed.tar.xz
Testing stage of the new versioning system. Use at own risk. May not
work. Will eat your babies. Yada. Yada.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs47
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs15
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs8
-rw-r--r--OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
5 files changed, 28 insertions, 50 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
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index 3800b3f..32ac992 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -81,8 +81,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
81 81
82 public void InitialiseService(IConfigSource configSource) 82 public void InitialiseService(IConfigSource configSource)
83 { 83 {
84 ServiceVersion = String.Format("SIMULATION/{0}", VersionInfo.SimulationServiceVersion);
85 m_log.InfoFormat("[LOCAL SIMULATION CONNECTOR]: Initialized with connector protocol version {0}", ServiceVersion);
86 } 84 }
87 85
88 public void PostInitialise() 86 public void PostInitialise()
@@ -251,10 +249,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
251 return true; 249 return true;
252 } 250 }
253 251
254 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, List<UUID> features, out string version, out string reason) 252 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, out float version, out string reason)
255 { 253 {
256 reason = "Communications failure"; 254 reason = "Communications failure";
257 version = ServiceVersion; 255 version = VersionInfo.SimulationServiceVersionAcceptedMax; // If it's within the process, use max. If it's not, the connector will overwrite this
258 if (destination == null) 256 if (destination == null)
259 return false; 257 return false;
260 258
@@ -265,17 +263,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
265// s.RegionInfo.RegionName, destination.RegionHandle); 263// s.RegionInfo.RegionName, destination.RegionHandle);
266 uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX; 264 uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX;
267 265
268 float theirVersionNumber = 0f;
269 string[] versionComponents = theirversion.Split(new char[] { '/' });
270 if (versionComponents.Length >= 2)
271 float.TryParse(versionComponents[1], out theirVersionNumber);
272
273 // Var regions here, and the requesting simulator is in an older version. 266 // Var regions here, and the requesting simulator is in an older version.
274 // We will forbide this, because it crashes the viewers 267 // We will forbide this, because it crashes the viewers
275 if (theirVersionNumber < 0.3f && size > 256) 268 if (version < 0.3f && size != 256)
276 { 269 {
277 reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; 270 reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading.";
278 m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber); 271 m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from older simulator was denied");
279 return false; 272 return false;
280 273
281 } 274 }
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
index f963242..e2f52c4 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
@@ -205,21 +205,21 @@ 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 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, List<UUID> features, out string version, out string reason) 208 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, List<UUID> features, out float version, out string reason)
209 { 209 {
210 reason = "Communications failure"; 210 reason = "Communications failure";
211 version = "Unknown"; 211 version = 0f;
212 212
213 if (destination == null) 213 if (destination == null)
214 return false; 214 return false;
215 215
216 // Try local first 216 // Try local first
217 if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason)) 217 if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, out version, out reason))
218 return true; 218 return true;
219 219
220 // else do the remote thing 220 // else do the remote thing
221 if (!m_localBackend.IsLocalRegion(destination.RegionID)) 221 if (!m_localBackend.IsLocalRegion(destination.RegionID))
222 return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, features, out version, out reason); 222 return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, features, out version, out reason);
223 223
224 return false; 224 return false;
225 } 225 }
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs
index 1ebef90..9e91d7d 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, float version);
39 39
40 public interface IEntityTransferModule 40 public interface IEntityTransferModule
41 { 41 {
@@ -92,12 +92,12 @@ namespace OpenSim.Region.Framework.Interfaces
92 92
93 void EnableChildAgent(ScenePresence agent, GridRegion region); 93 void EnableChildAgent(ScenePresence agent, GridRegion region);
94 94
95 GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out string version, 95 GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out float version,
96 out Vector3 newpos, out string reason); 96 out Vector3 newpos, out string reason);
97 97
98 void Cross(SceneObjectGroup sog, Vector3 position, bool silent); 98 void Cross(SceneObjectGroup sog, Vector3 position, bool silent);
99 99
100 ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); 100 ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, float version);
101 101
102 bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition); 102 bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition);
103 } 103 }
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 1d89267..f5e2c9d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -480,7 +480,7 @@ namespace OpenSim.Region.Framework.Scenes
480 ) 480 )
481 { 481 {
482 IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>(); 482 IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface<IEntityTransferModule>();
483 string version = String.Empty; 483 float version = 0f;
484 Vector3 newpos = Vector3.Zero; 484 Vector3 newpos = Vector3.Zero;
485 string failureReason = String.Empty; 485 string failureReason = String.Empty;
486 OpenSim.Services.Interfaces.GridRegion destination = null; 486 OpenSim.Services.Interfaces.GridRegion destination = null;