mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-10-21 08:01:41 +00:00
7344dee475
* account: Adds Account Manager In a way to have Custom User Profiles merged in master faster, this PR adds a `AccountManager` class (based on `AccountUtils` class) and the following changes have been made: - Adds a "default profile values" which were the old hardcoded ones. - The image profile is moved to the Account service folder. - The hardcoded UserId for the savedata is now using the `AccountManager` last opened one. - The DeviceId in Mii service is changed to the right value (checked by REd sys:set call). * Fix csproj * Addresses gdkchan's comments * Fix UserProfile fields * Fix mii GetDeviceId() * Update Ryujinx.HLE.csproj
40 lines
No EOL
992 B
C#
40 lines
No EOL
992 B
C#
using System;
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
|
{
|
|
public class UserProfile
|
|
{
|
|
private static readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
|
|
|
public UserId UserId { get; }
|
|
|
|
public string Name { get; }
|
|
|
|
public byte[] Image { get; }
|
|
|
|
public long LastModifiedTimestamp { get; private set; }
|
|
|
|
public AccountState AccountState { get; set; }
|
|
public AccountState OnlinePlayState { get; set; }
|
|
|
|
public UserProfile(UserId userId, string name, byte[] image)
|
|
{
|
|
UserId = userId;
|
|
Name = name;
|
|
|
|
Image = image;
|
|
|
|
LastModifiedTimestamp = 0;
|
|
|
|
AccountState = AccountState.Closed;
|
|
OnlinePlayState = AccountState.Closed;
|
|
|
|
UpdateTimestamp();
|
|
}
|
|
|
|
private void UpdateTimestamp()
|
|
{
|
|
LastModifiedTimestamp = (long)(DateTime.Now - Epoch).TotalSeconds;
|
|
}
|
|
}
|
|
} |