コード例 #1
0
        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);
        }
コード例 #2
0
 public static Account CreateAccount(string playerName, string password, int age)
 {
     return(new Account(playerName, GameSerializer.GetHash(password), age));
 }