Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 25, 2011, 8:22:36 PM (13 years ago)
Author:
scheusso
Message:

merging network6 into trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/libraries/network/ClientConnection.cc

    r7801 r8327  
    4242
    4343  ClientConnection::ClientConnection():
     44    Connection(NETWORK_PEER_ID_SERVER),
    4445    established_(false),
    4546    server_(NULL)
     
    103104      if( enet_host_service(this->host_, &event, NETWORK_CLIENT_WAIT_TIME)>=0 && event.type == ENET_EVENT_TYPE_CONNECT )
    104105      {
     106        // manually add server to list of peers
     107        /*incomingEvent inEvent = */Connection::preprocessConnectEvent(event);
     108//         addPeer(inEvent.peerID);
     109        // start communication thread
    105110        this->established_=true;
    106111        Connection::startCommunicationThread();
     
    118123      return true;
    119124    this->established_ = false;
     125   
     126    // stop communication thread and disconnect server
    120127    Connection::stopCommunicationThread();
    121128    enet_peer_disconnect(this->server_, 0);
     
    148155    assert( this->server_ );
    149156    assert( packet );
    150     return Connection::addPacket( packet, this->server_, channelID );
     157//     return Connection::addPacket( packet, NETWORK_PEER_ID_SERVER, channelID );
     158    // HACK: actually there should be a way to do this using addPacket and the correct peerID
     159    return Connection::broadcastPacket(packet, channelID);
    151160  }
    152161
    153   void ClientConnection::addPeer(ENetEvent* event)
     162  void ClientConnection::addPeer(uint32_t peerID)
    154163  {
    155164    assert(0);
    156165  }
    157   void ClientConnection::removePeer(ENetEvent* event)
     166  void ClientConnection::removePeer(uint32_t peerID)
    158167  {
    159168    this->established_=false;
Note: See TracChangeset for help on using the changeset viewer.