aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/Scene.cs
diff options
context:
space:
mode:
authorMelanie Thielker2008-08-14 00:04:37 +0000
committerMelanie Thielker2008-08-14 00:04:37 +0000
commite3157e61aa50d057b4345cb9d49c973afeb26b15 (patch)
tree8452565ff0d7e6c3d07541743e0e5f665bc7d03c /OpenSim/Region/Environment/Scenes/Scene.cs
parent* minor: make it clear on the console when a client is being logged out becau... (diff)
downloadopensim-SC_OLD-e3157e61aa50d057b4345cb9d49c973afeb26b15.zip
opensim-SC_OLD-e3157e61aa50d057b4345cb9d49c973afeb26b15.tar.gz
opensim-SC_OLD-e3157e61aa50d057b4345cb9d49c973afeb26b15.tar.bz2
opensim-SC_OLD-e3157e61aa50d057b4345cb9d49c973afeb26b15.tar.xz
Mantis #1946
Thank you, HomerHorwitz, for a patch that corrects and improves TP to landmark and home position handling.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs42
1 files changed, 38 insertions, 4 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 }