fix: allowing explicit setting of UUID for master avatar in

CreateRegion (and documenting it).
0.6.0-stable
Dr Scofield 2008-10-23 12:10:58 +00:00
parent dc7e3ddc3e
commit 44052a1423
1 changed files with 18 additions and 7 deletions

View File

@ -448,10 +448,20 @@ 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;
if (requestData.ContainsKey("region_master_uuid"))
{
// ok, client wants us to use an explicit UUID
// regardless of what the avatar name provided
userID = new UUID((string)requestData["region_master_uuid"]);
}
else
{
// no client supplied UUID: look it up...
UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(masterFirst, masterLast); UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(masterFirst, masterLast);
if (null == userProfile) if (null == userProfile)
{ {
m_log.InfoFormat("master avatar does not exist, creating it"); 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); 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}", if (userID == UUID.Zero) throw new Exception(String.Format("failed to create new user {0} {1}",
masterFirst, masterLast)); masterFirst, masterLast));
@ -460,6 +470,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{ {
userID = userProfile.ID; userID = userProfile.ID;
} }
}
region.MasterAvatarFirstName = masterFirst; region.MasterAvatarFirstName = masterFirst;
region.MasterAvatarLastName = masterLast; region.MasterAvatarLastName = masterLast;