Esempio n. 1
0
        public ResponseMessage <Player> ChangePassword(string newPassword, string oldPassword)
        {
            var newDictionary = HashPassword(newPassword);
            var oldDictionary = HashPassword(oldPassword);

            if (myPlayer.HashSalt != oldDictionary["Salt"] || myPlayer.PasswordHash != oldDictionary["PasswordHash"])
            {
                return(new ResponseMessage <Player>(Resources.Enums.ResponseStatusCodes.Error,
                                                    ResponseMessages.WrongOldPassword));
            }

            myPlayer.PasswordHash = newDictionary["PasswordHash"];
            myPlayer.HashSalt     = newDictionary["Salt"];

            return(playerDal.Update(myPlayer));
        }
Esempio n. 2
0
 public void Update(Player player)
 {
     _playerDal.Update(player);
 }