+ atcsim->set_path_names(tokens[2], tokens[3], tokens[4], tokens[5]);
+ return atcsim;
+ } else if ( protocol == "atlas" ) {
+ FGAtlas *atlas = new FGAtlas;
+ io = atlas;
+ } else if ( protocol == "opengc" ) {
+ // char wait;
+ // printf("Parsed opengc\n"); cin >> wait;
+ FGOpenGC *opengc = new FGOpenGC;
+ io = opengc;
+ } else if ( protocol == "AV400" ) {
+ FGAV400 *av400 = new FGAV400;
+ io = av400;
+ } else if ( protocol == "garmin" ) {
+ FGGarmin *garmin = new FGGarmin;
+ io = garmin;
+ } else if ( protocol == "httpd" ) {
+ // determine port
+ string port = tokens[1];
+ return new FGHttpd( atoi(port.c_str()) );
+#ifdef FG_JPEG_SERVER
+ } else if ( protocol == "jpg-httpd" ) {
+ // determine port
+ string port = tokens[1];
+ return new FGJpegHttpd( atoi(port.c_str()) );
+#endif
+ } else if ( protocol == "joyclient" ) {
+ FGJoyClient *joyclient = new FGJoyClient;
+ io = joyclient;
+ } else if ( protocol == "jsclient" ) {
+ FGJsClient *jsclient = new FGJsClient;
+ io = jsclient;
+ } else if ( protocol == "native" ) {
+ FGNative *native = new FGNative;
+ io = native;
+ } else if ( protocol == "native-ctrls" ) {
+ FGNativeCtrls *native_ctrls = new FGNativeCtrls;
+ io = native_ctrls;
+ } else if ( protocol == "native-fdm" ) {
+ FGNativeFDM *native_fdm = new FGNativeFDM;
+ io = native_fdm;
+ } else if ( protocol == "native-gui" ) {
+ FGNativeGUI *net_gui = new FGNativeGUI;
+ io = net_gui;
+ } else if ( protocol == "nmea" ) {
+ FGNMEA *nmea = new FGNMEA;
+ io = nmea;
+ } else if ( protocol == "props" || protocol == "telnet" ) {
+ io = new FGProps( tokens );
+ return io;
+ } else if ( protocol == "pve" ) {
+ FGPVE *pve = new FGPVE;
+ io = pve;
+ } else if ( protocol == "ray" ) {
+ FGRAY *ray = new FGRAY;
+ io = ray;
+ } else if ( protocol == "rul" ) {
+ FGRUL *rul = new FGRUL;
+ io = rul;
+ } else if ( protocol == "generic" ) {
+ int configToken;
+ if (tokens[1] == "socket")
+ configToken = 7;
+ else if (tokens[1] == "file")
+ configToken = 5;
+ else
+ configToken = 6;
+ FGGeneric *generic = new FGGeneric( tokens[configToken] );
+ io = generic;
+ } else if ( protocol == "multiplay" ) {
+ if ( tokens.size() != 5 ) {
+ SG_LOG( SG_IO, SG_ALERT, "Ignoring invalid --multiplay option "
+ "(4 arguments expected: --multiplay=dir,hz,hostname,port)" );
+ return NULL;
+ }
+ string dir = tokens[1];
+ string rate = tokens[2];
+ string host = tokens[3];
+ string port = tokens[4];
+ return new FGMultiplay(dir, atoi(rate.c_str()), host, atoi(port.c_str()));
+ } else {
+ return NULL;
+ }
+ }
+ catch (FGProtocolConfigError& err)
+ {
+ SG_LOG( SG_IO, SG_ALERT, "Port configuration error: " << err.what() );
+ delete io;
+ return 0;
+ }