UserProfile.cs 934 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. namespace Ryujinx.HLE.HOS.SystemState
  3. {
  4. class UserProfile
  5. {
  6. private static readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
  7. public UserId Uuid { get; private set; }
  8. public string Name { get; private set; }
  9. public long LastModifiedTimestamp { get; private set; }
  10. public OpenCloseState AccountState { get; set; }
  11. public OpenCloseState OnlinePlayState { get; set; }
  12. public UserProfile(UserId Uuid, string Name)
  13. {
  14. this.Uuid = Uuid;
  15. this.Name = Name;
  16. LastModifiedTimestamp = 0;
  17. AccountState = OpenCloseState.Closed;
  18. OnlinePlayState = OpenCloseState.Closed;
  19. UpdateTimestamp();
  20. }
  21. private void UpdateTimestamp()
  22. {
  23. LastModifiedTimestamp = (long)(DateTime.Now - Epoch).TotalSeconds;
  24. }
  25. }
  26. }