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
parent
4dcafab286
commit
dc7e3ddc3e
|
@ -441,12 +441,30 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY));
|
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"];
|
string masterFirst = (string)requestData["region_master_first"];
|
||||||
region.MasterAvatarLastName = (string) requestData["region_master_last"];
|
string masterLast = (string)requestData["region_master_last"];
|
||||||
region.MasterAvatarSandboxPassword = (string) requestData["region_master_password"];
|
string masterPassword = (string)requestData["region_master_password"];
|
||||||
region.MasterAvatarAssignedUUID = new UUID(requestData["region_master_uuid"].ToString());
|
|
||||||
|
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"]);
|
bool persist = Convert.ToBoolean((string)requestData["persist"]);
|
||||||
if (persist)
|
if (persist)
|
||||||
|
|
Loading…
Reference in New Issue