Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9269 in orxonox.OLD for branches/proxy/src/lib/network


Ignore:
Timestamp:
Jul 13, 2006, 2:00:20 PM (18 years ago)
Author:
patrick
Message:

network node type handshake extension

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

Legend:

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

    r9268 r9269  
    5858  localState.orxId = _ORXONOX_ID;
    5959  localState.version = _ORXONOX_VERSION;
    60 //   localState.nodeType =
     60  localState.nodeType = NET_CLIENT;
    6161  localState.canDel = 0;
    6262
     
    6969  remoteState.orxId = 0;
    7070  remoteState.version = 0;
     71  remoteState.nodeType = NET_CLIENT;
    7172  remoteState.canDel = 0;
    7273
     
    8586  {
    8687    // orxonox id handler
    87     if ( *it == orxId_handler )
     88    if ( *it == this->orxId_handler )
    8889    {
    8990      if ( remoteState.orxId != _ORXONOX_ID )
     
    9495        continue;
    9596      }
    96 
    9797    }
    9898
    9999    // orxonox version handler
    100     if ( *it == version_handler )
     100    if ( *it == this->version_handler )
    101101    {
    102102      if ( remoteState.version != _ORXONOX_VERSION )
     
    107107        continue;
    108108      }
     109    }
    109110
     111    // node type handler: for each node type there is a specific action to be taken
     112    if ( *it == this->nodeTypeHandler)
     113    {
     114      if ( remoteState.nodeType == NET_MASTER_SERVER )
     115      {
     116        continue;
     117      }
     118      else if( remoteState.nodeType == NET_PROXY_SERVER)
     119      {
     120        continue;
     121      }
     122      else if( remoteState.nodeType == NET_CLIENT)
     123      {
     124        continue;
     125      }
    110126    }
     127
    111128
    112129    // cancel
  • branches/proxy/src/lib/network/handshake.h

    r9268 r9269  
    4343    /** @returns true if no error has occured until now */
    4444    inline bool ok(){ return localState.error == 0 && remoteState.error == 0; }
     45    /** stops the handshake and reject the other side with @param reason: string describing the reason */
    4546    inline void doReject( std::string reason ){ localState.error = 1; localState.errorString = "the server rejected your connection ["+ reason +"]"; }
    4647    /** @returns true if the handshake is finished and the instances can be deleted */
     
    5859    /** @returns the unique id of the message manager */
    5960    inline int  getMessageManagerId(){ return remoteState.messageManagerId; }
    60     /** stops the handshake and reject the other side with @param reason: string describing the reason */
     61    /** @returns the node type of the remote host */
     62    inline int getRemoteNodeType() { return this->remoteState.nodeType; }
    6163
    6264    /** sets @param nick the prefereded nick name */
  • branches/proxy/src/lib/network/network_monitor.h

    r9266 r9269  
    1515class PeerInfo;
    1616
    17 class OrxGui::GLGuiBox;
     17namespace OrxGui { class GLGuiBox; };
    1818
    1919class NetworkMonitor : public Synchronizeable
  • branches/proxy/src/lib/network/network_stream.cc

    r9268 r9269  
    429429    if ( it->second.handshake )
    430430    {
     431      // handshake finished
    431432      if ( it->second.handshake->completed() )
    432433      {
     434        //handshake is correct
    433435        if ( it->second.handshake->ok() )
    434436        {
    435437          if ( !it->second.handshake->allowDel() )
    436438          {
    437             //if ( type != NET_MASTER_SERVER )
    438439            if ( type == NET_CLIENT )
    439440            {
     
    453454          else
    454455          {
     456            // handsheke finished registring new player
    455457            if ( it->second.handshake->canDel() )
    456458            {
Note: See TracChangeset for help on using the changeset viewer.