- } else if ( protocol == "joyclient" ) {
- FGJoyClient *joyclient = new FGJoyClient;
- io = joyclient;
- } 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 == "nmea" ) {
- FGNMEA *nmea = new FGNMEA;
- io = nmea;
- } else if ( protocol == "props" ) {
- FGProps *props = new FGProps;
- io = props;
- } 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 {
- return NULL;
+ } 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;