Fix up QueryAccess to also check parcels

This commit is contained in:
Melanie
2011-01-28 03:07:25 +01:00
parent 566eff17de
commit 657c14c5db
7 changed files with 47 additions and 20 deletions

View File

@@ -285,7 +285,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return;
}
if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId))
if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero))
{
sp.ControllingClient.SendTeleportFailed("The destination region has refused access");
return;
@@ -797,8 +797,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId))
if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos))
{
agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel");
if (r == null)
{
r = new ExpiringCache<ulong, DateTime>();

View File

@@ -257,7 +257,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return false;
}
public bool QueryAccess(GridRegion destination, UUID id)
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position)
{
if (destination == null)
return false;
@@ -265,7 +265,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
foreach (Scene s in m_sceneList)
{
if (s.RegionInfo.RegionID == destination.RegionID)
return s.QueryAccess(id);
return s.QueryAccess(id, position);
}
return false;
}

View File

@@ -239,18 +239,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
}
public bool QueryAccess(GridRegion destination, UUID id)
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position)
{
if (destination == null)
return false;
// Try local first
if (m_localBackend.QueryAccess(destination, id))
if (m_localBackend.QueryAccess(destination, id, position))
return true;
// else do the remote thing
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
return m_remoteConnector.QueryAccess(destination, id);
return m_remoteConnector.QueryAccess(destination, id, position);
return false;