From fae34bb10cfa10702faf5c19d8c8517faa018cb5 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 9 Sep 2008 01:26:48 +0000 Subject: Update svn properties, formatting cleanup. --- OpenSim/Grid/UserServer/UserLoginService.cs | 30 ++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index f22e084..07b29bd 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -194,13 +194,13 @@ namespace OpenSim.Grid.UserServer { start_x = Convert.ToInt32(startLocationRequestParsed[1]); start_y = Convert.ToInt32(startLocationRequestParsed[2]); - start_z = Convert.ToInt32(startLocationRequestParsed[3]); - + start_z = Convert.ToInt32(startLocationRequestParsed[3]); + if (start_x >= 0 && start_y >= 0 && start_z >= 0) { Vector3 tmp_v = new Vector3(start_x, start_y, start_z); theUser.CurrentAgent.Position = tmp_v; - } + } } } } @@ -242,7 +242,7 @@ namespace OpenSim.Grid.UserServer // Load information from the gridserver ulong defaultHandle = (((ulong) m_config.DefaultX * Constants.RegionSize) << 32) | ((ulong) m_config.DefaultY * Constants.RegionSize); - + if (defaultHandle == SimInfo.regionHandle) { m_log.ErrorFormat("[LOGIN]: Not trying the default region since this is the same as the selected region"); @@ -250,7 +250,7 @@ namespace OpenSim.Grid.UserServer } m_log.Error("[LOGIN]: Sending user to default region " + defaultHandle + " instead"); - + SimInfo = RegionProfileData.RequestSimProfileData(defaultHandle, m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey); // Customise the response @@ -260,18 +260,18 @@ namespace OpenSim.Grid.UserServer (SimInfo.regionLocX * Constants.RegionSize), (SimInfo.regionLocY*Constants.RegionSize), theUser.HomeLocation.X, theUser.HomeLocation.Y, theUser.HomeLocation.Z, - theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z); - + theUser.HomeLookAt.X, theUser.HomeLookAt.Y, theUser.HomeLookAt.Z); + if (!PrepareLoginToRegion(SimInfo, theUser, response)) { response.CreateDeadRegionResponse(); return false; } } - + return true; } - + /// /// Prepare a login to the given region. This involves both telling the region to expect a connection /// and appropriately customising the response to the user. @@ -283,7 +283,7 @@ namespace OpenSim.Grid.UserServer private bool PrepareLoginToRegion(RegionProfileData sim, UserProfileData user, LoginResponse response) { try - { + { response.SimAddress = Util.GetHostFromURL(sim.serverURI).ToString(); response.SimPort = uint.Parse(sim.serverURI.Split(new char[] {'/', ':'})[4]); response.RegionX = sim.regionLocX; @@ -300,7 +300,7 @@ namespace OpenSim.Grid.UserServer // Update agent with target sim user.CurrentAgent.Region = sim.UUID; - user.CurrentAgent.Handle = sim.regionHandle; + user.CurrentAgent.Handle = sim.regionHandle; // Prepare notification Hashtable SimParams = new Hashtable(); @@ -317,7 +317,7 @@ namespace OpenSim.Grid.UserServer SimParams["caps_path"] = capsPath; ArrayList SendParams = new ArrayList(); SendParams.Add(SimParams); - + // Send XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); XmlRpcResponse GridResp = GridReq.Send(sim.httpServerURI, 30000); @@ -363,13 +363,13 @@ namespace OpenSim.Grid.UserServer m_log.ErrorFormat("[LOGIN]: XmlRpc request to region failed with message {0}, code {1} ", GridResp.FaultString, GridResp.FaultCode); return false; } - } + } catch (Exception e) { m_log.ErrorFormat("[LOGIN]: Region not available for login, {0}", e); return false; - } - + } + return true; } -- cgit v1.1