From 9f635e354bea7b4b211012959e585ce7fa25cf3c Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 26 Aug 2008 03:07:24 +0000 Subject: [PATCH] * Fixed a bug that occurred if your home region wasn't logged in, in standalone. It wouldn't let you in even if your destination region is online with a 'region x not found' message. * The purpose of the check was to ensure that your home region was sent to your client properly when you connected. However, the desired result is that if the home region is down, but the destination region is online, the user should still get in. * Changes: if the home region isn't available, set the message to the client so that the home region is the destination region. --- .../Communications/Local/LocalLoginService.cs | 42 +++++++++++++------ 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 864d58c047..aeb9ae07aa 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -183,19 +183,37 @@ namespace OpenSim.Region.Communications.Local RegionInfo homeReg = m_Parent.GridService.RequestNeighbourInfo(theUser.HomeRegion); RegionInfo reg = m_Parent.GridService.RequestNeighbourInfo(currentRegion); - if ((homeReg != null) && (reg != null)) + if ((homeReg != null) || (reg != null)) { - response.Home = "{'region_handle':[r" + - (homeReg.RegionLocX * Constants.RegionSize).ToString() + ",r" + - (homeReg.RegionLocY * Constants.RegionSize).ToString() + "], " + - "'position':[r" + - theUser.HomeLocation.X.ToString() + ",r" + - theUser.HomeLocation.Y.ToString() + ",r" + - theUser.HomeLocation.Z.ToString() + "], " + - "'look_at':[r" + - theUser.HomeLocation.X.ToString() + ",r" + - theUser.HomeLocation.Y.ToString() + ",r" + - theUser.HomeLocation.Z.ToString() + "]}"; + if (homeReg != null) + { + response.Home = "{'region_handle':[r" + + (homeReg.RegionLocX * Constants.RegionSize).ToString() + ",r" + + (homeReg.RegionLocY * Constants.RegionSize).ToString() + "], " + + "'position':[r" + + theUser.HomeLocation.X.ToString() + ",r" + + theUser.HomeLocation.Y.ToString() + ",r" + + theUser.HomeLocation.Z.ToString() + "], " + + "'look_at':[r" + + theUser.HomeLocation.X.ToString() + ",r" + + theUser.HomeLocation.Y.ToString() + ",r" + + theUser.HomeLocation.Z.ToString() + "]}"; + } + else + { + m_log.Warn("[LOGIN]: Your home region doesn't exist"); + response.Home = "{'region_handle':[r" + + (reg.RegionLocX * Constants.RegionSize).ToString() + ",r" + + (reg.RegionLocY * Constants.RegionSize).ToString() + "], " + + "'position':[r" + + theUser.HomeLocation.X.ToString() + ",r" + + theUser.HomeLocation.Y.ToString() + ",r" + + theUser.HomeLocation.Z.ToString() + "], " + + "'look_at':[r" + + theUser.HomeLocation.X.ToString() + ",r" + + theUser.HomeLocation.Y.ToString() + ",r" + + theUser.HomeLocation.Z.ToString() + "]}"; + } string capsPath = Util.GetRandomCapsPath(); response.SimAddress = reg.ExternalEndPoint.Address.ToString(); response.SimPort = (uint) reg.ExternalEndPoint.Port;