Changeset 9638 in orxonox.OLD
- Timestamp:
- Jul 31, 2006, 3:34:56 AM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/network_manager.cc
r9636 r9638 173 173 // and start the handshake 174 174 this->networkStream->startHandshake(); 175 // create the proxy control 176 ProxyControl::getInstance(); 175 177 176 178 PRINTF(0)("Created Network Client\n"); -
branches/proxy/src/lib/network/network_stream.cc
r9625 r9638 135 135 136 136 this->currentState = 0; 137 this->redirectionUID = NET_ID_MASTER_SERVER; 137 138 138 139 remainingBytesToWriteToDict = Preferences::getInstance()->getInt( "compression", "writedict", 0 ); … … 376 377 if( this->bRedirect) 377 378 { 378 this->handleReconnect( NET_ID_MASTER_SERVER);379 this->handleReconnect( this->redirectionUID); 379 380 } 380 381 } … … 815 816 void NetworkStream::reconnectToServer(IP address) 816 817 { 818 ///TODO make a redirection struct and push it to the network monitor 817 819 this->networkMonitor->setForcedReconnection(address); 818 this->handleReconnect( NET_ID_MASTER_SERVER); 820 821 // reconnect (depending on how we are connected at the moment) 822 if ( peers.find( NET_ID_MASTER_SERVER) != peers.end() ) 823 this->redirectionUID = NET_ID_MASTER_SERVER; 824 else if( peers.find( NET_ID_PROXY_SERVER_01) != peers.end() ) 825 this->redirectionUID = NET_ID_PROXY_SERVER_01; 826 827 this->bRedirect = true; 819 828 } 820 829 -
branches/proxy/src/lib/network/network_stream.h
r9604 r9638 133 133 134 134 bool bRedirect; //!< true if the master server sent a redirect command 135 int redirectionUID; //!< uid of the redir host 135 136 }; 136 137 #endif /* _NETWORK_STREAM */ -
branches/proxy/src/lib/network/proxy/proxy_control.cc
r9637 r9638 47 47 { 48 48 this->setClassID( CL_PROXY_CONTROL, "ProxyControl" ); 49 50 this->setSynchronized(false); 49 51 50 52 MessageManager::getInstance()->registerMessageHandler( MSGID_PROXY_NEWCLIENT, messageHandlerNewClient, NULL ); … … 319 321 320 322 PRINTF(0)("Sending reconnection command to: %i\n", userId); 321 MessageManager::getInstance()->sendMessage( MSGID_PROXY_COMMAND, data, 3*INTSIZE, RT_ ALL_ME, NET_UNASSIGNED, MP_HIGHBANDWIDTH );323 MessageManager::getInstance()->sendMessage( MSGID_PROXY_COMMAND, data, 3*INTSIZE, RT_USER, userId, MP_HIGHBANDWIDTH ); 322 324 } 323 325 … … 360 362 assert( Converter::byteArrayToInt( data + INTSIZE, &ipHost) == INTSIZE ); 361 363 364 PRINTF(0)("Got reconnection command from %i: reconnect!\n", senderId); 362 365 // handle it 363 if( SharedNetworkData::getInstance()->getHostID() == userId && 364 (SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServerActive())) 366 if( SharedNetworkData::getInstance()->getHostID() == userId) 365 367 { 366 368 NetworkManager::getInstance()->reconnectToServer(IP(ipHost, 9999)); … … 373 375 374 376 375 // part for the master server376 if( SharedNetworkData::getInstance()->isMasterServer())377 {378 // we now create the new player ship and stuff...379 // NetworkGameManager::getInstance()->signalLeftPlayer(leaveClientId);380 }381 else if(SharedNetworkData::getInstance()->isProxyServerActive())382 {383 384 }385 377 386 378 return true;
Note: See TracChangeset
for help on using the changeset viewer.