From b51a900bebe914650c1c7db7b77f74c5ac107f6d Mon Sep 17 00:00:00 2001
From: mingchen
Date: Sat, 3 Nov 2007 17:49:45 +0000
Subject: *Master Avatar can be specified by a previous UUID in either grid
 mode or standalone mode by specifying a master_avatar_uuid attribute in the
 place of master_avatar_xxxx_name and master_avatar_password.You will not be
 asked for the name and password if a valid UUID is specified.

---
 OpenSim/Region/ClientStack/RegionApplicationBase.cs      | 13 +++++++++++--
 OpenSim/Region/Communications/Local/LocalUserServices.cs | 10 ++++++++++
 OpenSim/Region/Communications/OGS1/OGS1UserServices.cs   | 10 ++++++++++
 3 files changed, 31 insertions(+), 2 deletions(-)

(limited to 'OpenSim/Region')

diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 7551bff..6071dcd 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -113,10 +113,19 @@ namespace OpenSim.Region.ClientStack
             scene.PhysScene.SetTerrain(scene.Terrain.GetHeights1D());
 
             //Master Avatar Setup
-            UserProfileData masterAvatar =
-                m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName,
+            UserProfileData masterAvatar;
+            if (scene.RegionInfo.MasterAvatarAssignedUUID != LLUUID.Zero)
+            {
+                masterAvatar = m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarAssignedUUID);
+            }
+            else
+            {
+                masterAvatar =
+                    m_commsManager.UserService.SetupMasterUser(scene.RegionInfo.MasterAvatarFirstName,
                                                            scene.RegionInfo.MasterAvatarLastName,
                                                            scene.RegionInfo.MasterAvatarSandboxPassword);
+            }
+
             if (masterAvatar != null)
             {
                 m_log.Verbose("PARCEL", "Found master avatar [" + masterAvatar.UUID.ToStringHyphenated() + "]");
diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs
index a7687c7..d8c4b1d 100644
--- a/OpenSim/Region/Communications/Local/LocalUserServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs
@@ -81,5 +81,15 @@ namespace OpenSim.Region.Communications.Local
 
             return profile;
         }
+
+        public override UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid)
+        {
+            UserProfileData data = GetUserProfile(uuid);
+            if (data == null)
+            {
+                throw new Exception("Unknown master user UUID");
+            }
+            return data;
+        }
     }
 }
\ No newline at end of file
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index d00a813..990998e 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -145,6 +145,16 @@ namespace OpenSim.Region.Communications.OGS1
             return profile;
         }
 
+        public UserProfileData SetupMasterUser(libsecondlife.LLUUID uuid)
+        {
+            UserProfileData data = GetUserProfile(uuid);
+            if (data == null)
+            {
+                throw new Exception("Unknown master user UUID");
+            }
+            return data;
+        }
+
         public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
         {
             throw new Exception("The method or operation is not implemented.");
-- 
cgit v1.1