- Timestamp:
- Dec 12, 2005, 1:24:38 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/network_stream.cc
r6053 r6059 130 130 void NetworkStream::processData() 131 131 { 132 PRINTF(0)("processData()\n");133 132 if ( this->type == NET_SERVER ) 134 133 this->updateConnectionList(); … … 148 147 } 149 148 PRINT(0)("handshake finished\n"); 149 //TODO: replace handshake by entitymanager 150 150 } 151 151 else … … 167 167 for (SynchronizeableList::iterator it = synchronizeables.begin(); it!=synchronizeables.end(); it++) 168 168 { 169 if ( (*it) && (*it)->getOwner() == myHostId ) 169 //TODO: remove items from synchronizeables if they dont exist 170 if ( (*it)!=NULL && ClassList::exists(*it) && (*it)->getOwner() == myHostId ) 170 171 { 171 172 do { … … 173 174 dataLength = (*it)->readBytes(downBuffer, DATA_STREAM_BUFFER_SIZE, &reciever); 174 175 175 PRINTF(0)("reciever = %d\n", reciever);176 176 177 177 if ( dataLength<=0 ){ … … 180 180 } 181 181 182 PRINTF(0)("read %d bytes\n", dataLength); 183 184 if (ClassList::exists((*it))) 185 { 186 PRINTF(0)("before cast\n"); 187 dataLength = networkProtocol->createHeader((byte*)downBuffer, dataLength, DATA_STREAM_BUFFER_SIZE, static_cast<const Synchronizeable&>(*(*it))); 188 PRINTF(0)("after cast\n"); 189 } 190 else 191 { 192 PRINTF(0)("instance does not exist anymore\n"); 193 //synchronizeables.remove(it); 194 } 182 dataLength = networkProtocol->createHeader((byte*)downBuffer, dataLength, DATA_STREAM_BUFFER_SIZE, static_cast<const Synchronizeable&>(*(*it))); 195 183 196 184 if ( dataLength<=0 ) … … 199 187 if ( reciever!=0 ) 200 188 { 201 if ( networkSockets[reciever] )189 if ( networkSockets[reciever] != NULL ) 202 190 { 203 191 PRINTF(0)("write %d bytes to socket %d\n", dataLength, reciever); … … 213 201 for ( int i = 0; i<networkSockets.size(); i++) 214 202 { 215 if ( networkSockets[i] )203 if ( networkSockets[i] != NULL ) 216 204 { 217 205 PRINTF(0)("write %d bytes to socket %d\n", dataLength, reciever); … … 222 210 223 211 } while( reciever!=0 ); 212 } 213 else 214 { 215 PRINTF(0)("synchronizeables == NULL"); 224 216 } 225 217 } … … 365 357 networkSockets[i]->destroy(); 366 358 networkSockets[i] = NULL; 359 //TODO: delete handshake from synchronizeable list so i can delete it 367 360 delete handshakes[i]; 368 361 handshakes[i] = NULL;
Note: See TracChangeset
for help on using the changeset viewer.