AccountData.cs 798 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. namespace GFGGame
  4. {
  5. [System.Serializable]
  6. public class AccountData
  7. {
  8. public string username;
  9. public string encryptedPassword; // 存储的是加密后的字符串
  10. public string timestamp; // 用于记录时间,决定“最近”顺序
  11. public AccountData(string user, string encryptedPwd)
  12. {
  13. username = user;
  14. encryptedPassword = encryptedPwd;
  15. timestamp = DateTime.UtcNow.ToString("yyyyMMddHHmmss"); // 使用UTC时间避免时区问题
  16. }
  17. }
  18. // 可序列化的账号列表包装器,用于JSON处理
  19. [System.Serializable]
  20. public class AccountDataList
  21. {
  22. public List<AccountData> accounts = new List<AccountData>();
  23. }
  24. }