From 02fd7751d9b89d838fc8ca2dc60fe11f4cfe93a8 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 23 Nov 2008 03:38:40 +0000 Subject: [PATCH] Mantis#2660. Thank you kindly, Ruud Lathrop for a patch that: This patch adds the option of adding the email when you create a new user. This works in Gridmode as none Gridmode. This option is also added to RemoteAdminPlugin. With a new handler you can create a user with a email. --- .../RemoteController/RemoteAdminPlugin.cs | 104 ++++++++++++- .../Communications/CommunicationsManager.cs | 20 ++- .../Framework/Communications/IUserService.cs | 17 ++- .../Communications/IUserServiceAdmin.cs | 26 +++- .../Communications/UserManagerBase.cs | 29 +++- OpenSim/Grid/UserServer/Main.cs | 141 +++++++++++------- OpenSim/Region/Application/OpenSim.cs | 29 +++- OpenSim/Region/Application/OpenSimBase.cs | 4 +- .../Communications/Local/LocalLoginService.cs | 2 +- .../Communications/Local/LocalUserServices.cs | 2 +- .../InterGrid/OpenGridProtocolModule.cs | 2 +- 11 files changed, 285 insertions(+), 91 deletions(-) diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs index 1490893314..db99450f9a 100644 --- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs +++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs @@ -93,6 +93,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController m_httpd.AddXmlRPCHandler("admin_restart", XmlRpcRestartMethod, false); m_httpd.AddXmlRPCHandler("admin_load_heightmap", XmlRpcLoadHeightmapMethod, false); m_httpd.AddXmlRPCHandler("admin_create_user", XmlRpcCreateUserMethod, false); + //This handler creates a user with a email, + m_httpd.AddXmlRPCHandler("admin_create_user_email", XmlRpcCreateUserMethodEmail, false); m_httpd.AddXmlRPCHandler("admin_exists_user", XmlRpcUserExistsMethod, false); m_httpd.AddXmlRPCHandler("admin_update_user", XmlRpcUpdateUserAccountMethod, false); m_httpd.AddXmlRPCHandler("admin_load_xml", XmlRpcLoadXMLMethod, false); @@ -472,7 +474,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController { 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}", masterFirst, masterLast)); } @@ -647,7 +649,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController // check completeness checkStringParameters(request, new string[] { "password", "user_firstname", - "user_lastname", "user_password" }); + "user_lastname", "user_password", }); checkIntegerParams(request, new string[] { "start_region_x", "start_region_y" }); // check password @@ -658,6 +660,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController string firstname = (string) requestData["user_firstname"]; string lastname = (string) requestData["user_lastname"]; string passwd = (string) requestData["user_password"]; + string email = ""; //Empty string for email uint regX = Convert.ToUInt32((Int32)requestData["start_region_x"]); uint regY = Convert.ToUInt32((Int32)requestData["start_region_y"]); @@ -665,7 +668,7 @@ namespace OpenSim.ApplicationPlugins.RemoteController if (null != userProfile) throw new Exception(String.Format("avatar {0} {1} already exists", firstname, lastname)); - UUID userID = m_app.CreateUser(firstname, lastname, passwd, regX, regY); + UUID userID = m_app.CreateUser(firstname, lastname, passwd, email, regX, regY); if (userID == UUID.Zero) throw new Exception(String.Format("failed to create new user {0} {1}", firstname, lastname)); @@ -692,6 +695,101 @@ namespace OpenSim.ApplicationPlugins.RemoteController return response; } + /// + /// Create a new user account. + /// + /// incoming XML RPC request + /// + /// XmlRpcCreateUserMethod takes the following XMLRPC + /// parameters + /// + /// parameter namedescription + /// password + /// admin password as set in OpenSim.ini + /// user_firstname + /// avatar's first name + /// user_lastname + /// avatar's last name + /// user_password + /// avatar's password + /// start_region_x + /// avatar's start region coordinates, X value + /// start_region_y + /// avatar's start region coordinates, Y value + /// user_email + /// email of avatar + /// + /// + /// XmlRpcCreateUserMethod returns + /// + /// namedescription + /// success + /// true or false + /// error + /// error message if success is false + /// avatar_uuid + /// UUID of the newly created avatar + /// account; UUID.Zero if failed. + /// + /// + /// + public XmlRpcResponse XmlRpcCreateUserMethodEmail(XmlRpcRequest request) + { + m_log.Info("[RADMIN]: CreateUser: new request"); + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable responseData = new Hashtable(); + + try + { + Hashtable requestData = (Hashtable)request.Params[0]; + + // check completeness + checkStringParameters(request, new string[] { "password", "user_firstname", + "user_lastname", "user_password", "user_email" }); + checkIntegerParams(request, new string[] { "start_region_x", "start_region_y" }); + + // check password + if (!String.IsNullOrEmpty(requiredPassword) && + (string)requestData["password"] != requiredPassword) throw new Exception("wrong password"); + + // do the job + string firstname = (string)requestData["user_firstname"]; + string lastname = (string)requestData["user_lastname"]; + string passwd = (string)requestData["user_password"]; + string email = (string)requestData["user_email"]; + uint regX = Convert.ToUInt32((Int32)requestData["start_region_x"]); + uint regY = Convert.ToUInt32((Int32)requestData["start_region_y"]); + + UserProfileData userProfile = m_app.CommunicationsManager.UserService.GetUserProfile(firstname, lastname); + if (null != userProfile) + throw new Exception(String.Format("avatar {0} {1} already exists", firstname, lastname)); + + UUID userID = m_app.CreateUser(firstname, lastname, passwd, email, regX, regY); + + if (userID == UUID.Zero) throw new Exception(String.Format("failed to create new user {0} {1}", + firstname, lastname)); + + responseData["success"] = "true"; + responseData["avatar_uuid"] = userID.ToString(); + + response.Value = responseData; + + m_log.InfoFormat("[RADMIN]: CreateUser: User {0} {1} created, UUID {2}", firstname, lastname, userID); + } + catch (Exception e) + { + m_log.ErrorFormat("[RADMIN] CreateUser: failed: {0}", e.Message); + m_log.DebugFormat("[RADMIN] CreateUser: failed: {0}", e.ToString()); + + responseData["success"] = "false"; + responseData["avatar_uuid"] = UUID.Zero.ToString(); + responseData["error"] = e.Message; + + response.Value = responseData; + } + + return response; + } /// /// Check whether a certain user account exists. diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index bb4a853672..3f46776b72 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -255,14 +255,15 @@ namespace OpenSim.Framework.Communications /// /// /// + /// /// /// /// The UUID of the added user. Returns UUID.Zero if the add was unsuccessful - public UUID AddUser(string firstName, string lastName, string password, uint regX, uint regY) + public UUID AddUser(string firstName, string lastName, string password, string email, uint regX, uint regY) { string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); - m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY); + m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, email, regX, regY); UserProfileData userProf = UserService.GetUserProfile(firstName, lastName); if (userProf == null) { @@ -276,11 +277,22 @@ namespace OpenSim.Framework.Communications } } - public UUID AddUser(string firstName, string lastName, string password, uint regX, uint regY, UUID SetUUID) + /// + /// Adds the user. + /// + /// The first name. + /// The last name. + /// The password. + /// The email. + /// The reg X. + /// The reg Y. + /// The set UUID. + /// + public UUID AddUser(string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID) { string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); - m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY, SetUUID); + m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, email, regX, regY, SetUUID); UserProfileData userProf = UserService.GetUserProfile(firstName, lastName); if (userProf == null) { diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs index 50c9917c25..178b5a0c2e 100644 --- a/OpenSim/Framework/Communications/IUserService.cs +++ b/OpenSim/Framework/Communications/IUserService.cs @@ -35,15 +35,15 @@ namespace OpenSim.Framework.Communications /// /// Loads a user profile by name /// - /// First name - /// Last name + /// First name + /// Last name /// A user profile. Returns null if no profile is found UserProfileData GetUserProfile(string firstName, string lastName); /// /// Loads a user profile from a database by UUID /// - /// The target UUID + /// The target UUID /// A user profile. Returns null if no user profile is found. UserProfileData GetUserProfile(UUID userId); @@ -90,8 +90,8 @@ namespace OpenSim.Framework.Communications /// /// Logs off a user on the user server /// - /// UUID of the user - /// UUID of the Region + /// UUID of the user + /// UUID of the Region /// regionhandle /// final position /// final lookat @@ -100,8 +100,8 @@ namespace OpenSim.Framework.Communications /// /// Logs off a user on the user server (deprecated as of 2008-08-27) /// - /// UUID of the user - /// UUID of the Region + /// UUID of the user + /// UUID of the Region /// regionhandle /// final position x /// final position y @@ -118,7 +118,8 @@ namespace OpenSim.Framework.Communications /// Updates the current region the User is in /// /// User Region the Avatar is IN - /// User Region the Avatar is IN + /// User Region the Avatar is IN + /// User region handle void UpdateUserCurrentRegion(UUID avatarid, UUID regionuuid, ulong regionhandle); /// diff --git a/OpenSim/Framework/Communications/IUserServiceAdmin.cs b/OpenSim/Framework/Communications/IUserServiceAdmin.cs index 169385f5fa..a120addd62 100644 --- a/OpenSim/Framework/Communications/IUserServiceAdmin.cs +++ b/OpenSim/Framework/Communications/IUserServiceAdmin.cs @@ -30,15 +30,31 @@ using OpenMetaverse; namespace OpenSim.Framework.Communications { public interface IUserServiceAdmin - { + { /// /// Add a new user profile /// - /// - UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY); + /// The first name. + /// The last name. + /// password of avatar + /// email of user + /// region X. + /// region Y. + /// + UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY); - // Adds one for allowing setting of the UUID from modules.. SHOULD ONLY BE USED in very special circumstances! - UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY, UUID setUUID); + /// + /// Adds one for allowing setting of the UUID from modules.. SHOULD ONLY BE USED in very special circumstances! + /// + /// The first name. + /// The last name. + /// password of avatar + /// email of user + /// region X. + /// region Y. + /// The set UUID. + /// + UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY, UUID setUUID); /// /// Reset a user password diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 4b5d2bb2bc..bc1a593cc0 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -54,6 +54,7 @@ namespace OpenSim.Framework.Communications /// Adds a new user server plugin - user servers will be requested in the order they were loaded. /// /// The filename to the user server plugin DLL + /// public void AddPlugin(string provider, string connect) { PluginLoader loader = @@ -580,15 +581,32 @@ namespace OpenSim.Framework.Communications #endregion /// - /// + /// Add a new user profile /// - /// - public UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) + /// first name. + /// last name. + /// password + /// email. + /// location X. + /// location Y. + /// + public UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY) { - return AddUserProfile(firstName, lastName, pass, regX, regY, UUID.Random()); + return AddUserProfile(firstName, lastName, pass, email, regX, regY, UUID.Random()); } - public UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY, UUID SetUUID) + /// + /// Adds the user profile. + /// + /// first name. + /// last name. + /// password + /// email. + /// location X. + /// location Y. + /// UUID of avatar. + /// + public UUID AddUserProfile(string firstName, string lastName, string pass, string email, uint regX, uint regY, UUID SetUUID) { UserProfileData user = new UserProfileData(); user.HomeLocation = new Vector3(128, 128, 100); @@ -601,6 +619,7 @@ namespace OpenSim.Framework.Communications user.HomeLookAt = new Vector3(100, 100, 100); user.HomeRegionX = regX; user.HomeRegionY = regY; + user.Email = email; foreach (IUserDataPlugin plugin in _plugins) { diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index 1a37b835ec..eb47259ffe 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -162,62 +162,12 @@ namespace OpenSim.Grid.UserServer m_httpServer.AddXmlRPCHandler("update_user_profile", m_userManager.XmlRpcResponseXmlRPCUpdateUserProfile); } - public void do_create(string what) + public void do_create(string[] args) { - switch (what) + switch (args[0]) { case "user": - string tempfirstname = m_console.CmdPrompt("First name"); - string templastname = m_console.CmdPrompt("Last name"); - //tempMD5Passwd = m_console.PasswdPrompt("Password"); - string tempMD5Passwd = m_console.CmdPrompt("Password"); - uint regX = Convert.ToUInt32(m_console.CmdPrompt("Start Region X")); - uint regY = Convert.ToUInt32(m_console.CmdPrompt("Start Region Y")); - - if (null != m_userManager.GetUserProfile(tempfirstname, templastname)) - { - m_log.ErrorFormat( - "[USERS]: A user with the name {0} {1} already exists!", tempfirstname, templastname); - - break; - } - - tempMD5Passwd = Util.Md5Hash(Util.Md5Hash(tempMD5Passwd) + ":" + String.Empty); - - UUID userID = new UUID(); - - try - { - userID = m_userManager.AddUserProfile(tempfirstname, templastname, tempMD5Passwd, regX, regY); - } - catch (Exception ex) - { - m_log.ErrorFormat("[USERS]: Error creating user: {0}", ex.ToString()); - } - - try - { - if (!m_interServiceInventoryService.CreateNewUserInventory(userID)) - { - throw new Exception( - String.Format( - "The inventory creation request for user {0} did not succeed." - + " Please contact your inventory service provider for more information.", - userID)); - } - } - catch (WebException) - { - m_log.ErrorFormat( - "[USERS]: Could not contact the inventory service at {0} to create an inventory for {1}", - Cfg.InventoryUrl + "CreateInventory/", userID); - } - catch (Exception e) - { - m_log.ErrorFormat("[USERS]: Error creating inventory for user: {0}", e); - } - - m_lastCreatedUser = userID; + CreateUser(args); break; } } @@ -244,8 +194,87 @@ namespace OpenSim.Grid.UserServer break; } - } - + } + + /// + /// Create a new user + /// + /// string array with parameters: firstname, lastname, password, locationX, locationY, email + protected void CreateUser(string[] cmdparams) + { + string firstName; + string lastName; + string password; + string email; + uint regX = 1000; + uint regY = 1000; + + if (cmdparams.Length < 2) + firstName = MainConsole.Instance.CmdPrompt("First name", "Default"); + else firstName = cmdparams[1]; + + if (cmdparams.Length < 3) + lastName = MainConsole.Instance.CmdPrompt("Last name", "User"); + else lastName = cmdparams[2]; + + if (cmdparams.Length < 4) + password = MainConsole.Instance.PasswdPrompt("Password"); + else password = cmdparams[3]; + + if (cmdparams.Length < 5) + regX = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region X", regX.ToString())); + else regX = Convert.ToUInt32(cmdparams[4]); + + if (cmdparams.Length < 6) + regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); + else regY = Convert.ToUInt32(cmdparams[5]); + + if (cmdparams.Length < 7) + email = MainConsole.Instance.CmdPrompt("Email", ""); + else email = cmdparams[6]; + + if (null == m_userManager.GetUserProfile(firstName, lastName)) + { + password = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); + + UUID userID = new UUID(); + + try + { + userID = m_userManager.AddUserProfile(firstName, lastName, password, email, regX, regY); + } + catch (Exception ex) + { + m_log.ErrorFormat("[USERS]: Error creating user: {0}", ex.ToString()); + } + + try + { + if (!m_interServiceInventoryService.CreateNewUserInventory(userID)) + { + throw new Exception( + String.Format("The inventory creation request for user {0} did not succeed." + + " Please contact your inventory service provider for more information.", userID)); + } + } + catch (WebException) + { + m_log.ErrorFormat("[USERS]: Could not contact the inventory service at {0} to create an inventory for {1}", + Cfg.InventoryUrl + "CreateInventory/", userID); + } + catch (Exception e) + { + m_log.ErrorFormat("[USERS]: Error creating inventory for user: {0}", e); + } + + m_lastCreatedUser = userID; + } + else + { + m_log.ErrorFormat("[USERS]: A user with the name {0} {1} already exists!", firstName, lastName); + } + } + /// /// Reset a user password. /// @@ -277,7 +306,7 @@ namespace OpenSim.Grid.UserServer switch (cmd) { case "create": - do_create(cmdparams[0]); + do_create(cmdparams); break; case "reset": diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index e3aee9d89c..765c4716da 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -516,7 +516,14 @@ namespace OpenSim switch (args[0]) { case "user": - CreateUser(args); + if (ConfigurationSettings.Standalone) + { + CreateUser(args); + } + else + { + m_console.Notice("Create user is not available in grid mode, use the user-server."); + } break; } } @@ -537,7 +544,14 @@ namespace OpenSim switch (args[1]) { case "password": - ResetUserPassword(args); + if (ConfigurationSettings.Standalone) + { + ResetUserPassword(args); + } + else + { + m_console.Notice("Reset user password is not available in grid mode, use the user-server."); + } break; } @@ -734,12 +748,13 @@ namespace OpenSim /// /// Create a new user /// - /// + /// string array with parameters: firstname, lastname, password, locationX, locationY, email protected void CreateUser(string[] cmdparams) { string firstName; string lastName; string password; + string email; uint regX = 1000; uint regY = 1000; @@ -751,7 +766,7 @@ namespace OpenSim lastName = MainConsole.Instance.CmdPrompt("Last name", "User"); else lastName = cmdparams[2]; - if ( cmdparams.Length < 4 ) + if (cmdparams.Length < 4) password = MainConsole.Instance.PasswdPrompt("Password"); else password = cmdparams[3]; @@ -763,9 +778,13 @@ namespace OpenSim regY = Convert.ToUInt32(MainConsole.Instance.CmdPrompt("Start Region Y", regY.ToString())); else regY = Convert.ToUInt32(cmdparams[5]); + if (cmdparams.Length < 7) + email = MainConsole.Instance.CmdPrompt("Email", ""); + else email = cmdparams[6]; + if (null == m_commsManager.UserService.GetUserProfile(firstName, lastName)) { - CreateUser(firstName, lastName, password, regX, regY); + CreateUser(firstName, lastName, password, email, regX, regY); } else { diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index fc531f592f..608de06980 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -298,9 +298,9 @@ namespace OpenSim m_assetCache = new AssetCache(assetServer); } - public UUID CreateUser(string tempfirstname, string templastname, string tempPasswd, uint regX, uint regY) + public UUID CreateUser(string tempfirstname, string templastname, string tempPasswd, string email, uint regX, uint regY) { - return m_commsManager.AddUser(tempfirstname, templastname, tempPasswd, regX, regY); + return m_commsManager.AddUser(tempfirstname, templastname, tempPasswd, email, regX, regY); } /// diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs index 9caeda4cff..81cbbb4ec9 100644 --- a/OpenSim/Region/Communications/Local/LocalLoginService.cs +++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs @@ -94,7 +94,7 @@ namespace OpenSim.Region.Communications.Local //no current user account so make one m_log.Info("[LOGIN]: No user account found so creating a new one."); - m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY); + m_userManager.AddUserProfile(firstname, lastname, "test", "", defaultHomeX, defaultHomeY); profile = m_userManager.GetUserProfile(firstname, lastname); if (profile != null) diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index c0887dfad7..8649d614c2 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -72,7 +72,7 @@ namespace OpenSim.Region.Communications.Local } Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account"); - AddUserProfile(firstName, lastName, password, m_defaultHomeX, m_defaultHomeY); + AddUserProfile(firstName, lastName, password, "", m_defaultHomeX, m_defaultHomeY); profile = GetUserProfile(firstName, lastName); diff --git a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs index 1c86c2fbfd..e3e69b0106 100644 --- a/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/Environment/Modules/InterGrid/OpenGridProtocolModule.cs @@ -530,7 +530,7 @@ namespace OpenSim.Region.Environment.Modules.InterGrid // get seed capagentData.firstname = FirstName;agentData.lastname = LastName; if (homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID) == null && !GridMode) { - homeScene.CommsManager.AddUser(agentData.firstname, agentData.lastname, CreateRandomStr(7), homeScene.RegionInfo.RegionLocX, homeScene.RegionInfo.RegionLocY, agentData.AgentID); + homeScene.CommsManager.AddUser(agentData.firstname, agentData.lastname, CreateRandomStr(7), "", homeScene.RegionInfo.RegionLocX, homeScene.RegionInfo.RegionLocY, agentData.AgentID); UserProfileData userProfile2 = homeScene.CommsManager.UserService.GetUserProfile(agentData.AgentID); if (userProfile2 != null) {