public static boolean logIn(String username, String password, JFrame frame){
		try {
			System.out.println("Checking username and password with my boss...");
			if(username.equals("") || username.contains(" ")){
				JOptionPane.showMessageDialog(frame, "The username is invalid, please try an other one.", "Invalid Username", JOptionPane.ERROR_MESSAGE);
				return false;
			}
			if(password.equals("") || password.contains(" ")){
				JOptionPane.showMessageDialog(frame, "The password is invalid, please try an other one.", "Invalid Password", JOptionPane.ERROR_MESSAGE);
				return false;
			}
			if(!getReturnString("req=existsPlayer&name="+username)){
				JOptionPane.showMessageDialog(frame, "The player does not exits."
						+ "Please try an other username.", "Player does not exist", JOptionPane.ERROR_MESSAGE);
				return false;
			}
			if(!getReturnString("req=login&name=" + username + "&pass=" + password)){
				JOptionPane.showMessageDialog(frame, "The combination of username and passowrd is incorrect."+ System.lineSeparator()
						+ "Please try again.'"+ System.lineSeparator()
						+ "If you have forgotten your password, visit sinius15.com.", "Invalid login", JOptionPane.ERROR_MESSAGE);
				return false;
			}
			
		} catch (IOException e) {
			e.printStackTrace();
			JOptionPane.showMessageDialog(frame, "There seems to be a problem with the connection to the server" + System.lineSeparator()
					+ "You can start the game in offline mode if you still want to play." + System.lineSeparator()
					+ "We are verry sorry for the inconvenience caused.", "Problem", JOptionPane.ERROR_MESSAGE);
			return false;
		}
		return true;
	}