public void login() {
		NavalBattleIO.saveAttribute(new SettingsAttribute("lastGoodUserName",usernameField.getText()));
		AuthStatus status = NavalBattle.getRoketGamer().init(new APIKey(Constants.API_KEY), 
				new Player(usernameField.getText(), 
				new Password(createString(passwordField.getPassword()))), Constants.ROKETGAMER_LOG_HOOK);
		
		if (status == AuthStatus.GOOD) {
			NavalBattle.getDebugWindow().printInfo("User authenticated");
			NavalBattle.getDebugWindow().printInfo("Logged in as: " + NavalBattle.getRoketGamer().getPlayer().getName());
			NavalBattleIO.saveAttribute(new SettingsAttribute("lastGoodUserName",NavalBattle.getRoketGamer().getPlayer().getName()));
			NavalBattle.getGameState().setOffline(false);
			nextWindow("LoggingInWindow");
			donewithMe();
		} else {
			if(status == AuthStatus.BAD) {
				NavalBattle.getDebugWindow().printWarning("Authentication failed: AuthStatus.BAD");	
				JOptionPane.showMessageDialog(this, "Incorrect username or password. \nUse your application password to login.");
			} else if (status == AuthStatus.OFFLINE) {
				NavalBattle.getDebugWindow().printWarning("Authentication failed: AuthStatus.OFFLINE");	
				JOptionPane.showMessageDialog(this, "Unable to login. RoketGamer API is offline. Check website.");
			} else if (status == AuthStatus.INVALID_API_KEY) {
				NavalBattle.getDebugWindow().printWarning("Authentication failed: AuthStatus.INVALID_API_KEY");	
				JOptionPane.showMessageDialog(this, "Unable to login. API key is invalid.");
			} else if (status == AuthStatus.UNKNOWN) {
				NavalBattle.getDebugWindow().printWarning("Authentication failed: AuthStatus.UNKNOWN");	
				JOptionPane.showMessageDialog(this, "Unable to login. Retry later or check the RoketGamer website.");
			} else {
				NavalBattle.getDebugWindow().printWarning("Authentication failed: AuthStatus is not recognized.");
				NavalBattle.getDebugWindow().printWarning("Internet may be disconnected.");
				JOptionPane.showMessageDialog(this, "Unable to login. Check your internet connection.");
			}
		}
	}