diff options
Diffstat (limited to 'OpenSim/Grid/UserServer/UserLoginService.cs')
-rw-r--r-- | OpenSim/Grid/UserServer/UserLoginService.cs | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 198f95c..1f84346 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs | |||
@@ -215,13 +215,33 @@ namespace OpenSim.Grid.UserServer | |||
215 | // Customise the response | 215 | // Customise the response |
216 | //CFK: This is redundant and the next message should always appear. | 216 | //CFK: This is redundant and the next message should always appear. |
217 | //CFK: m_log.Info("[LOGIN]: Home Location"); | 217 | //CFK: m_log.Info("[LOGIN]: Home Location"); |
218 | response.Home = | 218 | if (HomeInfo != null) |
219 | string.Format( | 219 | { |
220 | "{{'region_handle':[r{0},r{1}], 'position':[r{2},r{3},r{4}], 'look_at':[r{5},r{6},r{7}]}}", | 220 | response.Home = |
221 | (HomeInfo.regionLocX*Constants.RegionSize), | 221 | string.Format( |
222 | (HomeInfo.regionLocY*Constants.RegionSize), | 222 | "{{'region_handle':[r{0},r{1}], 'position':[r{2},r{3},r{4}], 'look_at':[r{5},r{6},r{7}]}}", |
223 | theUser.HomeLocation.X, theUser.HomeLocation.Y, theUser.HomeLocation.Z, | 223 | (HomeInfo.regionLocX*Constants.RegionSize), |
224 | theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z); | 224 | (HomeInfo.regionLocY*Constants.RegionSize), |
225 | theUser.HomeLocation.X, theUser.HomeLocation.Y, theUser.HomeLocation.Z, | ||
226 | theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z); | ||
227 | } | ||
228 | else | ||
229 | { | ||
230 | // Emergency mode: Home-region isn't available, so we can't request the region info. | ||
231 | // Use the stored home regionHandle instead. | ||
232 | // NOTE: If the home-region moves, this will be wrong until the users update their user-profile again | ||
233 | ulong regionX = theUser.HomeRegion >> 32; | ||
234 | ulong regionY = theUser.HomeRegion & 0xffffffff; | ||
235 | response.Home = | ||
236 | string.Format( | ||
237 | "{{'region_handle':[r{0},r{1}], 'position':[r{2},r{3},r{4}], 'look_at':[r{5},r{6},r{7}]}}", | ||
238 | regionX, regionY, | ||
239 | theUser.HomeLocation.X, theUser.HomeLocation.Y, theUser.HomeLocation.Z, | ||
240 | theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z); | ||
241 | m_log.InfoFormat("[LOGIN] Home region of user {0} {1} is not available; using computed region position {2} {3}", | ||
242 | theUser.FirstName, theUser.SurName, | ||
243 | regionX, regionY); | ||
244 | } | ||
225 | 245 | ||
226 | // Destination | 246 | // Destination |
227 | //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into | 247 | //CFK: The "Notifying" message always seems to appear, so subsume the data from this message into |
@@ -507,4 +527,4 @@ namespace OpenSim.Grid.UserServer | |||
507 | userID)); | 527 | userID)); |
508 | } | 528 | } |
509 | } | 529 | } |
510 | } \ No newline at end of file | 530 | } |