aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
authorMelanie2010-12-09 02:01:41 +0100
committerMelanie2010-12-09 02:01:41 +0100
commitf28dc77ab4f0abeac942b25d3547f43184d5cf2e (patch)
tree4820d18755c55fa6da7dde2ec4626cb4fc9ce870 /OpenSim/Services/Connectors
parentPrevent sending of attachment data to any client if the attachment (diff)
downloadopensim-SC-f28dc77ab4f0abeac942b25d3547f43184d5cf2e.zip
opensim-SC-f28dc77ab4f0abeac942b25d3547f43184d5cf2e.tar.gz
opensim-SC-f28dc77ab4f0abeac942b25d3547f43184d5cf2e.tar.bz2
opensim-SC-f28dc77ab4f0abeac942b25d3547f43184d5cf2e.tar.xz
Plumb a code path for the entity transfer module to ask a destination scene
whether or not an agent is allowed there as a root agent.
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs59
1 files changed, 59 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index 415c6ea..d25a766 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -411,6 +411,65 @@ namespace OpenSim.Services.Connectors.Simulation
411 return false; 411 return false;
412 } 412 }
413 413
414 public bool QueryAccess(GridRegion destination, UUID id)
415 {
416 IPEndPoint ext = destination.ExternalEndPoint;
417 if (ext == null) return false;
418 // Eventually, we want to use a caps url instead of the agentID
419 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
420
421 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
422 request.Method = "QUERYACCESS";
423 request.Timeout = 10000;
424 //request.Headers.Add("authorization", ""); // coming soon
425
426 HttpWebResponse webResponse = null;
427 string reply = string.Empty;
428 StreamReader sr = null;
429 try
430 {
431 webResponse = (HttpWebResponse)request.GetResponse();
432 if (webResponse == null)
433 {
434 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Null reply on agent query ");
435 }
436
437 sr = new StreamReader(webResponse.GetResponseStream());
438 reply = sr.ReadToEnd().Trim();
439
440
441 }
442 catch (WebException ex)
443 {
444 m_log.WarnFormat("[REMOTE SIMULATION CONNECTOR]: exception on reply of agent query {0}", ex.Message);
445 // ignore, really
446 return false;
447 }
448 finally
449 {
450 if (sr != null)
451 sr.Close();
452 }
453
454 if (webResponse.StatusCode == HttpStatusCode.OK)
455 {
456 try
457 {
458 bool result;
459
460 result = bool.Parse(reply);
461
462 return result;
463 }
464 catch
465 {
466 return false;
467 }
468 }
469
470 return false;
471 }
472
414 public bool ReleaseAgent(UUID origin, UUID id, string uri) 473 public bool ReleaseAgent(UUID origin, UUID id, string uri)
415 { 474 {
416 WebRequest request = WebRequest.Create(uri); 475 WebRequest request = WebRequest.Create(uri);