public Account LogIn(string name, string password) { var a = AccountCache.FirstOrDefault(ac => ac.playerName == name); if (a is null) { return(null); } var s = GameSerializer.GetHash(password); if (s != a.passwordHash) { Debug.Log($"hash '{s}' != password '{password}'"); return(null); } SessionAccount = a; GameSlotCache = GetGameSlots(a).ToList(); return(a); }
public static Account CreateAccount(string playerName, string password, int age) { return(new Account(playerName, GameSerializer.GetHash(password), age)); }