Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 1, 2008, 1:44:44 PM (16 years ago)
Author:
scheusso
Message:

some speed enhancements regarding to mutexes in enet send/receive mechanisms

File:
1 edited

Legend:

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

    r1494 r1499  
    130130    ENetPacket *packet = packet_gen.chatMessage(msg.c_str());
    131131    //std::cout <<"adding packets" << std::endl;
    132     if(connection->addPacketAll(packet))
    133     //std::cout <<"added packets" << std::endl;
    134       return connection->sendPackets();
    135     else
    136       return false;
     132    return connection->addPacketAll(packet);
    137133  }
    138134
     
    145141    ENetPacket *packet = packet_gen.chatMessage(msg);
    146142    COUT(4) <<"Server: adding Packets" << std::endl;
    147     connection->addPacketAll(packet);
    148     //std::cout <<"added packets" << std::endl;
    149     if (connection->sendPackets()){
    150       COUT(4) << "Server: Sucessfully" << std::endl;
    151       return true;
    152     }
    153     return false;
     143    return connection->addPacketAll(packet);
    154144  }
    155145
     
    184174      if(!event)
    185175        continue;
     176      assert(event->type != ENET_EVENT_TYPE_NONE);
    186177      switch( event->type ) {
    187178      case ENET_EVENT_TYPE_CONNECT:
     
    265256      delete gs;
    266257    }
    267     if(added) {
     258    /*if(added) {
    268259      //std::cout << "send gamestates from server.cc in sendGameState" << std::endl;
    269260      return connection->sendPackets();
    270     }
    271     COUT(5) << "Server: had no gamestates to send" << std::endl;
    272     return false;
     261    }*/
     262    //COUT(5) << "Server: had no gamestates to send" << std::endl;
     263    return true;
    273264  }
    274265
Note: See TracChangeset for help on using the changeset viewer.