Changeset 9327 in orxonox.OLD
- Timestamp:
- Jul 18, 2006, 4:29:59 PM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/handshake.cc
r9303 r9327 11 11 ### File Specific: 12 12 main-programmer: Christoph Renner (rennerc@ee.ethz.ch) 13 co-programmer: Patirck Boenzli (boenzlip@orxonox.ethz.ch) 13 14 */ 14 15 -
branches/proxy/src/lib/network/monitor/network_monitor.h
r9308 r9327 9 9 #include "base_object.h" 10 10 #include "synchronizeable.h" 11 #include "shared_network_data.h" 11 12 12 13 #include "network_node.h" … … 58 59 59 60 /** @returns true if there are still free network slots available */ 60 inline bool gotFreeSlots() { return (this->localNode->getPlayerNumber() < NET_MAX_CONNECTIONS)?true:false; }61 inline bool gotFreeSlots() { return (this->localNode->getPlayerNumber() < SharedNetworkData::getInstance()->getMaxPlayer())?true:false; } 61 62 /** @param node node to be checked for slots @returns true if there are still free network slots available at this node */ 62 inline bool gotFreeSlots(NetworkNode* node) { return (node->getPlayerNumber() < NET_MAX_CONNECTIONS)?true:false; }63 inline bool gotFreeSlots(NetworkNode* node) { return (node->getPlayerNumber() < SharedNetworkData::getInstance()->getMaxPlayer())?true:false; } 63 64 PeerInfo* getFirstChoiceProxy(); 64 65 PeerInfo* getSecondChoiceProxy(); 65 66 /** @returns true if the next client should be reconnected to some other proxy server with more connections */ 66 inline bool reconnectNextClient() { return (this->localNode->getPlayerNumber() >= NET_MAX_CONNECTIONS)?true:false; }67 inline bool reconnectNextClient() { return (this->localNode->getPlayerNumber() >= SharedNetworkData::getInstance()->getMaxPlayer())?true:false; } 67 68 68 69 -
branches/proxy/src/lib/network/network_stream.cc
r9309 r9327 364 364 365 365 // check if there are too many clients connected (DEPRECATED: new: the masterserver sends a list of proxy servers) 366 if ( clientId > NET_MAX_CONNECTIONS)366 if ( clientId > SharedNetworkData::getInstance()->getMaxPlayer() ) 367 367 { 368 368 // peers[clientId].handshake->setRedirect(true); … … 449 449 (*it)->getUniqueID(), (*it)->beSynchronized()); 450 450 } 451 PRINT(0)(" Maximal Connections: %i\n", NET_MAX_CONNECTIONS);451 PRINT(0)(" Maximal Connections: %i\n", SharedNetworkData::getInstance()->getMaxPlayer() ); 452 452 453 453 } … … 620 620 621 621 // server fakes uniqueid == 0 for handshake 622 if ( this->isMasterServer() && sync.getUniqueID() < NET_MAX_CONNECTIONS- 1 )622 if ( this->isMasterServer() && sync.getUniqueID() < SharedNetworkData::getInstance()->getMaxPlayer() - 1 ) 623 623 n = Converter::intToByteArray( 0, buf + offset, UDP_PACKET_SIZE - offset ); 624 624 else -
branches/proxy/src/lib/network/network_stream.h
r9303 r9327 17 17 #include "udp_server_socket.h" 18 18 #include "peer_info.h" 19 20 #include "shared_network_data.h" 19 21 20 22 class Synchronizeable; … … 52 54 inline bool isClient() const { return (this->pInfo->nodeType == NET_CLIENT)? true:false; } 53 55 // inline bool isActive() const { return this->bActive; } 54 inline int getMaxConnections(){ return NET_MAX_CONNECTIONS; }56 inline int getMaxConnections(){ return SharedNetworkData::getInstance()->getMaxPlayer(); } 55 57 56 58 /* functions for the peerInfo information retreival */ -
branches/proxy/src/lib/network/shared_network_data.cc
r9290 r9327 35 35 this->hostID = -1; 36 36 this->defaultSyncStream = NULL; 37 this->newUniqueID = NET_MAX_CONNECTIONS+ 2;37 this->newUniqueID = SharedNetworkData::getInstance()->getMaxPlayer() + 2; 38 38 this->nodeType = NET_CLIENT; 39 39 }
Note: See TracChangeset
for help on using the changeset viewer.