Finally getting around to being able to specify host name and ports for
remote fdm application.
This commit is contained in:
parent
bef1e770bb
commit
39fcbc93ba
1 changed files with 41 additions and 10 deletions
|
@ -589,8 +589,39 @@ void fgInitFDM() {
|
||||||
cur_fdm_state = new FGMagicCarpet( dt );
|
cur_fdm_state = new FGMagicCarpet( dt );
|
||||||
} else if ( model == "external" ) {
|
} else if ( model == "external" ) {
|
||||||
cur_fdm_state = new FGExternal( dt );
|
cur_fdm_state = new FGExternal( dt );
|
||||||
} else if (model == "network") {
|
} else if ( model.find("network,") == 0 ) {
|
||||||
cur_fdm_state = new FGExternalNet( dt, 5501, 5502, 5503, "10.0.2.4" );
|
string host = "localhost";
|
||||||
|
int port1 = 5501;
|
||||||
|
int port2 = 5502;
|
||||||
|
int port3 = 5503;
|
||||||
|
string net_options = model.substr(8);
|
||||||
|
string::size_type begin, end;
|
||||||
|
begin = 0;
|
||||||
|
// host
|
||||||
|
end = net_options.find( ",", begin );
|
||||||
|
if ( end != string::npos ) {
|
||||||
|
host = net_options.substr(begin, end - begin);
|
||||||
|
begin = end + 1;
|
||||||
|
}
|
||||||
|
// port1
|
||||||
|
end = net_options.find( ",", begin );
|
||||||
|
if ( end != string::npos ) {
|
||||||
|
port1 = atoi( net_options.substr(begin, end - begin).c_str() );
|
||||||
|
begin = end + 1;
|
||||||
|
}
|
||||||
|
// port2
|
||||||
|
end = net_options.find( ",", begin );
|
||||||
|
if ( end != string::npos ) {
|
||||||
|
port2 = atoi( net_options.substr(begin, end - begin).c_str() );
|
||||||
|
begin = end + 1;
|
||||||
|
}
|
||||||
|
// port3
|
||||||
|
end = net_options.find( ",", begin );
|
||||||
|
if ( end != string::npos ) {
|
||||||
|
port3 = atoi( net_options.substr(begin, end - begin).c_str() );
|
||||||
|
begin = end + 1;
|
||||||
|
}
|
||||||
|
cur_fdm_state = new FGExternalNet( dt, host, port1, port2, port3 );
|
||||||
} else if ( model == "null" ) {
|
} else if ( model == "null" ) {
|
||||||
cur_fdm_state = new FGNullFDM( dt );
|
cur_fdm_state = new FGNullFDM( dt );
|
||||||
} else if ( model == "yasim" ) {
|
} else if ( model == "yasim" ) {
|
||||||
|
|
Loading…
Reference in a new issue