Files
opensim/OpenSim/Region/Communications/Local/LocalUserServices.cs
lbsa71 5a65521203 == The "right name and place" commit ==
* Moved InventoryData to Framework.Types/InventoryItemBase.cs
* Moved UserData to Framework.Interfaces/IUserData.cs
* Moved UserProfileData to Framework/Types/UserProfileData.cs
* Deleted ass-backwards Framework dependency on Framework.Data (now it's the other way round)
* Changed some namespaces to reflect file structure
2007-10-05 10:14:42 +00:00

57 lines
1.8 KiB
C#

using System;
using OpenSim.Framework.Communications;
using OpenSim.Framework.Types;
using OpenSim.Framework.UserManagement;
namespace OpenSim.Region.Communications.Local
{
public class LocalUserServices : UserManagerBase
{
private readonly NetworkServersInfo m_serversInfo;
private readonly uint m_defaultHomeX;
private readonly uint m_defaultHomeY;
private IInventoryServices m_inventoryService;
public LocalUserServices(NetworkServersInfo serversInfo, uint defaultHomeLocX, uint defaultHomeLocY, IInventoryServices inventoryService)
{
m_serversInfo = serversInfo;
m_defaultHomeX = defaultHomeLocX;
m_defaultHomeY = defaultHomeLocY;
m_inventoryService = inventoryService;
}
public override UserProfileData SetupMasterUser(string firstName, string lastName)
{
return SetupMasterUser(firstName, lastName, "");
}
public override UserProfileData SetupMasterUser(string firstName, string lastName, string password)
{
UserProfileData profile = GetUserProfile(firstName, lastName);
if (profile != null)
{
return profile;
}
Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account");
AddUserProfile(firstName, lastName, password, m_defaultHomeX, m_defaultHomeY);
profile = GetUserProfile(firstName, lastName);
if (profile == null)
{
Console.WriteLine("Unknown Master User after creation attempt. No clue what to do here.");
}
else
{
m_inventoryService.CreateNewUserInventory(profile.UUID);
}
return profile;
}
}
}