Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9459 in orxonox.OLD for branches/proxy


Ignore:
Timestamp:
Jul 25, 2006, 5:07:38 PM (18 years ago)
Author:
patrick
Message:

deep framework switch to enable differentiation of proxy/client network connection attempts

Location:
branches/proxy/src
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/README.NETWORK

    r9450 r9459  
    88
    99UserId:
     10=======
    1011containing the id of a user (==client). This id must be unique within a orxonox network its used especialy in the NetworkStream for node identification and also in the Synchronizeable base class for permissions checking (PERMISSION_OWNER)
    1112
     
    3435
    3536uniqueId:
     37=========
    3638uniqueId is an id (unique :D) for each synchronizeable to be identified in a network. the number space for uniqueIds goes from 0 to maxplayers - 1
    3739
    3840
     41permissions:
     42============
     43Each synchronizeable variable has some write permissions. this permission systems allows to manage which network nodes are able to write the variables.
     44PERMISSION_MASTER_SERVER       : only the master server can write this variable
     45PERMISSION_PROXY_SERVER        : only the proxy server can write this variable
     46PERMISSION_OWNER               : only the owner can write this variable
     47PERMISSION_ALL                 : all clients can write this variable
     48
     49
     50
     51
     52
    3953NetworkStream PeerInfo list: (peers)
     54=====================================
    4055The network node with the offset 0 is always the server to which the client must connect to (in case there are connections to other hosts at the same time).
  • branches/proxy/src/lib/network/network_stream.cc

    r9452 r9459  
    360360  //check for new connections
    361361
    362   NetworkSocket* tempNetworkSocket = serverSocket->getNewSocket();
     362  NetworkSocket* tempNetworkSocket = serverSocket->getNewClientSocket();
    363363
    364364  // we got new network node
     
    366366  {
    367367    int clientId;
    368     // if there is a list of free client id slots, take these
     368    // determine the network node id
    369369    if ( freeSocketSlots.size() > 0 )
    370370    {
  • branches/proxy/src/lib/network/network_stream.h

    r9453 r9459  
    5555
    5656    /* functions for the peerInfo information retreival */
     57    /** @returns true if this userId is activated at this client false if not*/
    5758    inline bool isUserIdActive( int userID ) { return (peers.find(userID) != peers.end()); }
     59    /** @returns true if this userId is a local client */
     60    inline bool isUserLocal( int userID) { return this->isUserIdActive(userID); }
     61    /** @returns true if this user is a master server */
    5862    inline bool isUserMasterServer( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isMasterServer(); }
     63    /** @returns true if this user is a proxy server */
    5964    inline bool isUserProxyServerActive( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isProxyServerActive(); }
     65    /** @returns true if this user is a client */
    6066    inline bool isUserClient( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isClient(); }
    6167
  • branches/proxy/src/lib/network/server_socket.h

    r7954 r9459  
    2525
    2626    virtual bool listen( unsigned int port ) = 0;
    27     virtual NetworkSocket* getNewSocket( void ) = 0;
     27    virtual NetworkSocket* getNewClientSocket( void ) = 0;
     28//     virtual NetworkSocket* getNewClientSocket( void ) = 0;
    2829    virtual void close() = 0;
    2930    virtual void update() = 0;
  • branches/proxy/src/lib/network/synchronizeable.cc

    r9458 r9459  
    416416void Synchronizeable::registerVar( SynchronizeableVar * var )
    417417{
    418   //PRINTF(0)("ADDING VAR: %s\n", var->getName().c_str());
    419418  syncVarList.push_back( var );
    420419}
     
    428427int Synchronizeable::registerVarId( SynchronizeableVar * var )
    429428{
    430   //PRINTF(0)("ADDING VAR: %s\n", var->getName().c_str());
    431429  syncVarList.push_back( var );
    432430  var->setWatched( true );
  • branches/proxy/src/lib/network/tcp_server_socket.cc

    r9406 r9459  
    105105
    106106
    107 NetworkSocket* TcpServerSocket::getNewSocket( )
     107NetworkSocket* TcpServerSocket::getNewClientSocket( )
    108108{
    109109  if ( !listenSocket )
  • branches/proxy/src/lib/network/tcp_server_socket.h

    r9406 r9459  
    2525
    2626    virtual bool listen( unsigned int port );
    27     virtual NetworkSocket* getNewSocket( void );
     27    virtual NetworkSocket* getNewClientSocket( void );
    2828    virtual void close();
    2929    virtual void update() {};
  • branches/proxy/src/lib/network/udp_server_socket.cc

    r8802 r9459  
    8080 * @return new socket or NULL if no new socket exists
    8181 */
    82 NetworkSocket * UdpServerSocket::getNewSocket( void )
     82NetworkSocket * UdpServerSocket::getNewClientSocket( void )
    8383{
    8484  NetworkSocket * result = NULL;
  • branches/proxy/src/lib/network/udp_server_socket.h

    r9246 r9459  
    5151    virtual bool listen( unsigned int port );
    5252
    53     virtual NetworkSocket* getNewSocket( void );
     53    virtual NetworkSocket* getNewClientSocket( void );
    5454
    5555    virtual void close();
  • branches/proxy/src/subprojects/network/network_unit_test.cc

    r9406 r9459  
    5050  {
    5151    server.update();
    52     server1 = server.getNewSocket();
     52    server1 = server.getNewClientSocket();
    5353  }
    5454 
     
    6161  {
    6262    server.update();
    63     server2 = server.getNewSocket();
     63    server2 = server.getNewClientSocket();
    6464  }
    6565
Note: See TracChangeset for help on using the changeset viewer.