aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorOren Hurvitz2014-04-07 09:25:18 +0300
committerOren Hurvitz2014-04-07 07:32:36 +0100
commit85d51e57a905ac8f823f345f525837926f4ed2ce (patch)
tree7fc86c9a7743afb0765cc8d822709e12bbc223f1 /OpenSim
parentRefactored: use Scene.GetAgentHomeURI() to get the Home URI of a user (diff)
downloadopensim-SC-85d51e57a905ac8f823f345f525837926f4ed2ce.zip
opensim-SC-85d51e57a905ac8f823f345f525837926f4ed2ce.tar.gz
opensim-SC-85d51e57a905ac8f823f345f525837926f4ed2ce.tar.bz2
opensim-SC-85d51e57a905ac8f823f345f525837926f4ed2ce.tar.xz
When sending QueryAccess to a region, also send the user's Home URI
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs7
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs4
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs5
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs8
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs8
-rw-r--r--OpenSim/Services/Interfaces/IHypergridServices.cs13
-rw-r--r--OpenSim/Services/Interfaces/ISimulationService.cs12
8 files changed, 47 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 3d9c93f..7e1d68d 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -700,6 +700,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
700 return; 700 return;
701 } 701 }
702 702
703 string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId);
704
703 m_log.DebugFormat( 705 m_log.DebugFormat(
704 "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}", 706 "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}",
705 sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName, 707 sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName,
@@ -744,7 +746,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
744 string reason; 746 string reason;
745 string version; 747 string version;
746 if (!Scene.SimulationService.QueryAccess( 748 if (!Scene.SimulationService.QueryAccess(
747 finalDestination, sp.ControllingClient.AgentId, position, out version, out reason)) 749 finalDestination, sp.ControllingClient.AgentId, homeURI, position, out version, out reason))
748 { 750 {
749 sp.ControllingClient.SendTeleportFailed(reason); 751 sp.ControllingClient.SendTeleportFailed(reason);
750 752
@@ -1456,6 +1458,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1456 version = String.Empty; 1458 version = String.Empty;
1457 newpos = pos; 1459 newpos = pos;
1458 failureReason = string.Empty; 1460 failureReason = string.Empty;
1461 string homeURI = scene.GetAgentHomeURI(agentID);
1459 1462
1460// m_log.DebugFormat( 1463// m_log.DebugFormat(
1461// "[ENTITY TRANSFER MODULE]: Crossing agent {0} at pos {1} in {2}", agent.Name, pos, scene.Name); 1464// "[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
1489 1492
1490 // Check to see if we have access to the target region. 1493 // Check to see if we have access to the target region.
1491 if (neighbourRegion != null 1494 if (neighbourRegion != null
1492 && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, newpos, out version, out failureReason)) 1495 && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, newpos, out version, out failureReason))
1493 { 1496 {
1494 // remember banned 1497 // remember banned
1495 m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); 1498 m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index 4dcb99f..dc06e4b 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
264 return true; 264 return true;
265 } 265 }
266 266
267 public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) 267 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason)
268 { 268 {
269 reason = "Communications failure"; 269 reason = "Communications failure";
270 version = ServiceVersion; 270 version = ServiceVersion;
@@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
277// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", 277// "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate",
278// s.RegionInfo.RegionName, destination.RegionHandle); 278// s.RegionInfo.RegionName, destination.RegionHandle);
279 279
280 return m_scenes[destination.RegionID].QueryAccess(id, position, out reason); 280 return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, position, out reason);
281 } 281 }
282 282
283 //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); 283 //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess");
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
index cc01430..5f43f08 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
@@ -207,7 +207,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
207 return m_remoteConnector.UpdateAgent(destination, cAgentData); 207 return m_remoteConnector.UpdateAgent(destination, cAgentData);
208 } 208 }
209 209
210 public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) 210 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason)
211 { 211 {
212 reason = "Communications failure"; 212 reason = "Communications failure";
213 version = "Unknown"; 213 version = "Unknown";
@@ -216,12 +216,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
216 return false; 216 return false;
217 217
218 // Try local first 218 // Try local first
219 if (m_localBackend.QueryAccess(destination, id, position, out version, out reason)) 219 if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason))
220 return true; 220 return true;
221 221
222 // else do the remote thing 222 // else do the remote thing
223 if (!m_localBackend.IsLocalRegion(destination.RegionID)) 223 if (!m_localBackend.IsLocalRegion(destination.RegionID))
224 return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason); 224 return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason);
225 225
226 return false; 226 return false;
227 } 227 }
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 3ff21ea..4013fa7 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5466,11 +5466,12 @@ namespace OpenSim.Region.Framework.Scenes
5466 /// or corssing the broder walking, but will NOT prevent 5466 /// or corssing the broder walking, but will NOT prevent
5467 /// child agent creation, thereby emulating the SL behavior. 5467 /// child agent creation, thereby emulating the SL behavior.
5468 /// </remarks> 5468 /// </remarks>
5469 /// <param name='agentID'></param> 5469 /// <param name='agentID'>The visitor's User ID</param>
5470 /// <param name="agentHomeURI">The visitor's Home URI (may be null)</param>
5470 /// <param name='position'></param> 5471 /// <param name='position'></param>
5471 /// <param name='reason'></param> 5472 /// <param name='reason'></param>
5472 /// <returns></returns> 5473 /// <returns></returns>
5473 public bool QueryAccess(UUID agentID, Vector3 position, out string reason) 5474 public bool QueryAccess(UUID agentID, string agentHomeURI, Vector3 position, out string reason)
5474 { 5475 {
5475 reason = "You are banned from the region"; 5476 reason = "You are banned from the region";
5476 5477
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 9c7f17e..c495b60 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -117,7 +117,7 @@ namespace OpenSim.Server.Handlers.Simulation
117 117
118 } 118 }
119 119
120 protected virtual void DoQueryAccess(Hashtable request, Hashtable responsedata, UUID id, UUID regionID) 120 protected virtual void DoQueryAccess(Hashtable request, Hashtable responsedata, UUID agentID, UUID regionID)
121 { 121 {
122 if (m_SimulationService == null) 122 if (m_SimulationService == null)
123 { 123 {
@@ -136,12 +136,16 @@ namespace OpenSim.Server.Handlers.Simulation
136 if (args.ContainsKey("position")) 136 if (args.ContainsKey("position"))
137 position = Vector3.Parse(args["position"].AsString()); 137 position = Vector3.Parse(args["position"].AsString());
138 138
139 string agentHomeURI = null;
140 if (args.ContainsKey("agent_home_uri"))
141 agentHomeURI = args["agent_home_uri"].AsString();
142
139 GridRegion destination = new GridRegion(); 143 GridRegion destination = new GridRegion();
140 destination.RegionID = regionID; 144 destination.RegionID = regionID;
141 145
142 string reason; 146 string reason;
143 string version; 147 string version;
144 bool result = m_SimulationService.QueryAccess(destination, id, position, out version, out reason); 148 bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason);
145 149
146 responsedata["int_response_code"] = HttpStatusCode.OK; 150 responsedata["int_response_code"] = HttpStatusCode.OK;
147 151
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 171beaa..98686f8 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -272,9 +272,7 @@ namespace OpenSim.Services.Connectors.Simulation
272 } 272 }
273 273
274 274
275 /// <summary> 275 public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason)
276 /// </summary>
277 public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason)
278 { 276 {
279 reason = "Failed to contact destination"; 277 reason = "Failed to contact destination";
280 version = "Unknown"; 278 version = "Unknown";
@@ -285,10 +283,12 @@ namespace OpenSim.Services.Connectors.Simulation
285 if (ext == null) return false; 283 if (ext == null) return false;
286 284
287 // Eventually, we want to use a caps url instead of the agentID 285 // Eventually, we want to use a caps url instead of the agentID
288 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; 286 string uri = destination.ServerURI + AgentPath() + agentID + "/" + destination.RegionID.ToString() + "/";
289 287
290 OSDMap request = new OSDMap(); 288 OSDMap request = new OSDMap();
291 request.Add("position", OSD.FromString(position.ToString())); 289 request.Add("position", OSD.FromString(position.ToString()));
290 if (agentHomeURI != null)
291 request.Add("agent_home_uri", OSD.FromString(agentHomeURI));
292 292
293 try 293 try
294 { 294 {
diff --git a/OpenSim/Services/Interfaces/IHypergridServices.cs b/OpenSim/Services/Interfaces/IHypergridServices.cs
index f3cdb76..30f27ee 100644
--- a/OpenSim/Services/Interfaces/IHypergridServices.cs
+++ b/OpenSim/Services/Interfaces/IHypergridServices.cs
@@ -37,6 +37,19 @@ 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
41 /// <summary>
42 /// Returns the region a Hypergrid visitor should enter.
43 /// </summary>
44 /// <remarks>
45 /// Usually the returned region will be the requested region. But the grid can choose to
46 /// redirect the user to another region: e.g., a default gateway region.
47 /// </remarks>
48 /// <param name="regionID">The region the visitor *wants* to enter</param>
49 /// <param name="agentID">The visitor's User ID. Will be missing (UUID.Zero) in older OpenSims.</param>
50 /// <param name="agentHomeURI">The visitor's Home URI. Will be missing (null) in older OpenSims.</param>
51 /// <param name="message">[out] A message to show to the user (optional, may be null)</param>
52 /// <returns>The region the visitor should enter, or null if no region can be found / is allowed</returns>
40 GridRegion GetHyperlinkRegion(UUID regionID, UUID agentID, string agentHomeURI, out string message); 53 GridRegion GetHyperlinkRegion(UUID regionID, UUID agentID, string agentHomeURI, out string message);
41 54
42 bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); 55 bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason);
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs
index 1c82b3e..d359056 100644
--- a/OpenSim/Services/Interfaces/ISimulationService.cs
+++ b/OpenSim/Services/Interfaces/ISimulationService.cs
@@ -75,7 +75,17 @@ namespace OpenSim.Services.Interfaces
75 /// <returns></returns> 75 /// <returns></returns>
76 bool UpdateAgent(GridRegion destination, AgentPosition data); 76 bool UpdateAgent(GridRegion destination, AgentPosition data);
77 77
78 bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason); 78 /// <summary>
79 /// Returns whether a propspective user is allowed to visit the region.
80 /// </summary>
81 /// <param name="destination">Desired destination</param>
82 /// <param name="agentID">The visitor's User ID</param>
83 /// <param name="agentHomeURI">The visitor's Home URI. Will be missing (null) in older OpenSims.</param>
84 /// <param name="position">Position in the region</param>
85 /// <param name="version"></param>
86 /// <param name="reason">[out] Optional error message</param>
87 /// <returns>True: ok; False: not allowed</returns>
88 bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason);
79 89
80 /// <summary> 90 /// <summary>
81 /// Message from receiving region to departing region, telling it got contacted by the client. 91 /// Message from receiving region to departing region, telling it got contacted by the client.