aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2015-08-26 05:29:08 +0100
committerUbitUmarov2015-08-26 05:29:08 +0100
commitce883e9b436a0d63cfe1d5c81f83477a266e727e (patch)
treea8b674cf6fa5e737ea2babaed6fd81eef205afe5 /OpenSim/Region
parentchange teleport version number to v0.3, without actually adding the checks (diff)
downloadopensim-SC_OLD-ce883e9b436a0d63cfe1d5c81f83477a266e727e.zip
opensim-SC_OLD-ce883e9b436a0d63cfe1d5c81f83477a266e727e.tar.gz
opensim-SC_OLD-ce883e9b436a0d63cfe1d5c81f83477a266e727e.tar.bz2
opensim-SC_OLD-ce883e9b436a0d63cfe1d5c81f83477a266e727e.tar.xz
add more of the v03 checks and homeURL. Sending side only for now
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs17
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs22
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs8
3 files changed, 36 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index ef9f8df..e3cf43c 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -750,9 +750,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
750 string version; 750 string version;
751 string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion); 751 string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion);
752 if (!Scene.SimulationService.QueryAccess( 752 if (!Scene.SimulationService.QueryAccess(
753 finalDestination, sp.ControllingClient.AgentId, position, out version, out reason)) 753 finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, out version, out reason))
754// if (!Scene.SimulationService.QueryAccess(
755// finalDestination, sp.ControllingClient.AgentId, homeURI, true, position, myversion, out version, out reason))
756 { 754 {
757 sp.ControllingClient.SendTeleportFailed(reason); 755 sp.ControllingClient.SendTeleportFailed(reason);
758 756
@@ -1470,8 +1468,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1470 } 1468 }
1471 1469
1472 Scene ascene = agent.Scene; 1470 Scene ascene = agent.Scene;
1471 string homeURI = ascene.GetAgentHomeURI(agentID);
1472 string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion);
1473
1473 1474
1474 if (!ascene.SimulationService.QueryAccess(destiny, agentID, position, out version, out reason)) 1475 if (!ascene.SimulationService.QueryAccess(destiny, agentID, homeURI, false, position,
1476 myversion, out version, out reason))
1475 { 1477 {
1476 m_bannedRegionCache.Add(destinyHandle, agentID, 30.0, 30.0); 1478 m_bannedRegionCache.Add(destinyHandle, agentID, 30.0, 30.0);
1477 return false; 1479 return false;
@@ -1490,6 +1492,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1490 // see that it is actually outside the current region), find the new region that the 1492 // see that it is actually outside the current region), find the new region that the
1491 // point is actually in. 1493 // point is actually in.
1492 // Returns the coordinates and information of the new region or 'null' of it doesn't exist. 1494 // Returns the coordinates and information of the new region or 'null' of it doesn't exist.
1495
1496 // now only works for crossings
1497
1493 public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, 1498 public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos,
1494 out string version, out Vector3 newpos, out string failureReason) 1499 out string version, out Vector3 newpos, out string failureReason)
1495 { 1500 {
@@ -1529,8 +1534,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1529 1534
1530 // Check to see if we have access to the target region. 1535 // Check to see if we have access to the target region.
1531 string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion); 1536 string myversion = string.Format("{0}/{1}", OutgoingTransferVersionName, MaxOutgoingTransferVersion);
1537 string homeURI = scene.GetAgentHomeURI(agentID);
1532 if (neighbourRegion != null 1538 if (neighbourRegion != null
1533 && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, newpos, out version, out failureReason)) 1539 && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, false, newpos, myversion, out version, out failureReason))
1534 { 1540 {
1535 // remember banned 1541 // remember banned
1536 m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); 1542 m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID);
@@ -1581,7 +1587,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1581 agent.IsInTransit = false; 1587 agent.IsInTransit = false;
1582 } 1588 }
1583 1589
1584
1585 public ScenePresence CrossAsync(ScenePresence agent, bool isFlying) 1590 public ScenePresence CrossAsync(ScenePresence agent, bool isFlying)
1586 { 1591 {
1587 uint x; 1592 uint x;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index 361bf34..81990d5 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
264 return true; 264 return true;
265 } 265 }
266 266
267 public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) 267 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, bool viaTeleport, Vector3 position, string theirversion, out string version, out string reason)
268 { 268 {
269 reason = "Communications failure"; 269 reason = "Communications failure";
270 version = ServiceVersion; 270 version = ServiceVersion;
@@ -277,7 +277,25 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
277// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", 277// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
278// s.RegionInfo.RegionName, destination.RegionHandle); 278// s.RegionInfo.RegionName, destination.RegionHandle);
279 279
280 return m_scenes[destination.RegionID].QueryAccess(id, position, out reason); 280
281 // not really need on a grid running var regions sims
282
283 uint size = m_scenes[destination.RegionID].RegionInfo.RegionSizeX;
284
285 float theirVersionNumber = 0f;
286 string[] versionComponents = theirversion.Split(new char[] { '/' });
287 if (versionComponents.Length >= 2)
288 float.TryParse(versionComponents[1], out theirVersionNumber);
289
290 // Var regions here, and the requesting simulator is in an older version.
291 // We will forbide this, because it crashes the viewers
292 if (theirVersionNumber < 0.3f && size > 256)
293 {
294 reason = "Destination is a variable-sized region, and source is an old simulator. Consider upgrading.";
295 m_log.DebugFormat("[LOCAL SIMULATION CONNECTOR]: Request to access this variable-sized region from {0} simulator was denied", theirVersionNumber);
296 return false;
297 }
298 return m_scenes[destination.RegionID].QueryAccess(agentID, position, out reason);
281 } 299 }
282 300
283 //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); 301 //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess");
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
index ab912ed..580109e 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 id, 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,14 @@ 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, id, 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 return true;
221 222
222 // else do the remote thing 223 // else do the remote thing
223 if (!m_localBackend.IsLocalRegion(destination.RegionID)) 224 if (!m_localBackend.IsLocalRegion(destination.RegionID))
224 return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason); 225 return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, viaTeleport, position, sversion, out version, out reason);
226
225 227
226 return false; 228 return false;
227 } 229 }