From 44052a142375ca7446064df093de0a7677364bc8 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Thu, 23 Oct 2008 12:10:58 +0000 Subject: fix: allowing explicit setting of UUID for master avatar in CreateRegion (and documenting it). --- .../RemoteController/RemoteAdminPlugin.cs | 25 ++++++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'OpenSim/ApplicationPlugins') diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index f29a62f..3157ffe 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -448,17 +448,28 @@ namespace OpenSim.ApplicationPlugins.RemoteController string masterPassword = (string)requestData["region_master_password"]; UUID userID = UUID.Zero; - UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(masterFirst, masterLast); - if (null == userProfile) + if (requestData.ContainsKey("region_master_uuid")) { - 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)); + // 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 { - 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; -- cgit v1.1