diff options
author | Charles Krinke | 2008-09-05 23:38:42 +0000 |
---|---|---|
committer | Charles Krinke | 2008-09-05 23:38:42 +0000 |
commit | da244d1e90843264e5db3b0d9f91a1509e974dd1 (patch) | |
tree | 7aba21b8c3f0314480b161de939c7a02312216e7 /OpenSim/Grid/UserServer/UserLoginService.cs | |
parent | Mantis#2126. Thank you kindly, Ralphos for a patch that addresses: (diff) | |
download | opensim-SC-da244d1e90843264e5db3b0d9f91a1509e974dd1.zip opensim-SC-da244d1e90843264e5db3b0d9f91a1509e974dd1.tar.gz opensim-SC-da244d1e90843264e5db3b0d9f91a1509e974dd1.tar.bz2 opensim-SC-da244d1e90843264e5db3b0d9f91a1509e974dd1.tar.xz |
Mantis#2048. Thank you kindly, HomerHorwitz for a patch that:
The attached patch (against r6075) fixes it for grid-mode. If the
home-region isn't available, the stored regionHandle will be used
to compute the region-coordinates of the home. This will be wrong
if the home-region has moved, of course, but without the region
being online we can't request the RegionInfo of it for finding out.
Doing that (before the patch) and accessing the (null) RegionInfo
led to a NullReferenceException, which prevented logging in to the
last location.
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 | } |