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.0.6.0-stable
parent
947242f476
commit
da244d1e90
|
@ -215,13 +215,33 @@ namespace OpenSim.Grid.UserServer
|
||||||
// Customise the response
|
// Customise the response
|
||||||
//CFK: This is redundant and the next message should always appear.
|
//CFK: This is redundant and the next message should always appear.
|
||||||
//CFK: m_log.Info("[LOGIN]: Home Location");
|
//CFK: m_log.Info("[LOGIN]: Home Location");
|
||||||
response.Home =
|
if (HomeInfo != null)
|
||||||
string.Format(
|
{
|
||||||
"{{'region_handle':[r{0},r{1}], 'position':[r{2},r{3},r{4}], 'look_at':[r{5},r{6},r{7}]}}",
|
response.Home =
|
||||||
(HomeInfo.regionLocX*Constants.RegionSize),
|
string.Format(
|
||||||
(HomeInfo.regionLocY*Constants.RegionSize),
|
"{{'region_handle':[r{0},r{1}], 'position':[r{2},r{3},r{4}], 'look_at':[r{5},r{6},r{7}]}}",
|
||||||
theUser.HomeLocation.X, theUser.HomeLocation.Y, theUser.HomeLocation.Z,
|
(HomeInfo.regionLocX*Constants.RegionSize),
|
||||||
theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z);
|
(HomeInfo.regionLocY*Constants.RegionSize),
|
||||||
|
theUser.HomeLocation.X, theUser.HomeLocation.Y, theUser.HomeLocation.Z,
|
||||||
|
theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Emergency mode: Home-region isn't available, so we can't request the region info.
|
||||||
|
// Use the stored home regionHandle instead.
|
||||||
|
// NOTE: If the home-region moves, this will be wrong until the users update their user-profile again
|
||||||
|
ulong regionX = theUser.HomeRegion >> 32;
|
||||||
|
ulong regionY = theUser.HomeRegion & 0xffffffff;
|
||||||
|
response.Home =
|
||||||
|
string.Format(
|
||||||
|
"{{'region_handle':[r{0},r{1}], 'position':[r{2},r{3},r{4}], 'look_at':[r{5},r{6},r{7}]}}",
|
||||||
|
regionX, regionY,
|
||||||
|
theUser.HomeLocation.X, theUser.HomeLocation.Y, theUser.HomeLocation.Z,
|
||||||
|
theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z);
|
||||||
|
m_log.InfoFormat("[LOGIN] Home region of user {0} {1} is not available; using computed region position {2} {3}",
|
||||||
|
theUser.FirstName, theUser.SurName,
|
||||||
|
regionX, regionY);
|
||||||
|
}
|
||||||
|
|
||||||
// Destination
|
// Destination
|
||||||
//CFK: The "Notifying" message always seems to appear, so subsume the data from this message into
|
//CFK: The "Notifying" message always seems to appear, so subsume the data from this message into
|
||||||
|
@ -507,4 +527,4 @@ namespace OpenSim.Grid.UserServer
|
||||||
userID));
|
userID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue