From 244bfcde5b86180981e99ac9e88eb394f20bcd09 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 17 Apr 2008 05:07:14 +0000 Subject: * Implements 'Set Home to Here' * Implements 'Teleport Home' * User Server has to be updated for it to save your home in grid mode * home position accuracy is in int because the grid comms ExpectUser method tries to convert to Uint and crashes if it gets a float. Added a convert to decimal in ExpectUser but to avoid a breaking change with old revisions, kept the save value in int for now. Eventually it needs to be a float, but lets release another incremental version before doing that. --- OpenSim/Grid/UserServer/UserManager.cs | 87 ++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) (limited to 'OpenSim/Grid/UserServer/UserManager.cs') diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index cf3f8d8..2a53d7b 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -363,6 +363,93 @@ namespace OpenSim.Grid.UserServer if (requestData.Contains("ProfileURL")) { } + if (requestData.Contains("home_region")) + { + try + { + userProfile.HomeRegion = Convert.ToUInt64((string)requestData["home_region"]); + } + catch (ArgumentException) + { + m_log.Error("[PROFILE]:Failed to set home region, Invalid Argument"); + } + catch (FormatException) + { + m_log.Error("[PROFILE]:Failed to set home region, Invalid Format"); + } + catch (OverflowException) + { + m_log.Error("[PROFILE]:Failed to set home region, Value was too large"); + } + + } + if (requestData.Contains("home_pos_x")) + { + try + { + userProfile.HomeLocationX = (float)Convert.ToDecimal((string)requestData["home_pos_x"]); + } + catch (System.InvalidCastException) + { + m_log.Error("[PROFILE]:Failed to set home postion x"); + } + + } + if (requestData.Contains("home_pos_y")) + { + try + { + userProfile.HomeLocationY = (float)Convert.ToDecimal((string)requestData["home_pos_y"]); + } + catch (System.InvalidCastException) + { + m_log.Error("[PROFILE]:Failed to set home postion y"); + } + } + if (requestData.Contains("home_pos_z")) + { + try + { + userProfile.HomeLocationZ = (float)Convert.ToDecimal((string)requestData["home_pos_z"]); + } + catch (System.InvalidCastException) + { + m_log.Error("[PROFILE]:Failed to set home postion z"); + } + } + if (requestData.Contains("home_look_x")) + { + try + { + userProfile.HomeLookAtX = (float)Convert.ToDecimal((string)requestData["home_look_x"]); + } + catch (System.InvalidCastException) + { + m_log.Error("[PROFILE]:Failed to set home lookat x"); + } + } + if (requestData.Contains("home_look_y")) + { + try + { + userProfile.HomeLookAtY = (float)Convert.ToDecimal((string)requestData["home_look_y"]); + } + catch (System.InvalidCastException) + { + m_log.Error("[PROFILE]:Failed to set home lookat y"); + } + } + if (requestData.Contains("home_look_z")) + { + try + { + userProfile.HomeLookAtZ = (float)Convert.ToDecimal((string)requestData["home_look_z"]); + } + catch (System.InvalidCastException) + { + m_log.Error("[PROFILE]:Failed to set home lookat z"); + } + } // call plugin! bool ret = UpdateUserProfileProperties(userProfile); responseData["returnString"] = ret.ToString(); -- cgit v1.1