Remove all references to master avatar, replacing with estate owner where

appropriate. This changes the behavior of the REST plugins and RemoteAdmin's
region creation process.
This commit is contained in:
Melanie
2010-01-10 22:41:42 +00:00
parent 6998668bbc
commit 3c90d834ea
19 changed files with 21 additions and 271 deletions

View File

@@ -584,45 +584,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
{
// ok, client wants us to use an explicit UUID
// regardless of what the avatar name provided
userID = new UUID((string) requestData["region_master_uuid"]);
userID = new UUID((string) requestData["estate_owner_uuid"]);
}
else
{
if (masterFirst != String.Empty && masterLast != String.Empty) // User requests a master avatar
{
// no client supplied UUID: look it up...
UUID scopeID = m_app.SceneManager.CurrentOrFirstScene.RegionInfo.ScopeID;
UserAccount account = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.GetUserAccount(scopeID, masterFirst, masterLast);
if (null == account)
{
m_log.InfoFormat("master avatar does not exist, creating it");
// ...or create new user
account = new UserAccount(scopeID, masterFirst, masterLast, "");
bool success = m_app.SceneManager.CurrentOrFirstScene.UserAccountService.StoreUserAccount(account);
if (success)
{
GridRegion home = m_app.SceneManager.CurrentOrFirstScene.GridService.GetRegionByPosition(scopeID,
(int)(region.RegionLocX * Constants.RegionSize), (int)(region.RegionLocY * Constants.RegionSize));
m_app.SceneManager.CurrentOrFirstScene.PresenceService.SetHomeLocation(account.PrincipalID.ToString(), home.RegionID, new Vector3(128, 128, 0), new Vector3(0, 1, 0));
}
else
throw new Exception(String.Format("failed to create new user {0} {1}",
masterFirst, masterLast));
}
else
{
userID = account.PrincipalID;
}
}
}
region.MasterAvatarFirstName = masterFirst;
region.MasterAvatarLastName = masterLast;
region.MasterAvatarSandboxPassword = masterPassword;
region.MasterAvatarAssignedUUID = userID;
bool persist = Convert.ToBoolean((string) requestData["persist"]);
if (persist)
@@ -667,6 +630,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController
// If an access specification was provided, use it.
// Otherwise accept the default.
newscene.RegionInfo.EstateSettings.PublicAccess = getBoolean(requestData, "public", m_publicAccess);
newscene.RegionInfo.EstateSettings.EstateOwner = userID;
if (persist)
newscene.RegionInfo.EstateSettings.Save();

View File

@@ -113,14 +113,6 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
rxw.WriteString(s.RegionInfo.ExternalHostName);
rxw.WriteEndAttribute();
rxw.WriteStartAttribute(String.Empty, "master_name", String.Empty);
rxw.WriteString(String.Format("{0} {1}", s.RegionInfo.MasterAvatarFirstName, s.RegionInfo.MasterAvatarLastName));
rxw.WriteEndAttribute();
rxw.WriteStartAttribute(String.Empty, "master_uuid", String.Empty);
rxw.WriteString(s.RegionInfo.MasterAvatarAssignedUUID.ToString());
rxw.WriteEndAttribute();
rxw.WriteStartAttribute(String.Empty, "ip", String.Empty);
rxw.WriteString(s.RegionInfo.InternalEndPoint.ToString());
rxw.WriteEndAttribute();

View File

@@ -56,20 +56,13 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
region_id = regInfo.RegionID.ToString();
region_x = regInfo.RegionLocX;
region_y = regInfo.RegionLocY;
if (regInfo.EstateSettings.EstateOwner != UUID.Zero)
region_owner_id = regInfo.EstateSettings.EstateOwner.ToString();
else
region_owner_id = regInfo.MasterAvatarAssignedUUID.ToString();
region_owner_id = regInfo.EstateSettings.EstateOwner.ToString();
region_http_port = regInfo.HttpPort;
region_server_uri = regInfo.ServerURI;
region_external_hostname = regInfo.ExternalHostName;
Uri uri = new Uri(region_server_uri);
region_port = (uint)uri.Port;
if (!String.IsNullOrEmpty(regInfo.MasterAvatarFirstName))
region_owner = String.Format("{0} {1}", regInfo.MasterAvatarFirstName,
regInfo.MasterAvatarLastName);
}
public string this[string idx]