diff options
author | Diva Canto | 2014-06-06 11:04:53 -0700 |
---|---|---|
committer | Justin Clark-Casey | 2014-06-10 20:28:47 +0100 |
commit | ffe07527fcd95c1bd8a8d29432fe33e350354538 (patch) | |
tree | 614ff2e79275c3aef16bd55be8345e68eb4e6ebd /OpenSim/Region | |
parent | Better comment regarding SizeX and SizeY (diff) | |
download | opensim-SC_OLD-ffe07527fcd95c1bd8a8d29432fe33e350354538.zip opensim-SC_OLD-ffe07527fcd95c1bd8a8d29432fe33e350354538.tar.gz opensim-SC_OLD-ffe07527fcd95c1bd8a8d29432fe33e350354538.tar.bz2 opensim-SC_OLD-ffe07527fcd95c1bd8a8d29432fe33e350354538.tar.xz |
Added simulation version compatibility check so that agents coming from 0.7.6 to a varregion running in 0.8 and above will be denied teleport, rather than be allowed and crash the viewer.
Diffstat (limited to 'OpenSim/Region')
3 files changed, 32 insertions, 10 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index e583590..b157e6b 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -208,7 +208,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
208 | protected virtual void InitialiseCommon(IConfigSource source) | 208 | protected virtual void InitialiseCommon(IConfigSource source) |
209 | { | 209 | { |
210 | string transferVersionName = "SIMULATION"; | 210 | string transferVersionName = "SIMULATION"; |
211 | float maxTransferVersion = 0.2f; | 211 | float maxTransferVersion = 0.3f; |
212 | 212 | ||
213 | IConfig hypergridConfig = source.Configs["Hypergrid"]; | 213 | IConfig hypergridConfig = source.Configs["Hypergrid"]; |
214 | if (hypergridConfig != null) | 214 | if (hypergridConfig != null) |
@@ -760,8 +760,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
760 | 760 | ||
761 | string reason; | 761 | string reason; |
762 | string version; | 762 | string version; |
763 | string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion); | ||
763 | if (!Scene.SimulationService.QueryAccess( | 764 | if (!Scene.SimulationService.QueryAccess( |
764 | finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, out version, out reason)) | 765 | finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, out version, out reason)) |
765 | { | 766 | { |
766 | sp.ControllingClient.SendTeleportFailed(reason); | 767 | sp.ControllingClient.SendTeleportFailed(reason); |
767 | 768 | ||
@@ -833,7 +834,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
833 | if (versionComponents.Length >= 2) | 834 | if (versionComponents.Length >= 2) |
834 | float.TryParse(versionComponents[1], out versionNumber); | 835 | float.TryParse(versionComponents[1], out versionNumber); |
835 | 836 | ||
836 | if (versionNumber == 0.2f && MaxOutgoingTransferVersion >= versionNumber) | 837 | if (versionNumber >= 0.2f && MaxOutgoingTransferVersion >= versionNumber) |
837 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 838 | TransferAgent_V2(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
838 | else | 839 | else |
839 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); | 840 | TransferAgent_V1(sp, agentCircuit, reg, finalDestination, endPoint, teleportFlags, oldRegionX, newRegionX, oldRegionY, newRegionY, version, out reason); |
@@ -1509,8 +1510,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1509 | } | 1510 | } |
1510 | 1511 | ||
1511 | // Check to see if we have access to the target region. | 1512 | // Check to see if we have access to the target region. |
1513 | string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion); | ||
1512 | if (neighbourRegion != null | 1514 | if (neighbourRegion != null |
1513 | && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, out version, out failureReason)) | 1515 | && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, myversion, out version, out failureReason)) |
1514 | { | 1516 | { |
1515 | // remember banned | 1517 | // remember banned |
1516 | m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); | 1518 | m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs index 926ef05..e6de0b6 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs | |||
@@ -52,6 +52,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
52 | /// Currently valid versions are "SIMULATION/0.1" and "SIMULATION/0.2" | 52 | /// Currently valid versions are "SIMULATION/0.1" and "SIMULATION/0.2" |
53 | /// </remarks> | 53 | /// </remarks> |
54 | public string ServiceVersion { get; set; } | 54 | public string ServiceVersion { get; set; } |
55 | private float m_VersionNumber = 0.3f; | ||
55 | 56 | ||
56 | /// <summary> | 57 | /// <summary> |
57 | /// Map region ID to scene. | 58 | /// Map region ID to scene. |
@@ -84,15 +85,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
84 | 85 | ||
85 | public void InitialiseService(IConfigSource configSource) | 86 | public void InitialiseService(IConfigSource configSource) |
86 | { | 87 | { |
87 | ServiceVersion = "SIMULATION/0.2"; | 88 | ServiceVersion = "SIMULATION/0.3"; |
88 | IConfig config = configSource.Configs["SimulationService"]; | 89 | IConfig config = configSource.Configs["SimulationService"]; |
89 | if (config != null) | 90 | if (config != null) |
90 | { | 91 | { |
91 | ServiceVersion = config.GetString("ConnectorProtocolVersion", ServiceVersion); | 92 | ServiceVersion = config.GetString("ConnectorProtocolVersion", ServiceVersion); |
92 | 93 | ||
93 | if (ServiceVersion != "SIMULATION/0.1" && ServiceVersion != "SIMULATION/0.2") | 94 | if (ServiceVersion != "SIMULATION/0.1" && ServiceVersion != "SIMULATION/0.2" && ServiceVersion != "SIMULATION/0.3") |
94 | throw new Exception(string.Format("Invalid ConnectorProtocolVersion {0}", ServiceVersion)); | 95 | throw new Exception(string.Format("Invalid ConnectorProtocolVersion {0}", ServiceVersion)); |
95 | 96 | ||
97 | string[] versionComponents = ServiceVersion.Split(new char[] { '/' }); | ||
98 | if (versionComponents.Length >= 2) | ||
99 | float.TryParse(versionComponents[1], out m_VersionNumber); | ||
100 | |||
96 | m_log.InfoFormat( | 101 | m_log.InfoFormat( |
97 | "[LOCAL SIMULATION CONNECTOR]: Initialized with connector protocol version {0}", ServiceVersion); | 102 | "[LOCAL SIMULATION CONNECTOR]: Initialized with connector protocol version {0}", ServiceVersion); |
98 | } | 103 | } |
@@ -264,7 +269,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
264 | return true; | 269 | return true; |
265 | } | 270 | } |
266 | 271 | ||
267 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason) | 272 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, out string version, out string reason) |
268 | { | 273 | { |
269 | reason = "Communications failure"; | 274 | reason = "Communications failure"; |
270 | version = ServiceVersion; | 275 | version = ServiceVersion; |
@@ -276,6 +281,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
276 | // m_log.DebugFormat( | 281 | // m_log.DebugFormat( |
277 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", | 282 | // "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", |
278 | // s.RegionInfo.RegionName, destination.RegionHandle); | 283 | // s.RegionInfo.RegionName, destination.RegionHandle); |
284 | uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX; | ||
285 | |||
286 | float theirVersionNumber = 0f; | ||
287 | string[] versionComponents = theirversion.Split(new char[] { '/' }); | ||
288 | if (versionComponents.Length >= 2) | ||
289 | float.TryParse(versionComponents[1], out theirVersionNumber); | ||
290 | |||
291 | // Var regions here, and the requesting simulator is in an older version. | ||
292 | // We will forbide this, because it crashes the viewers | ||
293 | if (theirVersionNumber < 0.3f && size > 256) | ||
294 | { | ||
295 | reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading."; | ||
296 | m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber); | ||
297 | return false; | ||
298 | } | ||
279 | 299 | ||
280 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, out reason); | 300 | return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, viaTeleport, position, out reason); |
281 | } | 301 | } |
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs index 0444e49..6ecc327 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs | |||
@@ -207,7 +207,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
207 | return m_remoteConnector.UpdateAgent(destination, cAgentData); | 207 | return m_remoteConnector.UpdateAgent(destination, cAgentData); |
208 | } | 208 | } |
209 | 209 | ||
210 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, out string version, out string reason) | 210 | public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string sversion, out string version, out string reason) |
211 | { | 211 | { |
212 | reason = "Communications failure"; | 212 | reason = "Communications failure"; |
213 | version = "Unknown"; | 213 | version = "Unknown"; |
@@ -216,12 +216,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | |||
216 | return false; | 216 | return false; |
217 | 217 | ||
218 | // Try local first | 218 | // Try local first |
219 | if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason)) | 219 | if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, out version, out reason)) |
220 | return true; | 220 | return true; |
221 | 221 | ||
222 | // else do the remote thing | 222 | // else do the remote thing |
223 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) | 223 | if (!m_localBackend.IsLocalRegion(destination.RegionID)) |
224 | return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, out version, out reason); | 224 | return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, out version, out reason); |
225 | 225 | ||
226 | return false; | 226 | return false; |
227 | } | 227 | } |