Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1483 for code/branches


Ignore:
Timestamp:
May 29, 2008, 12:37:34 PM (16 years ago)
Author:
scheusso
Message:

simple bandwidth limitation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/Server.cc

    r1433 r1483  
    159159    gamestates->processGameStates();
    160160    updateGamestate();
    161 //     usleep(500000); // TODO remove
     161     usleep(5000); // TODO remove
    162162    return;
    163163  }
     
    236236      if(gs==NULL){
    237237        COUT(2) << "Server: could not generate gamestate (NULL from compress)" << std::endl;
    238         return false;
     238        continue;
    239239      }
    240240      //std::cout << "adding gamestate" << std::endl;
    241       if ( !(connection->addPacket(packet_gen.gstate(gs), cid)) ){
     241      ENetPacket *packet = packet_gen.gstate(gs);
     242      if(!packet)
     243        continue;
     244      if ( !(connection->addPacket(packet, cid)) ){
    242245        COUT(3) << "Server: packet with client id (cid): " << cid << " not sended: " << temp->getFailures() << std::endl;
    243246        temp->addFailure();
    244         if(temp->getFailures() > 20 )
    245           disconnectClient(temp);
     247        /*if(temp->getFailures() > 0 )
     248          disconnectClient(temp);*/
    246249      //std::cout << "added gamestate" << std::endl;
    247250      }else
Note: See TracChangeset for help on using the changeset viewer.