2021-04-13 01:16:43 +00:00
|
|
|
|
using System;
|
2018-08-14 22:02:42 +00:00
|
|
|
|
|
2019-09-19 00:45:11 +00:00
|
|
|
|
namespace Ryujinx.HLE.HOS.Services.Account.Acc
|
2018-08-14 22:02:42 +00:00
|
|
|
|
{
|
2021-04-13 01:16:43 +00:00
|
|
|
|
public class UserProfile
|
2018-08-14 22:02:42 +00:00
|
|
|
|
{
|
|
|
|
|
private static readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
|
|
|
|
|
2021-04-13 01:16:43 +00:00
|
|
|
|
public UserId UserId { get; }
|
2018-08-14 22:02:42 +00:00
|
|
|
|
|
2021-04-13 01:16:43 +00:00
|
|
|
|
public string Name { get; }
|
|
|
|
|
|
|
|
|
|
public byte[] Image { get; }
|
2018-08-14 22:02:42 +00:00
|
|
|
|
|
|
|
|
|
public long LastModifiedTimestamp { get; private set; }
|
|
|
|
|
|
2021-04-13 01:16:43 +00:00
|
|
|
|
public AccountState AccountState { get; set; }
|
2019-06-15 22:35:38 +00:00
|
|
|
|
public AccountState OnlinePlayState { get; set; }
|
2018-08-14 22:02:42 +00:00
|
|
|
|
|
2021-04-13 01:16:43 +00:00
|
|
|
|
public UserProfile(UserId userId, string name, byte[] image)
|
2018-08-14 22:02:42 +00:00
|
|
|
|
{
|
2019-06-15 22:35:38 +00:00
|
|
|
|
UserId = userId;
|
|
|
|
|
Name = name;
|
2018-08-14 22:02:42 +00:00
|
|
|
|
|
2021-04-13 01:16:43 +00:00
|
|
|
|
Image = image;
|
|
|
|
|
|
2018-08-14 22:02:42 +00:00
|
|
|
|
LastModifiedTimestamp = 0;
|
|
|
|
|
|
2019-06-15 22:35:38 +00:00
|
|
|
|
AccountState = AccountState.Closed;
|
|
|
|
|
OnlinePlayState = AccountState.Closed;
|
2018-08-14 22:02:42 +00:00
|
|
|
|
|
|
|
|
|
UpdateTimestamp();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void UpdateTimestamp()
|
|
|
|
|
{
|
|
|
|
|
LastModifiedTimestamp = (long)(DateTime.Now - Epoch).TotalSeconds;
|
|
|
|
|
}
|
|
|
|
|
}
|
2019-07-14 19:04:38 +00:00
|
|
|
|
}
|