Changeset 9601 in orxonox.OLD for branches/proxy/src
- Timestamp:
- Jul 29, 2006, 10:09:02 AM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/monitor/network_monitor.h
r9589 r9601 82 82 NetworkNode* getNodeByUserId( int userId); 83 83 84 /* forced reconnection interface */ 85 inline void setForcedReconnection(IP address) { this->bForcedRecon = true; this->forcedReconnection = address;} 86 inline bool isForcedReconnection() { return this->bForcedRecon; } 87 inline IP getForcedReconnectionIP() { this->bForcedRecon = false; return this->forcedReconnection; } 88 84 89 85 90 void toggleGUI(); … … 98 103 int playerNumber; //!< total number of players in the game 99 104 int connectionNumber; //!< total number of connections at this localhost 105 106 IP forcedReconnection; //!< ip of a forced reconnection 107 bool bForcedRecon; //!< true if there is a forced recon 100 108 }; 101 109 -
branches/proxy/src/lib/network/network_stream.cc
r9600 r9601 717 717 PeerInfo* pInfo = &this->peers[userId]; 718 718 719 IP proxyIP; 720 if( this->networkMonitor->isForcedReconnection()) 721 proxyIP = this->networkMonitor->getForcedReconnectionIP(); 722 else 723 proxyIP = pInfo->handshake->getProxy1Address(); 724 719 725 PRINTF(0)("===============================================\n"); 720 726 PRINTF(0)("Client is redirected to the other proxy servers\n"); 721 727 PRINTF(0)(" user id: %i\n", userId); 722 PRINTF(0)(" connecting to: %s\n", this->networkMonitor->getFirstChoiceProxy()->ip.ipString().c_str());728 PRINTF(0)(" connecting to: %s\n", proxyIP.ipString().c_str()); 723 729 PRINTF(0)("===============================================\n"); 724 730 … … 726 732 pInfo->lastAckedState = 0; 727 733 pInfo->lastRecvedState = 0; 728 729 // temp save the ip address here730 IP proxyIP = pInfo->handshake->getProxy1Address();731 734 732 735 // disconnect from the current server and reconnect to proxy server … … 748 751 void NetworkStream::reconnectToServer(IP address) 749 752 { 750 753 this->networkMonitor->setForcedReconnection(address); 754 this->handleReconnect( NET_ID_MASTER_SERVER); 751 755 } 752 756 … … 759 763 void NetworkStream::softReconnectToServer(IP address) 760 764 { 761 765 this->networkMonitor->setForcedReconnection(address); 766 this->handleReconnect( NET_ID_MASTER_SERVER); 762 767 } 763 768
Note: See TracChangeset
for help on using the changeset viewer.