Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/network/peer_info.h @ 10621

Last change on this file since 10621 was 10114, checked in by patrick, 18 years ago

merged network back to trunk

File size: 1.7 KB
RevLine 
[9252]1/*!
2 * @file peer_info.h
3 *  implementation a peer info
4 */
5
6#ifndef _PEER_INFO_H
7#define _PEER_INFO_H
8
9#include "server_socket.h"
10#include "handshake.h"
[9275]11#include "monitor/connection_monitor.h"
[9252]12
[9286]13#include <string>
[9252]14
15//!< this structure contains informations about the network node
16class PeerInfo
17{
18  public:
19    PeerInfo();
20
21    void clear();
22
23
[9494]24    inline bool isMasterServer() const { return this->nodeType == NET_MASTER_SERVER; }
25    inline bool isProxyServerActive() const { return this->nodeType == NET_PROXY_SERVER_ACTIVE; }
26    inline bool isProxyServerActivePassive() const { return this->nodeType == NET_PROXY_SERVER_PASSIVE; }
27    inline bool isClient() const { return this->nodeType == NET_CLIENT; }
[9282]28
[9494]29    const std::string& getNodeTypeString() const;
30    static const std::string& nodeTypeToString(unsigned int type);
[9282]31
[9656]32    inline bool isLocal() { return this->bLocal; }
[9286]33
[9494]34
[9252]35  public:
[9396]36    int                 userId;                  //!< id of this network node
37    int                 nodeType;                //!< type of this network node
[10114]38    IP                  ip;                      //!< the ip address of this network node
[9290]39
[9396]40    NetworkSocket *     socket;                  //!< socket connecting to this node
41    Handshake *         handshake;               //!< the handshake object, active on connection setup
42    ConnectionMonitor * connectionMonitor;       //!< ConnectionMonitor monitoring the current network traffic
[9290]43
[9396]44    int                 lastAckedState;          //!< last acked state synchronized state
45    int                 lastRecvedState;         //!< last received state
[9494]46
[9656]47    bool                bLocal;                  //!< true if this node is localy connected to this node
48
[9494]49    static const std::string nodeNames[];
50
[9252]51};
52
53
54
55#endif /* _PEER_INFO_H */
Note: See TracBrowser for help on using the repository browser.