aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Data/MySQL/MySQLManager.cs10
-rw-r--r--OpenSim/Data/MySQL/MySQLUserData.cs2
-rw-r--r--OpenSim/Data/SQLite/SQLiteUserData.cs7
-rw-r--r--OpenSim/Framework/Communications/IGridServices.cs2
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Framework/UserProfileData.cs10
-rw-r--r--OpenSim/Grid/UserServer/UserManager.cs7
-rw-r--r--OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs2
-rw-r--r--OpenSim/Region/Communications/Local/LocalBackEndServices.cs10
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1UserServices.cs4
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs42
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs23
12 files changed, 105 insertions, 16 deletions
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs
index 89d0672..297b1a7 100644
--- a/OpenSim/Data/MySQL/MySQLManager.cs
+++ b/OpenSim/Data/MySQL/MySQLManager.cs
@@ -538,6 +538,10 @@ namespace OpenSim.Data.MySQL
538 Convert.ToSingle(reader["homeLookAtY"].ToString()), 538 Convert.ToSingle(reader["homeLookAtY"].ToString()),
539 Convert.ToSingle(reader["homeLookAtZ"].ToString())); 539 Convert.ToSingle(reader["homeLookAtZ"].ToString()));
540 540
541 LLUUID regionID = LLUUID.Zero;
542 LLUUID.TryParse(reader["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero
543 retval.HomeRegionID = regionID;
544
541 retval.Created = Convert.ToInt32(reader["created"].ToString()); 545 retval.Created = Convert.ToInt32(reader["created"].ToString());
542 retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString()); 546 retval.LastLogin = Convert.ToInt32(reader["lastLogin"].ToString());
543 547
@@ -583,6 +587,7 @@ namespace OpenSim.Data.MySQL
583 LLUUID.TryParse((string)reader["webLoginKey"], out tmp); 587 LLUUID.TryParse((string)reader["webLoginKey"], out tmp);
584 retval.WebLoginKey = tmp; 588 retval.WebLoginKey = tmp;
585 } 589 }
590
586 } 591 }
587 else 592 else
588 { 593 {
@@ -806,7 +811,7 @@ namespace OpenSim.Data.MySQL
806 /// <param name="webLoginKey">UUID for weblogin Key</param> 811 /// <param name="webLoginKey">UUID for weblogin Key</param>
807 /// <returns>Success?</returns> 812 /// <returns>Success?</returns>
808 public bool updateUserRow(LLUUID uuid, string username, string lastname, string passwordHash, 813 public bool updateUserRow(LLUUID uuid, string username, string lastname, string passwordHash,
809 string passwordSalt, UInt64 homeRegion, float homeLocX, float homeLocY, float homeLocZ, 814 string passwordSalt, UInt64 homeRegion, LLUUID homeRegionID, float homeLocX, float homeLocY, float homeLocZ,
810 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin, 815 float homeLookAtX, float homeLookAtY, float homeLookAtZ, int created, int lastlogin,
811 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask, 816 string inventoryURI, string assetURI, uint canDoMask, uint wantDoMask,
812 string aboutText, string firstText, 817 string aboutText, string firstText,
@@ -814,7 +819,7 @@ namespace OpenSim.Data.MySQL
814 { 819 {
815 string sql = "UPDATE users SET `username` = ?username , `lastname` = ?lastname "; 820 string sql = "UPDATE users SET `username` = ?username , `lastname` = ?lastname ";
816 sql += ", `passwordHash` = ?passwordHash , `passwordSalt` = ?passwordSalt , "; 821 sql += ", `passwordHash` = ?passwordHash , `passwordSalt` = ?passwordSalt , ";
817 sql += "`homeRegion` = ?homeRegion , `homeLocationX` = ?homeLocationX , "; 822 sql += "`homeRegion` = ?homeRegion , `homeRegionID` = ?homeRegionID, `homeLocationX` = ?homeLocationX , ";
818 sql += "`homeLocationY` = ?homeLocationY , `homeLocationZ` = ?homeLocationZ , "; 823 sql += "`homeLocationY` = ?homeLocationY , `homeLocationZ` = ?homeLocationZ , ";
819 sql += "`homeLookAtX` = ?homeLookAtX , `homeLookAtY` = ?homeLookAtY , "; 824 sql += "`homeLookAtX` = ?homeLookAtX , `homeLookAtY` = ?homeLookAtY , ";
820 sql += "`homeLookAtZ` = ?homeLookAtZ , `created` = ?created , `lastLogin` = ?lastLogin , "; 825 sql += "`homeLookAtZ` = ?homeLookAtZ , `created` = ?created , `lastLogin` = ?lastLogin , ";
@@ -831,6 +836,7 @@ namespace OpenSim.Data.MySQL
831 parameters["?passwordHash"] = passwordHash.ToString(); 836 parameters["?passwordHash"] = passwordHash.ToString();
832 parameters["?passwordSalt"] = passwordSalt.ToString(); 837 parameters["?passwordSalt"] = passwordSalt.ToString();
833 parameters["?homeRegion"] = homeRegion.ToString(); 838 parameters["?homeRegion"] = homeRegion.ToString();
839 parameters["?homeRegionID"] = homeRegionID.ToString();
834 parameters["?homeLocationX"] = homeLocX.ToString(); 840 parameters["?homeLocationX"] = homeLocX.ToString();
835 parameters["?homeLocationY"] = homeLocY.ToString(); 841 parameters["?homeLocationY"] = homeLocY.ToString();
836 parameters["?homeLocationZ"] = homeLocZ.ToString(); 842 parameters["?homeLocationZ"] = homeLocZ.ToString();
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs
index 131823a..d7bf2a8 100644
--- a/OpenSim/Data/MySQL/MySQLUserData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserData.cs
@@ -682,7 +682,7 @@ namespace OpenSim.Data.MySQL
682 lock (database) 682 lock (database)
683 { 683 {
684 database.updateUserRow(user.ID, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt, 684 database.updateUserRow(user.ID, user.FirstName, user.SurName, user.PasswordHash, user.PasswordSalt,
685 user.HomeRegion, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, user.HomeLookAt.X, 685 user.HomeRegion, user.HomeRegionID, user.HomeLocation.X, user.HomeLocation.Y, user.HomeLocation.Z, user.HomeLookAt.X,
686 user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, user.UserInventoryURI, 686 user.HomeLookAt.Y, user.HomeLookAt.Z, user.Created, user.LastLogin, user.UserInventoryURI,
687 user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText, 687 user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText,
688 user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey); 688 user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey);
diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs
index 45b4dc6..21c9dbc 100644
--- a/OpenSim/Data/SQLite/SQLiteUserData.cs
+++ b/OpenSim/Data/SQLite/SQLiteUserData.cs
@@ -662,6 +662,7 @@ namespace OpenSim.Data.SQLite
662 662
663 SQLiteUtil.createCol(users, "homeRegionX", typeof (Int32)); 663 SQLiteUtil.createCol(users, "homeRegionX", typeof (Int32));
664 SQLiteUtil.createCol(users, "homeRegionY", typeof (Int32)); 664 SQLiteUtil.createCol(users, "homeRegionY", typeof (Int32));
665 SQLiteUtil.createCol(users, "homeRegionID", typeof (String));
665 SQLiteUtil.createCol(users, "homeLocationX", typeof (Double)); 666 SQLiteUtil.createCol(users, "homeLocationX", typeof (Double));
666 SQLiteUtil.createCol(users, "homeLocationY", typeof (Double)); 667 SQLiteUtil.createCol(users, "homeLocationY", typeof (Double));
667 SQLiteUtil.createCol(users, "homeLocationZ", typeof (Double)); 668 SQLiteUtil.createCol(users, "homeLocationZ", typeof (Double));
@@ -769,6 +770,11 @@ namespace OpenSim.Data.SQLite
769 Convert.ToSingle(row["homeLookAtY"]), 770 Convert.ToSingle(row["homeLookAtY"]),
770 Convert.ToSingle(row["homeLookAtZ"]) 771 Convert.ToSingle(row["homeLookAtZ"])
771 ); 772 );
773
774 LLUUID regionID = LLUUID.Zero;
775 LLUUID.TryParse(row["homeRegionID"].ToString(), out regionID); // it's ok if it doesn't work; just use LLUUID.Zero
776 user.HomeRegionID = regionID;
777
772 user.Created = Convert.ToInt32(row["created"]); 778 user.Created = Convert.ToInt32(row["created"]);
773 user.LastLogin = Convert.ToInt32(row["lastLogin"]); 779 user.LastLogin = Convert.ToInt32(row["lastLogin"]);
774 user.RootInventoryFolderID = new LLUUID((String) row["rootInventoryFolderID"]); 780 user.RootInventoryFolderID = new LLUUID((String) row["rootInventoryFolderID"]);
@@ -803,6 +809,7 @@ namespace OpenSim.Data.SQLite
803 809
804 row["homeRegionX"] = user.HomeRegionX; 810 row["homeRegionX"] = user.HomeRegionX;
805 row["homeRegionY"] = user.HomeRegionY; 811 row["homeRegionY"] = user.HomeRegionY;
812 row["homeRegionID"] = user.HomeRegionID;
806 row["homeLocationX"] = user.HomeLocation.X; 813 row["homeLocationX"] = user.HomeLocation.X;
807 row["homeLocationY"] = user.HomeLocation.Y; 814 row["homeLocationY"] = user.HomeLocation.Y;
808 row["homeLocationZ"] = user.HomeLocation.Z; 815 row["homeLocationZ"] = user.HomeLocation.Z;
diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs
index 39f04c3..3ecda68 100644
--- a/OpenSim/Framework/Communications/IGridServices.cs
+++ b/OpenSim/Framework/Communications/IGridServices.cs
@@ -26,6 +26,7 @@
26 */ 26 */
27 27
28using System.Collections.Generic; 28using System.Collections.Generic;
29using libsecondlife;
29 30
30namespace OpenSim.Framework.Communications 31namespace OpenSim.Framework.Communications
31{ 32{
@@ -52,6 +53,7 @@ namespace OpenSim.Framework.Communications
52 List<SimpleRegionInfo> RequestNeighbours(uint x, uint y); 53 List<SimpleRegionInfo> RequestNeighbours(uint x, uint y);
53 54
54 RegionInfo RequestNeighbourInfo(ulong regionHandle); 55 RegionInfo RequestNeighbourInfo(ulong regionHandle);
56 RegionInfo RequestNeighbourInfo(LLUUID regionID);
55 RegionInfo RequestClosestRegion(string regionName); 57 RegionInfo RequestClosestRegion(string regionName);
56 Dictionary<string, string> GetGridSettings(); 58 Dictionary<string, string> GetGridSettings();
57 List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); 59 List<MapBlockData> RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY);
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index 893a783..66ea3ea 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -81,7 +81,7 @@ namespace OpenSim.Framework
81 IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags); 81 IClientAPI remoteClient, ulong regionHandle, LLVector3 position, LLVector3 lookAt, uint flags);
82 82
83 public delegate void TeleportLandmarkRequest( 83 public delegate void TeleportLandmarkRequest(
84 IClientAPI remoteClient, ulong regionHandle, LLVector3 position); 84 IClientAPI remoteClient, LLUUID regionID, LLVector3 position);
85 85
86 public delegate void DisconnectUser(); 86 public delegate void DisconnectUser();
87 87
diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs
index 17d339e..2b0e15f 100644
--- a/OpenSim/Framework/UserProfileData.cs
+++ b/OpenSim/Framework/UserProfileData.cs
@@ -149,6 +149,16 @@ namespace OpenSim.Framework
149 } 149 }
150 } 150 }
151 151
152 private LLUUID _homeRegionID;
153 /// <summary>
154 /// The regionID of the users home region. This is unique; even if the position of the region changes within the grid, this will refer to the same region.
155 /// </summary>
156 public LLUUID HomeRegionID
157 {
158 get { return _homeRegionID; }
159 set { _homeRegionID = value; }
160 }
161
152 // Property wrappers 162 // Property wrappers
153 public virtual LLUUID ID 163 public virtual LLUUID ID
154 { 164 {
diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs
index a43ade1..36f2a0d 100644
--- a/OpenSim/Grid/UserServer/UserManager.cs
+++ b/OpenSim/Grid/UserServer/UserManager.cs
@@ -151,6 +151,7 @@ namespace OpenSim.Grid.UserServer
151 responseData["home_coordinates_z"] = profile.HomeLocation.Z.ToString(); 151 responseData["home_coordinates_z"] = profile.HomeLocation.Z.ToString();
152 152
153 responseData["home_region"] = profile.HomeRegion.ToString(); 153 responseData["home_region"] = profile.HomeRegion.ToString();
154 responseData["home_region_id"] = profile.HomeRegionID.ToString();
154 155
155 responseData["home_look_x"] = profile.HomeLookAt.X.ToString(); 156 responseData["home_look_x"] = profile.HomeLookAt.X.ToString();
156 responseData["home_look_y"] = profile.HomeLookAt.Y.ToString(); 157 responseData["home_look_y"] = profile.HomeLookAt.Y.ToString();
@@ -564,6 +565,12 @@ namespace OpenSim.Grid.UserServer
564 } 565 }
565 566
566 } 567 }
568 if (requestData.Contains("home_region_id"))
569 {
570 LLUUID regionID = LLUUID.Zero;
571 LLUUID.TryParse((string)requestData["home_region_id"], out regionID);
572 userProfile.HomeRegionID = regionID;
573 }
567 if (requestData.Contains("home_pos_x")) 574 if (requestData.Contains("home_pos_x"))
568 { 575 {
569 try 576 try
diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
index 12e5452..245f533 100644
--- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs
@@ -5241,7 +5241,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
5241 handlerTeleportLandmarkRequest = OnTeleportLandmarkRequest; 5241 handlerTeleportLandmarkRequest = OnTeleportLandmarkRequest;
5242 if (handlerTeleportLandmarkRequest != null) 5242 if (handlerTeleportLandmarkRequest != null)
5243 { 5243 {
5244 handlerTeleportLandmarkRequest(this, lm.RegionHandle, lm.Position); 5244 handlerTeleportLandmarkRequest(this, lm.RegionID, lm.Position);
5245 } 5245 }
5246 else 5246 else
5247 { 5247 {
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 8d6bbcc..a608da0 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -172,6 +172,16 @@ namespace OpenSim.Region.Communications.Local
172 return null; 172 return null;
173 } 173 }
174 174
175 public RegionInfo RequestNeighbourInfo(LLUUID regionID)
176 {
177 // TODO add a dictionary for faster lookup
178 foreach(RegionInfo info in m_regions.Values)
179 {
180 if(info.RegionID == regionID) return info;
181 }
182 return null;
183 }
184
175 public RegionInfo RequestClosestRegion(string regionName) 185 public RegionInfo RequestClosestRegion(string regionName)
176 { 186 {
177 foreach (RegionInfo regInfo in m_regions.Values) 187 foreach (RegionInfo regInfo in m_regions.Values)
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index c6f905f..2d37e2f 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -75,6 +75,8 @@ namespace OpenSim.Region.Communications.OGS1
75 userData.Image = new LLUUID((string) data["profile_image"]); 75 userData.Image = new LLUUID((string) data["profile_image"]);
76 userData.LastLogin = Convert.ToInt32((string) data["profile_lastlogin"]); 76 userData.LastLogin = Convert.ToInt32((string) data["profile_lastlogin"]);
77 userData.HomeRegion = Convert.ToUInt64((string) data["home_region"]); 77 userData.HomeRegion = Convert.ToUInt64((string) data["home_region"]);
78 if(data.Contains("home_region_id")) userData.HomeRegionID = new LLUUID((string)data["home_region_id"]);
79 else userData.HomeRegionID = LLUUID.Zero;
78 userData.HomeLocation = 80 userData.HomeLocation =
79 new LLVector3((float) Convert.ToDecimal((string) data["home_coordinates_x"]), 81 new LLVector3((float) Convert.ToDecimal((string) data["home_coordinates_x"]),
80 (float) Convert.ToDecimal((string) data["home_coordinates_y"]), 82 (float) Convert.ToDecimal((string) data["home_coordinates_y"]),
@@ -83,7 +85,6 @@ namespace OpenSim.Region.Communications.OGS1
83 new LLVector3((float) Convert.ToDecimal((string) data["home_look_x"]), 85 new LLVector3((float) Convert.ToDecimal((string) data["home_look_x"]),
84 (float) Convert.ToDecimal((string) data["home_look_y"]), 86 (float) Convert.ToDecimal((string) data["home_look_y"]),
85 (float) Convert.ToDecimal((string) data["home_look_z"])); 87 (float) Convert.ToDecimal((string) data["home_look_z"]));
86
87 return userData; 88 return userData;
88 } 89 }
89 90
@@ -453,6 +454,7 @@ namespace OpenSim.Region.Communications.OGS1
453 //param["ProfileURL"] = UserProfile.ProfileURL.ToString(); 454 //param["ProfileURL"] = UserProfile.ProfileURL.ToString();
454 455
455 param["home_region"] = UserProfile.HomeRegion.ToString(); 456 param["home_region"] = UserProfile.HomeRegion.ToString();
457 param["home_region_id"] = UserProfile.HomeRegionID.ToString();
456 458
457 param["home_pos_x"] = UserProfile.HomeLocationX.ToString(); 459 param["home_pos_x"] = UserProfile.HomeLocationX.ToString();
458 param["home_pos_y"] = UserProfile.HomeLocationY.ToString(); 460 param["home_pos_y"] = UserProfile.HomeLocationY.ToString();
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)