aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs9
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs9
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Server/Handlers/Simulation/AgentHandlers.cs9
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs10
-rw-r--r--OpenSim/Services/Interfaces/ISimulationService.cs2
7 files changed, 31 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index 7804b7f..54b95f7 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -284,6 +284,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
284 return; 284 return;
285 } 285 }
286 286
287 if (!m_aScene.SimulationService.QueryAccess(finalDestination, sp.ControllingClient.AgentId, Vector3.Zero))
288 {
289 sp.ControllingClient.SendTeleportFailed("The destination region has refused access");
290 return;
291 }
292
287 sp.ControllingClient.SendTeleportStart(teleportFlags); 293 sp.ControllingClient.SendTeleportStart(teleportFlags);
288 294
289 // the avatar.Close below will clear the child region list. We need this below for (possibly) 295 // the avatar.Close below will clear the child region list. We need this below for (possibly)
@@ -772,8 +778,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
772 778
773 GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y); 779 GridRegion neighbourRegion = scene.GridService.GetRegionByPosition(scene.RegionInfo.ScopeID, (int)x, (int)y);
774 780
775 if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId)) 781 if (!scene.SimulationService.QueryAccess(neighbourRegion, agent.ControllingClient.AgentId, newpos))
776 { 782 {
783 agent.ControllingClient.SendAlertMessage("Cannot region cross into banned parcel");
777 if (r == null) 784 if (r == null)
778 { 785 {
779 r = new ExpiringCache<ulong, DateTime>(); 786 r = new ExpiringCache<ulong, DateTime>();
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
index 2dd0099..c5972dd 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/LocalSimulationConnector.cs
@@ -257,18 +257,15 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
257 return false; 257 return false;
258 } 258 }
259 259
260 public bool QueryAccess(GridRegion destination, UUID id) 260 public bool QueryAccess(GridRegion destination, UUID id, Vector3 position)
261 { 261 {
262 if (destination == null) 262 if (destination == null)
263 return false; 263 return false;
264 264
265 foreach (Scene s in m_sceneList) 265 foreach (Scene s in m_sceneList)
266 { 266 {
267 if (s.RegionInfo.RegionHandle == destination.RegionHandle) 267 if (s.RegionInfo.RegionID == destination.RegionID)
268 { 268 return s.QueryAccess(id, position);
269 //m_log.Debug("[LOCAL COMMS]: Found region to send QueryAccess");
270 return s.QueryAccess(id);
271 }
272 } 269 }
273 //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess"); 270 //m_log.Debug("[LOCAL COMMS]: region not found for QueryAccess");
274 return false; 271 return false;
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
index 387a9b8..c4919b3 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Simulation/RemoteSimulationConnector.cs
@@ -239,18 +239,18 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Simulation
239 239
240 } 240 }
241 241
242 public bool QueryAccess(GridRegion destination, UUID id) 242 public bool QueryAccess(GridRegion destination, UUID id, Vector3 position)
243 { 243 {
244 if (destination == null) 244 if (destination == null)
245 return false; 245 return false;
246 246
247 // Try local first 247 // Try local first
248 if (m_localBackend.QueryAccess(destination, id)) 248 if (m_localBackend.QueryAccess(destination, id, position))
249 return true; 249 return true;
250 250
251 // else do the remote thing 251 // else do the remote thing
252 if (!m_localBackend.IsLocalRegion(destination.RegionHandle)) 252 if (!m_localBackend.IsLocalRegion(destination.RegionHandle))
253 return m_remoteConnector.QueryAccess(destination, id); 253 return m_remoteConnector.QueryAccess(destination, id, position);
254 254
255 return false; 255 return false;
256 256
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 4325ab8..4fca261 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4921,7 +4921,7 @@ namespace OpenSim.Region.Framework.Scenes
4921 // from logging into the region, teleporting into the region 4921 // from logging into the region, teleporting into the region
4922 // or corssing the broder walking, but will NOT prevent 4922 // or corssing the broder walking, but will NOT prevent
4923 // child agent creation, thereby emulating the SL behavior. 4923 // child agent creation, thereby emulating the SL behavior.
4924 public bool QueryAccess(UUID agentID) 4924 public bool QueryAccess(UUID agentID, Vector3 position)
4925 { 4925 {
4926 return true; 4926 return true;
4927 } 4927 }
diff --git a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
index 57672a8..2601d2a 100644
--- a/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
+++ b/OpenSim/Server/Handlers/Simulation/AgentHandlers.cs
@@ -326,10 +326,17 @@ namespace OpenSim.Server.Handlers.Simulation
326 return; 326 return;
327 } 327 }
328 328
329 // m_log.DebugFormat("[AGENT HANDLER]: Received QUERYACCESS with {0}", (string)request["body"]);
330 OSDMap args = Utils.GetOSDMap((string)request["body"]);
331
332 Vector3 position = Vector3.Zero;
333 if (args.ContainsKey("position"))
334 position = Vector3.Parse(args["position"].AsString());
335
329 GridRegion destination = new GridRegion(); 336 GridRegion destination = new GridRegion();
330 destination.RegionID = regionID; 337 destination.RegionID = regionID;
331 338
332 bool result = m_SimulationService.QueryAccess(destination, id); 339 bool result = m_SimulationService.QueryAccess(destination, id, position);
333 340
334 responsedata["int_response_code"] = HttpStatusCode.OK; 341 responsedata["int_response_code"] = HttpStatusCode.OK;
335 responsedata["str_response_string"] = result.ToString(); 342 responsedata["str_response_string"] = result.ToString();
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 143c296..775bded 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -31,6 +31,7 @@ using System.IO;
31using System.Net; 31using System.Net;
32using System.Reflection; 32using System.Reflection;
33using System.Text; 33using System.Text;
34using System.Collections;
34 35
35using OpenSim.Framework; 36using OpenSim.Framework;
36using OpenSim.Services.Interfaces; 37using OpenSim.Services.Interfaces;
@@ -206,9 +207,9 @@ namespace OpenSim.Services.Connectors.Simulation
206 207
207 /// <summary> 208 /// <summary>
208 /// </summary> 209 /// </summary>
209 public bool QueryAccess(GridRegion destination, UUID id) 210 public bool QueryAccess(GridRegion destination, UUID id, Vector3 position)
210 { 211 {
211 // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start"); 212 // m_log.DebugFormat("[REMOTE SIMULATION CONNECTOR]: QueryAccess start, position={0}", position);
212 213
213 IPEndPoint ext = destination.ExternalEndPoint; 214 IPEndPoint ext = destination.ExternalEndPoint;
214 if (ext == null) return false; 215 if (ext == null) return false;
@@ -216,9 +217,12 @@ namespace OpenSim.Services.Connectors.Simulation
216 // Eventually, we want to use a caps url instead of the agentID 217 // Eventually, we want to use a caps url instead of the agentID
217 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; 218 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
218 219
220 OSDMap request = new OSDMap();
221 request.Add("position", OSD.FromString(position.ToString()));
222
219 try 223 try
220 { 224 {
221 OSDMap result = WebUtil.ServiceOSDRequest(uri,null,"QUERYACCESS",10000); 225 OSDMap result = WebUtil.ServiceOSDRequest(uri, request, "QUERYACCESS", 10000);
222 return result["Success"].AsBoolean(); 226 return result["Success"].AsBoolean();
223 } 227 }
224 catch (Exception e) 228 catch (Exception e)
diff --git a/OpenSim/Services/Interfaces/ISimulationService.cs b/OpenSim/Services/Interfaces/ISimulationService.cs
index 12e8982..48a2185 100644
--- a/OpenSim/Services/Interfaces/ISimulationService.cs
+++ b/OpenSim/Services/Interfaces/ISimulationService.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Services.Interfaces
60 60
61 bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent); 61 bool RetrieveAgent(GridRegion destination, UUID id, out IAgentData agent);
62 62
63 bool QueryAccess(GridRegion destination, UUID id); 63 bool QueryAccess(GridRegion destination, UUID id, Vector3 position);
64 64
65 /// <summary> 65 /// <summary>
66 /// Message from receiving region to departing region, telling it got contacted by the client. 66 /// Message from receiving region to departing region, telling it got contacted by the client.