#include <Main/globals.hxx>
#include <Main/viewmgr.hxx>
-#include <plib/netChat.h>
+#include <simgear/io/sg_netChat.hxx>
#include "props.hxx"
* 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.
static string
getValueTypeString( const SGPropertyNode *node )
{
+ using namespace simgear;
+
string result;
if ( node == NULL )
return "unknown";
}
- SGPropertyNode::Type type = node->getType();
- if ( type == SGPropertyNode::UNSPECIFIED ) {
+ props::Type type = node->getType();
+ if ( type == props::UNSPECIFIED ) {
result = "unspecified";
- } else if ( type == SGPropertyNode::NONE ) {
+ } else if ( type == props::NONE ) {
result = "none";
- } else if ( type == SGPropertyNode::BOOL ) {
+ } else if ( type == props::BOOL ) {
result = "bool";
- } else if ( type == SGPropertyNode::INT ) {
+ } else if ( type == props::INT ) {
result = "int";
- } else if ( type == SGPropertyNode::LONG ) {
+ } else if ( type == props::LONG ) {
result = "long";
- } else if ( type == SGPropertyNode::FLOAT ) {
+ } else if ( type == props::FLOAT ) {
result = "float";
- } else if ( type == SGPropertyNode::DOUBLE ) {
+ } else if ( type == props::DOUBLE ) {
result = "double";
- } else if ( type == SGPropertyNode::STRING ) {
+ } else if ( type == props::STRING ) {
result = "string";
}
return false;
}
- netChannel::open();
- netChannel::bind( "", port );
- netChannel::listen( 5 );
+ simgear::NetChannel::open();
+ simgear::NetChannel::bind( "", port );
+ simgear::NetChannel::listen( 5 );
SG_LOG( SG_IO, SG_INFO, "Props server started on port " << port );
set_enabled( true );
bool
FGProps::process()
{
- netChannel::poll();
+ simgear::NetChannel::poll();
return true;
}
void
FGProps::handleAccept()
{
- netAddress addr;
+ simgear::IPAddress addr;
int handle = accept( &addr );
SG_LOG( SG_IO, SG_INFO, "Props server accepted connection from "
<< addr.getHost() << ":" << addr.getPort() );