Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9494 in orxonox.OLD for trunk/src/lib/network/peer_info.cc


Ignore:
Timestamp:
Jul 27, 2006, 10:44:28 AM (19 years ago)
Author:
bensch
Message:

merged the proxy back

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/network/peer_info.cc

    r9406 r9494  
    5454
    5555
    56 std::string PeerInfo::getNodeTypeString()
     56const std::string& PeerInfo::getNodeTypeString() const
    5757{
    58   switch( this->nodeType)
    59   {
    60     case NET_CLIENT:
    61       return std::string("client");
    62     case NET_PROXY_SERVER_ACTIVE:
    63       return std::string("proxy server active");
    64     case NET_PROXY_SERVER_PASSIVE:
    65       return std::string("proxy server passive");
    66     case NET_MASTER_SERVER:
    67       return std::string("master server");
    68   }
     58  return PeerInfo::nodeTypeToString( this->nodeType );
     59  // the above does the same, and is faster in it. (there is no case where node is uninit i hope!)
     60}
    6961
    70   return std::string("node is uninit");
     62const std::string& PeerInfo::nodeTypeToString(unsigned int type)
     63{
     64  return PeerInfo::nodeNames[type];
    7165}
     66
     67
     68const std::string PeerInfo::nodeNames[] =
     69{
     70
     71  "maser server",
     72  "proxy server active",
     73  "proxy server passive",
     74  "client",
     75  "node is not initialized"
     76};
Note: See TracChangeset for help on using the changeset viewer.