aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
diff options
context:
space:
mode:
authordiva2008-12-31 00:18:24 +0000
committerdiva2008-12-31 00:18:24 +0000
commit5de40aaf46bc956fb6c25b36fb01b5a1cde2d30d (patch)
treebe412389f4a2ce944dfaabdabf4b79ba47b61c2d /OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
parentRemoving unnecessary null checks on structs in AgentsData pack/unpack. (diff)
downloadopensim-SC_OLD-5de40aaf46bc956fb6c25b36fb01b5a1cde2d30d.zip
opensim-SC_OLD-5de40aaf46bc956fb6c25b36fb01b5a1cde2d30d.tar.gz
opensim-SC_OLD-5de40aaf46bc956fb6c25b36fb01b5a1cde2d30d.tar.bz2
opensim-SC_OLD-5de40aaf46bc956fb6c25b36fb01b5a1cde2d30d.tar.xz
Added a SendChildAgentDataUpdate call on Teleports, so that the agent at the destination will have all the necessary information.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs40
1 files changed, 25 insertions, 15 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 7385725..2bf81d8 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -791,33 +791,34 @@ namespace OpenSim.Region.Environment.Scenes
791 //avatar.Scene.RemoveCapsHandler(avatar.UUID); 791 //avatar.Scene.RemoveCapsHandler(avatar.UUID);
792 792
793 793
794 // Let's close some agents
795 avatar.CloseChildAgents(newRegionX, newRegionY);
796
797 string capsPath = String.Empty; 794 string capsPath = String.Empty;
798 AgentCircuitData agent = avatar.ControllingClient.RequestClientInfo(); 795 AgentCircuitData agentCircuit = avatar.ControllingClient.RequestClientInfo();
799 agent.BaseFolder = UUID.Zero; 796 agentCircuit.BaseFolder = UUID.Zero;
800 agent.InventoryFolder = UUID.Zero; 797 agentCircuit.InventoryFolder = UUID.Zero;
801 agent.startpos = position; 798 agentCircuit.startpos = position;
802 agent.child = true; 799 agentCircuit.child = true;
803 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) 800 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
804 { 801 {
805 // brand new agent, let's create a new caps seed 802 // brand new agent, let's create a new caps seed
806 agent.CapsPath = Util.GetRandomCapsPath(); 803 agentCircuit.CapsPath = Util.GetRandomCapsPath();
807 } 804 }
808 805
809 if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent)) 806 // Let's create an agent there if one doesn't exist yet.
807 if (!m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agentCircuit))
810 { 808 {
811 avatar.ControllingClient.SendTeleportFailed("Destination is not accepting teleports."); 809 avatar.ControllingClient.SendTeleportFailed("Destination is not accepting teleports.");
812 return; 810 return;
813 } 811 }
814 812
813 // OK, it got this agent. Let's close some child agents
814 avatar.CloseChildAgents(newRegionX, newRegionY);
815
815 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) 816 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
816 { 817 {
817 // TODO Should construct this behind a method 818 // TODO Should construct this behind a method
818 capsPath = 819 capsPath =
819 "http://" + reg.ExternalHostName + ":" + reg.HttpPort 820 "http://" + reg.ExternalHostName + ":" + reg.HttpPort
820 + "/CAPS/" + agent.CapsPath + "0000/"; 821 + "/CAPS/" + agentCircuit.CapsPath + "0000/";
821 822
822 if (eq != null) 823 if (eq != null)
823 { 824 {
@@ -839,9 +840,9 @@ namespace OpenSim.Region.Environment.Scenes
839 } 840 }
840 else 841 else
841 { 842 {
842 agent.CapsPath = avatar.Scene.GetChildSeed(avatar.UUID, reg.RegionHandle); 843 agentCircuit.CapsPath = avatar.Scene.GetChildSeed(avatar.UUID, reg.RegionHandle);
843 capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort 844 capsPath = "http://" + reg.ExternalHostName + ":" + reg.HttpPort
844 + "/CAPS/" + agent.CapsPath + "0000/"; 845 + "/CAPS/" + agentCircuit.CapsPath + "0000/";
845 } 846 }
846 847
847 // Expect avatar crossing is a heavy-duty function at the destination. 848 // Expect avatar crossing is a heavy-duty function at the destination.
@@ -859,6 +860,13 @@ namespace OpenSim.Region.Environment.Scenes
859 // return; 860 // return;
860 //} 861 //}
861 862
863 // Let's send a full update of the agent. This is a synchronous call.
864 AgentData agent = new AgentData();
865 avatar.CopyTo(agent);
866 agent.Position = new Vector3(-1, -1, -1); // this means ignore position info; UGH!!!!
867
868 m_interregionCommsOut.SendChildAgentUpdate(reg.RegionHandle, agent);
869
862 avatar.MakeChildAgent(); 870 avatar.MakeChildAgent();
863 871
864 m_log.DebugFormat( 872 m_log.DebugFormat(
@@ -885,7 +893,9 @@ namespace OpenSim.Region.Environment.Scenes
885 // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which 893 // TeleportFinish makes the client send CompleteMovementIntoRegion (at the destination), which
886 // trigers a whole shebang of things there, including MakeRoot. So let's wait plenty before 894 // trigers a whole shebang of things there, including MakeRoot. So let's wait plenty before
887 // we send the attachments and close things here. 895 // we send the attachments and close things here.
888 Thread.Sleep(3000); 896 // We need to change this part of the protocol. The receiving region should tell this region
897 // when it's ok to continue.
898 Thread.Sleep(4000);
889 899
890 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it 900 // CrossAttachmentsIntoNewRegion is a synchronous call. We shouldn't need to wait after it
891 avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle, true); 901 avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle, true);
@@ -894,7 +904,7 @@ namespace OpenSim.Region.Environment.Scenes
894 904
895 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY)) 905 if (Util.IsOutsideView(oldRegionX, newRegionX, oldRegionY, newRegionY))
896 { 906 {
897 Thread.Sleep(5000); 907 Thread.Sleep(8000);
898 avatar.Close(); 908 avatar.Close();
899 CloseConnection(avatar.UUID); 909 CloseConnection(avatar.UUID);
900 } 910 }