Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


Ignore:
Timestamp:
May 23, 2006, 2:58:52 PM (19 years ago)
Author:
rennerc
Message:

fixed bug

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

Legend:

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

    r7767 r7772  
    3333  this->incomingUnzippedBandWidth = 0;
    3434  this->outgoingUnzippedBandWidth = 0;
     35  this->incomingZippedBandWidth = 0;
     36  this->outgoingZippedBandWidth = 0;
    3537  this->nIncomingPackets = 0;
    3638  this->nOutgoingPackets = 0;
     
    6264 
    6365  for ( int i = 0; i < length; i++ )
     66  {
    6467    if ( data[i] == '\0' )
    6568      nZeroBytes++;
     69  }
    6670 
    6771  NETPRINTF(n)( "ZEROBYTES: %d (%f%%)\n", nZeroBytes, ((float)100)*nZeroBytes/length );
     
    8286  }
    8387     
    84   while ( sentStateTicks.begin()->first <= ackedState )
    85     sentStateTicks.erase( sentStateTicks.begin() );
     88  //TODO cleanup list
     89//  while ( sentStateTicks.begin()->first <= ackedState )
     90//  {
     91//    NETPRINTF(n)("removing old state\n");
     92//    sentStateTicks.erase( sentStateTicks.begin() );
     93//  }
     94 
     95  NETPRINTF(n)("adsf\n");
    8696     
     97  //TODO cleanup list
     98#if 0
    8799  while ( ackDelay.size() > N_PACKETS_FOR_PING )
     100  {
     101    NETPRINTF(n)("removing old ackdelay\n");
    88102    ackDelay.erase( ackDelay.begin() );
     103  }
     104#endif
    89105     
    90106  ping = 0;
     
    112128  // delete old packets
    113129  while ( packetHistory.begin()->first < tick - MSECS_TO_CALC_BWIDTH )
     130  {
    114131    packetHistory.erase( packetHistory.begin() );
     132  }
    115133 
    116134  float res = 0.0f;
     
    131149}
    132150
     151/**
     152 * calculates max packet size you can send now to fit into bandwidth
     153 * @return
     154 */
     155int ConnectionMonitor::getMaxPacketSize( )
     156{
     157}
    133158
     159
  • branches/network/src/lib/network/connection_monitor.h

    r7767 r7772  
    2424    void processUnzippedOutgoingPacket( byte * data, int length, int stateId );
    2525    void processUnzippedIncomingPacket( byte * data, int length, int stateId, int ackedState );
    26     void processZippedPacket(  );
     26
    2727   
    2828    void calculatePing();
    2929   
    3030    bool hasTimedOut(){ return ( lastPacketTick + SECS_TO_TIMEOUT*1000 < SDL_GetTicks() ) && nIncomingPackets > 0; }
     31   
     32    int getMaxPacketSize();
    3133   
    3234  private:
     
    4042    std::map<int,int>   outgoingUnzippedPacketHistory;
    4143   
     44    std::map<int,int>   incomingZippedPacketHistory;
     45    std::map<int,int>   outgoingZippedPacketHistory;
     46   
    4247    std::list<int>      ackDelay;
    4348    int                 ping;
     
    4550    float               incomingUnzippedBandWidth;
    4651    float               outgoingUnzippedBandWidth;
     52   
     53    float               incomingZippedBandWidth;
     54    float               outgoingZippedBandWidth;
    4755   
    4856    int                 nIncomingPackets;
  • branches/network/src/lib/network/network_game_manager.cc

    r7767 r7772  
    467467{
    468468  /* create new playable for Player*/
     469
     470  assert ( SharedNetworkData::getInstance()->isGameServer() );
     471
    469472  PRINTF(0)("Request for creation: %i\n", userId);
    470473  int uniqueId = this->createEntity(CL_SPACE_SHIP, userId);
  • branches/network/src/lib/network/network_stream.cc

    r7767 r7772  
    336336            this->networkGameManager->setUniqueID( it->second.handshake->getNetworkGameManagerId() );
    337337            MessageManager::getInstance()->setUniqueID( it->second.handshake->getMessageManagerId() );
     338           
     339            handleNewClient( it->second.userId );
    338340          }
    339341
     
    343345          it->second.handshake = NULL;
    344346         
    345           handleNewClient( it->second.userId );
    346347        }
    347348        else
     
    597598void NetworkStream::cleanUpOldSyncList( )
    598599{
     600  //TODO dont return do something
     601  return;
    599602  int now = SDL_GetTicks();
    600603 
Note: See TracChangeset for help on using the changeset viewer.