Changeset 9654 in orxonox.OLD for branches/proxy
- Timestamp:
- Aug 1, 2006, 1:05:56 AM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/network_manager.cc
r9653 r9654 240 240 this->networkStream->setRedirectionTest(); 241 241 } 242 -
branches/proxy/src/lib/network/network_stream.cc
r9653 r9654 859 859 this->peers[serverUserId].socket = newSocket; 860 860 861 this->bSoftRedirect = false; 861 862 return; 862 863 … … 873 874 this->networkMonitor->removeNode(&this->peers[serverUserId]); 874 875 875 this->bSoftRedirect = false; 876 } 876 } 877 878 879 880 /** 881 * prepares a soft connection for a client to connect to 882 * @param userId that will connect to this server 883 */ 884 void NetworkStream::prepareSoftConnection(int userId) 885 { 886 PRINTF(0)("prepare soft connection for userId %i\n"); 887 } 888 877 889 878 890 -
branches/proxy/src/lib/network/network_stream.h
r9653 r9654 51 51 void reconnectToServer(IP address); 52 52 void softReconnectToServer(int serverUserId, IP address); 53 void prepareSoftConnection(int userId); 53 54 54 55 -
branches/proxy/src/lib/network/proxy/proxy_control.cc
r9638 r9654 24 24 #include "ip.h" 25 25 #include "peer_info.h" 26 #include "network_stream.h" 26 27 27 28 #include "converter.h" … … 278 279 279 280 280 this->forceReconnection(userId, serverI nfo->ip);281 this->forceReconnection(userId, serverId, serverInfo->ip); 281 282 } 282 283 … … 287 288 * @param newAddress the addresss the client should connect to 288 289 */ 289 void ProxyControl::forceReconnection(int userId, IP newAddress)290 void ProxyControl::forceReconnection(int userId, int serverId, IP newAddress) 290 291 { 291 292 PRINTF(0)("forcing reconnection: userId %i to %s\n", userId, newAddress.ipString().c_str()); … … 321 322 322 323 PRINTF(0)("Sending reconnection command to: %i\n", userId); 324 // send the reconnection signal to the client who must reconnect 323 325 MessageManager::getInstance()->sendMessage( MSGID_PROXY_COMMAND, data, 3*INTSIZE, RT_USER, userId, MP_HIGHBANDWIDTH ); 326 // and to the server who needs to accept the new client 327 MessageManager::getInstance()->sendMessage( MSGID_PROXY_COMMAND, data, 3*INTSIZE, RT_USER, serverId, MP_HIGHBANDWIDTH ); 324 328 } 325 329 … … 366 370 if( SharedNetworkData::getInstance()->getHostID() == userId) 367 371 { 368 NetworkManager::getInstance()->reconnectToServer(IP(ipHost, 9999)); 372 if( SharedNetworkData::getInstance()->isClient()) 373 SharedNetworkData::getInstance()->getDefaultSyncStream()->softReconnectToServer(userId, IP(ipHost, 9999)); 374 else 375 SharedNetworkData::getInstance()->getDefaultSyncStream()->prepareSoftConnection(userId); 369 376 } 370 377 break; -
branches/proxy/src/lib/network/proxy/proxy_control.h
r9625 r9654 49 49 void forceReconnectionShell(int userId, int serverId); 50 50 void forceReconnection(int userId, int serverId); 51 void forceReconnection(int userId, IP newAddress);51 void forceReconnection(int userId, int serverId, IP newAddress); 52 52 void forceReconnection(int userId, const std::string& newAddress); 53 53 static bool messageHandlerCommand( MessageType messageType, byte * data, int dataLength, void * someData, int senderId, int destinationId );
Note: See TracChangeset
for help on using the changeset viewer.