diff options
author | MW | 2007-05-25 16:27:07 +0000 |
---|---|---|
committer | MW | 2007-05-25 16:27:07 +0000 |
commit | b2d588ed1c9068324333ec3c5ab86efe6a36216d (patch) | |
tree | 950442d2af673e1df34e85ca5b8265ddd6c99906 /OpenGridServices/OpenGridServices.UserServer/UserManager.cs | |
parent | Oops (diff) | |
download | opensim-SC_OLD-b2d588ed1c9068324333ec3c5ab86efe6a36216d.zip opensim-SC_OLD-b2d588ed1c9068324333ec3c5ab86efe6a36216d.tar.gz opensim-SC_OLD-b2d588ed1c9068324333ec3c5ab86efe6a36216d.tar.bz2 opensim-SC_OLD-b2d588ed1c9068324333ec3c5ab86efe6a36216d.tar.xz |
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)
Diffstat (limited to 'OpenGridServices/OpenGridServices.UserServer/UserManager.cs')
-rw-r--r-- | OpenGridServices/OpenGridServices.UserServer/UserManager.cs | 31 |
1 files changed, 31 insertions, 0 deletions
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 | |||
53 | } | 53 | } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// | ||
57 | /// </summary> | ||
58 | /// <param name="user"></param> | ||
59 | public void AddUserProfile(string firstName, string lastName, string pass, uint regX, uint regY) | ||
60 | { | ||
61 | UserProfileData user = new UserProfileData(); | ||
62 | user.homeLocation = new LLVector3(128, 128, 100); | ||
63 | user.UUID = LLUUID.Random(); | ||
64 | user.username = firstName; | ||
65 | user.surname = lastName; | ||
66 | user.passwordHash = pass; | ||
67 | user.passwordSalt = ""; | ||
68 | user.created = Util.UnixTimeSinceEpoch(); | ||
69 | user.homeLookAt = new LLVector3(100, 100, 100); | ||
70 | user.homeRegion = Util.UIntsToLong((regX * 256), (regY * 256)); | ||
71 | |||
72 | foreach (KeyValuePair<string, IUserData> plugin in _plugins) | ||
73 | { | ||
74 | try | ||
75 | { | ||
76 | plugin.Value.addNewUserProfile(user); | ||
77 | |||
78 | } | ||
79 | catch (Exception e) | ||
80 | { | ||
81 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine(OpenSim.Framework.Console.LogPriority.LOW, "Unable to find user via " + plugin.Key + "(" + e.ToString() + ")"); | ||
82 | } | ||
83 | } | ||
84 | } | ||
85 | |||
86 | /// <summary> | ||
56 | /// Loads a user profile from a database by UUID | 87 | /// Loads a user profile from a database by UUID |
57 | /// </summary> | 88 | /// </summary> |
58 | /// <param name="uuid">The target UUID</param> | 89 | /// <param name="uuid">The target UUID</param> |