aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-09 05:59:49 +0000
committerTeravus Ovares2007-12-09 05:59:49 +0000
commitf2b175ef08066649a13b6a42f0a59d9bee503638 (patch)
tree084ef2d6e2c67358b85d62179aee98eaa838d25c /OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
parentadded more packet handling stubs (diff)
downloadopensim-SC-f2b175ef08066649a13b6a42f0a59d9bee503638.zip
opensim-SC-f2b175ef08066649a13b6a42f0a59d9bee503638.tar.gz
opensim-SC-f2b175ef08066649a13b6a42f0a59d9bee503638.tar.bz2
opensim-SC-f2b175ef08066649a13b6a42f0a59d9bee503638.tar.xz
* Added some inter-region comms glue for allowing sims to chat amongst themsevles about an agent behind the agent's back.
* Will be using this glue Tomorrow/today to tell other regions what the agent's draw distance is and what region they're actually in so the region can make decisions on what prim to send, if any.
Diffstat (limited to 'OpenSim/Region/Communications/OGS1/OGS1GridServices.cs')
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs86
1 files changed, 86 insertions, 0 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 978111f..c556188 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -462,12 +462,83 @@ namespace OpenSim.Region.Communications.OGS1
462 InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim; 462 InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim;
463 InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing; 463 InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing;
464 InterRegionSingleton.Instance.OnRegionUp += TriggerRegionUp; 464 InterRegionSingleton.Instance.OnRegionUp += TriggerRegionUp;
465 InterRegionSingleton.Instance.OnChildAgentUpdate += TriggerChildAgentUpdate;
465 //InterRegionSingleton.Instance.OnRegionUp += RegionUp; 466 //InterRegionSingleton.Instance.OnRegionUp += RegionUp;
466 } 467 }
467 468
468 #region Methods called by regions in this instance 469 #region Methods called by regions in this instance
469 470
471 public bool ChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData)
472 {
473 RegionInfo regInfo = null;
474 try
475 {
476 if (m_localBackend.ChildAgentUpdate(regionHandle, cAgentData))
477 {
478 return true;
479 }
480
481 regInfo = RequestNeighbourInfo(regionHandle);
482 if (regInfo != null)
483 {
484 //don't want to be creating a new link to the remote instance every time like we are here
485 bool retValue = false;
486
487
488 OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject(
489 typeof(OGS1InterRegionRemoting),
490 "tcp://" + regInfo.RemotingAddress +
491 ":" + regInfo.RemotingPort +
492 "/InterRegions");
493
494 if (remObject != null)
495 {
496 retValue = remObject.ChildAgentUpdate(regionHandle, cAgentData);
497 }
498 else
499 {
500 Console.WriteLine("remoting object not found");
501 }
502 remObject = null;
503 MainLog.Instance.Verbose("INTER", gdebugRegionName + ": OGS1 tried to Update Child Agent data on outside region and got " + retValue.ToString());
504
505 return retValue;
506 }
507
508 return false;
509 }
510 catch (RemotingException e)
511 {
512 MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
513 MainLog.Instance.Debug(e.ToString());
514 return false;
515 }
516 catch (SocketException e)
517 {
518 MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
519 MainLog.Instance.Debug(e.ToString());
520 return false;
521 }
522 catch (InvalidCredentialException e)
523 {
524 MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
525 MainLog.Instance.Debug(e.ToString());
526 return false;
527 }
528 catch (AuthenticationException e)
529 {
530 MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
531 MainLog.Instance.Debug(e.ToString());
532 return false;
533 }
534 catch (Exception e)
535 {
536 MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
537 MainLog.Instance.Debug(e.ToString());
538 return false;
539 }
470 540
541 }
471 542
472 /// <summary> 543 /// <summary>
473 /// 544 ///
@@ -877,6 +948,21 @@ namespace OpenSim.Region.Communications.OGS1
877 return false; 948 return false;
878 } 949 }
879 } 950 }
951 public bool TriggerChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData)
952 {
953 MainLog.Instance.Verbose("INTER", "Incoming OGS1 Child Agent Data Update");
954
955 try
956 {
957 return m_localBackend.TriggerChildAgentUpdate(regionHandle, cAgentData);
958 }
959 catch (RemotingException e)
960 {
961 MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
962 return false;
963 }
964
965 }
880 966
881 /// <summary> 967 /// <summary>
882 /// 968 ///