diff options
Diffstat (limited to 'OpenSim/Region/Communications/OGS1/OGS1GridServices.cs')
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 6b2407a..a0d6bd3 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -380,6 +380,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
380 | InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent; | 380 | InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent; |
381 | InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim; | 381 | InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim; |
382 | InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing; | 382 | InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing; |
383 | InterRegionSingleton.Instance.OnRegionUp += TriggerRegionUp; | ||
383 | 384 | ||
384 | } | 385 | } |
385 | 386 | ||
@@ -465,6 +466,81 @@ namespace OpenSim.Region.Communications.OGS1 | |||
465 | } | 466 | } |
466 | return true; | 467 | return true; |
467 | } | 468 | } |
469 | |||
470 | // UGLY! | ||
471 | public bool RegionUp(RegionInfo region) | ||
472 | { | ||
473 | RegionInfo regInfo = null; | ||
474 | try | ||
475 | { | ||
476 | if (m_localBackend.RegionUp(region)) | ||
477 | { | ||
478 | return true; | ||
479 | } | ||
480 | foreach (RegionInfo remoteInfo in m_remoteRegionInfoCache.Values) | ||
481 | { | ||
482 | regInfo = RequestNeighbourInfo(remoteInfo.RegionHandle); | ||
483 | if (regInfo != null) | ||
484 | { | ||
485 | //don't want to be creating a new link to the remote instance every time like we are here | ||
486 | bool retValue = false; | ||
487 | |||
488 | |||
489 | OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( | ||
490 | typeof(OGS1InterRegionRemoting), | ||
491 | "tcp://" + regInfo.RemotingAddress + | ||
492 | ":" + regInfo.RemotingPort + | ||
493 | "/InterRegions"); | ||
494 | |||
495 | if (remObject != null) | ||
496 | { | ||
497 | retValue = remObject.RegionUp(region); | ||
498 | } | ||
499 | else | ||
500 | { | ||
501 | Console.WriteLine("remoting object not found"); | ||
502 | } | ||
503 | remObject = null; | ||
504 | |||
505 | } | ||
506 | |||
507 | } | ||
508 | |||
509 | |||
510 | return true; | ||
511 | } | ||
512 | catch (RemotingException e) | ||
513 | { | ||
514 | MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
515 | MainLog.Instance.Debug(e.ToString()); | ||
516 | return false; | ||
517 | } | ||
518 | catch (SocketException e) | ||
519 | { | ||
520 | MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
521 | MainLog.Instance.Debug(e.ToString()); | ||
522 | return false; | ||
523 | } | ||
524 | catch (InvalidCredentialException e) | ||
525 | { | ||
526 | MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
527 | MainLog.Instance.Debug(e.ToString()); | ||
528 | return false; | ||
529 | } | ||
530 | catch (AuthenticationException e) | ||
531 | { | ||
532 | MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
533 | MainLog.Instance.Debug(e.ToString()); | ||
534 | return false; | ||
535 | } | ||
536 | catch (Exception e) | ||
537 | { | ||
538 | MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY); | ||
539 | MainLog.Instance.Debug(e.ToString()); | ||
540 | return false; | ||
541 | } | ||
542 | return true; | ||
543 | } | ||
468 | /// <summary> | 544 | /// <summary> |
469 | /// | 545 | /// |
470 | /// </summary> | 546 | /// </summary> |
@@ -680,6 +756,20 @@ namespace OpenSim.Region.Communications.OGS1 | |||
680 | } | 756 | } |
681 | } | 757 | } |
682 | 758 | ||
759 | public bool TriggerRegionUp(RegionInfo regionData) | ||
760 | { | ||
761 | try | ||
762 | { | ||
763 | return m_localBackend.TriggerRegionUp(regionData); | ||
764 | } | ||
765 | |||
766 | catch (RemotingException e) | ||
767 | { | ||
768 | MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString()); | ||
769 | return false; | ||
770 | } | ||
771 | } | ||
772 | |||
683 | /// <summary> | 773 | /// <summary> |
684 | /// | 774 | /// |
685 | /// </summary> | 775 | /// </summary> |