Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9286 in orxonox.OLD


Ignore:
Timestamp:
Jul 14, 2006, 10:59:33 AM (18 years ago)
Author:
patrick
Message:

first network monitor debug session

Location:
branches/proxy/src/lib/network
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/monitor/network_monitor.cc

    r9285 r9286  
    155155    this->playerNumber += (*it)->getPlayerNumber();
    156156  }
     157
     158  this->debug();
    157159}
    158160
    159 
     161/**
     162 * prints out the debug informations
     163 */
    160164void NetworkMonitor::debug()
    161165{
    162166  PRINTF(0)("================================= Network Monitor ========\n");
     167  PRINTF(0)(" I am: %s\n", this->localNode->getPeerInfo()->getNodeTypeString().c_str());
    163168  PRINTF(0)(" Total count of network nodes: %i\n", this->playerNumber);
    164 
     169  PRINTF(0)("==========================================================\n");
     170//   PRINTF(0)(" Currently got %i");
    165171}
    166172
  • branches/proxy/src/lib/network/monitor/network_node.h

    r9284 r9286  
    3434    /** @returns the node type of this node */
    3535    inline int getNodeType() { return this->peerInfo->nodeType; }
     36    /** @returns the peer info of this node */
     37    inline PeerInfo* getPeerInfo() { return this->peerInfo; }
    3638
    3739
  • branches/proxy/src/lib/network/network_stream.cc

    r9285 r9286  
    235235  if( this->networkMonitor == NULL)
    236236    this->networkMonitor = new NetworkMonitor(this);
     237  // and let it process some data
     238  this->networkMonitor->process();
    237239
    238240
  • branches/proxy/src/lib/network/peer_info.cc

    r9282 r9286  
    5050  this->connectionMonitor = NULL;
    5151}
     52
     53
     54std::string PeerInfo::getNodeTypeString()
     55{
     56  switch( this->nodeType)
     57  {
     58    case NET_CLIENT:
     59      return std::string("client");
     60    case NET_PROXY_SERVER:
     61      return std::string("proxy server");
     62    case NET_MASTER_SERVER:
     63      return std::string("master server");
     64  }
     65
     66  return std::string("node is uninit");
     67}
  • branches/proxy/src/lib/network/peer_info.h

    r9282 r9286  
    1111#include "monitor/connection_monitor.h"
    1212
     13#include <string>
    1314
    1415//!< this structure contains informations about the network node
     
    2526    inline bool isClient() { return this->nodeType == NET_CLIENT; }
    2627
     28    std::string getNodeTypeString();
     29
    2730
    2831  public:
    2932    int                 userId;
    3033    int                 nodeType;
    31 //     bool                isMasterServer;
    32 //     bool                isProxyServer;
    33 //     bool                isClient;
    3434    NetworkSocket *     socket;
    3535    Handshake *         handshake;
Note: See TracChangeset for help on using the changeset viewer.