aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorMelanie2013-03-22 01:01:24 +0000
committerMelanie2013-03-22 01:01:24 +0000
commit68b910c1ff03d241e2aec65ebe67ffaa58babbf6 (patch)
tree7b59aed339b6d13602b0ba9d65d04b9a920abe00 /OpenSim/Region/CoreModules
parentMerge branch 'avination' into careminster (diff)
parentImplement chat across region borders since we can tell if avatars in neighbou... (diff)
downloadopensim-SC_OLD-68b910c1ff03d241e2aec65ebe67ffaa58babbf6.zip
opensim-SC_OLD-68b910c1ff03d241e2aec65ebe67ffaa58babbf6.tar.gz
opensim-SC_OLD-68b910c1ff03d241e2aec65ebe67ffaa58babbf6.tar.bz2
opensim-SC_OLD-68b910c1ff03d241e2aec65ebe67ffaa58babbf6.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs10
-rw-r--r--OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs12
-rw-r--r--OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs46
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferStateMachine.cs9
-rwxr-xr-xOpenSim/Region/CoreModules/Framework/Statistics/Logging/LogWriter.cs2
7 files changed, 56 insertions, 29 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
index c94d152..f62512e 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs
@@ -573,8 +573,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments
573 } 573 }
574 574
575// m_log.DebugFormat( 575// m_log.DebugFormat(
576// "[ATTACHMENTS MODULE]: Detaching object {0} {1} for {2} in {3}", 576// "[ATTACHMENTS MODULE]: Detaching object {0} {1} (FromItemID {2}) for {3} in {4}",
577// so.Name, so.LocalId, sp.Name, m_scene.Name); 577// so.Name, so.LocalId, so.FromItemID, sp.Name, m_scene.Name);
578 578
579 // Scripts MUST be snapshotted before the object is 579 // Scripts MUST be snapshotted before the object is
580 // removed from the scene because doing otherwise will 580 // removed from the scene because doing otherwise will
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
index dee8ce3..a8fe045 100644
--- a/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
@@ -829,7 +829,13 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
829 sceneB, config, new CapabilitiesModule(), etmB, attModB, new BasicInventoryAccessModule()); 829 sceneB, config, new CapabilitiesModule(), etmB, attModB, new BasicInventoryAccessModule());
830 830
831 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(sceneA, 0x1); 831 UserAccount ua1 = UserAccountHelpers.CreateUserWithInventory(sceneA, 0x1);
832 ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, ua1.PrincipalID, sh.SceneManager); 832
833 AgentCircuitData acd = SceneHelpers.GenerateAgentData(ua1.PrincipalID);
834 TestClient tc = new TestClient(acd, sceneA, sh.SceneManager);
835 List<TestClient> destinationTestClients = new List<TestClient>();
836 EntityTransferHelpers.SetUpInformClientOfNeighbour(tc, destinationTestClients);
837
838 ScenePresence beforeTeleportSp = SceneHelpers.AddScenePresence(sceneA, tc, acd, sh.SceneManager);
833 beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32); 839 beforeTeleportSp.AbsolutePosition = new Vector3(30, 31, 32);
834 840
835 InventoryItemBase attItem = CreateAttachmentItem(sceneA, ua1.PrincipalID, "att", 0x10, 0x20); 841 InventoryItemBase attItem = CreateAttachmentItem(sceneA, ua1.PrincipalID, "att", 0x10, 0x20);
@@ -848,7 +854,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments.Tests
848 teleportLookAt, 854 teleportLookAt,
849 (uint)TeleportFlags.ViaLocation); 855 (uint)TeleportFlags.ViaLocation);
850 856
851 ((TestClient)beforeTeleportSp.ControllingClient).CompleteTeleportClientSide(); 857 destinationTestClients[0].CompleteMovement();
852 858
853 // Check attachments have made it into sceneB 859 // Check attachments have made it into sceneB
854 ScenePresence afterTeleportSceneBSp = sceneB.GetScenePresence(ua1.PrincipalID); 860 ScenePresence afterTeleportSceneBSp = sceneB.GetScenePresence(ua1.PrincipalID);
diff --git a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
index 864f33e..51fe1ea 100644
--- a/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/AvatarFactory/AvatarFactoryModule.cs
@@ -361,7 +361,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
361 361
362 public void QueueAppearanceSave(UUID agentid) 362 public void QueueAppearanceSave(UUID agentid)
363 { 363 {
364 // m_log.WarnFormat("[AVFACTORY]: Queue appearance save for {0}", agentid); 364// m_log.DebugFormat("[AVFACTORY]: Queueing appearance save for {0}", agentid);
365 365
366 // 10000 ticks per millisecond, 1000 milliseconds per second 366 // 10000 ticks per millisecond, 1000 milliseconds per second
367 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 1000 * 10000); 367 long timestamp = DateTime.Now.Ticks + Convert.ToInt64(m_savetime * 1000 * 10000);
@@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
658 return; 658 return;
659 } 659 }
660 660
661 // m_log.WarnFormat("[AVFACTORY] avatar {0} save appearance",agentid); 661// m_log.DebugFormat("[AVFACTORY]: Saving appearance for avatar {0}", agentid);
662 662
663 // This could take awhile since it needs to pull inventory 663 // This could take awhile since it needs to pull inventory
664 // We need to do it at the point of save so that there is a sufficient delay for any upload of new body part/shape 664 // We need to do it at the point of save so that there is a sufficient delay for any upload of new body part/shape
@@ -667,6 +667,14 @@ namespace OpenSim.Region.CoreModules.Avatar.AvatarFactory
667 // multiple save requests. 667 // multiple save requests.
668 SetAppearanceAssets(sp.UUID, sp.Appearance); 668 SetAppearanceAssets(sp.UUID, sp.Appearance);
669 669
670// List<AvatarAttachment> attachments = sp.Appearance.GetAttachments();
671// foreach (AvatarAttachment att in attachments)
672// {
673// m_log.DebugFormat(
674// "[AVFACTORY]: For {0} saving attachment {1} at point {2}",
675// sp.Name, att.ItemID, att.AttachPoint);
676// }
677
670 m_scene.AvatarService.SetAppearance(agentid, sp.Appearance); 678 m_scene.AvatarService.SetAppearance(agentid, sp.Appearance);
671 679
672 // Trigger this here because it's the final step in the set/queue/save process for appearance setting. 680 // Trigger this here because it's the final step in the set/queue/save process for appearance setting.
diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
index 4c3f1cc..174642d 100644
--- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
+++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs
@@ -256,7 +256,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat
256 // If camera is moved into client, then camera position can be used 256 // If camera is moved into client, then camera position can be used
257 // MT: No, it can't, as chat is heard from the avatar position, not 257 // MT: No, it can't, as chat is heard from the avatar position, not
258 // the camera position. 258 // the camera position.
259 s.ForEachRootScenePresence( 259 s.ForEachScenePresence(
260 delegate(ScenePresence presence) 260 delegate(ScenePresence presence)
261 { 261 {
262 if (destination != UUID.Zero && presence.UUID != destination) 262 if (destination != UUID.Zero && presence.UUID != destination)
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)