Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9259 in orxonox.OLD


Ignore:
Timestamp:
Jul 12, 2006, 5:40:02 PM (18 years ago)
Author:
patrick
Message:

some restructuring in handshake

File:
1 edited

Legend:

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

    r9258 r9259  
    4040
    4141
     42    /* functions indicating states of the handshake */
    4243    /** @returns true if the handshake is completed */
    4344    inline bool completed(){ return localState.completed != 0 && remoteState.completed != 0; }
    4445    /** @returns true if no error has occured until now */
    4546    inline bool ok(){ return localState.error == 0 && remoteState.error == 0; }
    46     /** @returns the host id of the remote host */
    47     inline int  getHostId(){ return remoteState.hostId; }
    48     /** @returns the unique id of the network game manager*/
    49     inline int  getNetworkGameManagerId(){ return remoteState.networkManagerId; }
    50     /** @returns the unique id of the message manager */
    51     inline int  getMessageManagerId(){ return remoteState.messageManagerId; }
    52     /** stops the handshake and reject the other side with @param reason: string describing the reason */
    5347    inline void doReject( std::string reason ){ localState.error = 1; localState.errorString = "the server rejected your connection ["+ reason +"]"; }
    5448    /** @returns true if the handshake is finished and the instances can be deleted */
     
    5953    inline void del(){ localState.canDel = 1; }
    6054
     55    /* the actual informations exchanged in the handshake */
     56    /** @returns the host id of the remote host */
     57    inline int  getHostId(){ return remoteState.hostId; }
     58    /** @returns the unique id of the network game manager*/
     59    inline int  getNetworkGameManagerId(){ return remoteState.networkManagerId; }
     60    /** @returns the unique id of the message manager */
     61    inline int  getMessageManagerId(){ return remoteState.messageManagerId; }
     62    /** stops the handshake and reject the other side with @param reason: string describing the reason */
     63
    6164    /** sets @param nick the prefereded nick name */
    6265    inline void setPreferedNickName( const std::string & nick ){ localState.preferedNickName = nick; }
     
    6467    inline std::string getPreferedNickName(){ return remoteState.preferedNickName; }
    6568
     69    /* variable handler function */
    6670    virtual void varChangeHandler( std::list<int> & id );
    6771
     72
    6873  private:
    69     HandshakeState localState;
    70     HandshakeState remoteState;
     74    HandshakeState     localState;                            //!< the local handshake state
     75    HandshakeState     remoteState;                           //!< the remote handshake state
    7176
    72     int netManId_handler;
    73     int msgManId_handler;
    74     int hostId_handler;
    75     int completed_handler;
    76     int error_handler;
    77     int errorString_handler;
    78     int orxId_handler;
    79     int version_handler;
    80     int candel_id;
     77    int                netManId_handler;                      //!< network manager handler
     78    int                msgManId_handler;                      //!< message manager handler
     79    int                hostId_handler;
     80    int                completed_handler;
     81    int                error_handler;
     82    int                errorString_handler;
     83    int                orxId_handler;
     84    int                version_handler;
     85    int                candel_id;
    8186
    8287};
Note: See TracChangeset for help on using the changeset viewer.