Changeset 9284 in orxonox.OLD for branches/proxy/src/lib/network
- Timestamp:
- Jul 14, 2006, 10:32:02 AM (18 years ago)
- Location:
- branches/proxy/src/lib/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/monitor/network_monitor.cc
r9283 r9284 40 40 this->networkStream = networkStream; 41 41 this->playerNumber = 0; 42 this->localNode = new NetworkNode( );42 this->localNode = new NetworkNode( this->networkStream->getPeerInfo()); 43 43 44 44 this->setSynchronized(false); -
branches/proxy/src/lib/network/monitor/network_node.cc
r9277 r9284 16 16 #include "network_node.h" 17 17 18 19 18 #include "debug.h" 20 19 … … 23 22 * constructor 24 23 */ 25 NetworkNode::NetworkNode( )24 NetworkNode::NetworkNode(PeerInfo* pInfo) 26 25 { 27 26 this->playerNumber = 0; 28 this-> nodeType = NET_CLIENT;27 this->peerInfo = pInfo; 29 28 } 30 29 -
branches/proxy/src/lib/network/monitor/network_node.h
r9279 r9284 9 9 #include "base_object.h" 10 10 #include "synchronizeable.h" 11 #include "peer_info.h" 11 12 12 13 #include <list> 13 14 14 class PeerInfo;15 15 16 16 //!< a class representing a node in the network (this can be a MASTER_SERVER, PROXY_SERVER or a CLIENT … … 18 18 { 19 19 public: 20 NetworkNode( );20 NetworkNode(PeerInfo* pInfo); 21 21 ~NetworkNode(); 22 22 … … 33 33 inline int getPlayerNumber() { return this->playerNumber; } 34 34 /** @returns the node type of this node */ 35 inline int getNodeType() { return this-> nodeType; }35 inline int getNodeType() { return this->peerInfo->nodeType; } 36 36 37 37 38 38 private: 39 int nodeType; //!< the type of the node40 39 int playerNumber; //!< localy direct connected player number 40 PeerInfo* peerInfo; //!< the peer informationa about this node 41 41 42 42 /* network nodes directly connected to this node */ -
branches/proxy/src/lib/network/network_stream.cc
r9282 r9284 107 107 this->networkMonitor = NULL; 108 108 109 this->pInfo = new PeerInfo(); 110 this->pInfo->nodeType = NET_CLIENT; 111 this->pInfo->userId = 0; 112 this->pInfo->lastAckedState = 0; 113 this->pInfo->lastRecvedState = 0; 114 109 115 this->myHostId = 0; 110 116 this->currentState = 0; … … 154 160 for ( SynchronizeableList::const_iterator it = getSyncBegin(); it != getSyncEnd(); it ++ ) 155 161 (*it)->setNetworkStream( NULL ); 162 163 if( this->pInfo) 164 delete this->pInfo; 156 165 } 157 166 -
branches/proxy/src/lib/network/network_stream.h
r9282 r9284 60 60 inline bool isUserClient( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isClient(); } 61 61 62 /* peering interface */ 63 inline PeerInfo & getPeerInfo( int userId ) { return peers[userId]; } 64 inline PeerInfo* getPeerInfo() { return this->pInfo; } 65 inline PeerList getPeerInfoList() { return this->peers; } 62 66 67 /* data processing*/ 63 68 virtual void processData(); 64 69 70 /* debugging */ 65 71 void debug(); 66 72 … … 70 76 inline SynchronizeableList::const_iterator getSyncBegin(){ return synchronizeables.begin(); } 71 77 inline SynchronizeableList::const_iterator getSyncEnd(){ return synchronizeables.end(); } 72 inline PeerInfo & getPeerInfo( int userId ) { return peers[userId]; }73 78 void cleanUpOldSyncList(); 74 79 int getSyncCount(); … … 88 93 PeerList peers; //!< list of the network node informations 89 94 95 PeerInfo* pInfo; //!< the info about the local peer node (not in the PeerList) 90 96 int nodeType; //!< the type of this host (NET_CLIENT, NET_MASTER_SERVER,...) 91 97 int myHostId; //!< the host id of the localhost
Note: See TracChangeset
for help on using the changeset viewer.