When sending QueryAccess to a region, also send the user's Home URI
							parent
							
								
									55cc8044cb
								
							
						
					
					
						commit
						85d51e57a9
					
				|  | @ -700,6 +700,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | ||||||
|                 return; |                 return; | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|  |             string homeURI = Scene.GetAgentHomeURI(sp.ControllingClient.AgentId); | ||||||
|  | 
 | ||||||
|             m_log.DebugFormat( |             m_log.DebugFormat( | ||||||
|                 "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}", |                 "[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}", | ||||||
|                 sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName, |                 sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName, | ||||||
|  | @ -744,7 +746,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | ||||||
|             string reason; |             string reason; | ||||||
|             string version; |             string version; | ||||||
|             if (!Scene.SimulationService.QueryAccess( |             if (!Scene.SimulationService.QueryAccess( | ||||||
|                 finalDestination, sp.ControllingClient.AgentId, position, out version, out reason)) |                 finalDestination, sp.ControllingClient.AgentId, homeURI, position, out version, out reason)) | ||||||
|             { |             { | ||||||
|                 sp.ControllingClient.SendTeleportFailed(reason); |                 sp.ControllingClient.SendTeleportFailed(reason); | ||||||
| 
 | 
 | ||||||
|  | @ -1456,6 +1458,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | ||||||
|             version = String.Empty; |             version = String.Empty; | ||||||
|             newpos = pos; |             newpos = pos; | ||||||
|             failureReason = string.Empty; |             failureReason = string.Empty; | ||||||
|  |             string homeURI = scene.GetAgentHomeURI(agentID); | ||||||
| 
 | 
 | ||||||
| //            m_log.DebugFormat( | //            m_log.DebugFormat( | ||||||
| //                "[ENTITY TRANSFER MODULE]: Crossing agent {0} at pos {1} in {2}", agent.Name, pos, scene.Name); | //                "[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 | ||||||
| 
 | 
 | ||||||
|                 // Check to see if we have access to the target region. |                 // Check to see if we have access to the target region. | ||||||
|                 if (neighbourRegion != null |                 if (neighbourRegion != null | ||||||
|                     && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, newpos, out version, out failureReason)) |                     && !scene.SimulationService.QueryAccess(neighbourRegion, agentID, homeURI, newpos, out version, out failureReason)) | ||||||
|                 { |                 { | ||||||
|                     // remember banned |                     // remember banned | ||||||
|                     m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); |                     m_bannedRegionCache.Add(neighbourRegion.RegionHandle, agentID); | ||||||
|  |  | ||||||
|  | @ -264,7 +264,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | ||||||
|             return true; |             return true; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         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 = "Communications failure"; |             reason = "Communications failure"; | ||||||
|             version = ServiceVersion; |             version = ServiceVersion; | ||||||
|  | @ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | ||||||
| //                        "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", | //                        "[LOCAL SIMULATION CONNECTOR]: Found region {0} {1} to send AgentUpdate", | ||||||
| //                        s.RegionInfo.RegionName, destination.RegionHandle); | //                        s.RegionInfo.RegionName, destination.RegionHandle); | ||||||
| 
 | 
 | ||||||
|                 return m_scenes[destination.RegionID].QueryAccess(id, position, out reason); |                 return m_scenes[destination.RegionID].QueryAccess(agentID, agentHomeURI, position, out reason); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); |             //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); | ||||||
|  |  | ||||||
|  | @ -207,7 +207,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | ||||||
|             return m_remoteConnector.UpdateAgent(destination, cAgentData); |             return m_remoteConnector.UpdateAgent(destination, cAgentData); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         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 = "Communications failure"; |             reason = "Communications failure"; | ||||||
|             version = "Unknown"; |             version = "Unknown"; | ||||||
|  | @ -216,12 +216,12 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation | ||||||
|                 return false; |                 return false; | ||||||
| 
 | 
 | ||||||
|             // Try local first |             // Try local first | ||||||
|             if (m_localBackend.QueryAccess(destination, id, position, out version, out reason)) |             if (m_localBackend.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason)) | ||||||
|                 return true; |                 return true; | ||||||
| 
 | 
 | ||||||
|             // else do the remote thing |             // else do the remote thing | ||||||
|             if (!m_localBackend.IsLocalRegion(destination.RegionID)) |             if (!m_localBackend.IsLocalRegion(destination.RegionID)) | ||||||
|                 return m_remoteConnector.QueryAccess(destination, id, position, out version, out reason); |                 return m_remoteConnector.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason); | ||||||
| 
 | 
 | ||||||
|             return false; |             return false; | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -5466,11 +5466,12 @@ namespace OpenSim.Region.Framework.Scenes | ||||||
|         /// or corssing the broder walking, but will NOT prevent |         /// or corssing the broder walking, but will NOT prevent | ||||||
|         /// child agent creation, thereby emulating the SL behavior. |         /// child agent creation, thereby emulating the SL behavior. | ||||||
|         /// </remarks> |         /// </remarks> | ||||||
|         /// <param name='agentID'></param> |         /// <param name='agentID'>The visitor's User ID</param> | ||||||
|  |         /// <param name="agentHomeURI">The visitor's Home URI (may be null)</param> | ||||||
|         /// <param name='position'></param> |         /// <param name='position'></param> | ||||||
|         /// <param name='reason'></param> |         /// <param name='reason'></param> | ||||||
|         /// <returns></returns> |         /// <returns></returns> | ||||||
|         public bool QueryAccess(UUID agentID, Vector3 position, out string reason) |         public bool QueryAccess(UUID agentID, string agentHomeURI, Vector3 position, out string reason) | ||||||
|         { |         { | ||||||
|             reason = "You are banned from the region"; |             reason = "You are banned from the region"; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -117,7 +117,7 @@ namespace OpenSim.Server.Handlers.Simulation | ||||||
| 
 | 
 | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         protected virtual void DoQueryAccess(Hashtable request, Hashtable responsedata, UUID id, UUID regionID) |         protected virtual void DoQueryAccess(Hashtable request, Hashtable responsedata, UUID agentID, UUID regionID) | ||||||
|         { |         { | ||||||
|             if (m_SimulationService == null) |             if (m_SimulationService == null) | ||||||
|             { |             { | ||||||
|  | @ -136,12 +136,16 @@ namespace OpenSim.Server.Handlers.Simulation | ||||||
|             if (args.ContainsKey("position")) |             if (args.ContainsKey("position")) | ||||||
|                 position = Vector3.Parse(args["position"].AsString()); |                 position = Vector3.Parse(args["position"].AsString()); | ||||||
| 
 | 
 | ||||||
|  |             string agentHomeURI = null; | ||||||
|  |             if (args.ContainsKey("agent_home_uri")) | ||||||
|  |                 agentHomeURI = args["agent_home_uri"].AsString(); | ||||||
|  | 
 | ||||||
|             GridRegion destination = new GridRegion(); |             GridRegion destination = new GridRegion(); | ||||||
|             destination.RegionID = regionID; |             destination.RegionID = regionID; | ||||||
| 
 | 
 | ||||||
|             string reason; |             string reason; | ||||||
|             string version; |             string version; | ||||||
|             bool result = m_SimulationService.QueryAccess(destination, id, position, out version, out reason); |             bool result = m_SimulationService.QueryAccess(destination, agentID, agentHomeURI, position, out version, out reason); | ||||||
| 
 | 
 | ||||||
|             responsedata["int_response_code"] = HttpStatusCode.OK; |             responsedata["int_response_code"] = HttpStatusCode.OK; | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -272,9 +272,7 @@ namespace OpenSim.Services.Connectors.Simulation | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|         /// <summary> |         public bool QueryAccess(GridRegion destination, UUID agentID, string agentHomeURI, Vector3 position, out string version, out string reason) | ||||||
|         /// </summary> |  | ||||||
|         public bool QueryAccess(GridRegion destination, UUID id, Vector3 position, out string version, out string reason) |  | ||||||
|         { |         { | ||||||
|             reason = "Failed to contact destination"; |             reason = "Failed to contact destination"; | ||||||
|             version = "Unknown"; |             version = "Unknown"; | ||||||
|  | @ -285,10 +283,12 @@ namespace OpenSim.Services.Connectors.Simulation | ||||||
|             if (ext == null) return false; |             if (ext == null) return false; | ||||||
| 
 | 
 | ||||||
|             // Eventually, we want to use a caps url instead of the agentID |             // 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(); |             OSDMap request = new OSDMap(); | ||||||
|             request.Add("position", OSD.FromString(position.ToString())); |             request.Add("position", OSD.FromString(position.ToString())); | ||||||
|  |             if (agentHomeURI != null) | ||||||
|  |                 request.Add("agent_home_uri", OSD.FromString(agentHomeURI)); | ||||||
| 
 | 
 | ||||||
|             try |             try | ||||||
|             { |             { | ||||||
|  |  | ||||||
|  | @ -37,6 +37,19 @@ namespace OpenSim.Services.Interfaces | ||||||
|     public interface IGatekeeperService |     public interface IGatekeeperService | ||||||
|     { |     { | ||||||
|         bool LinkRegion(string regionDescriptor, out UUID regionID, out ulong regionHandle, out string externalName, out string imageURL, out string reason); |         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); |         GridRegion GetHyperlinkRegion(UUID regionID, UUID agentID, string agentHomeURI, out string message); | ||||||
| 
 | 
 | ||||||
|         bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); |         bool LoginAgent(AgentCircuitData aCircuit, GridRegion destination, out string reason); | ||||||
|  |  | ||||||
|  | @ -75,7 +75,17 @@ namespace OpenSim.Services.Interfaces | ||||||
|         /// <returns></returns> |         /// <returns></returns> | ||||||
|         bool UpdateAgent(GridRegion destination, AgentPosition data); |         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> |         /// <summary> | ||||||
|         /// Message from receiving region to departing region, telling it got contacted by the client. |         /// Message from receiving region to departing region, telling it got contacted by the client. | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Oren Hurvitz
						Oren Hurvitz