UserProfile.cs 955 B

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