mirror of
https://github.com/opensim/opensim.git
synced 2026-08-07 01:35:46 +08:00
Change the QUERYACCESS method to eliminate spurious access denied messages
This commit is contained in:
@@ -285,9 +285,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero))
|
||||
string reason;
|
||||
if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero, out reason))
|
||||
{
|
||||
sp.ControllingClient.SendTeleportFailed("The destination region has refused access");
|
||||
sp.ControllingClient.SendTeleportFailed("Teleport failed: " + reason);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -324,8 +325,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
agentCircuit.CapsPath = CapsUtil.GetRandomCapsObjectPath();
|
||||
}
|
||||
|
||||
string reason = String.Empty;
|
||||
|
||||
// Let's create an agent there if one doesn't exist yet.
|
||||
bool logout = false;
|
||||
if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout))
|
||||
@@ -797,7 +796,8 @@ 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, newpos))
|
||||
string reason;
|
||||
if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos, out reason))
|
||||
{
|
||||
agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel");
|
||||
if (r == null)
|
||||
|
||||
@@ -257,15 +257,16 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position)
|
||||
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string reason)
|
||||
{
|
||||
reason = "Communications failure";
|
||||
if (destination == null)
|
||||
return false;
|
||||
|
||||
foreach (Scene s in m_sceneList)
|
||||
{
|
||||
if (s.RegionInfo.RegionID == destination.RegionID)
|
||||
return s.QueryAccess(id, position);
|
||||
return s.QueryAccess(id, position, out reason);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -239,18 +239,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
|
||||
|
||||
}
|
||||
|
||||
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position)
|
||||
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string reason)
|
||||
{
|
||||
reason = "Communications failure";
|
||||
if (destination == null)
|
||||
return false;
|
||||
|
||||
// Try local first
|
||||
if (m_localBackend.QueryAccess(destination, id, position))
|
||||
if (m_localBackend.QueryAccess(destination, id, position, out reason))
|
||||
return true;
|
||||
|
||||
// else do the remote thing
|
||||
if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
|
||||
return m_remoteConnector.QueryAccess(destination, id, position);
|
||||
return m_remoteConnector.QueryAccess(destination, id, position, out reason);
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user