public static Constants.ResponseType update(Client client, UpdateDataRequestMessage updateDataRequestMessage) {
        boolean update = false;
        Constants.ResponseType responseType = Constants.ResponseType.failed;
        EntityManager entityManager = PersistenceManager.getInstance().getEntityManager();
        EntityTransaction entityTransaction = entityManager.getTransaction();
        entityTransaction.begin();
        Player player = entityManager.find(Player.class, client.getPlayerModel().getName());
        if (player != null) {
            String oldPassword = updateDataRequestMessage.getOldPassword();
            String password = updateDataRequestMessage.getPassword();
            String mail = updateDataRequestMessage.getEmail();
            if ((oldPassword != null) && (oldPassword.length() > 0) && (password != null) && (password.length() > 0)) {
                if (player.getPassword().equals(oldPassword)) {
                    player.setPassword(password);
                    update = true;
                }
            }
            if ((mail != null) && (mail.length() > 0)) {
                player.setEmail(mail);
                update = true;
            } else {
                logger.error("Password not changed because old password was wrong");
            }

            if (update) {
                entityManager.merge(player);
                entityManager.flush();
                responseType = Constants.ResponseType.ok;
                logger.info("Registartion data for client " + client + " changed.");
            }
        } else {
            logger.error("player with client " + client + " was not found.");
        }
        entityTransaction.commit();
        return responseType;
    }