Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 446


Ignore:
Timestamp:
Dec 9, 2007, 8:44:04 PM (17 years ago)
Author:
scheusso
Message:

corrected clientinformation::removeClient(enet event)

Location:
code/branches/FICN/src/network
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/ClientInformation.cc

    r444 r446  
    143143bool ClientInformation::removeClient(ENetPeer *peer){
    144144  ClientInformation *temp = this;
    145   while(temp!=0 && (temp->getPeer()->address.host!=peer->address.host || temp->getPeer()->address.port!=peer->address.port))
     145  while(temp!=0){
     146    if(!temp->head)
     147      if(temp->getPeer()->address.host==peer->address.host && temp->getPeer()->address.port==peer->address.port)
     148        break;
    146149    temp = temp->next();
     150  }
    147151  if(temp==0)
    148152    return false;
     
    159163ClientInformation *ClientInformation::findClient(int clientID, bool look_backwards){
    160164  ClientInformation *temp = this;
    161   while(temp!=0 && temp->getID()!=clientID)
     165  while(temp!=0 && temp->getID()!=clientID){
     166    if (temp->head)
     167      continue;
    162168    temp = temp->next();
     169  }
    163170  // returns 0 if nothing has been found
    164171  return temp;
  • code/branches/FICN/src/network/ConnectionManager.cc

    r444 r446  
    5555  ENetPacket *ConnectionManager::getPacket(int &clientID){
    5656    ENetAddress address;
    57     ENetPacket *packet=getPacket(address);std::cout << "searching clientid " << head_->getID() << std::endl;
     57    ENetPacket *packet=getPacket(address);
    5858    ClientInformation *temp =head_->findClient(&address);
    59     std::cout << "searching clientid " << temp << std::endl;
    6059    clientID=temp->getID();
    6160    return packet;
     
    141140        break;
    142141      case ENET_EVENT_TYPE_RECEIVE:
     142        std::cout << "received data" << std::endl;
    143143        processData(&event);
    144144        break;
  • code/branches/FICN/src/network/dummyclient2.cc

    r442 r446  
    4949//    usleep(1000000);
    5050  }
    51 
     51  usleep(1000000);
    5252        // now disconnect
    5353  if(client.closeConnection())
  • code/branches/FICN/src/network/dummyclient3.cc

    r441 r446  
    2626          std::getline( std::cin, str );
    2727          client.sendChat( str );
     28          std::cout << "send message" << std::endl;
    2829  }
    2930}
  • code/branches/FICN/src/network/dummyserver3.cc

    r444 r446  
    3737
    3838void dummyserver3::tick(){
    39   Server::processQueue();
     39  processQueue();
    4040}
    4141
Note: See TracChangeset for help on using the changeset viewer.