Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9327 in orxonox.OLD


Ignore:
Timestamp:
Jul 18, 2006, 4:29:59 PM (18 years ago)
Author:
patrick
Message:

player number model switched

Location:
branches/proxy/src/lib/network
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/handshake.cc

    r9303 r9327  
    1111### File Specific:
    1212   main-programmer: Christoph Renner (rennerc@ee.ethz.ch)
     13   co-programmer: Patirck Boenzli (boenzlip@orxonox.ethz.ch)
    1314*/
    1415
  • branches/proxy/src/lib/network/monitor/network_monitor.h

    r9308 r9327  
    99#include "base_object.h"
    1010#include "synchronizeable.h"
     11#include "shared_network_data.h"
    1112
    1213#include "network_node.h"
     
    5859
    5960    /** @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; }
    6162    /** @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; }
    6364    PeerInfo* getFirstChoiceProxy();
    6465    PeerInfo* getSecondChoiceProxy();
    6566    /** @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; }
    6768
    6869
  • branches/proxy/src/lib/network/network_stream.cc

    r9309 r9327  
    364364
    365365    // 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() )
    367367    {
    368368//       peers[clientId].handshake->setRedirect(true);
     
    449449               (*it)->getUniqueID(), (*it)->beSynchronized());
    450450  }
    451   PRINT(0)(" Maximal Connections: %i\n", NET_MAX_CONNECTIONS );
     451  PRINT(0)(" Maximal Connections: %i\n", SharedNetworkData::getInstance()->getMaxPlayer() );
    452452
    453453}
     
    620620
    621621      // 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 )
    623623        n = Converter::intToByteArray( 0, buf + offset, UDP_PACKET_SIZE - offset );
    624624      else
  • branches/proxy/src/lib/network/network_stream.h

    r9303 r9327  
    1717#include "udp_server_socket.h"
    1818#include "peer_info.h"
     19
     20#include "shared_network_data.h"
    1921
    2022class Synchronizeable;
     
    5254    inline bool isClient() const { return (this->pInfo->nodeType == NET_CLIENT)? true:false; }
    5355//     inline bool isActive() const { return this->bActive; }
    54     inline int getMaxConnections(){ return NET_MAX_CONNECTIONS; }
     56    inline int getMaxConnections(){ return SharedNetworkData::getInstance()->getMaxPlayer(); }
    5557
    5658    /* functions for the peerInfo information retreival */
  • branches/proxy/src/lib/network/shared_network_data.cc

    r9290 r9327  
    3535  this->hostID = -1;
    3636  this->defaultSyncStream = NULL;
    37   this->newUniqueID = NET_MAX_CONNECTIONS + 2;
     37  this->newUniqueID = SharedNetworkData::getInstance()->getMaxPlayer() + 2;
    3838  this->nodeType = NET_CLIENT;
    3939}
Note: See TracChangeset for help on using the changeset viewer.