Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8015 in orxonox.OLD for branches/network/src/lib


Ignore:
Timestamp:
May 31, 2006, 10:43:16 AM (18 years ago)
Author:
rennerc
Message:

simplified bandwidth calculation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/connection_monitor.cc

    r7974 r8015  
    7575 
    7676  // count zero bytes
    77   int nZeroBytes = 0;
    78  
    79   for ( int i = 0; i < length; i++ )
    80     if ( data[i] == '\0' )
    81       nZeroBytes++;
     77  //int nZeroBytes = 0;
     78 
     79  //for ( int i = 0; i < length; i++ )
     80  //  if ( data[i] == '\0' )
     81  //    nZeroBytes++;
    8282 
    8383  //NETPRINTF(n)( "ZEROBYTES: %d (%f%%)\n", nZeroBytes, ((float)100)*nZeroBytes/length );
     
    145145  for ( std::map<int,int>::iterator it = packetHistory.begin(); it != packetHistory.end(); it++ )
    146146  {
    147     res += it->second;
     147    if ( it != packetHistory.begin() )
     148      res += it->second;
    148149  }
    149150 
     
    151152    res = 0.0f;
    152153  else
    153     res /= (float)((tick - packetHistory.begin()->first)*( 1 + 1/((float)(packetHistory.size()-1)) ));
     154    res /= (float)(tick - packetHistory.begin()->first);
    154155 
    155156  res *= 1000.0f;
Note: See TracChangeset for help on using the changeset viewer.