Rev | Line | |
---|
[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 |
---|
| 16 | class PeerInfo |
---|
| 17 | { |
---|
| 18 | public: |
---|
| 19 | PeerInfo(); |
---|
| 20 | |
---|
| 21 | void clear(); |
---|
| 22 | |
---|
| 23 | |
---|
[9282] | 24 | inline bool isMasterServer() { return this->nodeType == NET_MASTER_SERVER; } |
---|
[9303] | 25 | inline bool isProxyServer() { return this->nodeType == NET_PROXY_SERVER_ACTIVE; } |
---|
[9396] | 26 | inline bool isProxyServerPassive() { return this->nodeType == NET_PROXY_SERVER_PASSIVE; } |
---|
[9282] | 27 | inline bool isClient() { return this->nodeType == NET_CLIENT; } |
---|
| 28 | |
---|
[9286] | 29 | std::string getNodeTypeString(); |
---|
[9282] | 30 | |
---|
[9286] | 31 | |
---|
[9252] | 32 | public: |
---|
[9396] | 33 | int userId; //!< id of this network node |
---|
| 34 | int nodeType; //!< type of this network node |
---|
| 35 | IP ip; //!> the ip address of this network node |
---|
[9290] | 36 | |
---|
[9396] | 37 | NetworkSocket * socket; //!< socket connecting to this node |
---|
| 38 | Handshake * handshake; //!< the handshake object, active on connection setup |
---|
| 39 | ConnectionMonitor * connectionMonitor; //!< ConnectionMonitor monitoring the current network traffic |
---|
[9290] | 40 | |
---|
[9396] | 41 | int lastAckedState; //!< last acked state synchronized state |
---|
| 42 | int lastRecvedState; //!< last received state |
---|
[9252] | 43 | }; |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | #endif /* _PEER_INFO_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.