From 17be1b736d438273aa634943629b7f892503744d Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 25 Sep 2008 08:42:48 +0000 Subject: * In Standalone, add a persistant account for the OGP user. * Gridmode, this has no effect at all. --- .../Framework/Communications/CommunicationsManager.cs | 18 ++++++++++++++++++ OpenSim/Framework/Communications/IUserServiceAdmin.cs | 7 +++++-- OpenSim/Framework/Communications/UserManagerBase.cs | 9 +++++++-- 3 files changed, 30 insertions(+), 4 deletions(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 198bd83..1bf8c05 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -261,6 +261,24 @@ namespace OpenSim.Framework.Communications return userProf.ID; } } + + public UUID AddUser(string firstName, string lastName, string password, uint regX, uint regY, UUID SetUUID) + { + string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); + + m_userServiceAdmin.AddUserProfile(firstName, lastName, md5PasswdHash, regX, regY, SetUUID); + UserProfileData userProf = UserService.GetUserProfile(firstName, lastName); + if (userProf == null) + { + return UUID.Zero; + } + else + { + InterServiceInventoryService.CreateNewUserInventory(userProf.ID); + m_log.Info("[USERS]: Created new inventory set for " + firstName + " " + lastName); + return userProf.ID; + } + } /// /// Reset a user password diff --git a/OpenSim/Framework/Communications/IUserServiceAdmin.cs b/OpenSim/Framework/Communications/IUserServiceAdmin.cs index 9d1ab9f..169385f 100644 --- a/OpenSim/Framework/Communications/IUserServiceAdmin.cs +++ b/OpenSim/Framework/Communications/IUserServiceAdmin.cs @@ -35,8 +35,11 @@ namespace OpenSim.Framework.Communications /// Add a new user profile /// /// - UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY); - + UUID AddUserProfile(string firstName, string lastName, string pass, 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); + /// /// Reset a user password /// diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 46a9b67..b7f9f5a 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -546,9 +546,14 @@ namespace OpenSim.Framework.Communications /// public UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) { + return AddUserProfile(firstName, lastName, pass, regX, regY, UUID.Random()); + } + + public UUID AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY, UUID SetUUID) + { UserProfileData user = new UserProfileData(); user.HomeLocation = new Vector3(128, 128, 100); - user.ID = UUID.Random(); + user.ID = SetUUID; user.FirstName = firstName; user.SurName = lastName; user.PasswordHash = pass; @@ -572,7 +577,7 @@ namespace OpenSim.Framework.Communications return user.ID; } - + /// /// Reset a user password /// -- cgit v1.1