aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs104
1 files changed, 102 insertions, 2 deletions
diff --git a/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
index b5e8743..3d7f112 100644
--- a/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
+++ b/OpenSim/Services/Connectors/Grid/HypergridServiceConnector.cs
@@ -66,10 +66,20 @@ namespace OpenSim.Services.Connectors.Grid
66 IList paramList = new ArrayList(); 66 IList paramList = new ArrayList();
67 paramList.Add(hash); 67 paramList.Add(hash);
68 68
69 XmlRpcRequest request = new XmlRpcRequest("linkk_region", paramList); 69 XmlRpcRequest request = new XmlRpcRequest("link_region", paramList);
70 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/"; 70 string uri = "http://" + info.ExternalEndPoint.Address + ":" + info.HttpPort + "/";
71 m_log.Debug("[HGrid]: Linking to " + uri); 71 m_log.Debug("[HGrid]: Linking to " + uri);
72 XmlRpcResponse response = request.Send(uri, 10000); 72 XmlRpcResponse response = null;
73 try
74 {
75 response = request.Send(uri, 10000);
76 }
77 catch (Exception e)
78 {
79 m_log.Debug("[HGrid]: Exception " + e.Message);
80 return uuid;
81 }
82
73 if (response.IsFault) 83 if (response.IsFault)
74 { 84 {
75 m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString); 85 m_log.ErrorFormat("[HGrid]: remote call returned an error: {0}", response.FaultString);
@@ -82,6 +92,7 @@ namespace OpenSim.Services.Connectors.Grid
82 try 92 try
83 { 93 {
84 UUID.TryParse((string)hash["uuid"], out uuid); 94 UUID.TryParse((string)hash["uuid"], out uuid);
95 m_log.Debug(">> HERE, uuid: " + uuid);
85 info.RegionID = uuid; 96 info.RegionID = uuid;
86 if ((string)hash["handle"] != null) 97 if ((string)hash["handle"] != null)
87 { 98 {
@@ -148,5 +159,94 @@ namespace OpenSim.Services.Connectors.Grid
148 } 159 }
149 } 160 }
150 161
162 public bool InformRegionOfUser(GridRegion regInfo, AgentCircuitData agentData, GridRegion home, string userServer, string assetServer, string inventoryServer)
163 {
164 string capsPath = agentData.CapsPath;
165 Hashtable loginParams = new Hashtable();
166 loginParams["session_id"] = agentData.SessionID.ToString();
167
168 loginParams["firstname"] = agentData.firstname;
169 loginParams["lastname"] = agentData.lastname;
170
171 loginParams["agent_id"] = agentData.AgentID.ToString();
172 loginParams["circuit_code"] = agentData.circuitcode.ToString();
173 loginParams["startpos_x"] = agentData.startpos.X.ToString();
174 loginParams["startpos_y"] = agentData.startpos.Y.ToString();
175 loginParams["startpos_z"] = agentData.startpos.Z.ToString();
176 loginParams["caps_path"] = capsPath;
177
178 if (home != null)
179 {
180 loginParams["region_uuid"] = home.RegionID.ToString();
181 loginParams["regionhandle"] = home.RegionHandle.ToString();
182 loginParams["home_address"] = home.ExternalHostName;
183 loginParams["home_port"] = home.HttpPort.ToString();
184 loginParams["internal_port"] = home.InternalEndPoint.Port.ToString();
185
186 m_log.Debug(" --------- Home -------");
187 m_log.Debug(" >> " + loginParams["home_address"] + " <<");
188 m_log.Debug(" >> " + loginParams["region_uuid"] + " <<");
189 m_log.Debug(" >> " + loginParams["regionhandle"] + " <<");
190 m_log.Debug(" >> " + loginParams["home_port"] + " <<");
191 m_log.Debug(" --------- ------------ -------");
192 }
193 else
194 m_log.WarnFormat("[HGrid]: Home region not found for {0} {1}", agentData.firstname, agentData.lastname);
195
196 loginParams["userserver_id"] = userServer;
197 loginParams["assetserver_id"] = assetServer;
198 loginParams["inventoryserver_id"] = inventoryServer;
199
200
201 ArrayList SendParams = new ArrayList();
202 SendParams.Add(loginParams);
203
204 // Send
205 string uri = "http://" + regInfo.ExternalHostName + ":" + regInfo.HttpPort + "/";
206 //m_log.Debug("XXX uri: " + uri);
207 XmlRpcRequest request = new XmlRpcRequest("expect_hg_user", SendParams);
208 XmlRpcResponse reply;
209 try
210 {
211 reply = request.Send(uri, 6000);
212 }
213 catch (Exception e)
214 {
215 m_log.Warn("[HGrid]: Failed to notify region about user. Reason: " + e.Message);
216 return false;
217 }
218
219 if (!reply.IsFault)
220 {
221 bool responseSuccess = true;
222 if (reply.Value != null)
223 {
224 Hashtable resp = (Hashtable)reply.Value;
225 if (resp.ContainsKey("success"))
226 {
227 if ((string)resp["success"] == "FALSE")
228 {
229 responseSuccess = false;
230 }
231 }
232 }
233 if (responseSuccess)
234 {
235 m_log.Info("[HGrid]: Successfully informed remote region about user " + agentData.AgentID);
236 return true;
237 }
238 else
239 {
240 m_log.ErrorFormat("[HGrid]: Region responded that it is not available to receive clients");
241 return false;
242 }
243 }
244 else
245 {
246 m_log.ErrorFormat("[HGrid]: XmlRpc request to region failed with message {0}, code {1} ", reply.FaultString, reply.FaultCode);
247 return false;
248 }
249 }
250
151 } 251 }
152} 252}