When sending QueryAccess to a region, also send the user's Home URI

This commit is contained in:
Oren Hurvitz
2014-04-07 09:25:18 +03:00
parent 55cc8044cb
commit 85d51e57a9
8 changed files with 47 additions and 16 deletions

View File

@@ -700,6 +700,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
return;
}
string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId);
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}",
sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName,
@@ -744,7 +746,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
string reason;
string version;
if (!Scene.SimulationService.QueryAccess(
finalDestination, sp.ControllingClient.AgentId, position, out version, out reason))
finalDestination, sp.ControllingClient.AgentId, homeURI, position, out version, out reason))
{
sp.ControllingClient.SendTeleportFailed(reason);
@@ -1456,6 +1458,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
version = String.Empty;
newpos = pos;
failureReason = string.Empty;
string homeURI = scene.GetAgentHomeURI(agentID);
// m_log.DebugFormat(
// "[ENTITY TRANSFER MODULE]: Crossing agent {0} at pos {1} in {2}", agent.Name, pos, scene.Name);
@@ -1489,7 +1492,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// Check to see if we have access to the target region.
if (neighbourRegion != null
&& !scene.SimulationService.QueryAccess(neighbourRegion, agentID, newpos, out version, out failureReason))
&& !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, newpos, out version, out failureReason))
{
// remember banned
m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID);

View File

@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return true;
}
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason)
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason)
{
reason = "Communications failure";
version = ServiceVersion;
@@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
// s.RegionInfo.RegionName, destination.RegionHandle);
return m_scenes[destination.RegionID].QueryAccess(id, position, out reason);
return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, position, out reason);
}
//m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess");

View File

@@ -207,7 +207,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return m_remoteConnector.UpdateAgent(destination, cAgentData);
}
public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason)
public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason)
{
reason = "Communications failure";
version = "Unknown";
@@ -216,12 +216,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
return false;
// Try local first
if (m_localBackend.QueryAccess(destination, id, position, out version, out reason))
if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason))
return true;
// else do the remote thing
if (!m_localBackend.IsLocalRegion(destination.RegionID))
return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason);
return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason);
return false;
}