fix: recent patch to XmlRpcCreateRegionMethod introduced master avatar

UUID parameter without checking for it at the method entry. this patch
adds logic to obtain the master UUID via the user profile service,
and, if the master avatar does not exist, will create the user. in any
case the UUID is then the one supplied by the user profile service.
0.6.0-stable
Dr Scofield 2008-10-23 11:14:25 +00:00
parent 4dcafab286
commit dc7e3ddc3e
1 changed files with 23 additions and 5 deletions

View File

@ -441,12 +441,30 @@ namespace OpenSim.ApplicationPlugins.RemoteController
scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY));
region.ExternalHostName = (string) requestData["external_address"];
region.ExternalHostName = (string)requestData["external_address"];
region.MasterAvatarFirstName = (string) requestData["region_master_first"];
region.MasterAvatarLastName = (string) requestData["region_master_last"];
region.MasterAvatarSandboxPassword = (string) requestData["region_master_password"];
region.MasterAvatarAssignedUUID = new UUID(requestData["region_master_uuid"].ToString());
string masterFirst = (string)requestData["region_master_first"];
string masterLast = (string)requestData["region_master_last"];
string masterPassword = (string)requestData["region_master_password"];
UUID userID = UUID.Zero;
UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(masterFirst, masterLast);
if (null == userProfile)
{
m_log.InfoFormat("master avatar does not exist, creating it");
userID = m_app.CreateUser(masterFirst, masterLast, masterPassword, region.RegionLocX, region.RegionLocY);
if (userID == UUID.Zero) throw new Exception(String.Format("failed to create new user {0} {1}",
masterFirst, masterLast));
}
else
{
userID = userProfile.ID;
}
region.MasterAvatarFirstName = masterFirst;
region.MasterAvatarLastName = masterLast;
region.MasterAvatarSandboxPassword = masterPassword;
region.MasterAvatarAssignedUUID = userID;
bool persist = Convert.ToBoolean((string)requestData["persist"]);
if (persist)