fix: allowing explicit setting of UUID for master avatar in
CreateRegion (and documenting it).0.6.0-stable
parent
dc7e3ddc3e
commit
44052a1423
|
@ -448,17 +448,28 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||||
string masterPassword = (string)requestData["region_master_password"];
|
string masterPassword = (string)requestData["region_master_password"];
|
||||||
|
|
||||||
UUID userID = UUID.Zero;
|
UUID userID = UUID.Zero;
|
||||||
UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(masterFirst, masterLast);
|
if (requestData.ContainsKey("region_master_uuid"))
|
||||||
if (null == userProfile)
|
|
||||||
{
|
{
|
||||||
m_log.InfoFormat("master avatar does not exist, creating it");
|
// ok, client wants us to use an explicit UUID
|
||||||
userID = m_app.CreateUser(masterFirst, masterLast, masterPassword, region.RegionLocX, region.RegionLocY);
|
// regardless of what the avatar name provided
|
||||||
if (userID == UUID.Zero) throw new Exception(String.Format("failed to create new user {0} {1}",
|
userID = new UUID((string)requestData["region_master_uuid"]);
|
||||||
masterFirst, masterLast));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
userID = userProfile.ID;
|
// no client supplied UUID: look it up...
|
||||||
|
UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(masterFirst, masterLast);
|
||||||
|
if (null == userProfile)
|
||||||
|
{
|
||||||
|
m_log.InfoFormat("master avatar does not exist, creating it");
|
||||||
|
// ...or create new user
|
||||||
|
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.MasterAvatarFirstName = masterFirst;
|
||||||
|
|
Loading…
Reference in New Issue