Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9454 in orxonox.OLD for branches/proxy/src/lib/network/handshake.h


Ignore:
Timestamp:
Jul 25, 2006, 11:27:48 AM (18 years ago)
Author:
bensch
Message:

some consts added

File:
1 edited

Legend:

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

    r9406 r9454  
    4949    /* functions indicating states of the handshake */
    5050    /** @returns true if the handshake is completed */
    51     inline bool completed(){ return localState.completed != 0 && remoteState.completed != 0; }
     51    inline bool completed() const { return localState.completed != 0 && remoteState.completed != 0; }
    5252    /** @returns true if no error has occured until now */
    53     inline bool ok(){ return localState.error == 0 && remoteState.error == 0; }
     53    inline bool ok() const { return localState.error == 0 && remoteState.error == 0; }
    5454    /** stops the handshake and reject the other side with @param reason: string describing the reason */
    5555    inline void doReject( std::string reason ){ localState.error = 1; localState.errorString = "the server rejected your connection ["+ reason +"]"; }
    5656    /** @returns true if the handshake is finished and the instances can be deleted */
    57     inline bool canDel(){ return localState.canDel == 1 && remoteState.canDel == 1; }
     57    inline bool canDel() const { return localState.canDel == 1 && remoteState.canDel == 1; }
    5858    /** @returns true if the local state can be removed*/
    59     inline bool allowDel(){ return localState.canDel == 1; }
     59    inline bool allowDel() const { return localState.canDel == 1; }
    6060    /** marks the handshake to be deleted */
    61     inline void del(){ localState.canDel = 1; }
     61    inline void del() { localState.canDel = 1; }
    6262
    6363
    6464    /* the actual informations exchanged in the handshake */
    6565    /** @returns the host id of the remote host */
    66     inline int  getHostId(){ return remoteState.hostId; }
     66    inline int  getHostId() const { return remoteState.hostId; }
    6767    /** @returns the unique id of the network game manager*/
    68     inline int  getNetworkGameManagerId(){ return remoteState.networkManagerId; }
     68    inline int  getNetworkGameManagerId() const { return remoteState.networkManagerId; }
    6969    /** @returns the unique id of the message manager */
    70     inline int  getMessageManagerId(){ return remoteState.messageManagerId; }
     70    inline int  getMessageManagerId() const { return remoteState.messageManagerId; }
    7171    /** @returns the node type of the remote host */
    72     inline int getRemoteNodeType() { return this->remoteState.nodeType; }
     72    inline int getRemoteNodeType() const { return this->remoteState.nodeType; }
    7373
    7474    /** sets @param nick the prefereded nick name */
    7575    inline void setPreferedNickName( const std::string & nick ){ localState.preferedNickName = nick; }
    7676    /** @returns the prefered nick name */
    77     inline std::string getPreferedNickName(){ return remoteState.preferedNickName; }
     77    inline const std::string& getPreferedNickName() const { return remoteState.preferedNickName; }
    7878
    7979    /** @returns if true the local client should reconnect to a proxy server from the proxy server list */
    80     inline bool redirect() { return this->redirectProxy;}
     80    inline bool redirect() const  { return this->redirectProxy; }
    8181    /** @param flag: indicating if the client should be redirected */
    8282    inline void setRedirect(bool flag) { if( SharedNetworkData::getInstance()->isClient()) return; this->redirectProxy = (int)flag; }
     
    8585    inline void setProxy1Address(IP address) { if( SharedNetworkData::getInstance()->isClient()) return; this->proxy1 = address; }
    8686    /** @returns the address of the proxy server 1 if any */
    87     inline IP getProxy1Address() { return this->proxy1; }
     87    inline IP getProxy1Address() const { return this->proxy1; }
    8888    /** @param address: the address of the proxy server 2 if any */
    8989    inline void setProxy2Address(IP address) { if( SharedNetworkData::getInstance()->isClient()) return; this->proxy2 = address; }
    9090    /** @returns the address of the proxy server 2 if any */
    91     inline IP getProxy2Address() { return this->proxy2; }
     91    inline IP getProxy2Address() const { return this->proxy2; }
    9292
    9393
Note: See TracChangeset for help on using the changeset viewer.