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.0.8.0.3
parent
d4acaf25af
commit
abe0f4a088
|
@ -239,8 +239,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
|
|||
GatekeeperServiceConnector gConn = new GatekeeperServiceConnector();
|
||||
GridRegion gatekeeper = new GridRegion();
|
||||
gatekeeper.ServerURI = url;
|
||||
|
||||
string homeURI = null;
|
||||
AgentCircuitData acd = scene.AuthenticateHandler.GetAgentCircuitData(client.AgentId);
|
||||
if (acd != null && acd.ServiceURLs != null && acd.ServiceURLs.ContainsKey("HomeURI"))
|
||||
homeURI = (string)acd.ServiceURLs["HomeURI"];
|
||||
|
||||
string message;
|
||||
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(im.RegionID), out message);
|
||||
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(im.RegionID), client.AgentId, homeURI, out message);
|
||||
if (finalDestination != null)
|
||||
{
|
||||
ScenePresence sp = scene.GetScenePresence(client.AgentId);
|
||||
|
|
|
@ -529,8 +529,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
|
||||
if (reg != null)
|
||||
{
|
||||
string homeURI = null;
|
||||
AgentCircuitData acd = Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.AgentId);
|
||||
if (acd != null && acd.ServiceURLs != null && acd.ServiceURLs.ContainsKey("HomeURI"))
|
||||
homeURI = (string)acd.ServiceURLs["HomeURI"];
|
||||
|
||||
string message;
|
||||
finalDestination = GetFinalDestination(reg, out message);
|
||||
finalDestination = GetFinalDestination(reg, sp.ControllingClient.AgentId, homeURI, out message);
|
||||
|
||||
if (finalDestination == null)
|
||||
{
|
||||
|
@ -1331,7 +1336,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
scene.SendKillObject(new List<uint> { localID });
|
||||
}
|
||||
|
||||
protected virtual GridRegion GetFinalDestination(GridRegion region, out string message)
|
||||
protected virtual GridRegion GetFinalDestination(GridRegion region, UUID agentID, string agentHomeURI, out string message)
|
||||
{
|
||||
message = null;
|
||||
return region;
|
||||
|
|
|
@ -225,7 +225,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
|
||||
#region HG overrides of IEntiryTransferModule
|
||||
|
||||
protected override GridRegion GetFinalDestination(GridRegion region, out string message)
|
||||
protected override GridRegion GetFinalDestination(GridRegion region, UUID agentID, string agentHomeURI, out string message)
|
||||
{
|
||||
int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, region.RegionID);
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionName, flags);
|
||||
|
@ -234,7 +234,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
if ((flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0)
|
||||
{
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region is hyperlink");
|
||||
GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID, out message);
|
||||
GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID, agentID, agentHomeURI, out message);
|
||||
if (real_destination != null)
|
||||
m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination: ServerURI={0}", real_destination.ServerURI);
|
||||
else
|
||||
|
@ -534,8 +534,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
GatekeeperServiceConnector gConn = new GatekeeperServiceConnector();
|
||||
GridRegion gatekeeper = new GridRegion();
|
||||
gatekeeper.ServerURI = lm.Gatekeeper;
|
||||
|
||||
string homeURI = null;
|
||||
AgentCircuitData acd = Scene.AuthenticateHandler.GetAgentCircuitData(remoteClient.AgentId);
|
||||
if (acd != null && acd.ServiceURLs != null && acd.ServiceURLs.ContainsKey("HomeURI"))
|
||||
homeURI = (string)acd.ServiceURLs["HomeURI"];
|
||||
|
||||
string message;
|
||||
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID), out message);
|
||||
GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID), remoteClient.AgentId, homeURI, out message);
|
||||
|
||||
if (finalDestination != null)
|
||||
{
|
||||
|
|
|
@ -94,8 +94,15 @@ namespace OpenSim.Server.Handlers.Hypergrid
|
|||
UUID regionID = UUID.Zero;
|
||||
UUID.TryParse(regionID_str, out regionID);
|
||||
|
||||
UUID agentID = UUID.Zero;
|
||||
string agentHomeURI = null;
|
||||
if (requestData.ContainsKey("agent_id"))
|
||||
agentID = UUID.Parse((string)requestData["agent_id"]);
|
||||
if (requestData.ContainsKey("agent_home_uri"))
|
||||
agentHomeURI = (string)requestData["agent_home_uri"];
|
||||
|
||||
string message;
|
||||
GridRegion regInfo = m_GatekeeperService.GetHyperlinkRegion(regionID, out message);
|
||||
GridRegion regInfo = m_GatekeeperService.GetHyperlinkRegion(regionID, agentID, agentHomeURI, out message);
|
||||
|
||||
Hashtable hash = new Hashtable();
|
||||
if (regInfo == null)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue