Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9295 in orxonox.OLD


Ignore:
Timestamp:
Jul 14, 2006, 2:26:33 PM (18 years ago)
Author:
patrick
Message:

extended the handshake structure to support synchronization of proxy server addresses

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

Legend:

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

    r9272 r9295  
    4646
    4747  registerVar( new SynchronizeableString( &localState.preferedNickName, &remoteState.preferedNickName, "preferedNickName", PERMISSION_ALL ) );
     48  registerVar( new SynchronizeableIP( &localState.proxy1, &remoteState.proxy1, "proxy server 1", PERMISSION_ALL ) );
    4849
    4950  // init the local state
  • branches/proxy/src/lib/network/handshake.h

    r9270 r9295  
    1111
    1212
    13 struct HandshakeState {
    14   int orxId;                         //!< orxonox id
    15   int version;                       //!< network protocol version
     13struct HandshakeState
     14{
     15  int           orxId;                         //!< orxonox id
     16  int           version;                       //!< network protocol version
    1617
    17   int networkManagerId;              //!< unique id of the network manager
    18   int messageManagerId;              //!< unique id of the message manager
    19   int hostId;                        //!< host id
    20   int nodeType;                      //!< type of the network node
     18  int           networkManagerId;              //!< unique id of the network manager
     19  int           messageManagerId;              //!< unique id of the message manager
     20  int           hostId;                        //!< host id
     21  int           nodeType;                      //!< type of the network node
    2122
    22   int completed;                     //!< true if completed
    23   int canDel;                        //!< true if marked for deletion
     23  int           completed;                     //!< true if completed
     24  int           canDel;                        //!< true if marked for deletion
    2425
    25   int error;                         //!< error number
     26  int           error;                         //!< error number
    2627
    27   std::string errorString;           //!< error string
     28  std::string   errorString;                   //!< error string
    2829
    2930  //additional data
    30   std::string preferedNickName;      //!< prefered nick name
     31  std::string   preferedNickName;              //!< prefered nick name
     32
     33  int           freeSlots;                     //!< true if there are still free slots on this server
     34  IPaddress     proxy1;                        //!< ip address of the first proxy (0.0.0.0 of not available)
     35  IPaddress     proxy2;                        //!< ip address of the second proxy (0.0.0.0 of not available)
    3136};
    3237
     
    5257    inline void del(){ localState.canDel = 1; }
    5358
     59
    5460    /* the actual informations exchanged in the handshake */
    5561    /** @returns the host id of the remote host */
     
    6672    /** @returns the prefered nick name */
    6773    inline std::string getPreferedNickName(){ return remoteState.preferedNickName; }
     74
     75    /** @param address: the address of the proxy server 1 if any */
     76    inline void setProxy1Address(IPaddress address) { this->localState.proxy1 = address; }
     77    /** @returns the address of the proxy server 1 if any */
     78    inline IPaddress getProxy1Address() { return this->localState.proxy1; }
     79    /** @param address: the address of the proxy server 2 if any */
     80    inline void setProxy2Address(IPaddress address) { this->localState.proxy2 = address; }
     81    /** @returns the address of the proxy server 2 if any */
     82    inline IPaddress getProxy2Address() { return this->localState.proxy2; }
     83
    6884
    6985    /* variable handler function */
  • branches/proxy/src/lib/network/monitor/network_monitor.h

    r9292 r9295  
    4949    inline void removeMasterServer(NetworkNode* node, PeerInfo* pInfo) { node->removeMasterServer(pInfo); }
    5050
     51    /* slots admin and info interface */
    5152    /** @returns the total number of players in this game (including all proxy servers etc)*/
    5253    inline int getPlayerNumber() { return this->playerNumber; }
  • branches/proxy/src/lib/network/synchronizeable.h

    r9272 r9295  
    2020#include "synchronizeable_var/synchronizeable_bool.h"
    2121#include "synchronizeable_var/synchronizeable_uint.h"
     22#include "synchronizeable_var/synchronizeable_ip.h"
    2223
    2324
Note: See TracChangeset for help on using the changeset viewer.