Exemple #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));
        }
 public void Update(Player player)
 {
     _playerDal.Update(player);
 }