aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs21
1 files changed, 15 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 3eff96e..f1d69b0 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1443,10 +1443,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1443 // see that it is actually outside the current region), find the new region that the 1443 // see that it is actually outside the current region), find the new region that the
1444 // point is actually in. 1444 // point is actually in.
1445 // Returns the coordinates and information of the new region or 'null' of it doesn't exist. 1445 // 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, out string version, out Vector3 newpos) 1446 public GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos,
1447 out string version, out Vector3 newpos, out string failureReason)
1447 { 1448 {
1448 version = String.Empty; 1449 version = String.Empty;
1449 newpos = pos; 1450 newpos = pos;
1451 failureReason = string.Empty;
1450 1452
1451// m_log.DebugFormat( 1453// m_log.DebugFormat(
1452// "[ENTITY TRANSFER MODULE]: Crossing agent {0} at pos {1} in {2}", agent.Name, pos, scene.Name); 1454// "[ENTITY TRANSFER MODULE]: Crossing agent {0} at pos {1} in {2}", agent.Name, pos, scene.Name);
@@ -1463,12 +1465,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1463 if (neighbourRegion != null) 1465 if (neighbourRegion != null)
1464 { 1466 {
1465 // Compute the entity's position relative to the new region 1467 // Compute the entity's position relative to the new region
1466 newpos = new Vector3( (float)(presenceWorldX - (double)neighbourRegion.RegionLocX), 1468 newpos = new Vector3((float)(presenceWorldX - (double)neighbourRegion.RegionLocX),
1467 (float)(presenceWorldY - (double)neighbourRegion.RegionLocY), 1469 (float)(presenceWorldY - (double)neighbourRegion.RegionLocY),
1468 pos.Z); 1470 pos.Z);
1469 1471
1470 if (m_bannedRegionCache.IfBanned(neighbourRegion.RegionHandle, agentID)) 1472 if (m_bannedRegionCache.IfBanned(neighbourRegion.RegionHandle, agentID))
1471 { 1473 {
1474 failureReason = "Cannot region cross into banned parcel";
1472 neighbourRegion = null; 1475 neighbourRegion = null;
1473 } 1476 }
1474 else 1477 else
@@ -1478,15 +1481,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1478 } 1481 }
1479 1482
1480 // Check to see if we have access to the target region. 1483 // Check to see if we have access to the target region.
1481 string reason;
1482 if (neighbourRegion != null 1484 if (neighbourRegion != null
1483 && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, newpos, out version, out reason)) 1485 && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, newpos, out version, out failureReason))
1484 { 1486 {
1485 // remember banned 1487 // remember banned
1486 m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); 1488 m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID);
1487 neighbourRegion = null; 1489 neighbourRegion = null;
1488 } 1490 }
1489 } 1491 }
1492 else
1493 {
1494 // The destination region just doesn't exist
1495 failureReason = "Cannot cross into non-existant region";
1496 }
1490 1497
1491 if (neighbourRegion == null) 1498 if (neighbourRegion == null)
1492 m_log.DebugFormat("{0} GetDestination: region not found. Old region name={1} at <{2},{3}> of size <{4},{5}>. Old pos={6}", 1499 m_log.DebugFormat("{0} GetDestination: region not found. Old region name={1} at <{2},{3}> of size <{4},{5}>. Old pos={6}",
@@ -1509,11 +1516,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1509 uint y; 1516 uint y;
1510 Vector3 newpos; 1517 Vector3 newpos;
1511 string version; 1518 string version;
1519 string failureReason;
1512 1520
1513 GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition, out version, out newpos); 1521 GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, agent.AbsolutePosition,
1522 out version, out newpos, out failureReason);
1514 if (neighbourRegion == null) 1523 if (neighbourRegion == null)
1515 { 1524 {
1516 agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel"); 1525 agent.ControllingClient.SendAlertMessage(failureReason);
1517 return false; 1526 return false;
1518 } 1527 }
1519 1528