diff options
author | Melanie | 2013-03-22 01:01:24 +0000 |
---|---|---|
committer | Melanie | 2013-03-22 01:01:24 +0000 |
commit | 68b910c1ff03d241e2aec65ebe67ffaa58babbf6 (patch) | |
tree | 7b59aed339b6d13602b0ba9d65d04b9a920abe00 /OpenSim/Region/CoreModules/Framework | |
parent | Merge branch 'avination' into careminster (diff) | |
parent | Implement chat across region borders since we can tell if avatars in neighbou... (diff) | |
download | opensim-SC-68b910c1ff03d241e2aec65ebe67ffaa58babbf6.zip opensim-SC-68b910c1ff03d241e2aec65ebe67ffaa58babbf6.tar.gz opensim-SC-68b910c1ff03d241e2aec65ebe67ffaa58babbf6.tar.bz2 opensim-SC-68b910c1ff03d241e2aec65ebe67ffaa58babbf6.tar.xz |
Merge branch 'master' into careminster
Conflicts:
OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
3 files changed, 35 insertions, 22 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index b2c9564..195d7a9 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -520,12 +520,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
520 | "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for teleport of {0} from {1} to {2}. Continuing.", | 520 | "[ENTITY TRANSFER MODULE]: Failed validation of all attachments for teleport of {0} from {1} to {2}. Continuing.", |
521 | sp.Name, sp.Scene.RegionInfo.RegionName, finalDestination.RegionName); | 521 | sp.Name, sp.Scene.RegionInfo.RegionName, finalDestination.RegionName); |
522 | 522 | ||
523 | // if (!sp.ValidateAttachments()) | ||
524 | // { | ||
525 | // sp.ControllingClient.SendTeleportFailed("Inconsistent attachment state"); | ||
526 | // return; | ||
527 | // } | ||
528 | |||
529 | string reason; | 523 | string reason; |
530 | string version; | 524 | string version; |
531 | if (!Scene.SimulationService.QueryAccess( | 525 | if (!Scene.SimulationService.QueryAccess( |
@@ -588,6 +582,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
588 | } | 582 | } |
589 | 583 | ||
590 | // Let's create an agent there if one doesn't exist yet. | 584 | // Let's create an agent there if one doesn't exist yet. |
585 | // NOTE: logout will always be false for a non-HG teleport. | ||
591 | bool logout = false; | 586 | bool logout = false; |
592 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) | 587 | if (!CreateAgent(sp, reg, finalDestination, agentCircuit, teleportFlags, out reason, out logout)) |
593 | { | 588 | { |
@@ -630,11 +625,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
630 | 625 | ||
631 | if (m_eqModule != null) | 626 | if (m_eqModule != null) |
632 | { | 627 | { |
628 | // The EnableSimulator message makes the client establish a connection with the destination | ||
629 | // simulator by sending the initial UseCircuitCode UDP packet to the destination containing the | ||
630 | // correct circuit code. | ||
633 | m_eqModule.EnableSimulator(destinationHandle, endPoint, sp.UUID); | 631 | m_eqModule.EnableSimulator(destinationHandle, endPoint, sp.UUID); |
634 | 632 | ||
635 | // ES makes the client send a UseCircuitCode message to the destination, | 633 | // XXX: Is this wait necessary? We will always end up waiting on UpdateAgent for the destination |
636 | // which triggers a bunch of things there. | 634 | // simulator to confirm that it has established communication with the viewer. |
637 | // So let's wait | ||
638 | Thread.Sleep(200); | 635 | Thread.Sleep(200); |
639 | 636 | ||
640 | // At least on LL 3.3.4 for teleports between different regions on the same simulator this appears | 637 | // At least on LL 3.3.4 for teleports between different regions on the same simulator this appears |
@@ -645,6 +642,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
645 | } | 642 | } |
646 | else | 643 | else |
647 | { | 644 | { |
645 | // XXX: This is a little misleading since we're information the client of its avatar destination, | ||
646 | // which may or may not be a neighbour region of the source region. This path is probably little | ||
647 | // used anyway (with EQ being the one used). But it is currently being used for test code. | ||
648 | sp.ControllingClient.InformClientOfNeighbour(destinationHandle, endPoint); | 648 | sp.ControllingClient.InformClientOfNeighbour(destinationHandle, endPoint); |
649 | } | 649 | } |
650 | } | 650 | } |
@@ -662,14 +662,17 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
662 | 662 | ||
663 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent..."); | 663 | //sp.ControllingClient.SendTeleportProgress(teleportFlags, "Updating agent..."); |
664 | 664 | ||
665 | // A common teleport failure occurs when we can send CreateAgent to the | ||
666 | // destination region but the viewer cannot establish the connection (e.g. due to network issues between | ||
667 | // the viewer and the destination). In this case, UpdateAgent timesout after 10 seconds, although then | ||
668 | // there's a further 10 second wait whilst we attempt to tell the destination to delete the agent in Fail(). | ||
665 | if (!UpdateAgent(reg, finalDestination, agent, sp)) | 669 | if (!UpdateAgent(reg, finalDestination, agent, sp)) |
666 | { | 670 | { |
667 | // Region doesn't take it | ||
668 | m_log.WarnFormat( | 671 | m_log.WarnFormat( |
669 | "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1} from {2}. Returning avatar to source region.", | 672 | "[ENTITY TRANSFER MODULE]: UpdateAgent failed on teleport of {0} to {1} from {2}. Keeping avatar in source region.", |
670 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); | 673 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); |
671 | 674 | ||
672 | Fail(sp, finalDestination, logout); | 675 | Fail(sp, finalDestination, logout, "Connection between viewer and destination region could not be established."); |
673 | return; | 676 | return; |
674 | } | 677 | } |
675 | 678 | ||
@@ -688,6 +691,11 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
688 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", | 691 | "[ENTITY TRANSFER MODULE]: Sending new CAPS seed url {0} from {1} to {2}", |
689 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); | 692 | capsPath, sp.Scene.RegionInfo.RegionName, sp.Name); |
690 | 693 | ||
694 | // We need to set this here to avoid an unlikely race condition when teleporting to a neighbour simulator, | ||
695 | // where that neighbour simulator could otherwise request a child agent create on the source which then | ||
696 | // closes our existing agent which is still signalled as root. | ||
697 | sp.IsChildAgent = true; | ||
698 | |||
691 | if (m_eqModule != null) | 699 | if (m_eqModule != null) |
692 | { | 700 | { |
693 | m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID); | 701 | m_eqModule.TeleportFinishEvent(destinationHandle, 13, endPoint, 0, teleportFlags, capsPath, sp.UUID); |
@@ -698,9 +706,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
698 | teleportFlags, capsPath); | 706 | teleportFlags, capsPath); |
699 | } | 707 | } |
700 | 708 | ||
701 | // Let's set this to true tentatively. This does not trigger OnChildAgent | ||
702 | sp.IsChildAgent = true; | ||
703 | |||
704 | // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which | 709 | // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which |
705 | // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation | 710 | // trigers a whole shebang of things there, including MakeRoot. So let's wait for confirmation |
706 | // that the client contacted the destination before we close things here. | 711 | // that the client contacted the destination before we close things here. |
@@ -710,7 +715,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
710 | "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} from {2} failed due to no callback from destination region. Returning avatar to source region.", | 715 | "[ENTITY TRANSFER MODULE]: Teleport of {0} to {1} from {2} failed due to no callback from destination region. Returning avatar to source region.", |
711 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); | 716 | sp.Name, finalDestination.RegionName, sp.Scene.RegionInfo.RegionName); |
712 | 717 | ||
713 | Fail(sp, finalDestination, logout); | 718 | Fail(sp, finalDestination, logout, "Destination region did not signal teleport completion."); |
714 | return; | 719 | return; |
715 | } | 720 | } |
716 | 721 | ||
@@ -733,8 +738,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
733 | // Now let's make it officially a child agent | 738 | // Now let's make it officially a child agent |
734 | sp.MakeChildAgent(); | 739 | sp.MakeChildAgent(); |
735 | 740 | ||
736 | // sp.Scene.CleanDroppedAttachments(); | ||
737 | |||
738 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone | 741 | // Finally, let's close this previously-known-as-root agent, when the jump is outside the view zone |
739 | 742 | ||
740 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) | 743 | if (NeedsClosing(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, reg)) |
@@ -793,12 +796,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
793 | /// <param name='sp'></param> | 796 | /// <param name='sp'></param> |
794 | /// <param name='finalDestination'></param> | 797 | /// <param name='finalDestination'></param> |
795 | /// <param name='logout'></param> | 798 | /// <param name='logout'></param> |
796 | protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout) | 799 | /// <param name='reason'>Human readable reason for teleport failure. Will be sent to client.</param> |
800 | protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout, string reason) | ||
797 | { | 801 | { |
798 | CleanupAbortedInterRegionTeleport(sp, finalDestination); | 802 | CleanupAbortedInterRegionTeleport(sp, finalDestination); |
799 | 803 | ||
800 | sp.ControllingClient.SendTeleportFailed( | 804 | sp.ControllingClient.SendTeleportFailed( |
801 | string.Format("Problems connecting to destination {0}", finalDestination.RegionName)); | 805 | string.Format( |
806 | "Problems connecting to destination {0}, reason: {1}", finalDestination.RegionName, reason)); | ||
807 | |||
802 | sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout); | 808 | sp.Scene.EventManager.TriggerTeleportFail(sp.ControllingClient, logout); |
803 | } | 809 | } |
804 | 810 | ||
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs index 8b2cd09..b4f09ac 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs | |||
@@ -292,8 +292,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
292 | 292 | ||
293 | // There should be no race condition here since no other code should be removing the agent transfer or | 293 | // There should be no race condition here since no other code should be removing the agent transfer or |
294 | // changing the state to another other than Transferring => ReceivedAtDestination. | 294 | // changing the state to another other than Transferring => ReceivedAtDestination. |
295 | while (m_agentsInTransit[id] != AgentTransferState.ReceivedAtDestination && count-- > 0) | 295 | |
296 | while (count-- > 0) | ||
296 | { | 297 | { |
298 | lock (m_agentsInTransit) | ||
299 | { | ||
300 | if (m_agentsInTransit[id] == AgentTransferState.ReceivedAtDestination) | ||
301 | break; | ||
302 | } | ||
303 | |||
297 | // m_log.Debug(" >>> Waiting... " + count); | 304 | // m_log.Debug(" >>> Waiting... " + count); |
298 | Thread.Sleep(100); | 305 | Thread.Sleep(100); |
299 | } | 306 | } |
diff --git a/OpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs index 3c8e0ef..2fe9026 100755 --- a/OpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs +++ b/OpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs | |||
@@ -136,7 +136,7 @@ namespace OpenSim.Region.CoreModules.Framework.Statistics.Logging | |||
136 | { | 136 | { |
137 | lock (m_logFileWriteLock) | 137 | lock (m_logFileWriteLock) |
138 | { | 138 | { |
139 | DateTime now = DateTime.Now; | 139 | DateTime now = DateTime.UtcNow; |
140 | if (m_logFile == null || now > m_logFileEndTime) | 140 | if (m_logFile == null || now > m_logFileEndTime) |
141 | { | 141 | { |
142 | if (m_logFile != null) | 142 | if (m_logFile != null) |