From abe0f4a0882942e211b17408767eca664762e062 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Sun, 6 Apr 2014 16:18:40 +0300 Subject: When preparing a Hypergrid teleport, tell the receiving grid which user is entering the grid. This can affect which region to use. E.g., returning users may be allowed to enter any region, whereas users from other grids will have to enter a gateway region. Previously per-user decisions were only made later, but by then it's too late to change which region the user enters. --- .../Connectors/Hypergrid/GatekeeperServiceConnector.cs | 8 +++++++- OpenSim/Services/HypergridService/GatekeeperService.cs | 6 ++++-- OpenSim/Services/Interfaces/IHypergridServices.cs | 2 +- OpenSim/Services/LLLoginService/LLLoginService.cs | 11 +++++++---- 4 files changed, 19 insertions(+), 8 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs index 8b1cc27..b1663ee 100644 --- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs +++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs @@ -202,10 +202,16 @@ namespace OpenSim.Services.Connectors.Hypergrid return mapTile; } - public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID, out string message) + public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID, UUID agentID, string agentHomeURI, out string message) { Hashtable hash = new Hashtable(); hash["region_uuid"] = regionID.ToString(); + if (agentID != UUID.Zero) + { + hash["agent_id"] = agentID.ToString(); + if (agentHomeURI != null) + hash["agent_home_uri"] = agentHomeURI; + } IList paramList = new ArrayList(); paramList.Add(hash); diff --git a/OpenSim/Services/HypergridService/GatekeeperService.cs b/OpenSim/Services/HypergridService/GatekeeperService.cs index e9d41c7..24b98fd 100644 --- a/OpenSim/Services/HypergridService/GatekeeperService.cs +++ b/OpenSim/Services/HypergridService/GatekeeperService.cs @@ -204,9 +204,11 @@ namespace OpenSim.Services.HypergridService return true; } - public GridRegion GetHyperlinkRegion(UUID regionID, out string message) + public GridRegion GetHyperlinkRegion(UUID regionID, UUID agentID, string agentHomeURI, out string message) { - m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to get hyperlink region {0}", regionID); + m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to get hyperlink region {0} for user {1}{2}", + regionID, agentID, (agentHomeURI == null) ? "" : " @ " + agentHomeURI); + message = null; if (!m_AllowTeleportsToAnyRegion) diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs index a846bad..f3cdb76 100644 --- a/OpenSim/Services/Interfaces/IHypergridServices.cs +++ b/OpenSim/Services/Interfaces/IHypergridServices.cs @@ -37,7 +37,7 @@ 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); - GridRegion GetHyperlinkRegion(UUID regionID, out string message); + GridRegion GetHyperlinkRegion(UUID regionID, UUID agentID, string agentHomeURI, out string message); bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index 6d6e3d6..a2fb308 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs @@ -688,8 +688,7 @@ namespace OpenSim.Services.LLLoginService if (parts.Length > 1) UInt32.TryParse(parts[1], out port); -// GridRegion region = FindForeignRegion(domainName, port, regionName, out gatekeeper); - region = FindForeignRegion(domainName, port, regionName, out gatekeeper); + region = FindForeignRegion(domainName, port, regionName, account, out gatekeeper); return region; } } @@ -738,7 +737,7 @@ namespace OpenSim.Services.LLLoginService return null; } - private GridRegion FindForeignRegion(string domainName, uint port, string regionName, out GridRegion gatekeeper) + private GridRegion FindForeignRegion(string domainName, uint port, string regionName, UserAccount account, out GridRegion gatekeeper) { m_log.Debug("[LLLOGIN SERVICE]: attempting to findforeignregion " + domainName + ":" + port.ToString() + ":" + regionName); gatekeeper = new GridRegion(); @@ -753,7 +752,11 @@ namespace OpenSim.Services.LLLoginService string message; if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason)) { - GridRegion destination = m_GatekeeperConnector.GetHyperlinkRegion(gatekeeper, regionID, out message); + string homeURI = null; + if (account.ServiceURLs != null && account.ServiceURLs.ContainsKey("HomeURI")) + homeURI = (string)account.ServiceURLs["HomeURI"]; + + GridRegion destination = m_GatekeeperConnector.GetHyperlinkRegion(gatekeeper, regionID, account.PrincipalID, homeURI, out message); return destination; } -- cgit v1.1