public static IConstants.ResponseType update(Client client,
			UpdateDataRequestMessage updateDataRequestMessage) {
		boolean update = false;
		IConstants.ResponseType responseType = IConstants.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 = IConstants.ResponseType.ok;
				logger.info("registartion data for client " + client
						+ " changed.");
			}
		} else {
			logger.error("player with client " + client + " was not found.");
		}
		entityTransaction.commit();
		return responseType;
	}