aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs42
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs23
2 files changed, 55 insertions, 10 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 3b961a5..b4bb2f6 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2104,10 +2104,34 @@ namespace OpenSim.Region.Environment.Scenes
2104 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(AgentId); 2104 UserProfileData UserProfile = CommsManager.UserService.GetUserProfile(AgentId);
2105 if (UserProfile != null) 2105 if (UserProfile != null)
2106 { 2106 {
2107 ulong homeRegion = UserProfile.HomeRegion; 2107 LLUUID homeRegionID = UserProfile.HomeRegionID;
2108 LLVector3 homePostion = new LLVector3(UserProfile.HomeLocationX,UserProfile.HomeLocationY,UserProfile.HomeLocationZ); 2108 LLVector3 homePostion = new LLVector3(UserProfile.HomeLocationX,UserProfile.HomeLocationY,UserProfile.HomeLocationZ);
2109 LLVector3 homeLookat = new LLVector3(UserProfile.HomeLookAt); 2109 LLVector3 homeLookat = new LLVector3(UserProfile.HomeLookAt);
2110 RequestTeleportLocation(client, homeRegion, homePostion,homeLookat,(uint)0); 2110 ulong homeRegionHandle = UserProfile.HomeRegion;
2111 if(homeRegionID == LLUUID.Zero)
2112 {
2113 RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(UserProfile.HomeRegion);
2114 if(info == null)
2115 {
2116 // can't find the region: Tell viewer and abort
2117 client.SendTeleportFailed("Your home-region could not be found.");
2118 return;
2119 }
2120 UserProfile.HomeRegionID = info.RegionID;
2121 CommsManager.UserService.UpdateUserProfileProperties(UserProfile);
2122 }
2123 else
2124 {
2125 RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(homeRegionID);
2126 if(info == null)
2127 {
2128 // can't find the region: Tell viewer and abort
2129 client.SendTeleportFailed("Your home-region could not be found.");
2130 return;
2131 }
2132 homeRegionHandle = info.RegionHandle;
2133 }
2134 RequestTeleportLocation(client, homeRegionHandle, homePostion,homeLookat,(uint)0);
2111 } 2135 }
2112 } 2136 }
2113 2137
@@ -2189,6 +2213,9 @@ namespace OpenSim.Region.Environment.Scenes
2189 { 2213 {
2190 // I know I'm ignoring the regionHandle provided by the teleport location request. 2214 // I know I'm ignoring the regionHandle provided by the teleport location request.
2191 // reusing the TeleportLocationRequest delegate, so regionHandle isn't valid 2215 // reusing the TeleportLocationRequest delegate, so regionHandle isn't valid
2216 UserProfile.HomeRegionID = RegionInfo.RegionID;
2217 // TODO: The next line can be removed, as soon as only homeRegionID based UserServers are around.
2218 // TODO: The HomeRegion property can be removed then, too
2192 UserProfile.HomeRegion = RegionInfo.RegionHandle; 2219 UserProfile.HomeRegion = RegionInfo.RegionHandle;
2193 2220
2194 // We cast these to an int so as not to cause a breaking change with old regions 2221 // We cast these to an int so as not to cause a breaking change with old regions
@@ -2718,13 +2745,20 @@ namespace OpenSim.Region.Environment.Scenes
2718 /// <param name="remoteClient"></param> 2745 /// <param name="remoteClient"></param>
2719 /// <param name="regionHandle"></param> 2746 /// <param name="regionHandle"></param>
2720 /// <param name="position"></param> 2747 /// <param name="position"></param>
2721 public void RequestTeleportLandmark(IClientAPI remoteClient, ulong regionHandle, LLVector3 position) 2748 public void RequestTeleportLandmark(IClientAPI remoteClient, LLUUID regionID, LLVector3 position)
2722 { 2749 {
2750 RegionInfo info = CommsManager.GridService.RequestNeighbourInfo(regionID);
2751 if(info == null)
2752 {
2753 // can't find the region: Tell viewer and abort
2754 remoteClient.SendTeleportFailed("The teleport destination could not be found.");
2755 return;
2756 }
2723 lock (m_scenePresences) 2757 lock (m_scenePresences)
2724 { 2758 {
2725 if (m_scenePresences.ContainsKey(remoteClient.AgentId)) 2759 if (m_scenePresences.ContainsKey(remoteClient.AgentId))
2726 { 2760 {
2727 m_sceneGridService.RequestTeleportToLocation(m_scenePresences[remoteClient.AgentId], regionHandle, 2761 m_sceneGridService.RequestTeleportToLocation(m_scenePresences[remoteClient.AgentId], info.RegionHandle,
2728 position, LLVector3.Zero, 0); 2762 position, LLVector3.Zero, 0);
2729 } 2763 }
2730 } 2764 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 348b643..008d67a 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -532,6 +532,17 @@ namespace OpenSim.Region.Environment.Scenes
532 } 532 }
533 533
534 /// <summary> 534 /// <summary>
535 /// Helper function to request neighbors from grid-comms
536 /// </summary>
537 /// <param name="regionID"></param>
538 /// <returns></returns>
539 public virtual RegionInfo RequestNeighbouringRegionInfo(LLUUID regionID)
540 {
541 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending Grid Services Request about neighbor " + regionID);
542 return m_commsProvider.GridService.RequestNeighbourInfo(regionID);
543 }
544
545 /// <summary>
535 /// Requests map blocks in area of minX, maxX, minY, MaxY in world cordinates 546 /// Requests map blocks in area of minX, maxX, minY, MaxY in world cordinates
536 /// </summary> 547 /// </summary>
537 /// <param name="minX"></param> 548 /// <param name="minX"></param>
@@ -597,8 +608,8 @@ namespace OpenSim.Region.Environment.Scenes
597 // once we reach here... 608 // once we reach here...
598 avatar.Scene.RemoveCapsHandler(avatar.UUID); 609 avatar.Scene.RemoveCapsHandler(avatar.UUID);
599 610
600 m_commsProvider.InterRegion.InformRegionOfChildAgent(regionHandle, agent); 611 m_commsProvider.InterRegion.InformRegionOfChildAgent(reg.RegionHandle, agent);
601 m_commsProvider.InterRegion.ExpectAvatarCrossing(regionHandle, avatar.ControllingClient.AgentId, 612 m_commsProvider.InterRegion.ExpectAvatarCrossing(reg.RegionHandle, avatar.ControllingClient.AgentId,
602 position, false); 613 position, false);
603 AgentCircuitData circuitdata = avatar.ControllingClient.RequestClientInfo(); 614 AgentCircuitData circuitdata = avatar.ControllingClient.RequestClientInfo();
604 615
@@ -610,17 +621,17 @@ namespace OpenSim.Region.Environment.Scenes
610 m_log.DebugFormat( 621 m_log.DebugFormat(
611 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, avatar.UUID); 622 "[CAPS]: Sending new CAPS seed url {0} to client {1}", capsPath, avatar.UUID);
612 623
613 avatar.ControllingClient.SendRegionTeleport(regionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4), 624 avatar.ControllingClient.SendRegionTeleport(reg.RegionHandle, 13, reg.ExternalEndPoint, 4, (1 << 4),
614 capsPath); 625 capsPath);
615 avatar.MakeChildAgent(); 626 avatar.MakeChildAgent();
616 Thread.Sleep(5000); 627 Thread.Sleep(5000);
617 avatar.CrossAttachmentsIntoNewRegion(regionHandle); 628 avatar.CrossAttachmentsIntoNewRegion(reg.RegionHandle);
618 if (KillObject != null) 629 if (KillObject != null)
619 { 630 {
620 KillObject(avatar.LocalId); 631 KillObject(avatar.LocalId);
621 } 632 }
622 uint newRegionX = (uint)(regionHandle >> 40); 633 uint newRegionX = (uint)(reg.RegionHandle >> 40);
623 uint newRegionY = (((uint)(regionHandle)) >> 8); 634 uint newRegionY = (((uint)(reg.RegionHandle)) >> 8);
624 uint oldRegionX = (uint)(m_regionInfo.RegionHandle >> 40); 635 uint oldRegionX = (uint)(m_regionInfo.RegionHandle >> 40);
625 uint oldRegionY = (((uint)(m_regionInfo.RegionHandle)) >> 8); 636 uint oldRegionY = (((uint)(m_regionInfo.RegionHandle)) >> 8);
626 if (Util.fast_distance2d((int)(newRegionX - oldRegionX), (int)(newRegionY - oldRegionY)) > 3) 637 if (Util.fast_distance2d((int)(newRegionX - oldRegionX), (int)(newRegionY - oldRegionY)) > 3)