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)
This commit is contained in:
MW
2007-05-25 16:27:07 +00:00
parent eaf4b3f1a9
commit b2d588ed1c
18 changed files with 308 additions and 201 deletions

View File

@@ -52,6 +52,37 @@ namespace OpenGridServices.UserServer
pluginAssembly = null;
}
/// <summary>
///
/// </summary>
/// <param name="user"></param>
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<string, IUserData> 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() + ")");
}
}
}
/// <summary>
/// Loads a user profile from a database by UUID
/// </summary>