private void handle_interactive_login(final Client client) {
		final LoginData ld = getLoginData(client);
		
		if ( ld.state.equals(Constants.USERNAME) ) {
			requestInput("Name?     ", client);
		}
		else if ( ld.state.equals(Constants.PASSWORD) ) {
			if( ld.username.equalsIgnoreCase("new") ) {
				send("Invalid Name!", client);
				
				ld.state = Constants.USERNAME;
				
				handle_interactive_login(client);
			}
			else {
				requestInput("Password? ", client);
			}
		}
		else if ( ld.state.equals(Constants.LOGIN) ) {
			// try connecting
			cmd_connect(ld.username + " " + ld.password, client);

			// TODO: FIX NEEDED, clearing client state here breaks account logins
			// TODO figure out what to do, it seems silly to try a login and then test if it worked
			
			boolean conn_success = true;
			
			// after attempting a connection
			if (use_accounts) {
				if (!caTable.containsKey(client)) {
					// no such account
					send("No such player or account.", client);
					
					conn_success = false;
				}
			}
			else {
				if (getPlayer(client) == null) {
					// no such player
					send("No such player.", client);
					
					conn_success = false;
				}
			}
			
			if( !conn_success ) {
				ld.state = "NAME";
				handle_interactive_login(client);
			}
			else {
				setClientState(client, ""); // we successfully logged in, clear state
				setLoginData(client, null); // clear login data
			}
		}
	}