Adding support to set start region and lookat for an avatar via
XmlRpc.
0.6.0-stable
Dr Scofield 2008-10-30 15:24:52 +00:00
parent 537cd4708f
commit e8615f0fee
1 changed files with 28 additions and 7 deletions

View File

@ -817,15 +817,28 @@ namespace OpenSim.ApplicationPlugins.RemoteController
string passwd = String.Empty;
uint? regX = null;
uint? regY = null;
uint? ulaX = null;
uint? ulaY = null;
uint? ulaZ = null;
uint? usaX = null;
uint? usaY = null;
uint? usaZ = null;
if (requestData.ContainsKey("user_password")) passwd = (string) requestData["user_password"];
if (requestData.ContainsKey("start_region_x")) regX = Convert.ToUInt32((Int32)requestData["start_region_x"]);
if (requestData.ContainsKey("start_region_y")) regY = Convert.ToUInt32((Int32)requestData["start_region_y"]);
if (String.Empty == passwd && null == regX && null == regY)
throw new Exception("neither user_password nor start_region_x nor start_region_y provided");
if (requestData.ContainsKey("user_password")) passwd = (string) requestData["user_password"];
if (requestData.ContainsKey("start_region_x")) regX = Convert.ToUInt32((Int32)requestData["start_region_x"]);
if (requestData.ContainsKey("start_region_y")) regY = Convert.ToUInt32((Int32)requestData["start_region_y"]);
if (requestData.ContainsKey("start_lookat_x")) ulaY = Convert.ToUInt32((Int32)requestData["start_lookat_x"]);
if (requestData.ContainsKey("start_lookat_y")) ulaY = Convert.ToUInt32((Int32)requestData["start_lookat_y"]);
if (requestData.ContainsKey("start_lookat_z")) ulaY = Convert.ToUInt32((Int32)requestData["start_lookat_z"]);
if (requestData.ContainsKey("start_standat_x")) usaY = Convert.ToUInt32((Int32)requestData["start_standat_x"]);
if (requestData.ContainsKey("start_standat_y")) usaY = Convert.ToUInt32((Int32)requestData["start_standat_y"]);
if (requestData.ContainsKey("start_standat_z")) usaY = Convert.ToUInt32((Int32)requestData["start_standat_z"]);
UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(firstname, lastname);
if (null == userProfile)
throw new Exception(String.Format("avatar {0} {1} does not exist", firstname, lastname));
@ -835,8 +848,16 @@ namespace OpenSim.ApplicationPlugins.RemoteController
userProfile.PasswordHash = md5PasswdHash;
}
if (null != regX) userProfile.HomeRegionX = (uint)regX;
if (null != regY) userProfile.HomeRegionY = (uint)regY;
if (null != regX) userProfile.HomeRegionX = (uint)regX;
if (null != regY) userProfile.HomeRegionY = (uint)regY;
if (null != usaX) userProfile.HomeLocationX = (uint)usaX;
if (null != usaY) userProfile.HomeLocationY = (uint)usaY;
if (null != usaZ) userProfile.HomeLocationZ = (uint)usaZ;
if (null != ulaX) userProfile.HomeLookAtX = (uint)ulaX;
if (null != ulaY) userProfile.HomeLookAtY = (uint)ulaY;
if (null != ulaZ) userProfile.HomeLookAtZ = (uint)ulaZ;
if (!m_app.CommunicationsManager.UserService.UpdateUserProfile(userProfile))
throw new Exception("did not manage to update user profile");