Changeset 8327 for code/trunk/src/libraries/network/ClientConnection.cc
- Timestamp:
- Apr 25, 2011, 8:22:36 PM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/network6 (added) merged: 7823-7825,7875,7878,7881-7882,7898,7900,7931,8315
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/network/ClientConnection.cc
r7801 r8327 42 42 43 43 ClientConnection::ClientConnection(): 44 Connection(NETWORK_PEER_ID_SERVER), 44 45 established_(false), 45 46 server_(NULL) … … 103 104 if( enet_host_service(this->host_, &event, NETWORK_CLIENT_WAIT_TIME)>=0 && event.type == ENET_EVENT_TYPE_CONNECT ) 104 105 { 106 // manually add server to list of peers 107 /*incomingEvent inEvent = */Connection::preprocessConnectEvent(event); 108 // addPeer(inEvent.peerID); 109 // start communication thread 105 110 this->established_=true; 106 111 Connection::startCommunicationThread(); … … 118 123 return true; 119 124 this->established_ = false; 125 126 // stop communication thread and disconnect server 120 127 Connection::stopCommunicationThread(); 121 128 enet_peer_disconnect(this->server_, 0); … … 148 155 assert( this->server_ ); 149 156 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); 151 160 } 152 161 153 void ClientConnection::addPeer( ENetEvent* event)162 void ClientConnection::addPeer(uint32_t peerID) 154 163 { 155 164 assert(0); 156 165 } 157 void ClientConnection::removePeer( ENetEvent* event)166 void ClientConnection::removePeer(uint32_t peerID) 158 167 { 159 168 this->established_=false;
Note: See TracChangeset
for help on using the changeset viewer.