Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jun 1, 2008, 3:54:20 PM (16 years ago)
Author:
rgrieder
Message:
  • @everyone: Do not create a branch until I've added the svn:eol-style property correctly. Otherwise this would cost me another 4 hours or so when we want to merge back.
  • merged network branch back to trunk
  • I had to omit the changes from last evening concerning the line endings
  • might not work yet because of the line endings
  • @beni: script branch is the only branch still open. you probably will have to apply a patch because of inconsistent new lines
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/network/PacketBuffer.cc

    r1360 r1502  
    6262      last->next=NULL;
    6363      // change this!!!!!!!  ---- we are not doing stl so we won't change this
    64       last->packet = ev->packet;
    65       last->address = ev->peer->address;
     64      last->event = ev;
    6665      //last->address = ev->peer->address;
    6766    } else {
     
    7271      last->next=NULL;
    7372      // save the packet to the new element
    74       last->packet = ev->packet;
    75       last->address = ev->peer->address;
     73      last->event = ev;
    7674      //last->address = ev->peer->address;
    7775    }
     
    8280  //returns the first element in the list without deleting it but
    8381  //moving first pointer to next element
    84   ENetPacket *PacketBuffer::pop() {
     82  /*ENetPacket *PacketBuffer::pop() {
    8583    ENetAddress address;
    8684    return pop(address);
    87   }
    88 
    89   ENetPacket *PacketBuffer::pop(ENetAddress &address) {
     85  }*/
     86 
     87  ENetEvent *PacketBuffer::pop(){
    9088    boost::recursive_mutex::scoped_lock lock(mutex_);
    9189    //std::cout << "packetbuffer pop(address)" << std::endl;
     
    9391      QueueItem *temp = first;
    9492      // get packet
    95       ENetPacket *pck=first->packet;
    96       address = first->address;
     93      ENetEvent *ev=first->event;
     94      //address = first->address;
     95      // remove first element
     96      first = first->next;
     97      delete temp;
     98      lock.unlock();
     99      //std::cout << "pop(address) size of packet " << pck->dataLength << std::endl;
     100      return ev;
     101    } else{
     102      lock.unlock();
     103      return NULL;
     104    }
     105  }
     106
     107  /*ENetPacket *PacketBuffer::pop(ENetAddress &address) {
     108    boost::recursive_mutex::scoped_lock lock(mutex_);
     109    //std::cout << "packetbuffer pop(address)" << std::endl;
     110    if(first!=NULL ){
     111      QueueItem *temp = first;
     112      // get packet
     113      ENetPacket *pck=first->event->packet;
     114      address = first->event->peer->address;
    97115      // remove first element
    98116      first = first->next;
     
    105123      return NULL;
    106124    }
    107   }
     125  }*/
    108126
    109127  bool PacketBuffer::isEmpty() {
Note: See TracChangeset for help on using the changeset viewer.