Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8015 in orxonox.OLD for branches/network


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

simplified bandwidth calculation

Location:
branches/network/src
Files:
2 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;
  • branches/network/src/story_entities/multi_player_world_data.cc

    r8014 r8015  
    270270  GameWorldData::loadScene(root);
    271271 
     272  // create server playable
    272273  if ( NetworkManager::getInstance()->isGameServer() )
    273274  {
Note: See TracChangeset for help on using the changeset viewer.