void fs2netd_connect()
{
	int rc = 0;

	// don't bother with this if we aren't on FS2NetD
	if ( !Om_tracker_flag ) {
		return;
	}

	if ( !(Game_mode & GM_MULTIPLAYER) ) {
		return;
	}

	if (Is_connected) {
		return;
	}

	Assert( strlen(Multi_options_g.game_tracker_ip) );
	Assert( strlen(Multi_options_g.tracker_port) );

	In_process = true;

	if (Is_standalone) {
		do { rc = fs2netd_connect_do(); } while (!rc);
	} else {
		popup_till_condition(fs2netd_connect_do, XSTR("&Cancel", 779), XSTR("Connecting into FS2NetD", 1575));
	}

	In_process = false;
	Local_timeout = -1;
}
void fs2netd_connect()
{
	int rc = 0;

	// don't bother with this if we aren't on FS2NetD
	if ( !Om_tracker_flag ) {
		return;
	}

	if ( !(Game_mode & GM_MULTIPLAYER) ) {
		return;
	}

	if (Is_connected) {
		return;
	}


	if ( !PXO_port ) {
		Assert( strlen(Multi_options_g.game_tracker_ip) );
		Assert( strlen(Multi_options_g.tracker_port) );
	
		if ( strlen(Multi_options_g.game_tracker_ip) ) {
			strncpy( PXO_Server, Multi_options_g.game_tracker_ip, sizeof(PXO_Server) - 1 );
		} else {
			ml_printf("FS2NetD ERROR:  No server specified in multi.cfg!  Using default instead (%s)!", FS2NETD_DEFAULT_SERVER);
			strncpy( PXO_Server, FS2NETD_DEFAULT_SERVER, sizeof(PXO_Server) - 1 );
		}

		if ( strlen(Multi_options_g.tracker_port) ) {
			long tmp = strtol(Multi_options_g.tracker_port, (char**)NULL, 10);

			if ( (tmp < 1024) || (tmp > USHRT_MAX) ) {
				ml_printf("FS2NetD ERROR:  The port specified in multi.cfg, '%i', is outside of the required range, %i through %i!", tmp, 1024, USHRT_MAX);
				ml_printf("Fs2NetD ERROR:  Setting port to default value (%s) ...", FS2NETD_DEFAULT_PORT);
				PXO_port = (ushort) strtol(FS2NETD_DEFAULT_PORT, (char**)NULL, 10);
			} else {
				PXO_port = (ushort)tmp;
			}
		} else {
			PXO_port = (ushort) strtol(FS2NETD_DEFAULT_PORT, (char**)NULL, 10);
		}
	}

	In_process = true;

	if (Is_standalone) {
		do { rc = fs2netd_connect_do(); } while (!rc);
	} else {
		popup_till_condition(fs2netd_connect_do, XSTR("&Cancel", 779), XSTR("Connecting into FS2NetD", -1));
	}

	In_process = false;
}