From b2d588ed1c9068324333ec3c5ab86efe6a36216d Mon Sep 17 00:00:00 2001
From: MW
Date: Fri, 25 May 2007 16:27:07 +0000
Subject: Possible my last ever OpenSim/OGS contribution (if I continue to feel
like this): Re-added a CLI "create user" command to the userserver, only
currently works if using DB4o as the database provider. Added Xml config
files to both the UserServer and Gridserver (UserServerConfig.xml and
GridServerConfig.xml), so that the database provider can be set in it. (both
currently default to DB4o , so maybe Adam will want to change it back to
defaulting to MySQL)
---
.../OpenGridServices.UserServer/UserManager.cs | 31 ++++++++++++++++++++++
1 file changed, 31 insertions(+)
(limited to 'OpenGridServices/OpenGridServices.UserServer/UserManager.cs')
diff --git a/OpenGridServices/OpenGridServices.UserServer/UserManager.cs b/OpenGridServices/OpenGridServices.UserServer/UserManager.cs
index a312445..fdda63b 100644
--- a/OpenGridServices/OpenGridServices.UserServer/UserManager.cs
+++ b/OpenGridServices/OpenGridServices.UserServer/UserManager.cs
@@ -53,6 +53,37 @@ namespace OpenGridServices.UserServer
}
///
+ ///
+ ///
+ ///
+ public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY)
+ {
+ UserProfileData user = new UserProfileData();
+ user.homeLocation = new LLVector3(128, 128, 100);
+ user.UUID = LLUUID.Random();
+ user.username = firstName;
+ user.surname = lastName;
+ user.passwordHash = pass;
+ user.passwordSalt = "";
+ user.created = Util.UnixTimeSinceEpoch();
+ user.homeLookAt = new LLVector3(100, 100, 100);
+ user.homeRegion = Util.UIntsToLong((regX * 256), (regY * 256));
+
+ foreach (KeyValuePair plugin in _plugins)
+ {
+ try
+ {
+ plugin.Value.addNewUserProfile(user);
+
+ }
+ catch (Exception e)
+ {
+ OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")");
+ }
+ }
+ }
+
+ ///
/// Loads a user profile from a database by UUID
///
/// The target UUID
--
cgit v1.1