aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Hypergrid
diff options
context:
space:
mode:
authorDiva Canto2010-08-19 18:55:30 -0700
committerDiva Canto2010-08-19 21:27:07 -0700
commit05373de9df263dedccf500a02330e5d1469e5974 (patch)
treed03b0929a98f6b36258e4b91b521717d892b1e4b /OpenSim/Services/Connectors/Hypergrid
parentremove ancient and unused OpenSim.GridLaunch GUI code. (diff)
downloadopensim-SC_OLD-05373de9df263dedccf500a02330e5d1469e5974.zip
opensim-SC_OLD-05373de9df263dedccf500a02330e5d1469e5974.tar.gz
opensim-SC_OLD-05373de9df263dedccf500a02330e5d1469e5974.tar.bz2
opensim-SC_OLD-05373de9df263dedccf500a02330e5d1469e5974.tar.xz
Partial rewrite of client IP verification. Not completely finished yet, and untested. Committing to move to my other computer.
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 c426bba..291dd73 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
@@ -268,5 +269,48 @@ namespace OpenSim.Services.Connectors.Hypergrid
268 return null; 269 return null;
269 } 270 }
270 271
272 public bool CreateAgent(GridRegion destination, AgentCircuitData aCircuit, uint flags, out string myipaddress, out string reason)
273 {
274 HttpWebRequest AgentCreateRequest = null;
275 myipaddress = String.Empty;
276 reason = String.Empty;
277
278 if (SendRequest(destination, aCircuit, flags, out reason, out AgentCreateRequest))
279 {
280 string response = GetResponse(AgentCreateRequest, out reason);
281 bool success = true;
282 UnpackResponse(response, out success, out reason, out myipaddress);
283 return success;
284 }
285
286 return false;
287 }
288
289 protected void UnpackResponse(string response, out bool result, out string reason, out string ipaddress)
290 {
291 result = true;
292 reason = string.Empty;
293 ipaddress = string.Empty;
294
295 if (!String.IsNullOrEmpty(response))
296 {
297 try
298 {
299 // we assume we got an OSDMap back
300 OSDMap r = Util.GetOSDMap(response);
301 result = r["success"].AsBoolean();
302 reason = r["reason"].AsString();
303 ipaddress = r["your_ip"].AsString();
304 }
305 catch (NullReferenceException e)
306 {
307 m_log.InfoFormat("[GATEKEEPER SERVICE CONNECTOR]: exception on UnpackResponse of DoCreateChildAgentCall {0}", e.Message);
308 reason = "Internal error";
309 result = false;
310 }
311 }
312 }
313
314
271 } 315 }
272} 316}
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;