diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 90 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs | 26 |
2 files changed, 115 insertions, 1 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> |
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs index 70018fd..aa6f59a 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs | |||
@@ -41,6 +41,8 @@ namespace OpenSim.Region.Communications.OGS1 | |||
41 | 41 | ||
42 | public delegate bool PrimGroupArrival(ulong regionHandle, LLUUID primID, string objData); | 42 | public delegate bool PrimGroupArrival(ulong regionHandle, LLUUID primID, string objData); |
43 | 43 | ||
44 | public delegate bool RegionUP (RegionInfo region); | ||
45 | |||
44 | public sealed class InterRegionSingleton | 46 | public sealed class InterRegionSingleton |
45 | { | 47 | { |
46 | private static readonly InterRegionSingleton instance = new InterRegionSingleton(); | 48 | private static readonly InterRegionSingleton instance = new InterRegionSingleton(); |
@@ -49,6 +51,8 @@ namespace OpenSim.Region.Communications.OGS1 | |||
49 | public event ExpectArrival OnArrival; | 51 | public event ExpectArrival OnArrival; |
50 | public event InformRegionPrimGroup OnPrimGroupNear; | 52 | public event InformRegionPrimGroup OnPrimGroupNear; |
51 | public event PrimGroupArrival OnPrimGroupArrival; | 53 | public event PrimGroupArrival OnPrimGroupArrival; |
54 | public event RegionUp OnRegionUp; | ||
55 | |||
52 | 56 | ||
53 | static InterRegionSingleton() | 57 | static InterRegionSingleton() |
54 | { | 58 | { |
@@ -72,6 +76,15 @@ namespace OpenSim.Region.Communications.OGS1 | |||
72 | return false; | 76 | return false; |
73 | } | 77 | } |
74 | 78 | ||
79 | public bool RegionUp(RegionInfo region) | ||
80 | { | ||
81 | if (OnRegionUp != null) | ||
82 | { | ||
83 | return OnRegionUp(region); | ||
84 | } | ||
85 | return false; | ||
86 | } | ||
87 | |||
75 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) | 88 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) |
76 | { | 89 | { |
77 | if (OnArrival != null) | 90 | if (OnArrival != null) |
@@ -116,7 +129,18 @@ namespace OpenSim.Region.Communications.OGS1 | |||
116 | return false; | 129 | return false; |
117 | } | 130 | } |
118 | } | 131 | } |
119 | 132 | public bool RegionUp(RegionInfo region) | |
133 | { | ||
134 | try | ||
135 | { | ||
136 | return InterRegionSingleton.Instance.RegionUp(region); | ||
137 | } | ||
138 | catch (RemotingException e) | ||
139 | { | ||
140 | Console.WriteLine("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); | ||
141 | return false; | ||
142 | } | ||
143 | } | ||
120 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) | 144 | public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) |
121 | { | 145 | { |
122 | try | 146 | try |