diff options
author | Teravus Ovares | 2007-11-21 02:17:24 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-11-21 02:17:24 +0000 |
commit | 7cb38712d5ad6781e672e4f1c8500ecd88d85f3e (patch) | |
tree | 5203c9901fdbba5ec8d9a21880d7895f593af540 /OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |
parent | fix for mantis #2 from Justin Casey (IBM) (diff) | |
download | opensim-SC-7cb38712d5ad6781e672e4f1c8500ecd88d85f3e.zip opensim-SC-7cb38712d5ad6781e672e4f1c8500ecd88d85f3e.tar.gz opensim-SC-7cb38712d5ad6781e672e4f1c8500ecd88d85f3e.tar.bz2 opensim-SC-7cb38712d5ad6781e672e4f1c8500ecd88d85f3e.tar.xz |
* Did some initial work for prim crossing. Just glue so far.
* Added the child_get_tasks OpenSim.ini flag for testing the UDP packet sending code and packet throttler. This flag gets purposely disabled in grid mode. This flag also has the consequence that you can see the prim in neighboring regions without going into them. Be warned, this causes tons of dropped packets.
Diffstat (limited to 'OpenSim/Region/Communications/OGS1/OGS1GridServices.cs')
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 164 |
1 files changed, 164 insertions, 0 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index d355f92..fe46632 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | |||
@@ -63,6 +63,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
63 | { | 63 | { |
64 | serversInfo = servers_info; | 64 | serversInfo = servers_info; |
65 | httpServer = httpServe; | 65 | httpServer = httpServe; |
66 | //Respond to Grid Services requests | ||
66 | httpServer.AddXmlRPCHandler("expect_user", ExpectUser); | 67 | httpServer.AddXmlRPCHandler("expect_user", ExpectUser); |
67 | httpServer.AddXmlRPCHandler("check", PingCheckReply); | 68 | httpServer.AddXmlRPCHandler("check", PingCheckReply); |
68 | 69 | ||
@@ -340,7 +341,12 @@ namespace OpenSim.Region.Communications.OGS1 | |||
340 | 341 | ||
341 | return new XmlRpcResponse(); | 342 | return new XmlRpcResponse(); |
342 | } | 343 | } |
344 | |||
343 | 345 | ||
346 | |||
347 | |||
348 | |||
349 | |||
344 | #region m_interRegion Comms | 350 | #region m_interRegion Comms |
345 | 351 | ||
346 | /// <summary> | 352 | /// <summary> |
@@ -357,16 +363,22 @@ namespace OpenSim.Region.Communications.OGS1 | |||
357 | RemotingConfiguration.RegisterWellKnownServiceType(wellType); | 363 | RemotingConfiguration.RegisterWellKnownServiceType(wellType); |
358 | InterRegionSingleton.Instance.OnArrival += TriggerExpectAvatarCrossing; | 364 | InterRegionSingleton.Instance.OnArrival += TriggerExpectAvatarCrossing; |
359 | InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent; | 365 | InterRegionSingleton.Instance.OnChildAgent += IncomingChildAgent; |
366 | InterRegionSingleton.Instance.OnPrimGroupArrival += IncomingPrim; | ||
367 | InterRegionSingleton.Instance.OnPrimGroupNear += TriggerExpectPrimCrossing; | ||
368 | |||
360 | } | 369 | } |
361 | 370 | ||
362 | #region Methods called by regions in this instance | 371 | #region Methods called by regions in this instance |
363 | 372 | ||
373 | |||
374 | |||
364 | /// <summary> | 375 | /// <summary> |
365 | /// | 376 | /// |
366 | /// </summary> | 377 | /// </summary> |
367 | /// <param name="regionHandle"></param> | 378 | /// <param name="regionHandle"></param> |
368 | /// <param name="agentData"></param> | 379 | /// <param name="agentData"></param> |
369 | /// <returns></returns> | 380 | /// <returns></returns> |
381 | |||
370 | public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) | 382 | public bool InformRegionOfChildAgent(ulong regionHandle, AgentCircuitData agentData) |
371 | { | 383 | { |
372 | try | 384 | try |
@@ -432,7 +444,78 @@ namespace OpenSim.Region.Communications.OGS1 | |||
432 | } | 444 | } |
433 | return true; | 445 | return true; |
434 | } | 446 | } |
447 | /// <summary> | ||
448 | /// | ||
449 | /// </summary> | ||
450 | /// <param name="regionHandle"></param> | ||
451 | /// <param name="agentData"></param> | ||
452 | /// <returns></returns> | ||
453 | |||
454 | public bool InformRegionOfPrimCrossing(ulong regionHandle, LLUUID primID, string objData) | ||
455 | { | ||
456 | try | ||
457 | { | ||
458 | if (m_localBackend.InformRegionOfPrimCrossing(regionHandle,primID, objData)) | ||
459 | { | ||
460 | return true; | ||
461 | } | ||
435 | 462 | ||
463 | RegionInfo regInfo = RequestNeighbourInfo(regionHandle); | ||
464 | if (regInfo != null) | ||
465 | { | ||
466 | //don't want to be creating a new link to the remote instance every time like we are here | ||
467 | bool retValue = false; | ||
468 | |||
469 | |||
470 | OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting) Activator.GetObject( | ||
471 | typeof (OGS1InterRegionRemoting), | ||
472 | "tcp://" + regInfo.RemotingAddress + | ||
473 | ":" + regInfo.RemotingPort + | ||
474 | "/InterRegions"); | ||
475 | |||
476 | if (remObject != null) | ||
477 | { | ||
478 | retValue = remObject.InformRegionOfPrimCrossing(regionHandle,primID, objData); | ||
479 | } | ||
480 | else | ||
481 | { | ||
482 | Console.WriteLine("remoting object not found"); | ||
483 | } | ||
484 | remObject = null; | ||
485 | |||
486 | |||
487 | return retValue; | ||
488 | } | ||
489 | |||
490 | return false; | ||
491 | } | ||
492 | catch (RemotingException e) | ||
493 | { | ||
494 | MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); | ||
495 | return false; | ||
496 | } | ||
497 | catch (SocketException e) | ||
498 | { | ||
499 | MainLog.Instance.Error("Socket Error: Unable to connect to remote region.\n" + e.ToString()); | ||
500 | return false; | ||
501 | } | ||
502 | catch (InvalidCredentialException e) | ||
503 | { | ||
504 | MainLog.Instance.Error("Invalid Credentials: Unable to connect to remote region.\n" + e.ToString()); | ||
505 | return false; | ||
506 | } | ||
507 | catch (AuthenticationException e) | ||
508 | { | ||
509 | MainLog.Instance.Error("Authentication exception: Unable to connect to remote region.\n" + e.ToString()); | ||
510 | return false; | ||
511 | } | ||
512 | catch (Exception e) | ||
513 | { | ||
514 | MainLog.Instance.Error("Unknown exception: Unable to connect to remote region.\n" + e.ToString()); | ||
515 | return false; | ||
516 | } | ||
517 | return true; | ||
518 | } | ||
436 | /// <summary> | 519 | /// <summary> |
437 | /// | 520 | /// |
438 | /// </summary> | 521 | /// </summary> |
@@ -484,6 +567,50 @@ namespace OpenSim.Region.Communications.OGS1 | |||
484 | return false; | 567 | return false; |
485 | } | 568 | } |
486 | } | 569 | } |
570 | public bool ExpectPrimCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isPhysical) | ||
571 | { | ||
572 | try | ||
573 | { | ||
574 | if (m_localBackend.TriggerExpectPrimCrossing(regionHandle, agentID, position, isPhysical)) | ||
575 | { | ||
576 | return true; | ||
577 | } | ||
578 | |||
579 | RegionInfo regInfo = RequestNeighbourInfo(regionHandle); | ||
580 | if (regInfo != null) | ||
581 | { | ||
582 | bool retValue = false; | ||
583 | OGS1InterRegionRemoting remObject = (OGS1InterRegionRemoting)Activator.GetObject( | ||
584 | typeof(OGS1InterRegionRemoting), | ||
585 | "tcp://" + regInfo.RemotingAddress + | ||
586 | ":" + regInfo.RemotingPort + | ||
587 | "/InterRegions"); | ||
588 | if (remObject != null) | ||
589 | { | ||
590 | retValue = remObject.ExpectAvatarCrossing(regionHandle, agentID, position, isPhysical); | ||
591 | } | ||
592 | else | ||
593 | { | ||
594 | Console.WriteLine("remoting object not found"); | ||
595 | } | ||
596 | remObject = null; | ||
597 | |||
598 | return retValue; | ||
599 | } | ||
600 | //TODO need to see if we know about where this region is and use .net remoting | ||
601 | // to inform it. | ||
602 | return false; | ||
603 | } | ||
604 | catch (RemotingException e) | ||
605 | { | ||
606 | MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); | ||
607 | return false; | ||
608 | } | ||
609 | catch | ||
610 | { | ||
611 | return false; | ||
612 | } | ||
613 | } | ||
487 | 614 | ||
488 | public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) | 615 | public void TellRegionToCloseChildConnection(ulong regionHandle, LLUUID agentID) |
489 | { | 616 | { |
@@ -495,6 +622,10 @@ namespace OpenSim.Region.Communications.OGS1 | |||
495 | return m_localBackend.AcknowledgeAgentCrossed(regionHandle, agentId); | 622 | return m_localBackend.AcknowledgeAgentCrossed(regionHandle, agentId); |
496 | } | 623 | } |
497 | 624 | ||
625 | public bool AcknowledgePrimCrossed(ulong regionHandle, LLUUID primId) | ||
626 | { | ||
627 | return m_localBackend.AcknowledgePrimCrossed(regionHandle, primId); | ||
628 | } | ||
498 | #endregion | 629 | #endregion |
499 | 630 | ||
500 | #region Methods triggered by calls from external instances | 631 | #region Methods triggered by calls from external instances |
@@ -522,6 +653,27 @@ namespace OpenSim.Region.Communications.OGS1 | |||
522 | /// | 653 | /// |
523 | /// </summary> | 654 | /// </summary> |
524 | /// <param name="regionHandle"></param> | 655 | /// <param name="regionHandle"></param> |
656 | /// <param name="agentData"></param> | ||
657 | /// <returns></returns> | ||
658 | public bool IncomingPrim(ulong regionHandle, LLUUID primID, string objData) | ||
659 | { | ||
660 | // Is this necessary? | ||
661 | try | ||
662 | { | ||
663 | //return m_localBackend.TriggerExpectPrim(regionHandle,primID, objData); | ||
664 | //m_localBackend. | ||
665 | return false; | ||
666 | } | ||
667 | catch (RemotingException e) | ||
668 | { | ||
669 | MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); | ||
670 | return false; | ||
671 | } | ||
672 | } | ||
673 | /// <summary> | ||
674 | /// | ||
675 | /// </summary> | ||
676 | /// <param name="regionHandle"></param> | ||
525 | /// <param name="agentID"></param> | 677 | /// <param name="agentID"></param> |
526 | /// <param name="position"></param> | 678 | /// <param name="position"></param> |
527 | /// <returns></returns> | 679 | /// <returns></returns> |
@@ -537,6 +689,18 @@ namespace OpenSim.Region.Communications.OGS1 | |||
537 | return false; | 689 | return false; |
538 | } | 690 | } |
539 | } | 691 | } |
692 | public bool TriggerExpectPrimCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isPhysical) | ||
693 | { | ||
694 | try | ||
695 | { | ||
696 | return m_localBackend.TriggerExpectPrimCrossing(regionHandle, agentID, position, isPhysical); | ||
697 | } | ||
698 | catch (RemotingException e) | ||
699 | { | ||
700 | MainLog.Instance.Error("Remoting Error: Unable to connect to remote region.\n" + e.ToString()); | ||
701 | return false; | ||
702 | } | ||
703 | } | ||
540 | 704 | ||
541 | #endregion | 705 | #endregion |
542 | 706 | ||