Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9494 in orxonox.OLD for trunk/src/lib/network/network_stream.h


Ignore:
Timestamp:
Jul 27, 2006, 10:44:28 AM (19 years ago)
Author:
bensch
Message:

merged the proxy back

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/network/network_stream.h

    r9406 r9494  
    4242
    4343    void connectToMasterServer(std::string host, int port);
    44     void connectToProxyServer(std::string host, int port);
    45     void createServer(int port);
     44    void connectToProxyServer(int proxyId, std::string host, int port);
     45    void createServer(int clientPort, int proxyPort);
    4646
    4747    void createNetworkGameManager();
    48     void startHandshake();
     48    void startHandshake(int userId = NET_ID_MASTER_SERVER);
    4949
    5050    /* synchronizeable interface */
     
    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(); }
    59     inline bool isUserProxyServer( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isProxyServer(); }
     63    /** @returns true if this user is a proxy server */
     64    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
     
    8086
    8187    void updateConnectionList();
     88
    8289    /* handle processes */
    8390    void handleHandshakes();
     
    8794    /* handle events*/
    8895    void handleNewClient( int userId );
     96
     97    void handleConnect( int userId);
    8998    void handleReconnect( int userId );
     99    void handleDisconnect( int userId );
    90100
    91101    void writeToNewDict( byte * data, int length, bool upstream );
     
    102112    NetworkMonitor*            networkMonitor;              //!< the network monitor
    103113    NetworkGameManager*        networkGameManager;          //!< reference to the network game manager
    104     ServerSocket*              serverSocket;                //!< the listening socket of the server
     114    ServerSocket*              clientSocket;                //!< the listening socket of the server
     115    ServerSocket*              proxySocket;                 //!< socket for proxy connections
    105116
    106117    std::map<int,int>          oldSynchronizeables;         //!< used to save recently deleted sync ids to not recreate them
     
    113124    int                        dictServer;                  //!< the zip dict for the server
    114125    int                        dictClient;                  //!< the zip dict for the client
     126
     127    bool                       bRedirect;                   //!< true if the master server sent a redirect command
    115128};
    116129#endif /* _NETWORK_STREAM */
Note: See TracChangeset for help on using the changeset viewer.