Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1516


Ignore:
Timestamp:
Jun 2, 2008, 2:33:17 PM (16 years ago)
Author:
scheusso
Message:

removed crc testing and changes debug output

Location:
code/branches/network
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/TODO

    r1505 r1516  
    11- should we use enet_peer_ping to test if a client is still alive ?
    22- enet_host_broadcast ? (to all peers)
    3 - enet_host_check_events ? instead of enet_host_service
  • code/branches/network/src/network/ClientInformation.cc

    r1505 r1516  
    191191    failures_=0;
    192192  }
     193 
     194  enet_uint32 ClientInformation::getRTT(){
     195    return peer_->roundTripTime;
     196  }
     197 
     198  enet_uint32 ClientInformation::getPacketLoss(){
     199    return peer_->packetLoss;
     200  }
    193201
    194202  int ClientInformation::getGamestateID() {
  • code/branches/network/src/network/ClientInformation.h

    r1505 r1516  
    8787    void addFailure();
    8888    void resetFailures();
     89    enet_uint32 getRTT();
     90    enet_uint32 getPacketLoss();
    8991   
    9092    bool removeClient(int clientID);
  • code/branches/network/src/network/GameStateClient.cc

    r1505 r1516  
    8282      if (loadSnapshot(gs)){
    8383        gameStateMap.insert(std::pair<int, GameState*>(gs->id, gs));
    84         COUT(4) << "adding decoded gs with id: " << gs->id << " diffed from: " << gs->base_id << std::endl;
     84        COUT(5) << "adding decoded gs with id: " << gs->id << " diffed from: " << gs->base_id << std::endl;
    8585        last_diff_=gs->base_id;
    8686        //last_gamestate_=gs->id;
     
    241241      size+=it->getSize(); // size of the actual data of the synchronisable
    242242      size+=3*sizeof(int); // size of datasize, classID and objectID
    243       COUT(4) << "getpartialsnapshot: size: " << size << std::endl;
     243      COUT(5) << "getpartialsnapshot: size: " << size << std::endl;
    244244    }
    245245    //retval->data = (unsigned char*)malloc(size);
     
    380380    //std::cout << "length " << length << std::endl;
    381381    switch ( retval ) {
    382       case Z_OK: COUT(4) << "successfully decompressed" << std::endl; break;
     382      case Z_OK: COUT(5) << "successfully decompressed" << std::endl; break;
    383383      case Z_MEM_ERROR: COUT(1) << "not enough memory available" << std::endl; return NULL;
    384384      case Z_BUF_ERROR: COUT(2) << "not enough memory available in the buffer" << std::endl; return NULL;
     
    399399
    400400  GameState *GameStateClient::decode(GameState *old, GameStateCompressed *diff) {
    401     COUT(4) << "using diffed gamestate" << std::endl;
     401    COUT(5) << "using diffed gamestate" << std::endl;
    402402    GameState *t = decode(diff);
    403403    if(!t)
  • code/branches/network/src/network/GameStateManager.cc

    r1505 r1516  
    106106        break;
    107107      if( (*it).second <= 0 ){
    108         COUT(4) << "GameStateManager: deleting gamestate with id: " << (*it).first << ", uses: " << (*it).second << std::endl;
     108        COUT(5) << "GameStateManager: deleting gamestate with id: " << (*it).first << ", uses: " << (*it).second << std::endl;
    109109        std::map<int, GameState *>::iterator tempit = gameStateMap.find((*it).first);
    110110        if( tempit != gameStateMap.end() ){
     
    140140        client = it->second;
    141141      GameState *server = reference;
    142       COUT(4) << "client: " << client << " server: " << server << " gamestatemap: " << &gameStateMap << " size: " << server->size << std::endl;
     142      //COUT(4) << "client: " << client << " server: " << server << " gamestatemap: " << &gameStateMap << " size: " << server->size << std::endl;
     143      COUT(4) << "client: " << (client!=0 ? client->id : (int)client) << " server: " << server->id << " gamestatemap: " << &gameStateMap << " size: " << server->size << std::endl;
    143144      if(client)
    144145        return encode(client, server);
     
    267268      sync.data = data;
    268269      data+=sync.length;
    269       COUT(4) << "objectID: " << sync.objectID << " classID: " << sync.classID << std::endl;
     270      COUT(5) << "objectID: " << sync.objectID << " classID: " << sync.classID << std::endl;
    270271      while(it && it->objectID!=sync.objectID)
    271272        ++it;
     
    319320
    320321  GameStateCompressed *GameStateManager::encode(GameState *a, GameState *b) {
    321     COUT(4) << "G.St.Man: this will be a DIFFED gamestate" << std::endl;
     322    COUT(5) << "G.St.Man: this will be a DIFFED gamestate" << std::endl;
    322323    GameState *r = diff(a,b);
    323324    GameStateCompressed *c = compress_(r);
  • code/branches/network/src/network/PacketDecoder.cc

    r1505 r1516  
    151151  void PacketDecoder::gstate( ENetPacket* packet, int clientID )
    152152  {
    153     if(!testAndRemoveCRC(packet)){
    154       COUT(3) << "crc test of gamestate failed - dropping packet" << std::endl;
    155       return;
    156     }
     153//    if(!testAndRemoveCRC(packet)){
     154//     COUT(3) << "crc test of gamestate failed - dropping packet" << std::endl;
     155//      return;
     156//    }
    157157    GameStateCompressed* currentState = NULL;
    158158    currentState = new GameStateCompressed;
  • code/branches/network/src/network/PacketGenerator.cc

    r1505 r1516  
    144144    COUT(4) << "PacketGenerator generating totalLen " << totalLen << std::endl;
    145145    //delete[] data;
    146     if(!addCRC(packet))
    147       COUT(3) << "could not add crc to gamestate packet" << std::endl;
     146//    if(!addCRC(packet))
     147//      COUT(3) << "could not add crc to gamestate packet" << std::endl;
    148148    return packet;
    149149  }
  • code/branches/network/src/network/Server.cc

    r1505 r1516  
    202202  void Server::updateGamestate() {
    203203    gamestates->update();
    204     COUT(4) << "Server: one gamestate update complete, goig to sendGameState" << std::endl;
     204    COUT(5) << "Server: one gamestate update complete, goig to sendGameState" << std::endl;
    205205    //std::cout << "updated gamestate, sending it" << std::endl;
    206206    //if(clients->getGamestateID()!=GAMESTATEID_INITIAL)
    207207    sendGameState();
    208     COUT(4) << "Server: one sendGameState turn complete, repeat in next tick" << std::endl;
     208    COUT(5) << "Server: one sendGameState turn complete, repeat in next tick" << std::endl;
    209209    //std::cout << "sent gamestate" << std::endl;
    210210  }
     
    229229        continue;
    230230      }
     231      COUT(4) << "client id: " << temp->getID() << " RTT: " << temp->getRTT() << " loss: " << temp->getPacketLoss() << std::endl;
    231232      COUT(5) << "Server: doing gamestate gamestate preparation" << std::endl;
    232233      int gid = temp->getGamestateID(); //get gamestate id
     
    312313    COUT(4) << "Con.Man: creating client id: " << temp->getID() << std::endl;
    313314    connection->syncClassid(temp->getID());
    314     COUT(4) << "creating spaceship for clientid: " << temp->getID() << std::endl;
     315    COUT(5) << "creating spaceship for clientid: " << temp->getID() << std::endl;
    315316    // TODO: this is only a hack, untill we have a possibility to define default player-join actions
    316317    if(!createShip(temp))
  • code/branches/network/src/orxonox/objects/SpaceShip.cc

    r1505 r1516  
    469469        if( myShip_ )
    470470        {
    471           COUT(4) << "steering our ship: " << objectID << std::endl;
     471          COUT(5) << "steering our ship: " << objectID << std::endl;
    472472          this->acceleration_.x = 0;
    473473          this->acceleration_.y = 0;
Note: See TracChangeset for help on using the changeset viewer.