aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorOren Hurvitz2014-04-06 16:18:40 +0300
committerOren Hurvitz2014-04-06 15:40:45 +0100
commitabe0f4a0882942e211b17408767eca664762e062 (patch)
treec58141c3b8aab60e40c69c4e9bf47d46caa959fa /OpenSim
parentPass the correct position to QueryAccess() instead of UUID.Zero (it was wrong... (diff)
downloadopensim-SC_OLD-abe0f4a0882942e211b17408767eca664762e062.zip
opensim-SC_OLD-abe0f4a0882942e211b17408767eca664762e062.tar.gz
opensim-SC_OLD-abe0f4a0882942e211b17408767eca664762e062.tar.bz2
opensim-SC_OLD-abe0f4a0882942e211b17408767eca664762e062.tar.xz
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.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs8
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs9
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs12
-rw-r--r--OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs9
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs8
-rw-r--r--OpenSim/Services/HypergridService/GatekeeperService.cs6
-rw-r--r--OpenSim/Services/Interfaces/IHypergridServices.cs2
-rw-r--r--OpenSim/Services/LLLoginService/LLLoginService.cs11
8 files changed, 50 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
index 317f0e9..68fef29 100644
--- a/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Lure/HGLureModule.cs
@@ -239,8 +239,14 @@ namespace OpenSim.Region.CoreModules.Avatar.Lure
239 GatekeeperServiceConnector gConn = new GatekeeperServiceConnector(); 239 GatekeeperServiceConnector gConn = new GatekeeperServiceConnector();
240 GridRegion gatekeeper = new GridRegion(); 240 GridRegion gatekeeper = new GridRegion();
241 gatekeeper.ServerURI = url; 241 gatekeeper.ServerURI = url;
242
243 string homeURI = null;
244 AgentCircuitData acd = scene.AuthenticateHandler.GetAgentCircuitData(client.AgentId);
245 if (acd != null && acd.ServiceURLs != null && acd.ServiceURLs.ContainsKey("HomeURI"))
246 homeURI = (string)acd.ServiceURLs["HomeURI"];
247
242 string message; 248 string message;
243 GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(im.RegionID), out message); 249 GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(im.RegionID), client.AgentId, homeURI, out message);
244 if (finalDestination != null) 250 if (finalDestination != null)
245 { 251 {
246 ScenePresence sp = scene.GetScenePresence(client.AgentId); 252 ScenePresence sp = scene.GetScenePresence(client.AgentId);
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 7b4fbf9..3040a88 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -529,8 +529,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
529 529
530 if (reg != null) 530 if (reg != null)
531 { 531 {
532 string homeURI = null;
533 AgentCircuitData acd = Scene.AuthenticateHandler.GetAgentCircuitData(sp.ControllingClient.AgentId);
534 if (acd != null && acd.ServiceURLs != null && acd.ServiceURLs.ContainsKey("HomeURI"))
535 homeURI = (string)acd.ServiceURLs["HomeURI"];
536
532 string message; 537 string message;
533 finalDestination = GetFinalDestination(reg, out message); 538 finalDestination = GetFinalDestination(reg, sp.ControllingClient.AgentId, homeURI, out message);
534 539
535 if (finalDestination == null) 540 if (finalDestination == null)
536 { 541 {
@@ -1331,7 +1336,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1331 scene.SendKillObject(new List<uint> { localID }); 1336 scene.SendKillObject(new List<uint> { localID });
1332 } 1337 }
1333 1338
1334 protected virtual GridRegion GetFinalDestination(GridRegion region, out string message) 1339 protected virtual GridRegion GetFinalDestination(GridRegion region, UUID agentID, string agentHomeURI, out string message)
1335 { 1340 {
1336 message = null; 1341 message = null;
1337 return region; 1342 return region;
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
index fa05c90..381baed 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/HGEntityTransferModule.cs
@@ -225,7 +225,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
225 225
226 #region HG overrides of IEntiryTransferModule 226 #region HG overrides of IEntiryTransferModule
227 227
228 protected override GridRegion GetFinalDestination(GridRegion region, out string message) 228 protected override GridRegion GetFinalDestination(GridRegion region, UUID agentID, string agentHomeURI, out string message)
229 { 229 {
230 int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, region.RegionID); 230 int flags = Scene.GridService.GetRegionFlags(Scene.RegionInfo.ScopeID, region.RegionID);
231 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionName, flags); 231 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: region {0} flags: {1}", region.RegionName, flags);
@@ -234,7 +234,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
234 if ((flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0) 234 if ((flags & (int)OpenSim.Framework.RegionFlags.Hyperlink) != 0)
235 { 235 {
236 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region is hyperlink"); 236 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: Destination region is hyperlink");
237 GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID, out message); 237 GridRegion real_destination = m_GatekeeperConnector.GetHyperlinkRegion(region, region.RegionID, agentID, agentHomeURI, out message);
238 if (real_destination != null) 238 if (real_destination != null)
239 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination: ServerURI={0}", real_destination.ServerURI); 239 m_log.DebugFormat("[HG ENTITY TRANSFER MODULE]: GetFinalDestination: ServerURI={0}", real_destination.ServerURI);
240 else 240 else
@@ -534,8 +534,14 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
534 GatekeeperServiceConnector gConn = new GatekeeperServiceConnector(); 534 GatekeeperServiceConnector gConn = new GatekeeperServiceConnector();
535 GridRegion gatekeeper = new GridRegion(); 535 GridRegion gatekeeper = new GridRegion();
536 gatekeeper.ServerURI = lm.Gatekeeper; 536 gatekeeper.ServerURI = lm.Gatekeeper;
537
538 string homeURI = null;
539 AgentCircuitData acd = Scene.AuthenticateHandler.GetAgentCircuitData(remoteClient.AgentId);
540 if (acd != null && acd.ServiceURLs != null && acd.ServiceURLs.ContainsKey("HomeURI"))
541 homeURI = (string)acd.ServiceURLs["HomeURI"];
542
537 string message; 543 string message;
538 GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID), out message); 544 GridRegion finalDestination = gConn.GetHyperlinkRegion(gatekeeper, new UUID(lm.RegionID), remoteClient.AgentId, homeURI, out message);
539 545
540 if (finalDestination != null) 546 if (finalDestination != null)
541 { 547 {
diff --git a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
index a89d7f7..c7ac9be 100644
--- a/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
+++ b/OpenSim/Server/Handlers/Hypergrid/HypergridHandlers.cs
@@ -94,8 +94,15 @@ namespace OpenSim.Server.Handlers.Hypergrid
94 UUID regionID = UUID.Zero; 94 UUID regionID = UUID.Zero;
95 UUID.TryParse(regionID_str, out regionID); 95 UUID.TryParse(regionID_str, out regionID);
96 96
97 UUID agentID = UUID.Zero;
98 string agentHomeURI = null;
99 if (requestData.ContainsKey("agent_id"))
100 agentID = UUID.Parse((string)requestData["agent_id"]);
101 if (requestData.ContainsKey("agent_home_uri"))
102 agentHomeURI = (string)requestData["agent_home_uri"];
103
97 string message; 104 string message;
98 GridRegion regInfo = m_GatekeeperService.GetHyperlinkRegion(regionID, out message); 105 GridRegion regInfo = m_GatekeeperService.GetHyperlinkRegion(regionID, agentID, agentHomeURI, out message);
99 106
100 Hashtable hash = new Hashtable(); 107 Hashtable hash = new Hashtable();
101 if (regInfo == null) 108 if (regInfo == null)
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
202 return mapTile; 202 return mapTile;
203 } 203 }
204 204
205 public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID, out string message) 205 public GridRegion GetHyperlinkRegion(GridRegion gatekeeper, UUID regionID, UUID agentID, string agentHomeURI, out string message)
206 { 206 {
207 Hashtable hash = new Hashtable(); 207 Hashtable hash = new Hashtable();
208 hash["region_uuid"] = regionID.ToString(); 208 hash["region_uuid"] = regionID.ToString();
209 if (agentID != UUID.Zero)
210 {
211 hash["agent_id"] = agentID.ToString();
212 if (agentHomeURI != null)
213 hash["agent_home_uri"] = agentHomeURI;
214 }
209 215
210 IList paramList = new ArrayList(); 216 IList paramList = new ArrayList();
211 paramList.Add(hash); 217 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
204 return true; 204 return true;
205 } 205 }
206 206
207 public GridRegion GetHyperlinkRegion(UUID regionID, out string message) 207 public GridRegion GetHyperlinkRegion(UUID regionID, UUID agentID, string agentHomeURI, out string message)
208 { 208 {
209 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to get hyperlink region {0}", regionID); 209 m_log.DebugFormat("[GATEKEEPER SERVICE]: Request to get hyperlink region {0} for user {1}{2}",
210 regionID, agentID, (agentHomeURI == null) ? "" : " @ " + agentHomeURI);
211
210 message = null; 212 message = null;
211 213
212 if (!m_AllowTeleportsToAnyRegion) 214 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
37 public interface IGatekeeperService 37 public interface IGatekeeperService
38 { 38 {
39 bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason); 39 bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason);
40 GridRegion GetHyperlinkRegion(UUID regionID, out string message); 40 GridRegion GetHyperlinkRegion(UUID regionID, UUID agentID, string agentHomeURI, out string message);
41 41
42 bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); 42 bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason);
43 43
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
688 if (parts.Length > 1) 688 if (parts.Length > 1)
689 UInt32.TryParse(parts[1], out port); 689 UInt32.TryParse(parts[1], out port);
690 690
691// GridRegion region = FindForeignRegion(domainName, port, regionName, out gatekeeper); 691 region = FindForeignRegion(domainName, port, regionName, account, out gatekeeper);
692 region = FindForeignRegion(domainName, port, regionName, out gatekeeper);
693 return region; 692 return region;
694 } 693 }
695 } 694 }
@@ -738,7 +737,7 @@ namespace OpenSim.Services.LLLoginService
738 return null; 737 return null;
739 } 738 }
740 739
741 private GridRegion FindForeignRegion(string domainName, uint port, string regionName, out GridRegion gatekeeper) 740 private GridRegion FindForeignRegion(string domainName, uint port, string regionName, UserAccount account, out GridRegion gatekeeper)
742 { 741 {
743 m_log.Debug("[LLLOGIN SERVICE]: attempting to findforeignregion " + domainName + ":" + port.ToString() + ":" + regionName); 742 m_log.Debug("[LLLOGIN SERVICE]: attempting to findforeignregion " + domainName + ":" + port.ToString() + ":" + regionName);
744 gatekeeper = new GridRegion(); 743 gatekeeper = new GridRegion();
@@ -753,7 +752,11 @@ namespace OpenSim.Services.LLLoginService
753 string message; 752 string message;
754 if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason)) 753 if (m_GatekeeperConnector.LinkRegion(gatekeeper, out regionID, out handle, out domainName, out imageURL, out reason))
755 { 754 {
756 GridRegion destination = m_GatekeeperConnector.GetHyperlinkRegion(gatekeeper, regionID, out message); 755 string homeURI = null;
756 if (account.ServiceURLs != null && account.ServiceURLs.ContainsKey("HomeURI"))
757 homeURI = (string)account.ServiceURLs["HomeURI"];
758
759 GridRegion destination = m_GatekeeperConnector.GetHyperlinkRegion(gatekeeper, regionID, account.PrincipalID, homeURI, out message);
757 return destination; 760 return destination;
758 } 761 }
759 762