aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Hypergrid
diff options
context:
space:
mode:
authorMelanie2010-08-21 00:32:26 +0100
committerMelanie2010-08-21 00:32:26 +0100
commitf8ff98577ef3e576326c6eea28cb12ebb4e0bdc4 (patch)
tree3ef10e646ddda95929142eb2c3774b42d0923b3b /OpenSim/Services/Connectors/Hypergrid
parentForward-port a small improvement to the land out connector (diff)
parentForward-port a small improvement to the land out connector (diff)
downloadopensim-SC_OLD-f8ff98577ef3e576326c6eea28cb12ebb4e0bdc4.zip
opensim-SC_OLD-f8ff98577ef3e576326c6eea28cb12ebb4e0bdc4.tar.gz
opensim-SC_OLD-f8ff98577ef3e576326c6eea28cb12ebb4e0bdc4.tar.bz2
opensim-SC_OLD-f8ff98577ef3e576326c6eea28cb12ebb4e0bdc4.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Services/Connectors/Hypergrid')
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs44
-rw-r--r--OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs7
2 files changed, 51 insertions, 0 deletions
diff --git a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
index 6f159a0..cabee4c 100644
--- a/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/GatekeeperServiceConnector.cs
@@ -38,6 +38,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion;
38 38
39using OpenMetaverse; 39using OpenMetaverse;
40using OpenMetaverse.Imaging; 40using OpenMetaverse.Imaging;
41using OpenMetaverse.StructuredData;
41using Nwc.XmlRpc; 42using Nwc.XmlRpc;
42using log4net; 43using log4net;
43 44
@@ -278,5 +279,48 @@ namespace OpenSim.Services.Connectors.Hypergrid
278 return null; 279 return null;
279 } 280 }
280 281
282 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason)
283 {
284 HttpWebRequest AgentCreateRequest = null;
285 myipaddress = String.Empty;
286 reason = String.Empty;
287
288 if (SendRequest(destination, aCircuit, flags, out reason, out AgentCreateRequest))
289 {
290 string response = GetResponse(AgentCreateRequest, out reason);
291 bool success = true;
292 UnpackResponse(response, out success, out reason, out myipaddress);
293 return success;
294 }
295
296 return false;
297 }
298
299 protected void UnpackResponse(string response, out bool result, out string reason, out string ipaddress)
300 {
301 result = true;
302 reason = string.Empty;
303 ipaddress = string.Empty;
304
305 if (!String.IsNullOrEmpty(response))
306 {
307 try
308 {
309 // we assume we got an OSDMap back
310 OSDMap r = Util.GetOSDMap(response);
311 result = r["success"].AsBoolean();
312 reason = r["reason"].AsString();
313 ipaddress = r["your_ip"].AsString();
314 }
315 catch (NullReferenceException e)
316 {
317 m_log.InfoFormat("[GATEKEEPER SERVICE CONNECTOR]: exception on UnpackResponse of DoCreateChildAgentCall {0}", e.Message);
318 reason = "Internal error";
319 result = false;
320 }
321 }
322 }
323
324
281 } 325 }
282} 326}
diff --git a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
index 69dff3c..c1e5949 100644
--- a/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Hypergrid/UserAgentServiceConnector.cs
@@ -73,6 +73,13 @@ namespace OpenSim.Services.Connectors.Hypergrid
73 { 73 {
74 } 74 }
75 75
76 public bool LoginAgentToGrid(AgentCircuitData agent, GridRegion gatekeeper, GridRegion finalDestination, IPEndPoint ipaddress, out string reason)
77 {
78 // not available over remote calls
79 reason = "Method not available over remote calls";
80 return false;
81 }
82
76 public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason) 83 public bool LoginAgentToGrid(AgentCircuitData aCircuit, GridRegion gatekeeper, GridRegion destination, out string reason)
77 { 84 {
78 reason = String.Empty; 85 reason = String.Empty;