aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Grid/GridServer/GridManager.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Grid/GridServer/GridManager.cs64
1 files changed, 32 insertions, 32 deletions
diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs
index c2c212c..83b5319 100644
--- a/OpenSim/Grid/GridServer/GridManager.cs
+++ b/OpenSim/Grid/GridServer/GridManager.cs
@@ -243,22 +243,22 @@ namespace OpenSim.Grid.GridServer
243 243
244 /// <summary> 244 /// <summary>
245 /// Checks that it's valid to replace the existing region data with new data 245 /// Checks that it's valid to replace the existing region data with new data
246 /// 246 ///
247 /// Currently, this means ensure that the keys passed in by the new region 247 /// Currently, this means ensure that the keys passed in by the new region
248 /// match those in the original region. (XXX Is this correct? Shouldn't we simply check 248 /// match those in the original region. (XXX Is this correct? Shouldn't we simply check
249 /// against the keys in the current configuration?) 249 /// against the keys in the current configuration?)
250 /// </summary> 250 /// </summary>
251 /// <param name="sim"></param> 251 /// <param name="sim"></param>
252 /// <returns></returns> 252 /// <returns></returns>
253 protected virtual void ValidateOverwriteKeys(RegionProfileData sim, RegionProfileData existingSim) 253 protected virtual void ValidateOverwriteKeys(RegionProfileData sim, RegionProfileData existingSim)
254 { 254 {
255 if (!(existingSim.regionRecvKey == sim.regionRecvKey && existingSim.regionSendKey == sim.regionSendKey)) 255 if (!(existingSim.regionRecvKey == sim.regionRecvKey && existingSim.regionSendKey == sim.regionSendKey))
256 { 256 {
257 throw new LoginException( 257 throw new LoginException(
258 String.Format( 258 String.Format(
259 "Authentication failed when trying to login existing region {0} at location {1} {2} currently occupied by {3}" 259 "Authentication failed when trying to login existing region {0} at location {1} {2} currently occupied by {3}"
260 + " with the region's send key {4} (expected {5}) and the region's receive key {6} (expected {7})", 260 + " with the region's send key {4} (expected {5}) and the region's receive key {6} (expected {7})",
261 sim.regionName, sim.regionLocX, sim.regionLocY, existingSim.regionName, 261 sim.regionName, sim.regionLocX, sim.regionLocY, existingSim.regionName,
262 sim.regionSendKey, existingSim.regionSendKey, sim.regionRecvKey, existingSim.regionRecvKey), 262 sim.regionSendKey, existingSim.regionSendKey, sim.regionRecvKey, existingSim.regionRecvKey),
263 "The keys required to login your region did not match the grid server keys. Please check your grid send and receive keys."); 263 "The keys required to login your region did not match the grid server keys. Please check your grid send and receive keys.");
264 } 264 }
@@ -266,25 +266,25 @@ namespace OpenSim.Grid.GridServer
266 266
267 /// <summary> 267 /// <summary>
268 /// Checks that the new region data is valid. 268 /// Checks that the new region data is valid.
269 /// 269 ///
270 /// Currently, this means checking that the keys passed in by the new region 270 /// Currently, this means checking that the keys passed in by the new region
271 /// match those in the grid server's configuration. 271 /// match those in the grid server's configuration.
272 /// </summary> 272 /// </summary>
273 /// 273 ///
274 /// <param name="sim"></param> 274 /// <param name="sim"></param>
275 /// <exception cref="LoginException">Thrown if region login failed</exception> 275 /// <exception cref="LoginException">Thrown if region login failed</exception>
276 protected virtual void ValidateNewRegionKeys(RegionProfileData sim) 276 protected virtual void ValidateNewRegionKeys(RegionProfileData sim)
277 { 277 {
278 if (!(sim.regionRecvKey == Config.SimSendKey && sim.regionSendKey == Config.SimRecvKey)) 278 if (!(sim.regionRecvKey == Config.SimSendKey && sim.regionSendKey == Config.SimRecvKey))
279 { 279 {
280 throw new LoginException( 280 throw new LoginException(
281 String.Format( 281 String.Format(
282 "Authentication failed when trying to login new region {0} at location {1} {2}" 282 "Authentication failed when trying to login new region {0} at location {1} {2}"
283 + " with the region's send key {3} (expected {4}) and the region's receive key {5} (expected {6})", 283 + " with the region's send key {3} (expected {4}) and the region's receive key {5} (expected {6})",
284 sim.regionName, sim.regionLocX, sim.regionLocY, 284 sim.regionName, sim.regionLocX, sim.regionLocY,
285 sim.regionSendKey, Config.SimRecvKey, sim.regionRecvKey, Config.SimSendKey), 285 sim.regionSendKey, Config.SimRecvKey, sim.regionRecvKey, Config.SimSendKey),
286 "The keys required to login your region did not match your existing region keys. Please check your grid send and receive keys."); 286 "The keys required to login your region did not match your existing region keys. Please check your grid send and receive keys.");
287 } 287 }
288 } 288 }
289 289
290 /// <summary> 290 /// <summary>
@@ -295,13 +295,13 @@ namespace OpenSim.Grid.GridServer
295 protected virtual void ValidateRegionContactable(RegionProfileData sim) 295 protected virtual void ValidateRegionContactable(RegionProfileData sim)
296 { 296 {
297 string regionStatusUrl = String.Format("{0}{1}", sim.httpServerURI, "simstatus/"); 297 string regionStatusUrl = String.Format("{0}{1}", sim.httpServerURI, "simstatus/");
298 string regionStatusResponse; 298 string regionStatusResponse;
299 299
300 RestClient rc = new RestClient(regionStatusUrl); 300 RestClient rc = new RestClient(regionStatusUrl);
301 rc.RequestMethod = "GET"; 301 rc.RequestMethod = "GET";
302 302
303 m_log.DebugFormat("[LOGIN]: Contacting {0} for status of region {1}", regionStatusUrl, sim.regionName); 303 m_log.DebugFormat("[LOGIN]: Contacting {0} for status of region {1}", regionStatusUrl, sim.regionName);
304 304
305 try 305 try
306 { 306 {
307 Stream rs = rc.Request(); 307 Stream rs = rc.Request();
@@ -314,21 +314,21 @@ namespace OpenSim.Grid.GridServer
314 throw new LoginException( 314 throw new LoginException(
315 String.Format("Region status request to {0} failed", regionStatusUrl), 315 String.Format("Region status request to {0} failed", regionStatusUrl),
316 String.Format( 316 String.Format(
317 "The grid service could not contact the http url {0} at your region. Please make sure this url is reachable by the grid service", 317 "The grid service could not contact the http url {0} at your region. Please make sure this url is reachable by the grid service",
318 regionStatusUrl), 318 regionStatusUrl),
319 e); 319 e);
320 } 320 }
321 321
322 if (!regionStatusResponse.Equals("OK")) 322 if (!regionStatusResponse.Equals("OK"))
323 { 323 {
324 throw new LoginException( 324 throw new LoginException(
325 String.Format( 325 String.Format(
326 "Region {0} at {1} returned status response {2} rather than {3}", 326 "Region {0} at {1} returned status response {2} rather than {3}",
327 sim.regionName, regionStatusUrl, regionStatusResponse, "OK"), 327 sim.regionName, regionStatusUrl, regionStatusResponse, "OK"),
328 String.Format( 328 String.Format(
329 "When the grid service asked for the status of your region, it received the response {0} rather than {1}. Please check your status", 329 "When the grid service asked for the status of your region, it received the response {0} rather than {1}. Please check your status",
330 regionStatusResponse, "OK")); 330 regionStatusResponse, "OK"));
331 } 331 }
332 } 332 }
333 333
334 /// <summary> 334 /// <summary>
@@ -373,11 +373,11 @@ namespace OpenSim.Grid.GridServer
373 m_log.Warn("[LOGIN PRELUDE]: Invalid login parameters, sending back error response."); 373 m_log.Warn("[LOGIN PRELUDE]: Invalid login parameters, sending back error response.");
374 return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString()); 374 return ErrorResponse("Wrong format in login parameters. Please verify parameters." + e.ToString());
375 } 375 }
376 376
377 m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName); 377 m_log.InfoFormat("[LOGIN BEGIN]: Received login request from simulator: {0}", sim.regionName);
378 378
379 existingSim = GetRegion(sim.regionHandle); 379 existingSim = GetRegion(sim.regionHandle);
380 380
381 if (existingSim == null || existingSim.UUID == sim.UUID || sim.UUID != sim.originUUID) 381 if (existingSim == null || existingSim.UUID == sim.UUID || sim.UUID != sim.originUUID)
382 { 382 {
383 try 383 try
@@ -390,13 +390,13 @@ namespace OpenSim.Grid.GridServer
390 { 390 {
391 ValidateOverwriteKeys(sim, existingSim); 391 ValidateOverwriteKeys(sim, existingSim);
392 } 392 }
393 393
394 ValidateRegionContactable(sim); 394 ValidateRegionContactable(sim);
395 } 395 }
396 catch (LoginException e) 396 catch (LoginException e)
397 { 397 {
398 m_log.WarnFormat("[LOGIN END]: {0}", e.Message); 398 m_log.WarnFormat("[LOGIN END]: {0}", e.Message);
399 399
400 return e.XmlRpcErrorResponse; 400 return e.XmlRpcErrorResponse;
401 } 401 }
402 402
@@ -489,7 +489,7 @@ namespace OpenSim.Grid.GridServer
489 responseData["allow_forceful_banlines"] = Config.AllowForcefulBanlines; 489 responseData["allow_forceful_banlines"] = Config.AllowForcefulBanlines;
490 490
491 // Instead of sending a multitude of message servers to the registering sim 491 // Instead of sending a multitude of message servers to the registering sim
492 // we should probably be sending a single one and parhaps it's backup 492 // we should probably be sending a single one and parhaps it's backup
493 // that has responsibility over routing it's messages. 493 // that has responsibility over routing it's messages.
494 494
495 // The Sim won't be contacting us again about any of the message server stuff during it's time up. 495 // The Sim won't be contacting us again about any of the message server stuff during it's time up.
@@ -583,7 +583,7 @@ namespace OpenSim.Grid.GridServer
583 583
584 sim.regionRecvKey = String.Empty; 584 sim.regionRecvKey = String.Empty;
585 sim.regionSendKey = String.Empty; 585 sim.regionSendKey = String.Empty;
586 586
587 if (requestData.ContainsKey("region_secret")) 587 if (requestData.ContainsKey("region_secret"))
588 { 588 {
589 string regionsecret = (string)requestData["region_secret"]; 589 string regionsecret = (string)requestData["region_secret"];
@@ -596,8 +596,8 @@ namespace OpenSim.Grid.GridServer
596 else 596 else
597 { 597 {
598 sim.regionSecret = Config.SimRecvKey; 598 sim.regionSecret = Config.SimRecvKey;
599 } 599 }
600 600
601 sim.regionDataURI = String.Empty; 601 sim.regionDataURI = String.Empty;
602 sim.regionAssetURI = Config.DefaultAssetServer; 602 sim.regionAssetURI = Config.DefaultAssetServer;
603 sim.regionAssetRecvKey = Config.AssetRecvKey; 603 sim.regionAssetRecvKey = Config.AssetRecvKey;
@@ -626,7 +626,7 @@ namespace OpenSim.Grid.GridServer
626 // not at all. Current strategy is to put the code in place to support the validity of this information 626 // not at all. Current strategy is to put the code in place to support the validity of this information
627 // and to roll forward debugging any issues from that point 627 // and to roll forward debugging any issues from that point
628 // 628 //
629 // this particular section of the mod attempts to receive a value from the region's xml file by way of 629 // this particular section of the mod attempts to receive a value from the region's xml file by way of
630 // OSG1GridServices for the region's owner 630 // OSG1GridServices for the region's owner
631 sim.owner_uuid = (string)requestData["master_avatar_uuid"]; 631 sim.owner_uuid = (string)requestData["master_avatar_uuid"];
632 632
@@ -1120,7 +1120,7 @@ namespace OpenSim.Grid.GridServer
1120 return response; 1120 return response;
1121 } 1121 }
1122 } 1122 }
1123 1123
1124 /// <summary> 1124 /// <summary>
1125 /// Exception generated when a simulator fails to login to the grid 1125 /// Exception generated when a simulator fails to login to the grid
1126 /// </summary> 1126 /// </summary>
@@ -1147,6 +1147,6 @@ namespace OpenSim.Grid.GridServer
1147 { 1147 {
1148 // FIXME: Might be neater to refactor and put the method inside here 1148 // FIXME: Might be neater to refactor and put the method inside here
1149 m_xmlRpcErrorResponse = GridManager.ErrorResponse(xmlRpcMessage); 1149 m_xmlRpcErrorResponse = GridManager.ErrorResponse(xmlRpcMessage);
1150 } 1150 }
1151 } 1151 }
1152} 1152}