Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 8, 2009, 4:40:01 PM (15 years ago)
Author:
scheusso
Message:

some cleanup (mostly comments)

File:
1 edited

Legend:

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

    r2749 r2758  
    4646#include <boost/bind.hpp>
    4747
    48 // #include "core/CoreIncludes.h"
    49 // #include "core/BaseObject.h"
    50 // #include "core/Iterator.h"
    5148#include "util/Math.h"
    5249#include "util/Sleep.h"
     
    124121  void ConnectionManager::createListener() {
    125122    receiverThread_ = new boost::thread(boost::bind(&ConnectionManager::receiverThread, this));
    126     //network_threads.create_thread(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this));
    127          //boost::thread thr(boost::bind(boost::mem_fn(&ConnectionManager::receiverThread), this));
    128123    return;
    129124  }
     
    131126  bool ConnectionManager::quitListener() {
    132127    quit=true;
    133     //network_threads.join_all();
    134128    receiverThread_->join();
    135129    return true;
     
    206200        // log handling ================
    207201        case ENET_EVENT_TYPE_CONNECT:
    208           //COUT(3) << "adding event_type_connect to queue" << std::endl;
    209202        case ENET_EVENT_TYPE_DISCONNECT:
    210           //addClient(event);
    211           //this is a workaround to ensure thread safety
    212           //COUT(5) << "Con.Man: connection event has occured" << std::endl;
    213           //break;
    214203        case ENET_EVENT_TYPE_RECEIVE:
    215           //std::cout << "received data" << std::endl;
    216           //COUT(5) << "Con.Man: receive event has occured" << std::endl;
    217           // only add, if client has connected yet and not been disconnected
    218           //if(head_->findClient(&event->peer->address))
    219204            processData(event);
    220205            event = new ENetEvent;
    221 //           else
    222 //             COUT(3) << "received a packet from a client we don't know" << std::endl;
    223206          break;
    224         //case ENET_EVENT_TYPE_DISCONNECT:
    225           //clientDisconnect(event->peer);
    226           //break;
    227207        case ENET_EVENT_TYPE_NONE:
    228208          //receiverThread_->yield();
     
    299279  }
    300280
    301   /**
    302    *
    303    * @param clientID
    304    */
    305 //   void ConnectionManager::syncClassid(unsigned int clientID) {
    306 //     unsigned int network_id=0, failures=0;
    307 //     std::string classname;
    308 //     Identifier *id;
    309 //     std::map<std::string, Identifier*>::const_iterator it = Factory::getFactoryMapBegin();
    310 //     while(it != Factory::getFactoryMapEnd()){
    311 //       id = (*it).second;
    312 //       if(id == NULL)
    313 //         continue;
    314 //       classname = id->getName();
    315 //       network_id = id->getNetworkID();
    316 //       if(network_id==0)
    317 //         COUT(3) << "we got a null class id: " << id->getName() << std::endl;
    318 //       COUT(4) << "Con.Man:syncClassid:\tnetwork_id: " << network_id << ", classname: " << classname << std::endl;
    319 //
    320 //       packet::ClassID *classid = new packet::ClassID( network_id, classname );
    321 //       classid->setClientID(clientID);
    322 //       while(!classid->send() && failures < 10){
    323 //         failures++;
    324 //       }
    325 //       ++it;
    326 //     }
    327 //     //sendPackets();
    328 //     COUT(4) << "syncClassid:\tall synchClassID packets have been sent" << std::endl;
    329 //   }
    330281
    331282  void ConnectionManager::syncClassid(unsigned int clientID) {
Note: See TracChangeset for help on using the changeset viewer.