aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/Connectors')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs35
-rw-r--r--OpenSim/Services/Connectors/Land/LandServiceConnector.cs7
-rw-r--r--OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs4
-rw-r--r--OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs4
-rw-r--r--OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs55
-rw-r--r--OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs2
6 files changed, 31 insertions, 76 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 479a80e..4231be1 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -63,12 +63,12 @@ namespace OpenSim.Services.Connectors.Hypergrid
63 63
64 protected override string AgentPath() 64 protected override string AgentPath()
65 { 65 {
66 return "/foreignagent/"; 66 return "foreignagent/";
67 } 67 }
68 68
69 protected override string ObjectPath() 69 protected override string ObjectPath()
70 { 70 {
71 return "/foreignobject/"; 71 return "foreignobject/";
72 } 72 }
73 73
74 public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason) 74 public bool LinkRegion(GridRegion info, out UUID regionID, out ulong realHandle, out string externalName, out string imageURL, out string reason)
@@ -86,12 +86,11 @@ namespace OpenSim.Services.Connectors.Hypergrid
86 paramList.Add(hash); 86 paramList.Add(hash);
87 87
88 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList); 88 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
89 string uri = "http://" + ((info.ServerURI != null && info.ServerURI != string.Empty && !info.ServerURI.StartsWith("http:")) ? info.ServerURI : info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"); 89 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + info.ServerURI);
90 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Linking to " + uri);
91 XmlRpcResponse response = null; 90 XmlRpcResponse response = null;
92 try 91 try
93 { 92 {
94 response = request.Send(uri, 10000); 93 response = request.Send(info.ServerURI, 10000);
95 } 94 }
96 catch (Exception e) 95 catch (Exception e)
97 { 96 {
@@ -108,8 +107,8 @@ namespace OpenSim.Services.Connectors.Hypergrid
108 } 107 }
109 108
110 hash = (Hashtable)response.Value; 109 hash = (Hashtable)response.Value;
111 //foreach (Object o in hash) 110 foreach (Object o in hash)
112 // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); 111 m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value);
113 try 112 try
114 { 113 {
115 bool success = false; 114 bool success = false;
@@ -117,16 +116,20 @@ namespace OpenSim.Services.Connectors.Hypergrid
117 if (success) 116 if (success)
118 { 117 {
119 UUID.TryParse((string)hash["uuid"], out regionID); 118 UUID.TryParse((string)hash["uuid"], out regionID);
120 //m_log.Debug(">> HERE, uuid: " + uuid); 119 //m_log.Debug(">> HERE, uuid: " + regionID);
121 if ((string)hash["handle"] != null) 120 if ((string)hash["handle"] != null)
122 { 121 {
123 realHandle = Convert.ToUInt64((string)hash["handle"]); 122 realHandle = Convert.ToUInt64((string)hash["handle"]);
124 //m_log.Debug(">> HERE, realHandle: " + realHandle); 123 //m_log.Debug(">> HERE, realHandle: " + realHandle);
125 } 124 }
126 if (hash["region_image"] != null) 125 if (hash["region_image"] != null) {
127 imageURL = (string)hash["region_image"]; 126 imageURL = (string)hash["region_image"];
128 if (hash["external_name"] != null) 127 //m_log.Debug(">> HERE, imageURL: " + imageURL);
128 }
129 if (hash["external_name"] != null) {
129 externalName = (string)hash["external_name"]; 130 externalName = (string)hash["external_name"];
131 //m_log.Debug(">> HERE, externalName: " + externalName);
132 }
130 } 133 }
131 134
132 } 135 }
@@ -188,16 +191,15 @@ namespace OpenSim.Services.Connectors.Hypergrid
188 paramList.Add(hash); 191 paramList.Add(hash);
189 192
190 XmlRpcRequest request = new XmlRpcRequest("get_region", paramList); 193 XmlRpcRequest request = new XmlRpcRequest("get_region", paramList);
191 string uri = "http://" + ((gatekeeper.ServerURI != null && gatekeeper.ServerURI != string.Empty && !gatekeeper.ServerURI.StartsWith("http:")) ? gatekeeper.ServerURI : gatekeeper.ExternalEndPoint.Address + ":" + gatekeeper.HttpPort + "/"); 194 //m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + gatekeeper.ServerURI);
192 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: contacting " + uri);
193 XmlRpcResponse response = null; 195 XmlRpcResponse response = null;
194 try 196 try
195 { 197 {
196 response = request.Send(uri, 10000); 198 response = request.Send(gatekeeper.ServerURI, 10000);
197 } 199 }
198 catch (Exception e) 200 catch (Exception e)
199 { 201 {
200 m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Exception " + e.Message); 202 //m_log.Debug("[GATEKEEPER SERVICE CONNECTOR]: Exception " + e.Message);
201 return null; 203 return null;
202 } 204 }
203 205
@@ -236,21 +238,24 @@ namespace OpenSim.Services.Connectors.Hypergrid
236 if (hash["region_name"] != null) 238 if (hash["region_name"] != null)
237 { 239 {
238 region.RegionName = (string)hash["region_name"]; 240 region.RegionName = (string)hash["region_name"];
239 //m_log.Debug(">> HERE, name: " + region.RegionName); 241 //m_log.Debug(">> HERE, region_name: " + region.RegionName);
240 } 242 }
241 if (hash["hostname"] != null) 243 if (hash["hostname"] != null)
242 region.ExternalHostName = (string)hash["hostname"]; 244 region.ExternalHostName = (string)hash["hostname"];
245 //m_log.Debug(">> HERE, hostname: " + region.ExternalHostName);
243 if (hash["http_port"] != null) 246 if (hash["http_port"] != null)
244 { 247 {
245 uint p = 0; 248 uint p = 0;
246 UInt32.TryParse((string)hash["http_port"], out p); 249 UInt32.TryParse((string)hash["http_port"], out p);
247 region.HttpPort = p; 250 region.HttpPort = p;
251 //m_log.Debug(">> HERE, http_port: " + region.HttpPort);
248 } 252 }
249 if (hash["internal_port"] != null) 253 if (hash["internal_port"] != null)
250 { 254 {
251 int p = 0; 255 int p = 0;
252 Int32.TryParse((string)hash["internal_port"], out p); 256 Int32.TryParse((string)hash["internal_port"], out p);
253 region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p); 257 region.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), p);
258 //m_log.Debug(">> HERE, internal_port: " + region.InternalEndPoint);
254 } 259 }
255 260
256 // Successful return 261 // Successful return
diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
index 8f74335..10499e2 100644
--- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs
@@ -84,10 +84,7 @@ namespace OpenSim.Services.Connectors
84 if (info != null) // just to be sure 84 if (info != null) // just to be sure
85 { 85 {
86 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); 86 XmlRpcRequest request = new XmlRpcRequest("land_data", paramList);
87 87 XmlRpcResponse response = request.Send(info.ServerURI, 10000);
88 //Possible nullref from info.externalendpoint will be caught here
89 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
90 XmlRpcResponse response = request.Send(uri, 10000);
91 if (response.IsFault) 88 if (response.IsFault)
92 { 89 {
93 m_log.ErrorFormat("[LAND CONNECTOR]: remote call returned an error: {0}", response.FaultString); 90 m_log.ErrorFormat("[LAND CONNECTOR]: remote call returned an error: {0}", response.FaultString);
@@ -134,4 +131,4 @@ namespace OpenSim.Services.Connectors
134 return landData; 131 return landData;
135 } 132 }
136 } 133 }
137} \ No newline at end of file 134}
diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
index daf0439..9c57a40 100644
--- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs
@@ -87,9 +87,7 @@ namespace OpenSim.Services.Connectors
87 87
88 public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion) 88 public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion)
89 { 89 {
90 IPEndPoint ext = region.ExternalEndPoint; 90 string uri = region.ServerURI + "/region/" + thisRegion.RegionID + "/";
91 if (ext == null) return false;
92 string uri = "http://" + ext.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/";
93 //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri); 91 //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri);
94 92
95 WebRequest HelloNeighbourRequest = WebRequest.Create(uri); 93 WebRequest HelloNeighbourRequest = WebRequest.Create(uri);
diff --git a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
index 4fc2a6d..f86eba3 100644
--- a/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/SimianGrid/SimianGridServiceConnector.cs
@@ -147,8 +147,6 @@ namespace OpenSim.Services.Connectors.SimianGrid
147 Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0); 147 Vector3d minPosition = new Vector3d(regionInfo.RegionLocX, regionInfo.RegionLocY, 0.0);
148 Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0); 148 Vector3d maxPosition = minPosition + new Vector3d(Constants.RegionSize, Constants.RegionSize, 4096.0);
149 149
150 string httpAddress = "http://" + regionInfo.ExternalHostName + ":" + regionInfo.HttpPort + "/";
151
152 OSDMap extraData = new OSDMap 150 OSDMap extraData = new OSDMap
153 { 151 {
154 { "ServerURI", OSD.FromString(regionInfo.ServerURI) }, 152 { "ServerURI", OSD.FromString(regionInfo.ServerURI) },
@@ -170,7 +168,7 @@ namespace OpenSim.Services.Connectors.SimianGrid
170 { "Name", regionInfo.RegionName }, 168 { "Name", regionInfo.RegionName },
171 { "MinPosition", minPosition.ToString() }, 169 { "MinPosition", minPosition.ToString() },
172 { "MaxPosition", maxPosition.ToString() }, 170 { "MaxPosition", maxPosition.ToString() },
173 { "Address", httpAddress }, 171 { "Address", regionInfo.ServerURI },
174 { "Enabled", "1" }, 172 { "Enabled", "1" },
175 { "ExtraData", OSDParser.SerializeJsonString(extraData) } 173 { "ExtraData", OSDParser.SerializeJsonString(extraData) }
176 }; 174 };
diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
index a8ed66d..f855fde 100644
--- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs
@@ -72,7 +72,7 @@ namespace OpenSim.Services.Connectors.Simulation
72 72
73 protected virtual string AgentPath() 73 protected virtual string AgentPath()
74 { 74 {
75 return "/agent/"; 75 return "agent/";
76 } 76 }
77 77
78 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason) 78 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string reason)
@@ -104,26 +104,7 @@ namespace OpenSim.Services.Connectors.Simulation
104 return false; 104 return false;
105 } 105 }
106 106
107 string uri = string.Empty; 107 string uri = destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
108
109 // HACK -- Simian grid make it work!!!
110 if (destination.ServerURI != null && destination.ServerURI != string.Empty && !destination.ServerURI.StartsWith("http:"))
111 uri = "http://" + destination.ServerURI + AgentPath() + aCircuit.AgentID + "/";
112 else
113 {
114 try
115 {
116 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + aCircuit.AgentID + "/";
117 }
118 catch (Exception e)
119 {
120 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent create. Reason: " + e.Message);
121 reason = e.Message;
122 return false;
123 }
124 }
125
126 //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri);
127 108
128 AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri); 109 AgentCreateRequest = (HttpWebRequest)WebRequest.Create(uri);
129 AgentCreateRequest.Method = "POST"; 110 AgentCreateRequest.Method = "POST";
@@ -277,17 +258,7 @@ namespace OpenSim.Services.Connectors.Simulation
277 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData) 258 private bool UpdateAgent(GridRegion destination, IAgentData cAgentData)
278 { 259 {
279 // Eventually, we want to use a caps url instead of the agentID 260 // Eventually, we want to use a caps url instead of the agentID
280 string uri = string.Empty; 261 string uri = destination.ServerURI + AgentPath() + cAgentData.AgentID + "/";
281 try
282 {
283 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + cAgentData.AgentID + "/";
284 }
285 catch (Exception e)
286 {
287 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent update. Reason: " + e.Message);
288 return false;
289 }
290 //Console.WriteLine(" >>> DoAgentUpdateCall <<< " + uri);
291 262
292 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri); 263 HttpWebRequest ChildUpdateRequest = (HttpWebRequest)WebRequest.Create(uri);
293 ChildUpdateRequest.Method = "PUT"; 264 ChildUpdateRequest.Method = "PUT";
@@ -387,8 +358,7 @@ namespace OpenSim.Services.Connectors.Simulation
387 agent = null; 358 agent = null;
388 if (ext == null) return false; 359 if (ext == null) return false;
389 // Eventually, we want to use a caps url instead of the agentID 360 // Eventually, we want to use a caps url instead of the agentID
390 string uri = "http://" + ext.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/"; 361 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
391 //Console.WriteLine(" >>> DoRetrieveRootAgentCall <<< " + uri);
392 362
393 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri); 363 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(uri);
394 request.Method = "GET"; 364 request.Method = "GET";
@@ -409,7 +379,6 @@ namespace OpenSim.Services.Connectors.Simulation
409 sr = new StreamReader(webResponse.GetResponseStream()); 379 sr = new StreamReader(webResponse.GetResponseStream());
410 reply = sr.ReadToEnd().Trim(); 380 reply = sr.ReadToEnd().Trim();
411 381
412 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: ChilAgentUpdate reply was " + reply);
413 382
414 } 383 }
415 catch (WebException ex) 384 catch (WebException ex)
@@ -430,7 +399,6 @@ namespace OpenSim.Services.Connectors.Simulation
430 OSDMap args = Util.GetOSDMap(reply); 399 OSDMap args = Util.GetOSDMap(reply);
431 if (args == null) 400 if (args == null)
432 { 401 {
433 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: Error getting OSDMap from reply");
434 return false; 402 return false;
435 } 403 }
436 404
@@ -439,7 +407,6 @@ namespace OpenSim.Services.Connectors.Simulation
439 return true; 407 return true;
440 } 408 }
441 409
442 //Console.WriteLine("[REMOTE SIMULATION CONNECTOR]: DoRetrieveRootAgentCall returned status " + webResponse.StatusCode);
443 return false; 410 return false;
444 } 411 }
445 412
@@ -481,18 +448,8 @@ namespace OpenSim.Services.Connectors.Simulation
481 448
482 private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly) 449 private bool CloseAgent(GridRegion destination, UUID id, bool ChildOnly)
483 { 450 {
484 string uri = string.Empty; 451 string uri = destination.ServerURI + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
485 try
486 {
487 uri = "http://" + destination.ExternalEndPoint.Address + ":" + destination.HttpPort + AgentPath() + id + "/" + destination.RegionID.ToString() + "/";
488 }
489 catch (Exception e)
490 {
491 m_log.Debug("[REMOTE SIMULATION CONNECTOR]: Unable to resolve external endpoint on agent close. Reason: " + e.Message);
492 return false;
493 }
494 452
495 //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri);
496 453
497 WebRequest request = WebRequest.Create(uri); 454 WebRequest request = WebRequest.Create(uri);
498 request.Method = "DELETE"; 455 request.Method = "DELETE";
@@ -554,7 +511,7 @@ namespace OpenSim.Services.Connectors.Simulation
554 IPEndPoint ext = destination.ExternalEndPoint; 511 IPEndPoint ext = destination.ExternalEndPoint;
555 if (ext == null) return false; 512 if (ext == null) return false;
556 string uri 513 string uri
557 = "http://" + ext.Address + ":" + destination.HttpPort + ObjectPath() + sog.UUID + "/"; 514 = destination.ServerURI + ObjectPath() + sog.UUID + "/";
558 //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri); 515 //m_log.Debug(" >>> DoCreateObjectCall <<< " + uri);
559 516
560 WebRequest ObjectCreateRequest = WebRequest.Create(uri); 517 WebRequest ObjectCreateRequest = WebRequest.Create(uri);
diff --git a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
index 67c482b..2a5df83 100644
--- a/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
+++ b/OpenSim/Services/Connectors/UserAccounts/UserAccountServiceConnector.cs
@@ -113,7 +113,7 @@ namespace OpenSim.Services.Connectors
113 113
114 public virtual UserAccount GetUserAccount(UUID scopeID, UUID userID) 114 public virtual UserAccount GetUserAccount(UUID scopeID, UUID userID)
115 { 115 {
116 // m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUserAccount {0}", userID); 116 //m_log.DebugFormat("[ACCOUNTS CONNECTOR]: GetUserAccount {0}", userID);
117 Dictionary<string, object> sendData = new Dictionary<string, object>(); 117 Dictionary<string, object> sendData = new Dictionary<string, object>();
118 //sendData["SCOPEID"] = scopeID.ToString(); 118 //sendData["SCOPEID"] = scopeID.ToString();
119 sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString(); 119 sendData["VERSIONMIN"] = ProtocolVersions.ClientProtocolVersionMin.ToString();