Ignore:
Timestamp:
Jan 8, 2011, 8:13:43 PM (13 years ago)
Author:
Torben Dannhauer
Message:

XML configuration now works also with dataIO extLink

File:
1 edited

Legend:

Unmodified
Added
Removed
  • osgVisual/trunk/src/cluster/dataIO_clusterENet.cpp

    r185 r186  
    109109bool dataIO_clusterENet::processXMLConfiguration(xmlNode* clusterConfig_)
    110110{
    111                                 // Extract cluster role
    112                                 xmlAttr  *attr = clusterConfig_->properties;
    113                                 while ( attr )
    114                                 {
    115                                         std::string attr_name=reinterpret_cast<const char*>(attr->name);
    116                                         std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
    117                                         if( attr_name == "implementation" )
    118                                         {
    119                                                 if(attr_value != "enet")
    120                                                 {
    121                                                         OSG_NOTIFY( osg::ALWAYS ) << "WARNING: Cluster configuration does not match the currently used 'enet' implementation, falling back to clusterDummy" << std::endl;
    122                                                         return false;
    123                                                 }
    124                                         }
    125                                         if( attr_name == "hardsync" )
    126                                         {
    127                                                 if(attr_value == "yes")
    128                                                         hardSync = true;
    129                                                 else
    130                                                         hardSync = false;
    131                                         }
    132                                         if( attr_name == "master_ip" )
    133                                         {
    134                                                 serverToConnect = attr_value;
    135                                         }
    136                                         if( attr_name == "port" )
    137                                         {
    138                                                 std::istringstream i(attr_value);
    139                                                 if (!(i >> port))
    140                                                 {
    141                                                         OSG_NOTIFY( osg::ALWAYS ) << "WARNING: Cluster configuration : Invalid port number '" << attr_value << "', falling back to clusterDummy" << std::endl;
    142                                                         return false;
    143                                                 }
    144                                         }
    145                                         if( attr_name == "use_zlib_compressor" )
    146                                         {
    147                                                 if(attr_value == "yes")
    148                                                         compressionEnabled = true;
    149                                                 else
    150                                                         compressionEnabled = false;
    151                                         }
    152                                         attr = attr->next;
    153                                 }       // WHILE attrib END
     111        // Extract cluster role
     112        xmlAttr  *attr = clusterConfig_->properties;
     113        while ( attr )
     114        {
     115                std::string attr_name=reinterpret_cast<const char*>(attr->name);
     116                std::string attr_value=reinterpret_cast<const char*>(attr->children->content);
     117                if( attr_name == "implementation" )
     118                {
     119                        if(attr_value != "enet")
     120                        {
     121                                OSG_NOTIFY( osg::ALWAYS ) << "WARNING: Cluster configuration does not match the currently used 'enet' implementation, falling back to clusterDummy" << std::endl;
     122                                return false;
     123                        }
     124                }
     125                if( attr_name == "hardsync" )
     126                {
     127                        if(attr_value == "yes")
     128                                hardSync = true;
     129                        else
     130                                hardSync = false;
     131                }
     132                if( attr_name == "master_ip" )
     133                {
     134                        serverToConnect = attr_value;
     135                }
     136                if( attr_name == "port" )
     137                {
     138                        std::istringstream i(attr_value);
     139                        if (!(i >> port))
     140                        {
     141                                OSG_NOTIFY( osg::ALWAYS ) << "WARNING: Cluster configuration : Invalid port number '" << attr_value << "', falling back to clusterDummy" << std::endl;
     142                                return false;
     143                        }
     144                }
     145                if( attr_name == "use_zlib_compressor" )
     146                {
     147                        if(attr_value == "yes")
     148                                compressionEnabled = true;
     149                        else
     150                                compressionEnabled = false;
     151                }
     152                attr = attr->next;
     153        }       // WHILE attrib END
    154154
    155155        return true;
Note: See TracChangeset for help on using the changeset viewer.