Changeset 7777 in orxonox.OLD for branches/network/src
- Timestamp:
- May 23, 2006, 4:21:02 PM (19 years ago)
- Location:
- branches/network/src/lib/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/lib/network/handshake.cc
r7776 r7777 79 79 localState.error = 1; 80 80 localState.completed = 1; 81 localState.errorString = "Seems not to be orxonox!"; 81 PRINTF(0)("orxId: %d:%d", remoteState.orxId, _ORXONOX_ID); 82 localState.errorString = "Seems not to be orxonox!\n"; 82 83 return; 83 84 } … … 93 94 localState.error = 2; 94 95 localState.completed = 1; 95 localState.errorString = "Versions of server and client do not match!"; 96 PRINTF(0)("version: %d:%d", remoteState.version, _ORXONOX_VERSION); 97 localState.errorString = "Versions of server and client do not match!\n"; 96 98 return; 97 99 } -
branches/network/src/lib/network/handshake.h
r7731 r7777 39 39 inline int getMessageManagerId(){ return remoteState.messageManagerId; } 40 40 inline void doReject( std::string reason ){ localState.error = 1; localState.errorString = "the server rejected your connection ["+ reason +"]"; } 41 inline std::string getErrorString(){ return remoteState.errorString; } 41 42 42 43 virtual void varChangeHandler( std::list<int> & id ); -
branches/network/src/lib/network/network_stream.cc
r7776 r7777 341 341 handleNewClient( it->second.userId ); 342 342 343 PRINT (0)("handshake finished id=%d\n", it->second.handshake->getNetworkGameManagerId());343 PRINTF(0)("handshake finished id=%d\n", it->second.handshake->getNetworkGameManagerId()); 344 344 345 345 delete it->second.handshake; … … 349 349 else 350 350 { 351 PRINT (1)("handshake failed!\n");351 PRINTF(1)("handshake failed: %s!\n", it->second.handshake->getErrorString().c_str()); 352 352 it->second.socket->disconnectServer(); 353 it->second.socket = NULL; 354 355 delete it->second.handshake; 356 it->second.handshake = NULL; 353 357 } 354 358 } … … 422 426 } 423 427 424 NETPRINTF( n)("adsf\n");428 NETPRINTF(0)("adsf\n"); 425 429 426 430 assert( Converter::intToByteArray( offset, buf, INTSIZE ) == INTSIZE ); 427 431 432 NETPRINTF(0)("adsf %d\n", offset); 433 428 434 assert( peer->second.socket->writePacket( buf, offset ) ); 435 436 NETPRINTF(0)("adsf\n"); 429 437 430 438 //peer->second.connectionMonitor->processUnzippedOutgoingPacket( buf, offset, currentState ); -
branches/network/src/lib/network/udp_socket.cc
r7613 r7777 17 17 #include "udp_server_socket.h" 18 18 19 #include "network_log.h" 19 20 20 21 void UdpSocket::init( ) … … 151 152 bool UdpSocket::writePacket( byte * data, int length ) 152 153 { 154 NETPRINTF(0)("adsf\n"); 153 155 if ( serverSocket ) 154 156 { 157 NETPRINTF(0)("adsf\n"); 155 158 NetworkPacket networkPacket; 156 159 networkPacket.length = length; 157 160 networkPacket.data = data; 161 NETPRINTF(0)("adsf\n"); 158 162 if ( !serverSocket->sendPacket( networkPacket, this->userId ) ) 159 163 { 164 NETPRINTF(0)("adsf\n"); 160 165 bOk = false; 161 166 return false; 162 167 } 163 168 else 169 { 170 NETPRINTF(0)("adsf\n"); 164 171 return true; 172 } 173 NETPRINTF(0)("adsf\n"); 165 174 } 166 175 else 167 176 { 177 if ( !socket ) 178 return false; 179 180 NETPRINTF(0)("adsf\n"); 168 181 assert( length <= packet->maxlen ); 169 182 183 NETPRINTF(0)("adsf\n"); 170 184 memcpy( packet->data, data, length ); 185 NETPRINTF(0)("adsf\n"); 171 186 packet->len = length; 172 187 188 NETPRINTF(0)("adsf\n"); 173 189 if ( SDLNet_UDP_Send( socket, 1, packet) == 0 ) 174 190 { 191 NETPRINTF(0)("adsf\n"); 175 192 PRINTF(1)("SDLNet_UDP_Send: %s\n", SDLNet_GetError()); 176 193 bOk = false; … … 178 195 } 179 196 197 NETPRINTF(0)("adsf\n"); 180 198 return true; 181 199 } 200 NETPRINTF(0)("adsf\n"); 182 201 } 183 202
Note: See TracChangeset
for help on using the changeset viewer.