Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8505 in orxonox.OLD


Ignore:
Timestamp:
Jun 15, 2006, 11:04:18 PM (18 years ago)
Author:
rennerc
Message:

simpler bandwidth computation

Location:
branches/network/src/lib/network
Files:
2 edited

Legend:

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

    r8481 r8505  
    151151 
    152152  float res = 0.0f;
    153  
     153#if 0
    154154  for ( std::map<int,int>::iterator it = packetHistory.begin(); it != packetHistory.end(); it++ )
    155155  {
     
    164164 
    165165  res *= 1000.0f;
    166  
     166#endif
     167
     168  for ( std::map<int,int>::iterator it = packetHistory.begin(); it != packetHistory.end(); it++ )
     169  {
     170    res += it->second;
     171  }
     172 
     173  if ( packetHistory.size() <= 1 )
     174    res = 0.0f;
     175  else
     176    res /= (float)(tick - packetHistory.begin()->first);
     177 
     178  res *= 1000.0f;
     179
    167180  return res;
    168181}
  • branches/network/src/lib/network/network_stream.cc

    r8502 r8505  
    514514      compLength = Zip::getInstance()->zip( buf, offset, compBuf, UDP_PACKET_SIZE, dictClient );
    515515   
    516     if ( compLength < 0 )
     516    if ( compLength <= 0 )
    517517    {
    518518      PRINTF(1)("compression failed!\n");
Note: See TracChangeset for help on using the changeset viewer.