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

@@ -272,9 +272,7 @@ namespace OpenSim.Services.Connectors.Simulation
}
/// <summary>
/// </summary>
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 = "Failed to contact destination";
version = "Unknown";
@@ -285,10 +283,12 @@ namespace OpenSim.Services.Connectors.Simulation
if (ext == null) return false;
// Eventually, we want to use a caps url instead of the agentID
string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
string uri = destination.ServerURI + AgentPath() + agentID + "/" + destination.RegionID.ToString() + "/";
OSDMap request = new OSDMap();
request.Add("position", OSD.FromString(position.ToString()));
if (agentHomeURI != null)
request.Add("agent_home_uri", OSD.FromString(agentHomeURI));
try
{

View File

@@ -37,6 +37,19 @@ namespace OpenSim.Services.Interfaces
public interface IGatekeeperService
{
bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason);
/// <summary>
/// Returns the region a Hypergrid visitor should enter.
/// </summary>
/// <remarks>
/// Usually the returned region will be the requested region. But the grid can choose to
/// redirect the user to another region: e.g., a default gateway region.
/// </remarks>
/// <param name="regionID">The region the visitor *wants* to enter</param>
/// <param name="agentID">The visitor's User ID. Will be missing (UUID.Zero) in older OpenSims.</param>
/// <param name="agentHomeURI">The visitor's Home URI. Will be missing (null) in older OpenSims.</param>
/// <param name="message">[out] A message to show to the user (optional, may be null)</param>
/// <returns>The region the visitor should enter, or null if no region can be found / is allowed</returns>
GridRegion GetHyperlinkRegion(UUID regionID, UUID agentID, string agentHomeURI, out string message);
bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason);

View File

@@ -75,7 +75,17 @@ namespace OpenSim.Services.Interfaces
/// <returns></returns>
bool UpdateAgent(GridRegion destination, AgentPosition data);
bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason);
/// <summary>
/// Returns whether a propspective user is allowed to visit the region.
/// </summary>
/// <param name="destination">Desired destination</param>
/// <param name="agentID">The visitor's User ID</param>
/// <param name="agentHomeURI">The visitor's Home URI. Will be missing (null) in older OpenSims.</param>
/// <param name="position">Position in the region</param>
/// <param name="version"></param>
/// <param name="reason">[out] Optional error message</param>
/// <returns>True: ok; False: not allowed</returns>
bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason);
/// <summary>
/// Message from receiving region to departing region, telling it got contacted by the client.