Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9268 in orxonox.OLD for branches/proxy/src/lib


Ignore:
Timestamp:
Jul 13, 2006, 11:32:48 AM (18 years ago)
Author:
patrick
Message:

extending handshake for node type exchange

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

Legend:

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

    r9263 r9268  
    4343  errorString_handler = registerVarId( new SynchronizeableString( &localState.errorString, &remoteState.errorString, "errorString", PERMISSION_ALL ) );
    4444
     45  this->nodeTypeHandler = registerVarId( new SynchronizeableInt( &localState.nodeType, &remoteState.nodeType, "nodeType", PERMISSION_ALL ) );
     46
    4547  candel_id = registerVarId( new SynchronizeableInt( &localState.canDel, &remoteState.canDel, "canDel", PERMISSION_ALL ) );
    4648
     
    5658  localState.orxId = _ORXONOX_ID;
    5759  localState.version = _ORXONOX_VERSION;
     60//   localState.nodeType =
    5861  localState.canDel = 0;
    5962
  • branches/proxy/src/lib/network/handshake.h

    r9262 r9268  
    1212
    1313struct HandshakeState {
    14   int orxId;
    15   int version;
     14  int orxId;                         //!< orxonox id
     15  int version;                       //!< network protocol version
    1616
    17   int networkManagerId;
    18   int messageManagerId;
    19   int hostId;
     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
    2021
    21   int completed;
    22   int canDel;
     22  int completed;                     //!< true if completed
     23  int canDel;                        //!< true if marked for deletion
    2324
    24   int error;
     25  int error;                         //!< error number
    2526
    26   std::string errorString;
     27  std::string errorString;           //!< error string
    2728
    2829  //additional data
    29   std::string preferedNickName;
     30  std::string preferedNickName;      //!< prefered nick name
    3031};
    3132
     
    7778    int                msgManId_handler;                      //!< message manager handler
    7879    int                hostId_handler;                        //!< host id handler
    79     int                serverAddressHandler;                  //!< server address handler
     80    int                nodeTypeHandler;                       //!< node type handler
    8081
    8182    int                completed_handler;                     //!< handshake completion handler
     
    8384    int                errorString_handler;                   //!< handshake error string handler
    8485    int                candel_id;                             //!< handshake deletion handler
     86    int                nodeType;                              //!, the type of the network node
    8587
    8688};
  • branches/proxy/src/lib/network/network_stream.cc

    r9256 r9268  
    2626#include "udp_server_socket.h"
    2727#include "connection_monitor.h"
     28#include "network_monitor.h"
    2829#include "synchronizeable.h"
    2930#include "network_game_manager.h"
     
    4546#include <algorithm>
    4647
    47 /* include your own header */
     48
    4849#include "network_stream.h"
    4950
    50 /* probably unnecessary */
     51
    5152using namespace std;
    5253
     
    792793/**
    793794 * is executed when a handshake has finished
    794  * @todo create playable for new user
    795795 */
    796796void NetworkStream::handleNewClient( int userId )
    797797{
     798  // init and assign the message manager
    798799  MessageManager::getInstance()->initUser( userId );
    799 
     800  // do all game relevant stuff here
    800801  networkGameManager->signalNewPlayer( userId );
    801 }
     802
     803  // register the new client at the network monitor
     804//   this->networkMonitor->addClient();
     805}
     806
    802807
    803808/**
  • branches/proxy/src/lib/network/network_stream.h

    r9255 r9268  
    2222class ServerSocket;
    2323class NetworkGameManager;
     24class NetworkMonitor;
    2425
    2526
     
    6667
    6768  private:
     69
    6870    inline SynchronizeableList::const_iterator getSyncBegin(){ return synchronizeables.begin(); }
    6971    inline SynchronizeableList::const_iterator getSyncEnd(){ return synchronizeables.end(); }
    7072    inline PeerInfo & getPeerInfo( int userId ) { return peers[userId]; }
    71 
     73    void cleanUpOldSyncList();
    7274    int getSyncCount();
    7375
    7476    void updateConnectionList();
     77
    7578    void handleHandshakes();
    7679    void handleUpstream( int tick );
    7780    void handleDownstream(int tick );
    7881    void handleNewClient( int userId );
    79     void cleanUpOldSyncList();
     82
    8083
    8184    void writeToNewDict( byte * data, int length, bool upstream );
     
    9194    int                        currentState;                //!< current state id
    9295
     96    NetworkMonitor*            networkMonitor;              //!< the network monitor
    9397    NetworkGameManager*        networkGameManager;          //!< reference to the network game manager
    9498    ServerSocket*              serverSocket;                //!< the listening socket of the server
Note: See TracChangeset for help on using the changeset viewer.