Replace plib/net.h by SimGear
This commit is contained in:
parent
6c777745db
commit
65301bf84e
8 changed files with 44 additions and 33 deletions
|
@ -46,7 +46,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -126,7 +126,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty.x64\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -204,7 +204,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
|
@ -282,7 +282,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -126,7 +126,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty.x64\include"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -205,7 +205,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
UsePrecompiledHeader="0"
|
||||
|
@ -284,7 +284,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty.x64\include"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
UsePrecompiledHeader="0"
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include;..\..\..\..\boost_1_44_0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -126,7 +126,7 @@
|
|||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty.x64\include;..\..\..\..\boost_1_44_0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
|
@ -205,7 +205,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90\OpenSceneGraph\include;..\..\..\..\3rdParty\include;..\..\..\..\boost_1_44_0"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
UsePrecompiledHeader="0"
|
||||
|
@ -284,7 +284,7 @@
|
|||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\..\src;..\..\..\..\SimGear;..\..\..\..\install\msvc90-64\OpenSceneGraph\include;..\..\..\..\3rdParty.x64\include;..\..\..\..\boost_1_44_0"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;HAVE_WINDOWS_H"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeTypeInfo="true"
|
||||
UsePrecompiledHeader="0"
|
||||
|
|
|
@ -2,16 +2,20 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <plib/net.h>
|
||||
#include <plib/sg.h>
|
||||
|
||||
#include <simgear/constants.h>
|
||||
#include <simgear/io/lowlevel.hxx> // endian tests
|
||||
#include <simgear/io/sg_file.hxx>
|
||||
#include <simgear/io/sg_serial.hxx>
|
||||
#include <simgear/io/raw_socket.hxx>
|
||||
#include <simgear/math/sg_geodesy.hxx>
|
||||
#include <simgear/timing/timestamp.hxx>
|
||||
|
||||
|
@ -27,7 +31,7 @@ using std::string;
|
|||
|
||||
|
||||
// Network channels
|
||||
static netSocket fdm_sock, ctrls_sock;
|
||||
static simgear::Socket fdm_sock, ctrls_sock;
|
||||
|
||||
// midg data
|
||||
MIDGTrack track;
|
||||
|
@ -394,7 +398,7 @@ int main( int argc, char **argv ) {
|
|||
|
||||
// Setup up outgoing network connections
|
||||
|
||||
netInit( &argc,argv ); // We must call this before any other net stuff
|
||||
simgear::Socket::initSockets(); // We must call this before any other net stuff
|
||||
|
||||
if ( ! fdm_sock.open( false ) ) { // open a UDP socket
|
||||
cout << "error opening fdm output socket" << endl;
|
||||
|
|
|
@ -2,6 +2,10 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
# include <strings.h> // for bzero()
|
||||
#else
|
||||
|
@ -10,12 +14,12 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <plib/net.h>
|
||||
#include <plib/sg.h>
|
||||
|
||||
#include <simgear/constants.h>
|
||||
#include <simgear/io/lowlevel.hxx> // endian tests
|
||||
#include <simgear/io/sg_file.hxx>
|
||||
#include <simgear/io/raw_socket.hxx>
|
||||
#include <simgear/serial/serial.hxx>
|
||||
#include <simgear/math/sg_geodesy.hxx>
|
||||
#include <simgear/timing/timestamp.hxx>
|
||||
|
@ -35,7 +39,7 @@ using std::string;
|
|||
|
||||
|
||||
// Network channels
|
||||
static netSocket fdm_sock, ctrls_sock, opengc_sock;
|
||||
static simgear::Socket fdm_sock, ctrls_sock, opengc_sock;
|
||||
|
||||
// ugear data
|
||||
UGTrack track;
|
||||
|
@ -658,7 +662,7 @@ int main( int argc, char **argv ) {
|
|||
|
||||
// Setup up outgoing network connections
|
||||
|
||||
netInit( &argc,argv ); // We must call this before any other net stuff
|
||||
simgear::Socket::initSockets(); // We must call this before any other net stuff
|
||||
|
||||
if ( ! opengc_sock.open( false ) ) { // open a UDP socket
|
||||
cout << "error opening opengc output socket" << endl;
|
||||
|
|
|
@ -23,14 +23,13 @@
|
|||
// $Id$
|
||||
|
||||
|
||||
#include <simgear/io/sg_netChat.hxx>
|
||||
#include <simgear/structure/commands.hxx>
|
||||
#include <simgear/misc/strutils.hxx>
|
||||
#include <simgear/math/SGMath.hxx>
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include <plib/netChat.h>
|
||||
|
||||
#include "UGear_command.hxx"
|
||||
#include "UGear_telnet.hxx"
|
||||
|
||||
|
@ -41,9 +40,9 @@ using std::ends;
|
|||
* Props connection class.
|
||||
* This class represents a connection to props client.
|
||||
*/
|
||||
class PropsChannel : public netChat
|
||||
class PropsChannel : public simgear::NetChat
|
||||
{
|
||||
netBuffer buffer;
|
||||
simgear::NetBuffer buffer;
|
||||
|
||||
/**
|
||||
* Current property node name.
|
||||
|
@ -188,9 +187,9 @@ UGTelnet::open()
|
|||
return false;
|
||||
}
|
||||
|
||||
netChannel::open();
|
||||
netChannel::bind( "", port );
|
||||
netChannel::listen( 5 );
|
||||
simgear::NetChannel::open();
|
||||
simgear::NetChannel::bind( "", port );
|
||||
simgear::NetChannel::listen( 5 );
|
||||
printf("Telnet server started on port %d\n", port );
|
||||
|
||||
enabled = true;
|
||||
|
@ -214,7 +213,7 @@ UGTelnet::close()
|
|||
bool
|
||||
UGTelnet::process()
|
||||
{
|
||||
netChannel::poll();
|
||||
simgear::NetChannel::poll();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -224,8 +223,8 @@ UGTelnet::process()
|
|||
void
|
||||
UGTelnet::handleAccept()
|
||||
{
|
||||
netAddress addr;
|
||||
int handle = netChannel::accept( &addr );
|
||||
simgear::IPAddress addr;
|
||||
int handle = simgear::NetChannel::accept( &addr );
|
||||
printf("Telent server accepted connection from %s:%d\n",
|
||||
addr.getHost(), addr.getPort() );
|
||||
PropsChannel* channel = new PropsChannel();
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
#include <plib/netChannel.h>
|
||||
#include <simgear/io/sg_netChannel.hxx>
|
||||
|
||||
|
||||
/**
|
||||
|
@ -41,7 +41,7 @@ using std::vector;
|
|||
* This class provides a telnet-like server for remote access to
|
||||
* FlightGear properties.
|
||||
*/
|
||||
class UGTelnet: netChannel
|
||||
class UGTelnet: simgear::NetChannel
|
||||
{
|
||||
|
||||
private:
|
||||
|
|
|
@ -2,13 +2,17 @@
|
|||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WINDOWS_H
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#include <plib/net.h>
|
||||
#include <plib/sg.h>
|
||||
|
||||
#include <simgear/io/lowlevel.hxx> // endian tests
|
||||
#include <simgear/io/raw_socket.hxx>
|
||||
#include <simgear/timing/timestamp.hxx>
|
||||
|
||||
#include <Network/net_ctrls.hxx>
|
||||
|
@ -23,7 +27,7 @@ using std::string;
|
|||
|
||||
|
||||
// Network channels
|
||||
static netSocket fdm_sock, ctrls_sock;
|
||||
static simgear::Socket fdm_sock, ctrls_sock;
|
||||
|
||||
// gps data
|
||||
GPSTrack track;
|
||||
|
@ -369,7 +373,7 @@ int main( int argc, char **argv ) {
|
|||
|
||||
// Setup up outgoing network connections
|
||||
|
||||
netInit( &argc,argv ); // We must call this before any other net stuff
|
||||
simgear::Socket::initSockets(); // We must call this before any other net stuff
|
||||
|
||||
if ( ! fdm_sock.open( false ) ) { // open a UDP socket
|
||||
cout << "error opening fdm output socket" << endl;
|
||||
|
|
Loading…
Reference in a new issue