mirror of
https://github.com/opensim/opensim.git
synced 2026-06-03 09:06:32 +08:00
* 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
57 lines
1.8 KiB
C#
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;
|
|
}
|
|
}
|
|
} |