- Timestamp:
- Jul 12, 2006, 10:58:24 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/proxy/src/lib/network/network_stream.h
r9250 r9251 76 76 void startHandshake(); 77 77 78 /* synchronizeable interface */ 78 79 void connectSynchronizeable(Synchronizeable& sync); 79 80 void disconnectSynchronizeable(Synchronizeable& sync); 80 81 82 /* functions for the localhost settings */ 81 83 inline bool isMasterServer() const { return (this->type == NET_MASTER_SERVER)? true:false; } 82 84 inline bool isProxyServer() const { return (this->type == NET_PROXY_SERVER)? true:false; } 83 85 inline bool isClient() const { return (this->type == NET_CLIENT)? true:false; } 84 86 inline bool isActive() const { return this->bActive; } 85 86 87 inline int getMaxConnections(){ return MAX_CONNECTIONS; } 87 88 88 virtual void processData(); 89 90 inline SynchronizeableList::const_iterator getSyncBegin(){ return synchronizeables.begin(); } 91 inline SynchronizeableList::const_iterator getSyncEnd(){ return synchronizeables.end(); } 92 int getSyncCount(); 93 89 /* functions for the peerInfo information retreival */ 94 90 inline bool isUserIdActive( int userID ) { return (peers.find(userID) != peers.end()); } 95 91 inline bool isUserMasterServer( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isMasterServer; } … … 97 93 inline bool isUserClient( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isClient; } 98 94 95 96 virtual void processData(); 97 99 98 void debug(); 100 101 inline PeerInfo & getPeerInfo( int userId ) { return peers[userId]; }102 99 103 100 104 101 private: 102 inline SynchronizeableList::const_iterator getSyncBegin(){ return synchronizeables.begin(); } 103 inline SynchronizeableList::const_iterator getSyncEnd(){ return synchronizeables.end(); } 104 inline PeerInfo & getPeerInfo( int userId ) { return peers[userId]; } 105 106 int getSyncCount(); 107 105 108 void updateConnectionList(); 106 109 void handleHandshakes(); … … 114 117 115 118 private: 116 SynchronizeableList synchronizeables; 117 PeerList peers; 118 ServerSocket* serverSocket; 119 int type; 120 bool bActive; 121 std::list<int> freeSocketSlots; 119 PeerList peers; //!< list of the network node informations 122 120 123 int myHostId; 121 int type; //!< the type of this host (NET_CLIENT, NET_MASTER_SERVER,...) 122 int myHostId; //!< the host id of the localhost 123 bool bActive; //!< true if this host is active 124 124 125 std::list<int> freeSocketSlots; //!< list of free sockets (to ensure not to resycle sockets) 125 126 int currentState; //!< current state id 126 127 127 NetworkGameManager* networkGameManager; 128 NetworkGameManager* networkGameManager; //!< reference to the network game manager 129 ServerSocket* serverSocket; //!< the listening socket of the server 128 130 129 131 std::map<int,int> oldSynchronizeables; //!< used to save recently deleted sync ids to not recreate them 132 SynchronizeableList synchronizeables; //!< list of the synchronizeables 130 133 131 134 byte buf[UDP_PACKET_SIZE]; //!< used by handleUp/Downstream 132 135 byte compBuf[UDP_PACKET_SIZE]; //!< used by handleUp/Downstream 133 134 136 int remainingBytesToWriteToDict; //!< if > 0 NetworkStream will write packets to DATA/dicts/newdict 135 137 136 int dictServer;137 int dictClient;138 int dictServer; //!< the zip dict for the server 139 int dictClient; //!< the zip dict for the client 138 140 }; 139 141 #endif /* _NETWORK_STREAM */
Note: See TracChangeset
for help on using the changeset viewer.