+ } 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" ) {
+ FGGeneric *generic = new FGGeneric( tokens );
+ if (!generic->getInitOk())
+ {
+ // failed to initialize (i.e. invalid configuration)
+ delete generic;
+ return NULL;
+ }
+ 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];
+ int rate = atoi(tokens[2].c_str());
+ string host = tokens[3];
+
+ short port = atoi(tokens[4].c_str());
+
+ // multiplay used to be handled by an FGProtocol, but no longer. This code
+ // retains compatibility with existing command-line syntax
+ fgSetInt("/sim/multiplay/tx-rate-hz", rate);
+ if (dir == "in") {
+ fgSetInt("/sim/multiplay/rxport", port);
+ fgSetString("/sim/multiplay/rxhost", host.c_str());
+ } else if (dir == "out") {
+ fgSetInt("/sim/multiplay/txport", port);
+ fgSetString("/sim/multiplay/txhost", host.c_str());
+ }
+
+ return NULL;
+ }
+#ifdef FG_HAVE_HLA
+ else if ( protocol == "hla" ) {
+ return new FGHLA(tokens);
+ }
+ else if ( protocol == "hla-local" ) {
+ // This is just about to bring up some defaults
+ if (tokens.size() != 2) {
+ SG_LOG( SG_IO, SG_ALERT, "Ignoring invalid --hla-local option "
+ "(one argument expected: --hla-local=<federationname>" );
+ return NULL;
+ }
+ tokens.insert(tokens.begin(), "");
+ tokens.insert(tokens.begin(), "60");
+ tokens.insert(tokens.begin(), "bi");
+ tokens.push_back("fg-local.xml");
+ return new FGHLA(tokens);
+ }